diff options
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/home/christian.nix | 7 | ||||
| -rw-r--r-- | modules/home/xmobar/xmobarrc | 26 | ||||
| -rw-r--r-- | modules/xmonad.hs | 28 |
3 files changed, 47 insertions, 14 deletions
diff --git a/modules/home/christian.nix b/modules/home/christian.nix index 9c35e07..b7bbe3d 100644 --- a/modules/home/christian.nix +++ b/modules/home/christian.nix @@ -49,7 +49,12 @@ ]; }; }; - + + programs.xmobar = { + enable = true; + extraConfig = builtins.readFile ./xmobar/xmobarrc; + }; + programs.home-manager.enable = true; } diff --git a/modules/home/xmobar/xmobarrc b/modules/home/xmobar/xmobarrc new file mode 100644 index 0000000..3185112 --- /dev/null +++ b/modules/home/xmobar/xmobarrc @@ -0,0 +1,26 @@ +Config + { font = "Monospace" + , borderColor = "#d0d0d0" + , border = FullB + , borderWidth = 1 + , bgColor = "#222" + , fgColor = "grey" + , position = TopH 30 + , commands = + [ Run Cpu ["-t", "cpu: <fc=#4eb4fa><bar> <total>%</fc>"] 10 + , Run Network "wlan0" ["-S", "True", "-t", "wlan: <fc=#4eb4fa><rx></fc>/<fc=#4eb4fa><tx></fc>"] 10 + , Run Memory ["-t","mem: <fc=#4eb4fa><usedbar> <usedratio>%</fc>"] 10 + , Run Date "date: <fc=#4eb4fa>%a %d %b %Y %I:%M:%S %p </fc>" "date" 10 + , Run Battery + ["-t", "bat: <leftbar> <left> <watts>", + "-L", "10", "-H", "80", "-S", "True", + "-l", "red", "-n", "#4eb4fa", "-h", "green", + "--", + "-L", "-15", "-H", "-5", + "-l", "red", "-m", "#4eb4fa", "-h", "green"] + 600 + ] + , sepChar = "%" + , alignSep = "}{" + , template = " %battery% | %cpu% | %memory% | %wlan0% }{%date% " +} diff --git a/modules/xmonad.hs b/modules/xmonad.hs index 1df21b5..6de28c7 100644 --- a/modules/xmonad.hs +++ b/modules/xmonad.hs @@ -1,5 +1,8 @@ import XMonad import XMonad.Util.EZConfig (additionalKeys) +import XMonad.Hooks.ManageDocks +import XMonad.Hooks.StatusBar +import XMonad.Hooks.StatusBar.PP import Control.Monad (when) import Text.Printf (printf) import System.Posix.Process (executeFile) @@ -7,23 +10,22 @@ import System.Info (arch,os) import System.Environment (getArgs) import System.FilePath ((</>)) -compiledConfig = printf "xmonad-%s-%s" arch os +myLayout = avoidStruts (tiled ||| Mirror tiled ||| Full) + where + tiled = Tall nmaster delta ratio + nmaster = 1 -- Default number of windows in the master pane + ratio = 1/2 -- Default proportion of screen occupied by master pane + delta = 3/100 -- Percent of screen to increment by when resizing panes myConfig = defaultConfig { modMask = mod1Mask + , layoutHook = myLayout + , focusedBorderColor = "#4eb4fa" , terminal = "alacritty" } `additionalKeys` - [ ( (mod1Mask, xK_r), compileRestart True) - , ( (mod1Mask, xK_q), restart "xmonad" True ) ] + [ ( (mod1Mask, xK_q), restart "xmonad" True ) ] -compileRestart resume = do - dirs <- asks directories - whenX (recompile dirs True) $ do - when resume writeStateToFile - catchIO - ( do - args <- getArgs - executeFile (cacheDir dirs </> compiledConfig) False args Nothing - ) +mySB = statusBarProp "xmobar" (pure xmobarPP) +-- main = xmonad $ withEasySB mySB defToggleStrutsKey def -main = getDirectories >>= launch myConfig +main = getDirectories >>= launch (docks $ withSB mySB myConfig) |
