Update XMonad config

This commit is contained in:
daniele 2024-03-29 15:42:11 +01:00
parent 0fd7ac9a0e
commit bf9dc87640
Signed by: fuxino
GPG Key ID: 981A2B2A3BBF5514

View File

@ -1,5 +1,9 @@
-- Import -- Import
import XMonad as X import XMonad
-- Actions
import XMonad.Actions.PhysicalScreens
import Data.Default
-- Hooks -- Hooks
import XMonad.Hooks.DynamicLog import XMonad.Hooks.DynamicLog
@ -30,8 +34,7 @@ import XMonad.Util.SpawnOnce
-- Extra keys -- Extra keys
import Graphics.X11.ExtraTypes.XF86 import Graphics.X11.ExtraTypes.XF86
import XMonad.StackSet as W import qualified XMonad.StackSet as W
-- Main -- Main
main :: IO () main :: IO ()
@ -51,7 +54,7 @@ myTerminal = "kitty"
myConfig = def myConfig = def
{ modMask = myModMask { modMask = myModMask
, terminal = myTerminal , terminal = myTerminal
, X.workspaces = myWorkspaces , workspaces = myWorkspaces
, focusedBorderColor = "#006700" , focusedBorderColor = "#006700"
, normalBorderColor = "#000000" , normalBorderColor = "#000000"
, layoutHook = myLayout , layoutHook = myLayout
@ -59,7 +62,7 @@ myConfig = def
, manageHook = myManageHook , manageHook = myManageHook
} }
`additionalKeysP` `additionalKeysP`
[ ("M-S-l" , spawn "xscreensaver-command -lock" ) [ ("M-S-l" , spawn "slock" )
, ("M-<Print>" , unGrab *> spawn "gnome-screenshot -i" ) , ("M-<Print>" , unGrab *> spawn "gnome-screenshot -i" )
, ("M-d" , spawn "dmenu_run" ) , ("M-d" , spawn "dmenu_run" )
, ("M-p" , spawn "passmenu -i" ) , ("M-p" , spawn "passmenu -i" )
@ -74,10 +77,15 @@ myConfig = def
, ((0, xF86XK_Mail) , spawn "kitty mutt" ) , ((0, xF86XK_Mail) , spawn "kitty mutt" )
, ((0, xF86XK_Tools) , spawn "kitty ncmpcpp" ) , ((0, xF86XK_Tools) , spawn "kitty ncmpcpp" )
] ]
++
[((myModMask .|. mask, key), f sc)
| (key, sc) <- zip [xK_w, xK_e] [0..]
, (f, mask) <- [(viewScreen def, 0), (sendToScreen def, shiftMask)]
]
-- Workspaces -- Workspaces
myWorkspaces :: [String] myWorkspaces :: [String]
myWorkspaces = [ "1:\xf489 ", "2:\xe743 ", "3:\xf1b6 ", "4:\xf10b ", "5:\xead9 " ] ++ map show [6..9] myWorkspaces = [ "1:\xf489 ", "2:\xe743 ", "3:\xf1b6 ", "4:\xf10b ", "5:\xead9 ", "6:\xeb69 " ] ++ map show [7..9]
-- Layout -- Layout
myLayout = onWorkspace "2:\xe743 " myWebLayout $ onWorkspace "3:\xf1b6 " myGamesLayout $ myDefaultLayout myLayout = onWorkspace "2:\xe743 " myWebLayout $ onWorkspace "3:\xf1b6 " myGamesLayout $ myDefaultLayout
@ -135,7 +143,7 @@ myStartupHook :: X ()
myStartupHook = do myStartupHook = do
spawnOnce "xsetroot -cursor_name left_ptr" spawnOnce "xsetroot -cursor_name left_ptr"
spawnOnce "mons -e left && ~/.fehbg" spawnOnce "mons -e left && ~/.fehbg"
spawnOnce "xscreensaver -no-splash" spawnOnce "xautolock -time 10 -locker slock -detectsleep"
spawnOnce "trayer --edge top --align right --SetDockType true \ spawnOnce "trayer --edge top --align right --SetDockType true \
\--SetPartialStrut true --expand true --width 7 \ \--SetPartialStrut true --expand true --width 7 \
\--transparent true --tint 0x1f2022 --height 18 \ \--transparent true --tint 0x1f2022 --height 18 \
@ -146,24 +154,31 @@ myStartupHook = do
spawnOnce "discover-overlay" spawnOnce "discover-overlay"
spawnOnce "arch-audit-gtk" spawnOnce "arch-audit-gtk"
spawnOnce "xcompmgr" spawnOnce "xcompmgr"
spawnOnce "dunst"
-- Manage hook -- Manage hook
myManageHook :: ManageHook myManageHook :: ManageHook
myManageHook = composeAll myManageHook = composeAll
[ className =? "kitty" --> doShift "1:\xf489 " [ className =? "Galculator" --> doFloat
, className =? "Vivaldi-stable" --> doShift "2:\xe743 " , className =? "Gpodder" --> doShift "5:\xead9 "
, className =? "steam" --> doShift "3:\xf1b6 " , className =? "Signal" --> doShift "4:\xf10b "
, className =? "discord" --> doShift "4:\xf10b " , className =? "Vivaldi-stable" --> doShift "2:\xe743 "
, className =? "Signal" --> doShift "4:\xf10b " , className =? "Windscribe2" --> doShift "9"
, className =? "mpv" --> doFullFloat , className =? "Windscribe2" --> doRectFloat (W.RationalRect 0.4 0.4 0.6 0.6)
, className =? "mpv" --> doShift "5:\xead9 " , className =? "Xmessage" --> doFloat
, className =? "Gpodder" --> doShift "5:\xead9 " , className =? "Xreader" --> doShift "6:\xeb69 "
, className =? "Xviewer" --> doFloat , className =? "Xscreensaver-settings" --> doFloat
, className =? "Galculator" --> doFloat , className =? "Xviewer" --> doFloat
, className =? "steam_app_109600" --> doFloat , className =? "calibre" --> doShift "6:\xeb69 "
, className =? "Xmessage" --> doFloat , className =? "discord" --> doShift "4:\xf10b "
, className =? "Windscribe2" --> doShift "9" , className =? "kitty" --> doShift "1:\xf489 "
, className =? "Windscribe2" --> doRectFloat (W.RationalRect 0.4 0.4 0.6 0.6) , className =? "libreoffice-calc" --> doShift "6:\xeb69 "
, isDialog --> doFloat , className =? "libreoffice-writer" --> doShift "6:\xeb69 "
, isFullscreen --> doFullFloat , className =? "mpv" --> doFullFloat
, className =? "mpv" --> doShift "5:\xead9 "
, className =? "steam" --> doShift "3:\xf1b6 "
, className =? "steam_app_109600" --> doFloat
, className =? "transmission-gtk" --> doShift "2:\xe743 "
, isDialog --> doFloat
, isFullscreen --> doFullFloat
] ]