fix: config checker not working on generic sys

This commit is contained in:
Swarsel 2024-12-15 15:01:33 +01:00
parent 3ba1690e3a
commit 65c8c2430e
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
3 changed files with 254 additions and 244 deletions

View file

@ -1879,7 +1879,7 @@ This scripts checks if there are uncommited changes in either my dotfile repo, m
#+begin_src shell :tangle scripts/waybarupdate.sh #+begin_src shell :tangle scripts/waybarupdate.sh
CFG=$(git --git-dir="$HOME"/.dotfiles/.git --work-tree="$HOME"/.dotfiles/ status -s | wc -l) CFG=$(git --git-dir="$HOME"/.dotfiles/.git --work-tree="$HOME"/.dotfiles/ status -s | wc -l)
CSE=$(git --git-dir="$HOME"/Documents/GitHub/CSE_TUWIEN/.git --work-tree="$HOME"/Documents/GitHub/CSE_TUWIEN/ status -s | wc -l) CSE=$(git --git-dir="$DOCUMENT_DIR_PRIV"/CSE_TUWIEN/.git --work-tree="$DOCUMENT_DIR_PRIV"/CSE_TUWIEN/ status -s | wc -l)
PASS=$(($(git --git-dir="$HOME"/.local/share/password-store/.git --work-tree="$HOME"/.local/share/password-store/ status -s | wc -l) + $(git --git-dir="$HOME"/.local/share/password-store/.git --work-tree="$HOME"/.local/share/password-store/ diff origin/main..HEAD | wc -l))) PASS=$(($(git --git-dir="$HOME"/.local/share/password-store/.git --work-tree="$HOME"/.local/share/password-store/ status -s | wc -l) + $(git --git-dir="$HOME"/.local/share/password-store/.git --work-tree="$HOME"/.local/share/password-store/ diff origin/main..HEAD | wc -l)))
if [[ $CFG != 0 ]]; then if [[ $CFG != 0 ]]; then
@ -8201,270 +8201,272 @@ The rest of the related configuration is found here:
- [[#h:f93f66f9-6b8b-478e-b139-b2f382c1f25e][waybarupdate]] - [[#h:f93f66f9-6b8b-478e-b139-b2f382c1f25e][waybarupdate]]
#+begin_src nix :tangle profiles/common/home/waybar.nix #+begin_src nix :tangle profiles/common/home/waybar.nix
{ self, config, lib, ... }: { self, config, lib, ... }:
{ {
programs.waybar = { programs.waybar = {
enable = true;
systemd = {
enable = true; enable = true;
target = "sway-sessions.target"; systemd = {
}; enable = true;
settings = { target = "sway-sessions.target";
mainBar = { };
layer = "top"; settings = {
position = "top"; mainBar = {
modules-left = [ "sway/workspaces" "custom/outer-right-arrow-dark" "sway/window" ]; ipc = true;
modules-center = [ "sway/mode" "privacy" "custom/github" "custom/configwarn" "custom/nix-updates" ]; id = "bar-0";
"sway/mode" = { layer = "top";
format = "<span style=\"italic\" font-weight=\"bold\">{}</span>"; position = "top";
}; modules-left = [ "sway/workspaces" "custom/outer-right-arrow-dark" "sway/window" ];
modules-center = [ "sway/mode" "privacy" "custom/github" "custom/configwarn" "custom/nix-updates" ];
modules-right = config.swarselsystems.waybarModules; "sway/mode" = {
format = "<span style=\"italic\" font-weight=\"bold\">{}</span>";
"custom/pseudobat" = lib.mkIf (!config.swarselsystems.isLaptop) {
format = "";
on-click-right = "wlogout -p layer-shell";
};
"custom/configwarn" = {
exec = "waybarupdate";
interval = 60;
};
"custom/scratchpad-indicator" = {
interval = 3;
exec = "swaymsg -t get_tree | jq 'recurse(.nodes[]) | first(select(.name==\"__i3_scratch\")) | .floating_nodes | length | select(. >= 1)'";
format = "{} ";
on-click = "swaymsg 'scratchpad show'";
on-click-right = "swaymsg 'move scratchpad'";
};
"custom/github" = {
format = "{}  ";
return-type = "json";
interval = 60;
exec = "github-notifications";
on-click = "xdg-open https://github.com/notifications";
};
# "custom/nix-updates" = {
# exec = "update-checker";
# on-click = "update-checker && notify-send 'The system has been updated'";
# interval = "once";
# tooltip = true;
# return-type = "json";
# format = "{} {icon}";
# format-icon = {
# "has-updates" = "";
# "updated" = " ";
# };
# };
idle_inhibitor = {
format = "{icon}";
format-icons = {
activated = "";
deactivated = "";
}; };
};
"group/hardware" = { modules-right = config.swarselsystems.waybarModules;
orientation = "inherit";
drawer = { "custom/pseudobat" = lib.mkIf (!config.swarselsystems.isLaptop) {
"transition-left-to-right" = false; format = "";
on-click-right = "wlogout -p layer-shell";
}; };
modules = [
"tray"
"temperature"
"power-profiles-daemon"
"custom/left-arrow-light"
"custom/left-arrow-dark"
"custom/scratchpad-indicator"
"custom/left-arrow-light"
"disk"
"custom/left-arrow-dark"
"memory"
"custom/left-arrow-light"
"cpu"
"custom/left-arrow-dark"
"backlight/slider"
"idle_inhibitor"
];
};
"backlight/slider" = { "custom/configwarn" = {
min = 0; exec = "waybarupdate";
max = 100; interval = 60;
orientation = "horizontal";
device = "intel_backlight";
};
power-profiles-daemon = {
format = "{icon}";
tooltip-format = "Power profile: {profile}\nDriver: {driver}";
tooltip = true;
format-icons = {
"default" = "";
"performance" = "";
"balanced" = "";
"power-saver" = "";
}; };
};
temperature = { "custom/scratchpad-indicator" = {
hwmon-path = lib.mkIf (!config.swarselsystems.temperatureHwmon.isAbsolutePath) config.swarselsystems.temperatureHwmon.path; interval = 3;
hwmon-path-abs = lib.mkIf config.swarselsystems.temperatureHwmon.isAbsolutePath config.swarselsystems.temperatureHwmon.path; exec = "swaymsg -t get_tree | jq 'recurse(.nodes[]) | first(select(.name==\"__i3_scratch\")) | .floating_nodes | length | select(. >= 1)'";
input-filename = lib.mkIf config.swarselsystems.temperatureHwmon.isAbsolutePath config.swarselsystems.temperatureHwmon.input-filename; format = "{} ";
critical-threshold = 80; on-click = "swaymsg 'scratchpad show'";
format-critical = " {temperatureC}°C"; on-click-right = "swaymsg 'move scratchpad'";
format = " {temperatureC}°C";
};
mpris = {
format = "{player_icon} {title} <small>[{position}/{length}]</small>";
format-paused = "{player_icon} <i>{title} <small>[{position}/{length}]</small></i>";
player-icons = {
"default" = "▶ ";
"mpv" = "🎵 ";
"spotify" = " ";
}; };
status-icons = {
"paused" = " "; "custom/github" = {
format = "{}  ";
return-type = "json";
interval = 60;
exec = "github-notifications";
on-click = "xdg-open https://github.com/notifications";
}; };
interval = 1;
title-len = 20;
artist-len = 20;
album-len = 10;
};
"custom/left-arrow-dark" = {
format = "";
tooltip = false;
};
"custom/outer-left-arrow-dark" = {
format = "";
tooltip = false;
};
"custom/left-arrow-light" = {
format = "";
tooltip = false;
};
"custom/right-arrow-dark" = {
format = "";
tooltip = false;
};
"custom/outer-right-arrow-dark" = {
format = "";
tooltip = false;
};
"custom/right-arrow-light" = {
format = "";
tooltip = false;
};
"sway/workspaces" = {
disable-scroll = true;
format = "{name}";
};
"clock#1" = { # "custom/nix-updates" = {
min-length = 8; # exec = "update-checker";
interval = 1; # on-click = "update-checker && notify-send 'The system has been updated'";
format = "{:%H:%M:%S}"; # interval = "once";
# on-click-right= "gnome-clocks"; # tooltip = true;
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>"; # return-type = "json";
}; # format = "{} {icon}";
# format-icon = {
# "has-updates" = "";
# "updated" = " ";
# };
# };
"clock#2" = { idle_inhibitor = {
format = "{:%d. %B %Y}"; format = "{icon}";
# on-click-right= "gnome-clocks"; format-icons = {
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>"; activated = "";
}; deactivated = "";
};
};
pulseaudio = { "group/hardware" = {
format = "{icon} {volume:2}%"; orientation = "inherit";
format-bluetooth = "{icon} {volume}%"; drawer = {
format-muted = "MUTE"; "transition-left-to-right" = false;
format-icons = { };
headphones = ""; modules = [
default = [ "tray"
"" "temperature"
"" "power-profiles-daemon"
"custom/left-arrow-light"
"custom/left-arrow-dark"
"custom/scratchpad-indicator"
"custom/left-arrow-light"
"disk"
"custom/left-arrow-dark"
"memory"
"custom/left-arrow-light"
"cpu"
"custom/left-arrow-dark"
"backlight/slider"
"idle_inhibitor"
]; ];
}; };
scroll-step = 1;
on-click = "pamixer -t";
on-click-right = "pavucontrol";
};
memory = { "backlight/slider" = {
interval = 5; min = 0;
format = " {}%"; max = 100;
tooltip-format = "Memory: {used:0.1f}G/{total:0.1f}G\nSwap: {swapUsed}G/{swapTotal}G"; orientation = "horizontal";
}; device = "intel_backlight";
cpu = { };
format = config.swarselsystems.cpuString;
min-length = 6;
interval = 5;
format-icons = [ "▁" "▂" "▃" "▄" "▅" "▆" "▇" "█" ];
# on-click-right= "com.github.stsdc.monitor";
on-click-right = "kitty -o confirm_os_window_close=0 btm";
}; power-profiles-daemon = {
"custom/vpn" = { format = "{icon}";
format = "()"; tooltip-format = "Power profile: {profile}\nDriver: {driver}";
exec = "echo '{\"class\": \"connected\"}'"; tooltip = true;
exec-if = "test -d /proc/sys/net/ipv4/conf/tun0"; format-icons = {
return-type = "json"; "default" = "";
interval = 5; "performance" = "";
}; "balanced" = "";
battery = { "power-saver" = "";
states = { };
"warning" = 60;
"error" = 30;
"critical" = 15;
}; };
interval = 5;
format = "{icon} {capacity}%"; temperature = {
format-charging = "{capacity}% "; hwmon-path = lib.mkIf (!config.swarselsystems.temperatureHwmon.isAbsolutePath) config.swarselsystems.temperatureHwmon.path;
format-plugged = "{capacity}% "; hwmon-path-abs = lib.mkIf config.swarselsystems.temperatureHwmon.isAbsolutePath config.swarselsystems.temperatureHwmon.path;
format-icons = [ input-filename = lib.mkIf config.swarselsystems.temperatureHwmon.isAbsolutePath config.swarselsystems.temperatureHwmon.input-filename;
"" critical-threshold = 80;
"" format-critical = " {temperatureC}°C";
"" format = " {temperatureC}°C";
""
"" };
];
on-click-right = "wlogout -p layer-shell"; mpris = {
}; format = "{player_icon} {title} <small>[{position}/{length}]</small>";
disk = { format-paused = "{player_icon} <i>{title} <small>[{position}/{length}]</small></i>";
interval = 30; player-icons = {
format = "Disk {percentage_used:2}%"; "default" = "▶ ";
path = "/"; "mpv" = "🎵 ";
states = { "spotify" = " ";
"warning" = 80; };
"critical" = 90; status-icons = {
"paused" = " ";
};
interval = 1;
title-len = 20;
artist-len = 20;
album-len = 10;
};
"custom/left-arrow-dark" = {
format = "";
tooltip = false;
};
"custom/outer-left-arrow-dark" = {
format = "";
tooltip = false;
};
"custom/left-arrow-light" = {
format = "";
tooltip = false;
};
"custom/right-arrow-dark" = {
format = "";
tooltip = false;
};
"custom/outer-right-arrow-dark" = {
format = "";
tooltip = false;
};
"custom/right-arrow-light" = {
format = "";
tooltip = false;
};
"sway/workspaces" = {
disable-scroll = true;
format = "{name}";
};
"clock#1" = {
min-length = 8;
interval = 1;
format = "{:%H:%M:%S}";
# on-click-right= "gnome-clocks";
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
};
"clock#2" = {
format = "{:%d. %B %Y}";
# on-click-right= "gnome-clocks";
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
};
pulseaudio = {
format = "{icon} {volume:2}%";
format-bluetooth = "{icon} {volume}%";
format-muted = "MUTE";
format-icons = {
headphones = "";
default = [
""
""
];
};
scroll-step = 1;
on-click = "pamixer -t";
on-click-right = "pavucontrol";
};
memory = {
interval = 5;
format = " {}%";
tooltip-format = "Memory: {used:0.1f}G/{total:0.1f}G\nSwap: {swapUsed}G/{swapTotal}G";
};
cpu = {
format = config.swarselsystems.cpuString;
min-length = 6;
interval = 5;
format-icons = [ "▁" "▂" "▃" "▄" "▅" "▆" "▇" "█" ];
# on-click-right= "com.github.stsdc.monitor";
on-click-right = "kitty -o confirm_os_window_close=0 btm";
};
"custom/vpn" = {
format = "()";
exec = "echo '{\"class\": \"connected\"}'";
exec-if = "test -d /proc/sys/net/ipv4/conf/tun0";
return-type = "json";
interval = 5;
};
battery = {
states = {
"warning" = 60;
"error" = 30;
"critical" = 15;
};
interval = 5;
format = "{icon} {capacity}%";
format-charging = "{capacity}% ";
format-plugged = "{capacity}% ";
format-icons = [
""
""
""
""
""
];
on-click-right = "wlogout -p layer-shell";
};
disk = {
interval = 30;
format = "Disk {percentage_used:2}%";
path = "/";
states = {
"warning" = 80;
"critical" = 90;
};
tooltip-format = "{used} used out of {total} on {path} ({percentage_used}%)\n{free} free on {path} ({percentage_free}%)";
};
tray = {
icon-size = 20;
};
network = {
interval = 5;
format-wifi = "{signalStrength}% ";
format-ethernet = "";
format-linked = "{ifname} (No IP) ";
format-disconnected = "Disconnected ⚠";
format-alt = "{ifname}: {ipaddr}/{cidr}";
tooltip-format-ethernet = "{ifname} via {gwaddr}: {essid} {ipaddr}/{cidr}\n\n⇡{bandwidthUpBytes} ⇣{bandwidthDownBytes}";
tooltip-format-wifi = "{ifname} via {gwaddr}: {essid} {ipaddr}/{cidr} \n{signaldBm}dBm @ {frequency}MHz\n\n⇡{bandwidthUpBytes} ⇣{bandwidthDownBytes}";
}; };
tooltip-format = "{used} used out of {total} on {path} ({percentage_used}%)\n{free} free on {path} ({percentage_free}%)";
};
tray = {
icon-size = 20;
};
network = {
interval = 5;
format-wifi = "{signalStrength}% ";
format-ethernet = "";
format-linked = "{ifname} (No IP) ";
format-disconnected = "Disconnected ⚠";
format-alt = "{ifname}: {ipaddr}/{cidr}";
tooltip-format-ethernet = "{ifname} via {gwaddr}: {essid} {ipaddr}/{cidr}\n\n⇡{bandwidthUpBytes} ⇣{bandwidthDownBytes}";
tooltip-format-wifi = "{ifname} via {gwaddr}: {essid} {ipaddr}/{cidr} \n{signaldBm}dBm @ {frequency}MHz\n\n⇡{bandwidthUpBytes} ⇣{bandwidthDownBytes}";
}; };
}; };
style = builtins.readFile (self + /programs/waybar/style.css);
}; };
style = builtins.readFile (self + /programs/waybar/style.css); }
};
}
#+end_src #+end_src
**** Firefox **** Firefox
@ -9368,6 +9370,10 @@ The rest of the settings is at [[#h:bbf2ecb6-c8ff-4462-b5d5-d45b28604ddf][work]]
libguestfs-with-appliance libguestfs-with-appliance
]; ];
home.sessionVariables = {
DOCUMENT_DIR_PRIV = lib.mkForce "${config.home.homeDirectory}/Documents/Private";
DOCUMENT_DIR_WORK = lib.mkForce "${config.home.homeDirectory}/Documents/Work";
};
programs = { programs = {
git.userEmail = "leon.schwarzaeugl@imba.oeaw.ac.at"; git.userEmail = "leon.schwarzaeugl@imba.oeaw.ac.at";

View file

@ -11,6 +11,10 @@
libguestfs-with-appliance libguestfs-with-appliance
]; ];
home.sessionVariables = {
DOCUMENT_DIR_PRIV = lib.mkForce "${config.home.homeDirectory}/Documents/Private";
DOCUMENT_DIR_WORK = lib.mkForce "${config.home.homeDirectory}/Documents/Work";
};
programs = { programs = {
git.userEmail = "leon.schwarzaeugl@imba.oeaw.ac.at"; git.userEmail = "leon.schwarzaeugl@imba.oeaw.ac.at";

View file

@ -1,5 +1,5 @@
CFG=$(git --git-dir="$HOME"/.dotfiles/.git --work-tree="$HOME"/.dotfiles/ status -s | wc -l) CFG=$(git --git-dir="$HOME"/.dotfiles/.git --work-tree="$HOME"/.dotfiles/ status -s | wc -l)
CSE=$(git --git-dir="$HOME"/Documents/GitHub/CSE_TUWIEN/.git --work-tree="$HOME"/Documents/GitHub/CSE_TUWIEN/ status -s | wc -l) CSE=$(git --git-dir="$DOCUMENT_DIR_PRIV"/CSE_TUWIEN/.git --work-tree="$DOCUMENT_DIR_PRIV"/CSE_TUWIEN/ status -s | wc -l)
PASS=$(($(git --git-dir="$HOME"/.local/share/password-store/.git --work-tree="$HOME"/.local/share/password-store/ status -s | wc -l) + $(git --git-dir="$HOME"/.local/share/password-store/.git --work-tree="$HOME"/.local/share/password-store/ diff origin/main..HEAD | wc -l))) PASS=$(($(git --git-dir="$HOME"/.local/share/password-store/.git --work-tree="$HOME"/.local/share/password-store/ status -s | wc -l) + $(git --git-dir="$HOME"/.local/share/password-store/.git --work-tree="$HOME"/.local/share/password-store/ diff origin/main..HEAD | wc -l)))
if [[ $CFG != 0 ]]; then if [[ $CFG != 0 ]]; then