home/xmonad: keybindings cosmetic changes

This commit is contained in:
Dmitriy Pleshevskiy 2022-09-10 23:49:11 +03:00
parent 44850f3e15
commit 4b20878d5f
Signed by: pleshevskiy
GPG key ID: 1B59187B161C0215

View file

@ -48,11 +48,9 @@ import XMonad.Util.Run
myTerminal = "alacritty" myTerminal = "alacritty"
-- Whether focus follows the mouse pointer. -- Whether focus follows the mouse pointer.
myFocusFollowsMouse :: Bool
myFocusFollowsMouse = False myFocusFollowsMouse = False
-- Whether clicking on a window to focus also passes the click to the window -- Whether clicking on a window to focus also passes the click to the window
myClickJustFocuses :: Bool
myClickJustFocuses = False myClickJustFocuses = False
-- Width of the window border in pixels. -- Width of the window border in pixels.
@ -251,79 +249,93 @@ myManageHook = manageApps
-- Key bindings. Add, modify or remove key bindings here. -- Key bindings. Add, modify or remove key bindings here.
-- --
myKeys conf = myKeys conf =
mkKeymap conf $ let easyMotionConfig =
-- launch a terminal def
[ ("M-S-<Return>", spawn $ XMonad.terminal conf), { sKeys = AnyKeys [xK_a, xK_o, xK_e, xK_u, xK_h, xK_t, xK_n, xK_s]
-- launch a 'flameshot' to screenshot }
("M-S-s", safeSpawn "flameshot" ["gui"]),
-- launch 'librewolf' browser
("M-S-b", spawn "librewolf"),
-- launch 'dmenu_run' to choose applications
("M-p", spawn "dmenu_run"),
-- close focused window
("M4-S-c", kill),
-- Rotate through the available layout algorithms
("M-<Space>", cycleThroughLayouts ["Full", "Mirror Spacing Tall"]),
("M-<Tab>", cycleThroughLayouts ["Spacing ThreeCol", "Spacing Tall", "Mirror Spacing Tall"]),
-- Reset the layouts on the current workspace to default
("M-S-<Space>", setLayout $ XMonad.layoutHook conf),
-- Resize viewed windows to the correct size
("M-n", refresh),
-- Easy moution to focus windows
("M-s", selectWindow easyMotionConfig >>= (`whenJust` windows . W.focusWindow)),
-- Move focus to the next window
("M-j", windows W.focusDown),
-- Move focus to the previous window
("M-k", windows W.focusUp),
-- Move focus to the master window
("M-m", windows W.focusMaster),
-- Swap the focused window and the master window
("M-<Return>", windows W.swapMaster),
-- Swap the focused window with the next window
("M-S-j", windows W.swapDown),
-- Swap the focused window with the previous window
("M-S-k", windows W.swapUp),
-- Shrink the master area
("M-h", sendMessage Shrink),
-- Expand the master area
("M-l", sendMessage Expand),
-- Push window back into tiling
("M-t", withFocused $ windows . W.sink),
-- Increment the number of windows in the master area
("M-,", sendMessage $ IncMasterN 1),
-- Deincrement the number of windows in the master area
("M-.", sendMessage $ IncMasterN (-1)),
-- Toggle the status bar gap
-- Use this binding with avoidStruts from Hooks.ManageDocks.
-- See also the statusBar function from Hooks.DynamicLog.
--
-- , ("M-b", sendMessage ToggleStruts)
-- Lock screen apps_kb =
("M4-l", spawn "betterlockscreen --lock --display 1 -- -e"), [ -- launch a terminal
-- Change volume ("M-S-<Return>", spawn $ XMonad.terminal conf),
("<XF86AudioMute>", spawn "amixer -q sset Master toggle"), -- launch a 'flameshot' to screenshot
("<XF86AudioRaiseVolume>", spawn "amixer -q sset Master 5%+"), ("M-S-s", safeSpawn "flameshot" ["gui"]),
("<XF86AudioLowerVolume>", spawn "amixer -q sset Master 5%-"), -- launch 'librewolf' browser
-- Keyboard apps ("M-S-b", spawn "librewolf"),
("<XF86Calculator>", spawn "gnome-calculator"), -- launch 'dmenu_run' to choose applications
-- Quit xmonad ("M-p", spawn "dmenu_run")
("M4-S-q", io exitSuccess) -- Open calculator
] -- ("<XF86Calculator>", spawn "gnome-calculator"),
++ ]
--
-- mod-[1..9], Switch to workspace N workspaces_kb =
-- mod-shift-[1..9], Move client to workspace N --
-- -- mod-[1..9], Switch to workspace N
[ ("M-" ++ m ++ show k, windows $ f i) -- mod-shift-[1..9], Move client to workspace N
| (i, k) <- zip (XMonad.workspaces conf) [1 .. 9], --
(f, m) <- [(W.greedyView, ""), (W.shift, "S-")] [ ("M-" ++ m ++ show k, windows $ f i)
] | (i, k) <- zip (XMonad.workspaces conf) [1 .. 9],
where (f, m) <- [(W.greedyView, ""), (W.shift, "S-")]
easyMotionConfig = ]
def
{ sKeys = AnyKeys [xK_a, xK_o, xK_e, xK_u, xK_h, xK_t, xK_n, xK_s] windows_kb =
} [ -- close focused window
("M4-S-c", kill),
-- Resize viewed windows to the correct size
("M-n", refresh),
-- Easy moution to focus windows
("M-s", selectWindow easyMotionConfig >>= (`whenJust` windows . W.focusWindow)),
-- Move focus to the next window
("M-j", windows W.focusDown),
-- Move focus to the previous window
("M-k", windows W.focusUp),
-- Move focus to the master window
("M-m", windows W.focusMaster),
-- Swap the focused window and the master window
("M-<Return>", windows W.swapMaster),
-- Swap the focused window with the next window
("M-S-j", windows W.swapDown),
-- Swap the focused window with the previous window
("M-S-k", windows W.swapUp)
]
layout_kb =
[ -- Rotate through the available layout algorithms
("M-<Space>", cycleThroughLayouts ["Full", "Mirror Spacing Tall"]),
("M-<Tab>", cycleThroughLayouts ["Spacing ThreeCol", "Spacing Tall", "Mirror Spacing Tall"]),
-- Reset the layouts on the current workspace to default
("M-S-<Space>", setLayout $ XMonad.layoutHook conf),
-- Shrink the master area
("M-h", sendMessage Shrink),
-- Expand the master area
("M-l", sendMessage Expand),
-- Push window back into tiling
("M-t", withFocused $ windows . W.sink),
-- Increment the number of windows in the master area
("M-,", sendMessage $ IncMasterN 1),
-- Deincrement the number of windows in the master area
("M-.", sendMessage $ IncMasterN (-1))
-- Toggle the status bar gap
-- Use this binding with avoidStruts from Hooks.ManageDocks.
-- See also the statusBar function from Hooks.DynamicLog.
--
-- , ("M-b", sendMessage ToggleStruts)
]
system_kb =
[ -- Lock screen
("M4-l", spawn "betterlockscreen --lock --display 1 -- -e"),
-- Quit xmonad
("M4-S-q", io exitSuccess)
]
misc_kb =
[ -- Change volume
("<XF86AudioMute>", spawn "amixer -q sset Master toggle"),
("<XF86AudioRaiseVolume>", spawn "amixer -q sset Master 5%+"),
("<XF86AudioLowerVolume>", spawn "amixer -q sset Master 5%-")
]
in mkKeymap conf $
apps_kb ++ workspaces_kb ++ windows_kb ++ layout_kb ++ system_kb ++ misc_kb
------------------------------------------------------------------------ ------------------------------------------------------------------------
-- Mouse bindings: default actions bound to mouse events -- Mouse bindings: default actions bound to mouse events