Fix xmobar and trayer management
This commit is contained in:
		@@ -8,7 +8,7 @@ alias rm='rm -I'
 | 
			
		||||
alias sort='sort -n'
 | 
			
		||||
alias ssh='kitten ssh'
 | 
			
		||||
alias sudo='sudo '
 | 
			
		||||
alias trayer='trayer --edge top --align right --SetDockType true --SetPartialStrut true --expand true --width 7 --transparent true --tint 0x232634 --height 18 --monitor 0'
 | 
			
		||||
alias trayer='trayer -l --edge top --align right --SetDockType true --SetPartialStrut true --expand true --widthtype request --transparent true --tint 0x232634 --height 18 --monitor 0'
 | 
			
		||||
alias trc='trash-empty'
 | 
			
		||||
alias trl='trash-list'
 | 
			
		||||
alias trm='trash-rm'
 | 
			
		||||
 
 | 
			
		||||
@@ -1,14 +1,15 @@
 | 
			
		||||
Config { overrideRedirect   = False
 | 
			
		||||
Config { overrideRedirect   = True
 | 
			
		||||
       , lowerOnStart       = True
 | 
			
		||||
       , font               = "Jetbrains Mono Nerd Font Bold 9"
 | 
			
		||||
       , bgColor            = "#232634"
 | 
			
		||||
       , fgColor            = "#626880"
 | 
			
		||||
       , position           = TopW L 93
 | 
			
		||||
       , position           = Top
 | 
			
		||||
       , border             = NoBorder
 | 
			
		||||
       , borderColor        = "#232634" 
 | 
			
		||||
       , allDesktops        = True
 | 
			
		||||
       , pickBroadest       = True
 | 
			
		||||
       , commands           = [ Run Weather "LZIB"
 | 
			
		||||
                                [ "--template", "<weather> <tempC>°C"
 | 
			
		||||
                                [ "--template", "\xe302  <station>: <tempC>°C"
 | 
			
		||||
                                , "-L", "5"
 | 
			
		||||
                                , "-H", "25"
 | 
			
		||||
                                , "--low"       , "#8caaee"
 | 
			
		||||
@@ -16,7 +17,7 @@ Config { overrideRedirect   = False
 | 
			
		||||
                                , "--high"      , "#eebebe"
 | 
			
		||||
                                ] 9000
 | 
			
		||||
                              , Run MultiCpu
 | 
			
		||||
                                [ "--template"  , "Cpu: <total>%"
 | 
			
		||||
                                [ "--template"  , "\xf4bc  Cpu: <total>%"
 | 
			
		||||
                                , "--Low"       , "25"
 | 
			
		||||
                                , "--High"      , "75"
 | 
			
		||||
                                , "--low"       , "#a6d189"
 | 
			
		||||
@@ -24,7 +25,7 @@ Config { overrideRedirect   = False
 | 
			
		||||
                                , "--high"      , "#eebebe"
 | 
			
		||||
                                ] 10
 | 
			
		||||
                              , Run CoreTemp
 | 
			
		||||
                                [ "--template"  , "Temp: <core0>°C|<core1>°C|<core2>°C|<core3>°C|<core4>°C|<core5>°C"
 | 
			
		||||
                                [ "--template"  , "Temp: <core0>°C"
 | 
			
		||||
                                , "--Low"       , "60"
 | 
			
		||||
                                , "--High"      , "85"
 | 
			
		||||
                                , "--low"       , "#a6d189"
 | 
			
		||||
@@ -32,22 +33,26 @@ Config { overrideRedirect   = False
 | 
			
		||||
                                , "--high"      , "#eebebe"
 | 
			
		||||
                                ] 50
 | 
			
		||||
                              , Run Memory
 | 
			
		||||
                                [ "--template"  , "Mem: <usedratio>%" 
 | 
			
		||||
                                [ "--template"  , "\xefc5  Mem: <usedratio>%" 
 | 
			
		||||
                                , "--Low"       , "20"
 | 
			
		||||
                                , "--High"      , "60"
 | 
			
		||||
                                , "--low"       , "#a6d189"
 | 
			
		||||
                                , "--normal"    , "#ef9f76"
 | 
			
		||||
                                , "--high"      , "#eebebe"
 | 
			
		||||
                                ] 10
 | 
			
		||||
                                ] 50
 | 
			
		||||
                              , Run Kbd
 | 
			
		||||
                                [ ("it"         , "<fc=#a6d189>IT</fc>") 
 | 
			
		||||
                                , ("us"         , "<fc=#ef9f76>US</fc>")
 | 
			
		||||
                                , ("sk(qwerty)" , "<fc=#eebebe>SK</fc>")
 | 
			
		||||
                                ]
 | 
			
		||||
                              , Run Date "%a %Y-%m-%d <fc=#81c8be>%H:%M</fc>" "date" 10
 | 
			
		||||
                              , Run Date "\xf133  %a %Y-%m-%d <fc=#81c8be>%H:%M</fc>" "date" 10
 | 
			
		||||
                              , Run Uptime
 | 
			
		||||
                                [ "--template"  , "\xf017  Uptime: <days>d <hours>h <minutes>m"
 | 
			
		||||
                                ] 600
 | 
			
		||||
                              , Run XPropertyLog "_XMONAD_TRAYPAD"
 | 
			
		||||
                              , Run XMonadLog
 | 
			
		||||
                              ]
 | 
			
		||||
        , sepChar           = "%"
 | 
			
		||||
        , alignSep          = "}{"
 | 
			
		||||
        , template          = "%XMonadLog% }{ %multicpu% | %coretemp% | %memory% | %kbd% | %LZIB% | %date% "
 | 
			
		||||
        , template          = "  | %XMonadLog% } %uptime% | %multicpu%, %coretemp% | %memory% |   %kbd% { %LZIB% | %date% %_XMONAD_TRAYPAD%"
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,5 @@
 | 
			
		||||
Config { overrideRedirect   = False
 | 
			
		||||
       , lowerOnStart       = True
 | 
			
		||||
       , font               = "Jetbrains Mono Nerd Font Bold 9"
 | 
			
		||||
       , bgColor            = "#232634"
 | 
			
		||||
       , fgColor            = "#626880"
 | 
			
		||||
@@ -8,7 +9,7 @@ Config { overrideRedirect   = False
 | 
			
		||||
       , allDesktops        = True
 | 
			
		||||
       , pickBroadest       = True
 | 
			
		||||
       , commands           = [ Run Weather "LZIB"
 | 
			
		||||
                                [ "--template", "<weather> <tempC>°C"
 | 
			
		||||
                                [ "--template", "\xe302  <station>: <tempC>°C"
 | 
			
		||||
                                , "-L", "5"
 | 
			
		||||
                                , "-H", "25"
 | 
			
		||||
                                , "--low"       , "#8caaee"
 | 
			
		||||
@@ -16,7 +17,7 @@ Config { overrideRedirect   = False
 | 
			
		||||
                                , "--high"      , "#eebebe"
 | 
			
		||||
                                ] 9000
 | 
			
		||||
                              , Run MultiCpu
 | 
			
		||||
                                [ "--template"  , "Cpu: <total>%"
 | 
			
		||||
                                [ "--template"  , "\xf4bc  Cpu: <total>%"
 | 
			
		||||
                                , "--Low"       , "25"
 | 
			
		||||
                                , "--High"      , "75"
 | 
			
		||||
                                , "--low"       , "#a6d189"
 | 
			
		||||
@@ -24,7 +25,7 @@ Config { overrideRedirect   = False
 | 
			
		||||
                                , "--high"      , "#eebebe"
 | 
			
		||||
                                ] 10
 | 
			
		||||
                              , Run CoreTemp
 | 
			
		||||
                                [ "--template"  , "Temp: <core0>°C|<core1>°C|<core2>°C|<core3>°C|<core4>°C|<core5>°C"
 | 
			
		||||
                                [ "--template"  , "Temp: <core0>°C"
 | 
			
		||||
                                , "--Low"       , "60"
 | 
			
		||||
                                , "--High"      , "85"
 | 
			
		||||
                                , "--low"       , "#a6d189"
 | 
			
		||||
@@ -32,25 +33,25 @@ Config { overrideRedirect   = False
 | 
			
		||||
                                , "--high"      , "#eebebe"
 | 
			
		||||
                                ] 50
 | 
			
		||||
                              , Run Memory
 | 
			
		||||
                                [ "--template"  , "Mem: <usedratio>%" 
 | 
			
		||||
                                [ "--template"  , "\xefc5  Mem: <usedratio>%" 
 | 
			
		||||
                                , "--Low"       , "20"
 | 
			
		||||
                                , "--High"      , "60"
 | 
			
		||||
                                , "--low"       , "#a6d189"
 | 
			
		||||
                                , "--normal"    , "#ef9f76"
 | 
			
		||||
                                , "--high"      , "#eebebe"
 | 
			
		||||
                                ] 10
 | 
			
		||||
                                ] 50
 | 
			
		||||
                              , Run Kbd
 | 
			
		||||
                                [ ("it"         , "<fc=#a6d189>IT</fc>") 
 | 
			
		||||
                                , ("us"         , "<fc=#ef9f76>US</fc>")
 | 
			
		||||
                                , ("sk(qwerty)" , "<fc=#eebebe>SK</fc>")
 | 
			
		||||
                                ]
 | 
			
		||||
                              , Run Date "%a %Y-%m-%d <fc=#81c8be>%H:%M</fc>" "date" 10
 | 
			
		||||
                              , Run Date "\xf133  %a %Y-%m-%d <fc=#81c8be>%H:%M</fc>" "date" 10
 | 
			
		||||
                              , Run Uptime
 | 
			
		||||
                                [ "--template"  , "Uptime: <days>d <hours>h <minutes>m"
 | 
			
		||||
                                [ "--template"  , "\xf017  Uptime: <days>d <hours>h <minutes>m"
 | 
			
		||||
                                ] 600
 | 
			
		||||
                              , Run XMonadLog
 | 
			
		||||
                              ]
 | 
			
		||||
        , sepChar           = "%"
 | 
			
		||||
        , alignSep          = "}{"
 | 
			
		||||
        , template          = "%XMonadLog% | %uptime% }{%multicpu% | %coretemp% | %memory% | %kbd% | %LZIB% | %date% "
 | 
			
		||||
        , template          = "  | %XMonadLog% } %uptime% | %multicpu%, %coretemp% | %memory% |   %kbd% { %LZIB% | %date% "
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
@@ -28,6 +28,7 @@ import XMonad.Layout.Renamed
 | 
			
		||||
 | 
			
		||||
-- Util
 | 
			
		||||
import XMonad.Util.EZConfig
 | 
			
		||||
import qualified XMonad.Util.Hacks as Hacks
 | 
			
		||||
import XMonad.Util.Loggers
 | 
			
		||||
import XMonad.Util.NamedScratchpad
 | 
			
		||||
import XMonad.Util.SpawnOnce
 | 
			
		||||
@@ -78,11 +79,13 @@ myScratchpads =
 | 
			
		||||
    , NS "Terminal" spawnTerminal (title =? "kitty-float") (customFloating $ W.RationalRect 0.2 0.2 0.6 0.6)
 | 
			
		||||
    , NS "Music" spawnMusic (title =? "ncmpcpp") (customFloating $ W.RationalRect 0.2 0.2 0.6 0.6)
 | 
			
		||||
    , NS "Mail" spawnMail (title =? "mutt") (customFloating $ W.RationalRect 0.2 0.2 0.6 0.6)
 | 
			
		||||
    , NS "Cal" spawnCal (title =? "calcurse") (customFloating $ W.RationalRect 0.2 0.2 0.6 0.6)
 | 
			
		||||
    ]
 | 
			
		||||
    where
 | 
			
		||||
        spawnTerminal = myTerminal ++ " -T kitty-float"
 | 
			
		||||
        spawnMusic = myTerminal ++ " -T ncmpcpp ncmpcpp"
 | 
			
		||||
        spawnMail = myTerminal ++ " -T mutt bash -c 'pushd ~/Downloads > /dev/null; mutt; popd > /dev/null'"
 | 
			
		||||
        spawnCal = myTerminal ++ " -T calcurse calcurse"
 | 
			
		||||
 | 
			
		||||
-- Config
 | 
			
		||||
myConfig = def
 | 
			
		||||
@@ -94,6 +97,7 @@ myConfig = def
 | 
			
		||||
    , layoutHook            = myLayoutHook
 | 
			
		||||
    , startupHook           = myStartupHook
 | 
			
		||||
    , manageHook            = myManageHook
 | 
			
		||||
    , handleEventHook       = handleEventHook def <> Hacks.trayerAboveXmobarEventHook <> Hacks.trayerPaddingXmobarEventHook
 | 
			
		||||
    }
 | 
			
		||||
    `additionalKeysP`
 | 
			
		||||
    [ ("M-S-l"          , spawn "slock"                                                             )
 | 
			
		||||
@@ -108,6 +112,7 @@ myConfig = def
 | 
			
		||||
    , ("M-s"            , spawn $ "setxkbmap" ++ myKeyboardLayoutSK                                 )
 | 
			
		||||
    , ("M-S-v"          , namedScratchpadAction myScratchpads "Windscribe"                          )
 | 
			
		||||
    , ("M-S-s"          , namedScratchpadAction myScratchpads "Terminal"                            )
 | 
			
		||||
    , ("M-S-a"          , namedScratchpadAction myScratchpads "Cal"                                 )
 | 
			
		||||
    , ("M-x"            , spawn "bluetoothctl connect E8:EE:CC:3E:A6:0D"                            )
 | 
			
		||||
    , ("M-S-x"          , spawn "bluetoothctl disconnect E8:EE:CC:3E:A6:0D"                         )
 | 
			
		||||
    ]
 | 
			
		||||
@@ -187,8 +192,8 @@ myStartupHook = do
 | 
			
		||||
    spawnOnce "xsetroot -cursor_name left_ptr"
 | 
			
		||||
    spawnOnce "mons -e left && ~/.fehbg"
 | 
			
		||||
    spawnOnce "xautolock -time 10 -locker slock -detectsleep"
 | 
			
		||||
    spawnOnce "trayer --edge top --align right --SetDockType true \
 | 
			
		||||
              \--SetPartialStrut true --expand true --width 7 \
 | 
			
		||||
    spawnOnce "trayer -l --edge top --align right --SetDockType true \
 | 
			
		||||
              \--SetPartialStrut true --expand true --widthtype request \
 | 
			
		||||
              \--transparent true --tint 0x232634 --height 18 \
 | 
			
		||||
              \--monitor 0"
 | 
			
		||||
    spawnOnce "redshift-gtk"
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user