From fa9d8884ffbdef07249b1e69ac426b2dc08e0803 Mon Sep 17 00:00:00 2001 From: sajenim Date: Mon, 5 Feb 2024 22:07:22 +0800 Subject: [PATCH] rework keybinding --- pkgs/xmonad-config/src/xmonad.hs | 75 ++++++++++++++++---------------- 1 file changed, 37 insertions(+), 38 deletions(-) diff --git a/pkgs/xmonad-config/src/xmonad.hs b/pkgs/xmonad-config/src/xmonad.hs index 8a0d95e..f14a199 100644 --- a/pkgs/xmonad-config/src/xmonad.hs +++ b/pkgs/xmonad-config/src/xmonad.hs @@ -16,7 +16,7 @@ import XMonad.Layout.Renamed import XMonad.Layout.NoBorders -- Utilities -import XMonad.Util.EZConfig (additionalKeysP) +import XMonad.Util.EZConfig (additionalKeys) -- xmobar dependencies import XMonad.Hooks.DynamicLog @@ -35,43 +35,42 @@ myWorkspaces = ["code", "chat", "web", "games", "misc"] -- | Keybindings myKeys = -- launching and killing programs - [ ("M-n" , spawn myTerminal ) -- %! Launch terminal - , ("M-e" , spawn "rofi -modi run,calc -show run" ) -- %! Launch rofi - , ("M-C-w" , kill ) -- %! Close the focused window + [ ((myModMask, xK_n ), spawn myTerminal ) -- %! Launch terminal + , ((myModMask, xK_e ), spawn "rofi -modi run,calc -show run" ) -- %! Launch rofi + , ((myModMask .|. controlMask, xK_w ), kill ) -- %! Close the focused window + , ((myModMask .|. shiftMask, xK_q ), io exitSuccess ) -- %! Quit xmonad + -- layouts - , ("M-t" , sendMessage $ JumpToLayout "Spacing Tiled") -- %! Jump to our tiled layout - , ("M-m" , sendMessage $ JumpToLayout "Maximized" ) -- %! Jump to our maximized layout - , ("M-f" , sendMessage $ JumpToLayout "Fullscreen" ) -- %! Jump to our fullscreen layout - -- move focus up or down the window stack - , ("M-" , windows W.focusDown ) -- %! Move focus to the next window - , ("M-" , windows W.focusUp ) -- %! Move focus to the previous window - , ("M-" , windows W.focusMaster ) -- %! Move focus to the master window - -- modifying the window order - , ("M-S-" , windows W.swapDown ) -- %! Swap the focused window with the next window - , ("M-S-" , windows W.swapUp ) -- %! Swap the focused window with the previous window - , ("M-S-" , windows W.swapMaster ) -- %! Swap the focused window with the master window - -- resizing the master/slave ratio - , ("M-" , sendMessage Expand ) -- %! Expand the master area - , ("M-" , sendMessage Shrink ) -- %! Shrink the master area - -- number of windows in the master area - , ("M-S-" , sendMessage (IncMasterN 1) ) -- %! Increase the number of windows in the master area - , ("M-S-", sendMessage (IncMasterN (-1)) ) -- %! Decrease the number of windows in the master area - -- floating layer support - , ("M-" , withFocused $ windows . W.sink ) -- %! Push window back into tiling - -- workspace navigation - , ("M-" , moveTo Next hiddenWS ) -- %! Move focus to the next hidden workspace - , ("M-" , moveTo Prev hiddenWS ) -- %! Move focus to the previous hidden workspace - -- move window to workspace - , ("M-S-" , shiftTo Next hiddenWS ) -- %! Move focused window to the next hidden workspace - , ("M-S-