feat(prog/xmonad): float hwt by default

style(prog/xmonad): format code
style(prog/xmonad): change default layout ratio
This commit is contained in:
Dmitriy Pleshevskiy 2022-04-12 16:06:18 +03:00
parent e7b6501dca
commit f651e814e8

View file

@ -126,7 +126,7 @@ myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
-- , ((modm , xK_b ), sendMessage ToggleStruts) -- , ((modm , xK_b ), sendMessage ToggleStruts)
-- Quit xmonad -- Quit xmonad
, ((mod4Mask .|. shiftMask, xK_q ), io (exitWith ExitSuccess)) , ((mod4Mask .|. shiftMask, xK_q ), io exitSuccess)
-- Lock screen -- Lock screen
, ((mod4Mask , xK_l ), spawn "i3lock -e -c 000000") , ((mod4Mask , xK_l ), spawn "i3lock -e -c 000000")
@ -160,18 +160,15 @@ myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
------------------------------------------------------------------------ ------------------------------------------------------------------------
-- Mouse bindings: default actions bound to mouse events -- Mouse bindings: default actions bound to mouse events
-- --
myMouseBindings (XConfig {XMonad.modMask = modm}) = M.fromList $ myMouseBindings (XConfig {XMonad.modMask = modm}) = M.fromList
-- mod-button1, Set the window to floating mode and move by dragging -- mod-button1, Set the window to floating mode and move by dragging
[ ((modm, button1), (\w -> focus w >> mouseMoveWindow w [ ((modm, button1), \w -> focus w >> mouseMoveWindow w >> windows W.shiftMaster)
>> windows W.shiftMaster))
-- mod-button2, Raise the window to the top of the stack -- mod-button2, Raise the window to the top of the stack
, ((modm, button2), (\w -> focus w >> windows W.shiftMaster)) , ((modm, button2), \w -> focus w >> windows W.shiftMaster)
-- mod-button3, Set the window to floating mode and resize by dragging -- mod-button3, Set the window to floating mode and resize by dragging
, ((modm, button3), (\w -> focus w >> mouseResizeWindow w , ((modm, button3), \w -> focus w >> mouseResizeWindow w >> windows W.shiftMaster)
>> windows W.shiftMaster))
-- you may also bind events to the mouse scroll wheel (button4 and button5) -- you may also bind events to the mouse scroll wheel (button4 and button5)
] ]
@ -196,7 +193,7 @@ myLayout = avoidStruts (tiled ||| Mirror tiled ||| Full)
nmaster = 1 nmaster = 1
-- Default proportion of screen occupied by master pane -- Default proportion of screen occupied by master pane
ratio = 1/2 ratio = 1/4
-- Percent of screen to increment by when resizing panes -- Percent of screen to increment by when resizing panes
delta = 3/100 delta = 3/100
@ -220,7 +217,10 @@ myManageHook = composeAll
[ className =? "MPlayer" --> doFloat [ className =? "MPlayer" --> doFloat
, className =? "Gimp" --> doFloat , className =? "Gimp" --> doFloat
, resource =? "desktop_window" --> doIgnore , resource =? "desktop_window" --> doIgnore
, resource =? "kdesktop" --> doIgnore ] , resource =? "kdesktop" --> doIgnore
-- my libs
, resource =? "hwt" --> doFloat
]
------------------------------------------------------------------------ ------------------------------------------------------------------------
-- Event handling -- Event handling
@ -264,74 +264,74 @@ main = xmonad . ewmhFullscreen . ewmh . xmobarProp $ defaults
-- --
-- No need to modify this. -- No need to modify this.
-- --
defaults = def { defaults = def
-- simple stuff -- simple stuff
terminal = myTerminal, { terminal = myTerminal
focusFollowsMouse = myFocusFollowsMouse, , focusFollowsMouse = myFocusFollowsMouse
clickJustFocuses = myClickJustFocuses, , clickJustFocuses = myClickJustFocuses
borderWidth = myBorderWidth, , borderWidth = myBorderWidth
modMask = myModMask, , modMask = myModMask
workspaces = myWorkspaces, , workspaces = myWorkspaces
normalBorderColor = myNormalBorderColor, , normalBorderColor = myNormalBorderColor
focusedBorderColor = myFocusedBorderColor, , focusedBorderColor = myFocusedBorderColor
-- key bindings
-- key bindings , keys = myKeys
keys = myKeys, , mouseBindings = myMouseBindings
mouseBindings = myMouseBindings, -- hooks, layouts
, layoutHook = myLayout
-- hooks, layouts , manageHook = myManageHook
layoutHook = myLayout, , handleEventHook = myEventHook
manageHook = myManageHook, , logHook = myLogHook
handleEventHook = myEventHook, , startupHook = myStartupHook
logHook = myLogHook, }
startupHook = myStartupHook
}
-- | Finally, a copy of the default bindings in simple textual tabular format. -- | Finally, a copy of the default bindings in simple textual tabular format.
help :: String help :: String
help = unlines ["The default modifier key is 'alt'. Default keybindings:", help = unlines
"", [ "The default modifier key is 'alt'. Default keybindings:"
"-- launching and killing programs", , ""
"mod-Shift-Enter Launch 'alacritty' terminal", , "-- launching and killing programs"
"mod-Shift-s Launch 'flameshot' to screenshot", , "mod-Shift-Enter Launch 'alacritty' terminal"
"mod-p Launch 'dmenu_run'", , "mod-Shift-s Launch 'flameshot' to screenshot"
"mod-Shift-c Close/kill the focused window", , "mod-p Launch 'dmenu_run'"
"mod-Shift-/ Show this help message with the default keybindings", , "mod-Shift-c Close/kill the focused window"
"", , "mod-Shift-/ Show this help message with the default keybindings"
"-- move focus up or down the window stack", , ""
"mod-j Move focus to the next window", , "-- move focus up or down the window stack"
"mod-k Move focus to the previous window", , "mod-j Move focus to the next window"
"mod-m Move focus to the master window", , "mod-k Move focus to the previous window"
"", , "mod-m Move focus to the master window"
"-- modifying the window order", , ""
"mod-Return Swap the focused window and the master window", , "-- modifying the window order"
"mod-Shift-j Swap the focused window with the next window", , "mod-Return Swap the focused window and the master window"
"mod-Shift-k Swap the focused window with the previous window", , "mod-Shift-j Swap the focused window with the next window"
"", , "mod-Shift-k Swap the focused window with the previous window"
"-- workspace layout", , ""
"mod-Space Rotate through the available layout algorithms", , "-- workspace layout"
"mod-Shift-Space Reset the layouts on the current workspace to default", , "mod-Space Rotate through the available layout algorithms"
"mod-n Resize/refresh viewed windows to the correct size", , "mod-Shift-Space Reset the layouts on the current workspace to default"
"mod-h Shrink the master area", , "mod-n Resize/refresh viewed windows to the correct size"
"mod-l Expand the master area", , "mod-h Shrink the master area"
"mod-t Push window back into tiling; unfloat and re-tile it", , "mod-l Expand the master area"
"", , "mod-t Push window back into tiling; unfloat and re-tile it"
"-- increase or decrease number of windows in the master area", , ""
"mod-comma (mod-,) Increment the number of windows in the master area", , "-- increase or decrease number of windows in the master area"
"mod-period (mod-.) Deincrement the number of windows in the master area", , "mod-comma (mod-,) Increment the number of windows in the master area"
"", , "mod-period (mod-.) Deincrement the number of windows in the master area"
"-- System ", , ""
"mod4-l Lock screen", , "-- System "
"mod4-Shift-q Quit xmonad", , "mod4-l Lock screen"
"mod-q Restart xmonad", , "mod4-Shift-q Quit xmonad"
"", , "mod-q Restart xmonad"
"-- Workspaces & screens", , ""
"mod-[1..9] Switch to workSpace N", , "-- Workspaces & screens"
"mod-Shift-[1..9] Move client to workspace N", , "mod-[1..9] Switch to workSpace N"
"mod-{w,e,r} Switch to physical/Xinerama screens 1, 2, or 3", , "mod-Shift-[1..9] Move client to workspace N"
"mod-Shift-{w,e,r} Move client to screen 1, 2, or 3", , "mod-{w,e,r} Switch to physical/Xinerama screens 1, 2, or 3"
"", , "mod-Shift-{w,e,r} Move client to screen 1, 2, or 3"
"-- Mouse bindings: default actions bound to mouse events", , ""
"mod-button1 Set the window to floating mode and move by dragging", , "-- Mouse bindings: default actions bound to mouse events"
"mod-button2 Raise the window to the top of the stack", , "mod-button1 Set the window to floating mode and move by dragging"
"mod-button3 Set the window to floating mode and resize by dragging"] , "mod-button2 Raise the window to the top of the stack"
, "mod-button3 Set the window to floating mode and resize by dragging"
]