diff options
| author | Josh Rahm <joshuarahm@gmail.com> | 2022-04-24 20:34:51 -0600 |
|---|---|---|
| committer | Josh Rahm <joshuarahm@gmail.com> | 2022-04-24 20:34:51 -0600 |
| commit | 72414e1732064079719b1f1021dc4badce654903 (patch) | |
| tree | 0f2bcdf6074b6a8f696c53efb0a83bdd53460275 /src/Rahm/Desktop/Keys.hs | |
| parent | 32a394483e5d8f571b27a70f9a7156cae1ed6180 (diff) | |
| download | rde-72414e1732064079719b1f1021dc4badce654903.tar.gz rde-72414e1732064079719b1f1021dc4badce654903.tar.bz2 rde-72414e1732064079719b1f1021dc4badce654903.zip | |
Add R.D.StackSet as a replacement for StackSet.
Diffstat (limited to 'src/Rahm/Desktop/Keys.hs')
| -rw-r--r-- | src/Rahm/Desktop/Keys.hs | 51 |
1 files changed, 30 insertions, 21 deletions
diff --git a/src/Rahm/Desktop/Keys.hs b/src/Rahm/Desktop/Keys.hs index 728db52..a8b05a4 100644 --- a/src/Rahm/Desktop/Keys.hs +++ b/src/Rahm/Desktop/Keys.hs @@ -37,9 +37,9 @@ import XMonad.Util.CustomKeys import XMonad.Util.Run (safeSpawn) import XMonad.Util.Scratchpad import XMonad.Util.Ungrab +import Prettyprinter import qualified Data.Map as Map -import qualified XMonad.StackSet as W import Rahm.Desktop.DMenu import Rahm.Desktop.Keys.Dsl @@ -64,6 +64,7 @@ import Rahm.Desktop.Swallow import Rahm.Desktop.SwapMaster (swapMaster) import Rahm.Desktop.Windows import Rahm.Desktop.Workspaces +import qualified Rahm.Desktop.StackSet as W import Rahm.Desktop.History type KeyMap l = XConfig l -> Map (KeyMask, KeySym) (X ()) @@ -280,11 +281,11 @@ keymap = runKeys $ do runMaybeT_ $ (lift . gotoWorkspaceFn) =<< readNextWorkspace shiftMod $ - doc "Move the currently focused window to another workspace" $ + doc "Swap a workspace with another workspace." $ runMaybeT_ $ do - ws <- readNextWorkspace - loc <- lift getCurrentLocation - lift $ moveLocationToWorkspaceFn ws loc + ws1 <- readNextWorkspace + ws2 <- readNextWorkspace + lift $ windows $ W.swapWorkspaces (workspaceName ws1) (workspaceName ws2) controlMod $ doc "Move the current focused window to another workspace and view that workspace" $ @@ -366,12 +367,14 @@ keymap = runKeys $ do justMod $ doc "Mark the current window with the next typed character." $ do locs <- fromMaybe [] <$> runMaybeT readNextLocationSet - withBorderColor "#00ffff" (mapMaybe locationWindow locs) $ do - runMaybeT_ $ do - mapNextString $ \_ str -> lift $ - case str of - [ch] | isAlpha ch -> markAllLocations str locs - _ -> return () + let wins = mapMaybe locationWindow locs + withBorderWidth 4 wins $ + withBorderColor "#00ffff" wins $ do + runMaybeT_ $ do + mapNextString $ \_ str -> lift $ + case str of + [ch] | isAlpha ch -> markAllLocations str locs + _ -> return () bind xK_plus $ do justMod $ @@ -407,17 +410,18 @@ keymap = runKeys $ do locations <- fromMaybe [] <$> runMaybeT readNextLocationSet let locationWindows = mapMaybe locationWindow locations - withBorderColor "#00ffff" locationWindows $ do - runMaybeT_ $ do - workspace <- readNextWorkspace - mapM_ (lift . moveLocationToWorkspaceFn workspace) locations + withBorderWidth 4 locationWindows $ + withBorderColor "#00ffff" locationWindows $ do + runMaybeT_ $ do + workspace <- readNextWorkspace + mapM_ (lift . moveLocationToWorkspaceFn workspace) locations - lift $ setAlternateWindows locationWindows - forM_ locations $ \loc -> - case locationWindow loc of - Nothing -> return () - Just win -> do - lift $ setAlternateWorkspace win (locationWorkspace loc) + lift $ setAlternateWindows locationWindows + forM_ locations $ \loc -> + case locationWindow loc of + Nothing -> return () + Just win -> do + lift $ setAlternateWorkspace win (locationWorkspace loc) altMod $ spawnX "sudo -A systemctl suspend && xsecurelock" @@ -613,6 +617,11 @@ keymap = runKeys $ do setLogLevel next logs next "LogLevel set to %s." (show next) + shiftMod $ do + ss <- withWindowSet return + logs Info "Current Stack Set:%s" + (show $ viaShow $ W.mapLayout (const ()) ss) + bind xF86XK_Calculator $ do noMod $ spawnX $ terminal config ++ " -t Floating\\ Term -e /usr/bin/env python3" |