diff --git a/haskell/xmobar/xmobar.hs b/haskell/xmobar/xmobar.hs index a2fe690..0240a8f 100644 --- a/haskell/xmobar/xmobar.hs +++ b/haskell/xmobar/xmobar.hs @@ -1,27 +1,27 @@ - import Xmobar +import Xmobar - config :: Config - config = - defaultConfig - { font = "FiraCode Nerd Font", - allDesktops = True, - alpha = 255, - bgColor = "#282828", - fgColor = "#ebdbb2", - commands = - -- [ Run XMonadLog, - -- Run $ Memory ["t", "Mem: %"] 10, - -- Run $ Kbd [], - -- Run $ Date "%a %_d %b %Y %H:%M:%S" "date" 10 - -- ], - [ Run $ Memory ["t", "Mem: %"] 10, - Run $ Kbd [], - Run $ Date "%a %_d %b %Y %H:%M:%S" "date" 10 - ], - template = "%kbd% | %date% | %memory%", - alignSep = "}{", - position = TopH 24 - } +fc code content = "" ++ content ++ "" - main :: IO () - main = xmobar config -- or: configFromArgs config >>= xmobar +sep = fc "#7c6f64" +icon = fc "#d65d0e" + +config :: Config +config = + defaultConfig + { font = "FiraCode Nerd Font", + allDesktops = True, + alpha = 255, + bgColor = "#282828", + fgColor = "#ebdbb2", + commands = + [ Run $ Memory ["t", "Mem: %"] 10, + Run $ Kbd [], + Run $ Date (icon "\983277" ++ " %Y" ++ sep "-" ++ "%m" ++ sep "-" ++ "%d " ++ icon "\988236" ++ " %H" ++ sep ":" ++ "%M" ++ sep ":" ++ "%S ") "date" 10 + ], + template = "}{ %date%", + alignSep = "}{", + position = TopH 24 + } + +main :: IO () +main = xmobar config -- or: configFromArgs config >>= xmobar diff --git a/haskell/xmonad/xmonad.hs b/haskell/xmonad/xmonad.hs index 8a936e9..3e4f439 100644 --- a/haskell/xmonad/xmonad.hs +++ b/haskell/xmonad/xmonad.hs @@ -25,6 +25,7 @@ import XMonad.Prompt.Layout import XMonad.StackSet qualified as W import XMonad.Actions.NoBorders import XMonad.Util.EZConfig +import XMonad.Hooks.ServerMode myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $ @@ -142,10 +143,8 @@ myStartupHook = do spawn "pgrep nm-applet || nm-applet" spawn "pgrep mullvad-gui || mullvad-vpn" spawn "feh --bg-fill ~/Pictures/wallpaper.jpg" - killStatusBar "xmobar" - spawnStatusBar "xmobar" -xmeowbar = statusBarProp "xmobar" $ pure xmobarPP +xmeowbar = statusBarProp "~/.config/xmobar/xmobar" $ pure xmobarPP polybar = statusBarProp "polybar" $ pure xmobarPP barSpawner 0 = pure $ xmeowbar <> polybar barSpawner _ = mempty @@ -168,5 +167,6 @@ defaults = mouseBindings = myMouseBindings, layoutHook =myLayout, manageHook = myManageHook, - startupHook = myStartupHook + startupHook = myStartupHook, + handleEventHook = serverModeEventHook } diff --git a/modules/desktop/polybar.nix b/modules/desktop/polybar.nix index 7db300d..769aba3 100644 --- a/modules/desktop/polybar.nix +++ b/modules/desktop/polybar.nix @@ -45,7 +45,7 @@ separator-foreground = "\${colors.disabled}"; font-0 = "FiraCode Nerd Font"; modules-left = "xworkspaces xwindow"; - modules-right = "memory cpu wlan battery date"; + modules-right = "memory cpu wlan battery"; cursor-click = "pointer"; cursor-scroll = "ns-resize"; enable-ipc = true; @@ -138,14 +138,6 @@ ]; }; - "module/date" = { - type = "internal/date"; - interval = 1; - date = "%Y%{F#7c6f64}-%{F#ebdbb2}%m%{F#7c6f64}-%{F#ebdbb2}%d"; - time = "%H%{F#7c6f64}:%{F#ebdbb2}%M%{F#7c6f64}:%{F#ebdbb2}%S"; - label = "%{F#d65d0e}󰃭%{F#ebdbb2} %date% %{F#d65d0e}󱑌%{F#ebdbb2} %time%"; - }; - "settings" = { screenchange-reload = true; pseudo-transparency = true; diff --git a/modules/desktop/xmonad.nix b/modules/desktop/xmonad.nix index 793723b..db504a5 100644 --- a/modules/desktop/xmonad.nix +++ b/modules/desktop/xmonad.nix @@ -14,12 +14,12 @@ programs.xmobar = { enable = true; }; - home.file."xmobar.hs" = { + home.file."xmobar.hs" = rec { source = ../../haskell/xmobar/xmobar.hs; target = ".config/xmobar/xmobar.hs"; onChange = '' - export PATH=${lib.makeBinPath [xmobarGhc]}:$PATH - ${pkgs.xmobar}/bin/xmobar --recompile + ${xmobarGhc}/bin/ghc -threaded ${target} + ${pkgs.busybox}/bin/pkill xmobar ${pkgs.haskellPackages.xmonad}/bin/xmonad --restart ''; };