diff options
| author | Josh Rahm <rahm@google.com> | 2024-03-15 11:02:29 -0600 |
|---|---|---|
| committer | Josh Rahm <rahm@google.com> | 2024-03-15 11:02:29 -0600 |
| commit | 8ddcf499ce97be0aa607677cbca52d810c969684 (patch) | |
| tree | 2204886b18985849b18e9fd9545971485c2956d1 | |
| parent | b1bd3547e761d61f8d0ce96d55ab1fd92ed8ce19 (diff) | |
| download | rde-8ddcf499ce97be0aa607677cbca52d810c969684.tar.gz rde-8ddcf499ce97be0aa607677cbca52d810c969684.tar.bz2 rde-8ddcf499ce97be0aa607677cbca52d810c969684.zip | |
Add some keybindings. Add some manage hooks.wip_mapping_keycodes
| -rwxr-xr-x | extras/HOME/.xmonad/xmobar-wifi | 8 | ||||
| -rw-r--r-- | src/Main.hs | 19 | ||||
| -rw-r--r-- | src/Rahm/Desktop/Keys.hs | 18 |
3 files changed, 20 insertions, 25 deletions
diff --git a/extras/HOME/.xmonad/xmobar-wifi b/extras/HOME/.xmonad/xmobar-wifi index bc55725..0422cc5 100755 --- a/extras/HOME/.xmonad/xmobar-wifi +++ b/extras/HOME/.xmonad/xmobar-wifi @@ -4,11 +4,15 @@ runtime_dir=$XDG_RUNTIME_DIR/rde/vars/ mkdir -p $runtime_dir +ethernet="$(nmcli connection show --active | grep "ethernet")" wifi="$(nmcli connection show --active | grep "wifi")" -if [[ -z "$wifi" ]] ; then +if [[ -z "$wifi" && -z "$ethernet" ]] ; then echo "<fc=#404040> </fc>" -else +elif [[ -z "$ethernet" ]] ; then name=${wifi/ */} echo "<fc=#ffffff> $name</fc>" +else + devname=$(echo "$ethernet" | awk '{print $4}') + echo "<fc=#ffffff> $devname</fc>" fi diff --git a/src/Main.hs b/src/Main.hs index f0059d7..936163e 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -1,10 +1,11 @@ import Control.Monad.Reader ( MonadReader (ask), ReaderT (runReaderT), + liftM2, ) import Data.Char (toUpper) -import Data.List (isPrefixOf) -import Data.Monoid (Endo (Endo)) +import Data.List (isInfixOf, isPrefixOf) +import Data.Monoid (All (All), Endo (Endo)) import qualified Rahm.Desktop.BorderColors import Rahm.Desktop.Common ( Location (Location), @@ -15,7 +16,7 @@ import Rahm.Desktop.History (historyHook) import Rahm.Desktop.Hooks.WindowChange (withStackChangeHook) import Rahm.Desktop.Keys (applyKeys) import Rahm.Desktop.Layout (myLayout) -import Rahm.Desktop.Logger (LogLevel (Debug, Info), logs) +import Rahm.Desktop.Logger (LogLevel (Debug, Info, Trace), logs) import Rahm.Desktop.Marking (Mark, markAllLocations) import Rahm.Desktop.RebindKeys (WindowHook, remapHook) import qualified Rahm.Desktop.StackSet as W @@ -54,6 +55,7 @@ import XMonad composeAll, doF, doFloat, + doIgnore, floatLocation, liftX, mod4Mask, @@ -112,11 +114,13 @@ main = do className =? "Tilda" --> doFloat, className =? "yakuake" --> doFloat, className =? "MPlayer" --> doFloat, + className =? "Xfce4-notifyd" --> doIgnore, title =? "Event Tester" --> doFloat, title =? "Floating Term" --> doCenterFloat, title =? "Notes" --> doCenterFloat, title =? "xmessage" --> doCenterFloat, title =? "gxmessage" --> doCenterFloat, + fmap (isInfixOf "wlroots") title --> doCenterFloat, title =? "Volume Control" --> doCenterFloat, className =? "mpv" --> doFloat, className =? "gnubby_ssh_prompt" --> doFloat, @@ -127,10 +131,11 @@ main = do -- monitors on boot. If you need more than 15 monitors, you'll have to -- configure those ones after starting XMonad. workspaces = - map return (['w', 'r', 'j', 's', 't'] ++ ['0'..'9']), + map return (['w', 'r', 'j', 's', 't'] ++ ['0' .. '9']), handleEventHook = composeAll - [ fullscreenEventHook, + [ traceLogHook, + fullscreenEventHook, remapHook, dynamicTitle ( composeAll @@ -142,6 +147,10 @@ main = do clickJustFocuses = False, logHook = logHook xmobar } + where + traceLogHook e = do + logs Trace "Event found: %s" (show e) + (return (All True) :: X All) -- Should the chrome window float? Returns false if the window's title starts -- with "New Tab" because this usually means a new window was launched. If the diff --git a/src/Rahm/Desktop/Keys.hs b/src/Rahm/Desktop/Keys.hs index a6d1a8a..3866937 100644 --- a/src/Rahm/Desktop/Keys.hs +++ b/src/Rahm/Desktop/Keys.hs @@ -1350,24 +1350,6 @@ windowSpecificBindings config = do rawMask (m .|. mod3Mask) $ emitKey (m .|. controlMask, xK_Page_Down) - configureIf (flip elem (browsers ++ spotify) <$> className) $ do - bind xK_h $ do - rawMask controlMask $ emitKey (0, xK_BackSpace) - forM_ mods $ \mask -> - rawMask (altMask .|. mask) $ emitKey (mask, xK_Left) - - bind xK_t $ - forM_ mods $ \mask -> - rawMask (altMask .|. mask) $ emitKey (mask, xK_Down) - - bind xK_c $ - forM_ mods $ \mask -> - rawMask (altMask .|. mask) $ emitKey (mask, xK_Up) - - bind xK_n $ - forM_ mods $ \mask -> - rawMask (altMask .|. mask) $ emitKey (mask, xK_Right) - configureIf (flip elem browsers <$> className) $ do -- if the window is a browser, configure these bindings. Lots of browsers -- make up their own garbage bindings that are not standard across many |