nix/bar/polybar: fix env to run custom scripts

This commit is contained in:
Dmitriy Pleshevskiy 2022-08-25 10:24:46 +03:00
parent 60b7339ce2
commit cb0bca9969
Signed by: pleshevskiy
GPG Key ID: 1B59187B161C0215
3 changed files with 17 additions and 4 deletions

2
.gitignore vendored
View File

@ -2,6 +2,8 @@
!/.gitignore
!/notes
!/nix
/nix/*
!/nix/wm

View File

@ -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 = "<label-layout>";
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;
};
};
};
};

6
notes/systemd.md Normal file
View File

@ -0,0 +1,6 @@
# The user systemd session is degraded
```sh
systemctl --user reset-failed
home-manager switch
```