diff --git a/flake.nix b/flake.nix
index 17b61dd..67768d8 100644
--- a/flake.nix
+++ b/flake.nix
@@ -36,7 +36,13 @@
devShells."x86_64-linux".default = pkgs.mkShell {
buildInputs = [
(pkgs.haskellPackages.ghcWithPackages
- (pkgs: with pkgs; [xmonad xmonad-contrib xmobar]))
+ (pkgs:
+ with pkgs; [
+ xmonad
+ xmonad-contrib
+ xmobar
+ statgrab
+ ]))
pkgs.haskell-language-server
];
};
diff --git a/haskell/xmobar/xmobar.hs b/haskell/xmobar/xmobar.hs
index c9a01f1..51b6138 100644
--- a/haskell/xmobar/xmobar.hs
+++ b/haskell/xmobar/xmobar.hs
@@ -1,4 +1,5 @@
import Xmobar
+import System.Statgrab
-- TODOS:
-- - custom cpu module
@@ -10,12 +11,14 @@ import Xmobar
-- - mail/message monitoring
-- - if possible, different bars per workspace
-data CustomCpu = CustomCpu
+data CustomCpu = CustomCpu
deriving (Read, Show)
instance Exec CustomCpu where
alias CustomCpu = "cpu"
- run CustomCpu = return "meow"
+ run CustomCpu = do
+ -- return (show :: IO String (snapshot :: Stats CPUPercent))
+ return "meow"
fc code content = "" ++ content ++ ""
@@ -31,7 +34,7 @@ config =
bgColor = "#282828",
fgColor = "#ebdbb2",
commands =
- [ Run $ Memory ["t", "Mem: %"] 10,
+ [ Run $ Xmobar.Memory ["t", "Mem: %"] 10,
Run $ CustomCpu,
Run $ Date (icon "\983277" ++ " %Y" ++ sep "-" ++ "%m" ++ sep "-" ++ "%d " ++ icon "\988236" ++ " %H" ++ sep ":" ++ "%M" ++ sep ":" ++ "%S ") "date" 10
],
diff --git a/modules/desktop/xmonad.nix b/modules/desktop/xmonad.nix
index db504a5..9f806a3 100644
--- a/modules/desktop/xmonad.nix
+++ b/modules/desktop/xmonad.nix
@@ -8,7 +8,11 @@
pkgs,
...
}: let
- xmobarGhc = pkgs.haskellPackages.ghcWithPackages (pkgs: with pkgs; [xmobar]);
+ xmobarGhc = pkgs.haskellPackages.ghcWithPackages (pkgs:
+ with pkgs; [
+ xmobar
+ statgrab
+ ]);
in {
home.packages = [xmobarGhc pkgs.xmonadctl];
programs.xmobar = {