Update XMonad config

This commit is contained in:
daniele 2024-03-27 20:33:33 +01:00
parent a49b6f32a0
commit 7e958459de
Signed by: fuxino
GPG Key ID: 981A2B2A3BBF5514
3 changed files with 37 additions and 18 deletions

View File

@ -16,7 +16,7 @@ Config { overrideRedirect = False
, "--high" , "darkred" , "--high" , "darkred"
] 9000 ] 9000
, Run MultiCpu , Run MultiCpu
[ "--template" , "Cpu: <total0>%|<total1>%|<total2>%|<total3>%|<total4>%|<total5>%" [ "--template" , "Cpu: <total>%"
, "--Low" , "25" , "--Low" , "25"
, "--High" , "75" , "--High" , "75"
, "--low" , "darkgreen" , "--low" , "darkgreen"
@ -41,7 +41,7 @@ Config { overrideRedirect = False
] 10 ] 10
, Run Kbd , Run Kbd
[ ("it" , "<fc=#00008B>IT</fc>") [ ("it" , "<fc=#00008B>IT</fc>")
, ("us" , "<fc=#8B0000>US</fc>") , ("us" , "<fc=#8B0000>US</fc>")
, ("sk(qwerty)" , "<fc=#008B00>SK</fc>") , ("sk(qwerty)" , "<fc=#008B00>SK</fc>")
] ]
, Run Date "%a %Y-%m-%d <fc=#8be9fd>%H:%M</fc>" "date" 10 , Run Date "%a %Y-%m-%d <fc=#8be9fd>%H:%M</fc>" "date" 10

View File

@ -16,7 +16,7 @@ Config { overrideRedirect = False
, "--high" , "darkred" , "--high" , "darkred"
] 9000 ] 9000
, Run MultiCpu , Run MultiCpu
[ "--template" , "Cpu: <total0>%|<total1>%|<total2>%|<total3>%|<total4>%|<total5>%" [ "--template" , "Cpu: <total>%"
, "--Low" , "25" , "--Low" , "25"
, "--High" , "75" , "--High" , "75"
, "--low" , "darkgreen" , "--low" , "darkgreen"
@ -41,7 +41,7 @@ Config { overrideRedirect = False
] 10 ] 10
, Run Kbd , Run Kbd
[ ("it" , "<fc=#00008B>IT</fc>") [ ("it" , "<fc=#00008B>IT</fc>")
, ("us" , "<fc=#8B0000>US</fc>") , ("us" , "<fc=#8B0000>US</fc>")
, ("sk(qwerty)" , "<fc=#008B00>SK</fc>") , ("sk(qwerty)" , "<fc=#008B00>SK</fc>")
] ]
, Run Date "%a %Y-%m-%d <fc=#8be9fd>%H:%M</fc>" "date" 10 , Run Date "%a %Y-%m-%d <fc=#8be9fd>%H:%M</fc>" "date" 10

View File

@ -1,10 +1,11 @@
-- Import -- Import
import XMonad import XMonad as X
-- Hooks -- Hooks
import XMonad.Hooks.DynamicLog import XMonad.Hooks.DynamicLog
import XMonad.Hooks.EwmhDesktops import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.InsertPosition import XMonad.Hooks.InsertPosition
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ManageHelpers import XMonad.Hooks.ManageHelpers
import XMonad.Hooks.StatusBar import XMonad.Hooks.StatusBar
import XMonad.Hooks.StatusBar.PP import XMonad.Hooks.StatusBar.PP
@ -18,8 +19,8 @@ import XMonad.Layout.ThreeColumns
-- Layout modifiers -- Layout modifiers
import XMonad.Layout.LayoutCombinators import XMonad.Layout.LayoutCombinators
import XMonad.Layout.Magnifier import XMonad.Layout.Magnifier
import XMonad.Layout.PerWorkspace
import XMonad.Layout.Renamed import XMonad.Layout.Renamed
import XMonad.Layout.ShowWName
-- Util -- Util
import XMonad.Util.EZConfig import XMonad.Util.EZConfig
@ -29,6 +30,9 @@ import XMonad.Util.SpawnOnce
-- Extra keys -- Extra keys
import Graphics.X11.ExtraTypes.XF86 import Graphics.X11.ExtraTypes.XF86
import XMonad.StackSet as W
-- Main -- Main
main :: IO () main :: IO ()
main = xmonad main = xmonad
@ -37,14 +41,20 @@ main = xmonad
. withEasySB (xmobar1 <> xmobar2) defToggleStrutsKey . withEasySB (xmobar1 <> xmobar2) defToggleStrutsKey
$ myConfig $ myConfig
-- Variables
myModMask = mod4Mask
myTerminal :: String
myTerminal = "kitty"
-- Config -- Config
myConfig = def myConfig = def
{ modMask = mod4Mask { modMask = myModMask
, terminal = "kitty" , terminal = myTerminal
, workspaces = myWorkspaces , X.workspaces = myWorkspaces
, focusedBorderColor = "#006700" , focusedBorderColor = "#006700"
, normalBorderColor = "#000000" , normalBorderColor = "#000000"
, layoutHook = showWName myLayout , layoutHook = myLayout
, startupHook = myStartupHook , startupHook = myStartupHook
, manageHook = myManageHook , manageHook = myManageHook
} }
@ -66,11 +76,15 @@ myConfig = def
] ]
-- Workspaces -- Workspaces
myWorkspaces = [ "1:term", "2:web", "3:games", "4:msg" ] ++ map show [5..9] myWorkspaces :: [String]
myWorkspaces = [ "1:\xf489 ", "2:\xe743 ", "3:\xf1b6 ", "4:\xf10b ", "5:\xead9 " ] ++ map show [6..9]
-- Layout -- Layout
myLayout = tiled ||| Mirror tiled ||| myTabbed ||| threeCol ||| Grid ||| spiral(0.856) myLayout = onWorkspace "2:\xe743 " myWebLayout $ onWorkspace "3:\xf1b6 " myGamesLayout $ myDefaultLayout
where where
myWebLayout = avoidStruts $ myTabbed ||| tiled ||| Mirror tiled ||| threeCol ||| Grid ||| spiral(0.856)
myGamesLayout = avoidStruts $ Full
myDefaultLayout = avoidStruts $ tiled ||| Mirror tiled ||| myTabbed ||| threeCol ||| Grid ||| spiral(0.856)
threeCol threeCol
= renamed [Replace "ThreeCol"] = renamed [Replace "ThreeCol"]
$ magnifiercz' 1.3 $ magnifiercz' 1.3
@ -106,7 +120,7 @@ myXmobarPP = def
formatUnfocused = wrap (lowWhite "[") (lowWhite "]") . white . ppWindow formatUnfocused = wrap (lowWhite "[") (lowWhite "]") . white . ppWindow
ppWindow :: String -> String ppWindow :: String -> String
ppWindow = xmobarRaw . (\w -> if null w then "untitled" else w) . shorten 30 ppWindow = xmobarRaw . (\w -> if null w then "untitled" else w) . shorten 25
blue, lowWhite, darkgreen, red, white, yellow :: String -> String blue, lowWhite, darkgreen, red, white, yellow :: String -> String
darkgreen = xmobarColor "#013220" "" darkgreen = xmobarColor "#013220" ""
@ -136,15 +150,20 @@ myStartupHook = do
-- Manage hook -- Manage hook
myManageHook :: ManageHook myManageHook :: ManageHook
myManageHook = composeAll myManageHook = composeAll
[ className =? "kitty" --> doShift "1:term" [ className =? "kitty" --> doShift "1:\xf489 "
, className =? "Vivaldi-stable" --> doShift "2:web" , className =? "Vivaldi-stable" --> doShift "2:\xe743 "
, className =? "steam" --> doShift "3:games" , className =? "steam" --> doShift "3:\xf1b6 "
, className =? "discord" --> doShift "4:msg" , className =? "discord" --> doShift "4:\xf10b "
, className =? "Signal" --> doShift "4:msg" , className =? "Signal" --> doShift "4:\xf10b "
, className =? "mpv" --> doFullFloat , className =? "mpv" --> doFullFloat
, className =? "mpv" --> doShift "5:\xead9 "
, className =? "Gpodder" --> doShift "5:\xead9 "
, className =? "Xviewer" --> doFloat , className =? "Xviewer" --> doFloat
, className =? "Galculator" --> doFloat , className =? "Galculator" --> doFloat
, className =? "steam_app_109600" --> doFloat , className =? "steam_app_109600" --> doFloat
, className =? "Xmessage" --> doFloat
, className =? "Windscribe2" --> doShift "9"
, className =? "Windscribe2" --> doRectFloat (W.RationalRect 0.4 0.4 0.6 0.6)
, isDialog --> doFloat , isDialog --> doFloat
, isFullscreen --> doFullFloat , isFullscreen --> doFullFloat
] ]