From cb0bca9969f0761e5d797d8d1c524ecee45339d1 Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Thu, 25 Aug 2022 10:24:46 +0300 Subject: [PATCH] nix/bar/polybar: fix env to run custom scripts --- .gitignore | 2 ++ nix/wm/bar/polybar/default.nix | 13 +++++++++---- notes/systemd.md | 6 ++++++ 3 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 notes/systemd.md diff --git a/.gitignore b/.gitignore index c18401e..35f5100 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ !/.gitignore +!/notes + !/nix /nix/* !/nix/wm diff --git a/nix/wm/bar/polybar/default.nix b/nix/wm/bar/polybar/default.nix index a23036c..35b88db 100644 --- a/nix/wm/bar/polybar/default.nix +++ b/nix/wm/bar/polybar/default.nix @@ -4,6 +4,7 @@ with lib; let cfg = config.wm.bar.polybar; + pcfg = config.services.polybar; colors = { orange = "#ee9a00"; @@ -19,6 +20,11 @@ in }; config = mkIf cfg.enable { + systemd.user.services.polybar = { + # Add additional /usr/bin to run custom scripts + Service.Environment = mkForce "PATH=${pcfg.package}/bin:/run/wrappers/bin:/usr/bin"; + }; + services.polybar = { enable = true; script = "polybar &"; @@ -26,7 +32,7 @@ in "bar/main" = { monitor = "DisplayPort-1"; width = "100%"; - height = "16px"; + height = "20px"; font = [ "Fira Code:size=9:antialias=true" "Fira Code:bold:size=0:antialias=true" @@ -35,7 +41,7 @@ in modules = { left = "xmonad"; center = "date wifi"; - right = "lang time"; + right = "volume lang time"; }; }; @@ -63,9 +69,9 @@ in text = ""; padding = 1; }; + label.layout.font = 2; }; - # TODO: fix amixer "module/volume" = { type = "custom/script"; exec = "~/scripts/get_volume.sh"; @@ -101,7 +107,6 @@ in bottom = 0; top = 0; }; - }; }; }; diff --git a/notes/systemd.md b/notes/systemd.md new file mode 100644 index 0000000..7d82a2c --- /dev/null +++ b/notes/systemd.md @@ -0,0 +1,6 @@ +# The user systemd session is degraded + +```sh +systemctl --user reset-failed +home-manager switch +```