feat: finish nix-update, add idle/github/bright.

This commit is contained in:
Swarsel 2024-08-11 01:18:07 +02:00
parent 40ccc0a9e9
commit 220451e8ac
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
9 changed files with 377 additions and 218 deletions

View file

@ -3850,6 +3850,7 @@ This is the central station for self-defined packages. These are all referenced
opacitytoggle = callPackage ./opacitytoggle { }; opacitytoggle = callPackage ./opacitytoggle { };
fs-diff = callPackage ./fs-diff { }; fs-diff = callPackage ./fs-diff { };
update-checker = callPackage ./update-checker { }; update-checker = callPackage ./update-checker { };
github-notifications = callPackage ./github-notifications { };
} }
#+end_src #+end_src
@ -4324,14 +4325,21 @@ This utility checks if there are updated packages in nixpkgs-unstable. It does s
#+begin_src shell :tangle scripts/update-checker.sh #+begin_src shell :tangle scripts/update-checker.sh
updates="$(cd ~/.dotfiles && nix flake lock --update-input nixpkgs && nix build .#nixosConfigurations."$HOSTNAME".config.system.build.toplevel && nvd diff /run/current-system ./result | grep -c '\[U')" updates="$( { cd /home/swarsel/.dotfiles && nix flake lock --update-input nixpkgs && nix build .#nixosConfigurations."$(eval hostname)".config.system.build.toplevel && nvd diff /run/current-system ./result | grep -c '\[U'; } || true)"
alt="has-updates"
if [[ $updates -eq 0 ]]; then
alt="updated"
fi
tooltip="System updated" tooltip="System updated"
if [[ $updates != 0 ]]; then if [[ $updates != 0 ]]; then
tooltip=$(cd ~/.dotfiles && nvd diff /run/current-system ./result | grep -e '\[U' | awk '{ for (i=3; i<NF; i++) printf $i " "; if (NF >= 3) print $NF; }' ORS='\\n' ) tooltip=$(cd ~/.dotfiles && nvd diff /run/current-system ./result | grep -e '\[U' | awk '{ for (i=3; i<NF; i++) printf $i " "; if (NF >= 3) print $NF; }' ORS='\\n' )
echo "{ \"text\":\"$updates\", \"alt\":\"$alt\", \"tooltip\":\"$tooltip\" }"
else
echo "{ \"text\":\"\", \"alt\":\"$alt\", \"tooltip\":\"\" }"
fi fi
echo "{ \"text\":\"$updates\", \"tooltip\":\"$tooltip\" }"
#+end_src #+end_src
@ -4345,6 +4353,27 @@ This utility checks if there are updated packages in nixpkgs-unstable. It does s
} }
#+end_src #+end_src
**** github-notifications
This utility checks if there are updated packages in nixpkgs-unstable. It does so by fully building the most recent configuration, which I do not love, but it has its merits once I am willing to switch to the newer version.
#+begin_src nix :tangle pkgs/github-notifications/default.nix
{ writeShellApplication, jq }:
writeShellApplication {
name = "github-notifications";
runtimeInputs = [ jq ];
text = ''
count=$(curl -u Swarsel:"$(cat /run/user/1000/secrets/github_notif)" https://api.github.com/notifications | jq '. | length')
if [[ "$count" != "0" ]]; then
echo "{\"text\":\"$count\"}"
fi
'';
}
#+end_src
*** Overlays (additions, overrides, nixpkgs-stable) *** Overlays (additions, overrides, nixpkgs-stable)
:PROPERTIES: :PROPERTIES:
@ -6630,6 +6659,7 @@ This is just a separate container for derivations defined in [[#h:64a5cc16-6b16-
opacitytoggle opacitytoggle
fs-diff fs-diff
update-checker update-checker
github-notifications
(pkgs.writeScriptBin "project" '' (pkgs.writeScriptBin "project" ''
#! ${pkgs.bash}/bin/bash #! ${pkgs.bash}/bin/bash
@ -6701,6 +6731,7 @@ I use sops-nix to handle secrets that I want to have available on my machines at
nautilus = { path = "/run/user/1000/secrets/nautilus"; }; nautilus = { path = "/run/user/1000/secrets/nautilus"; };
leon = { path = "/run/user/1000/secrets/leon"; }; leon = { path = "/run/user/1000/secrets/leon"; };
swarselmail = { path = "/run/user/1000/secrets/swarselmail"; }; swarselmail = { path = "/run/user/1000/secrets/swarselmail"; };
github_notif = { path = "/run/user/1000/secrets/github_notif"; };
caldav = { path = "${config.home.homeDirectory}/.emacs.d/.caldav"; }; caldav = { path = "${config.home.homeDirectory}/.emacs.d/.caldav"; };
}; };
}; };
@ -7569,232 +7600,270 @@ 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
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
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" ]; layer = "top";
modules-center = [ "sway/mode" "custom/configwarn" "custom/nix-updates" ]; position = "top";
"sway/mode" = { modules-left = [ "sway/workspaces" "custom/outer-right-arrow-dark" "sway/window" ];
format = "<span style=\"italic\" font-weight=\"bold\">{}</span>"; modules-center = [ "sway/mode" "privacy" "custom/github" "custom/configwarn" "custom/nix-updates" ];
}; "sway/mode" = {
format = "<span style=\"italic\" font-weight=\"bold\">{}</span>";
modules-right = config.swarselsystems.waybarModules;
"custom/pseudobat" = lib.mkIf (!config.swarselsystems.isLaptop) {
format = "";
on-click-right = "wlogout -p layer-shell";
};
"custom/configwarn" = {
exec = "waybarupdate";
interval = 60;
};
"custom/nix-updates" = {
exec = "update-checker";
on-click = "update-checker && notify-send 'The system has been updated'";
interval = 3600;
tooltip = true;
return-type = "json";
format = "{} ";
};
"group/hardware" = {
orientation = "inherit";
drawer = {
"transition-left-to-right" = false;
}; };
modules = [
"tray"
"temperature"
"power-profiles-daemon"
"custom/left-arrow-light"
"custom/left-arrow-dark"
"custom/left-arrow-light"
"disk"
"custom/left-arrow-dark"
"memory"
"custom/left-arrow-light"
"cpu"
"custom/left-arrow-dark"
];
};
power-profiles-daemon = { modules-right = config.swarselsystems.waybarModules;
format = "{icon}";
tooltip-format = "Power profile: {profile}\nDriver: {driver}"; "custom/pseudobat" = lib.mkIf (!config.swarselsystems.isLaptop) {
tooltip = true; format = "";
format-icons = { on-click-right = "wlogout -p layer-shell";
"default" = "";
"performance" = "";
"balanced" = "";
"power-saver" = "";
}; };
};
temperature = { "custom/configwarn" = {
hwmon-path = lib.mkIf (!config.swarselsystems.temperatureHwmon.isAbsolutePath) config.swarselsystems.temperatureHwmon.path; exec = "waybarupdate";
hwmon-path-abs = lib.mkIf config.swarselsystems.temperatureHwmon.isAbsolutePath config.swarselsystems.temperatureHwmon.path; interval = 60;
input-filename = lib.mkIf config.swarselsystems.temperatureHwmon.isAbsolutePath config.swarselsystems.temperatureHwmon.input-filename;
critical-threshold = 80;
format-critical = " {temperatureC}°C";
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/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'";
}; };
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/github" = {
min-length = 8; format = "{}  ";
interval = 1; return-type = "json";
format = "{:%H:%M:%S}"; interval = 60;
# on-click-right= "gnome-clocks"; exec = "github-notifications";
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>"; on-click = "xdg-open https://github.com/notifications";
}; };
"clock#2" = { "custom/nix-updates" = {
format = "{:%d. %B %Y}"; exec = "update-checker";
# on-click-right= "gnome-clocks"; on-click = "update-checker && notify-send 'The system has been updated'";
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>"; interval = 3600;
}; tooltip = true;
return-type = "json";
format = "{} {icon}";
format-icon = {
"has-updates" = "";
"updated" = " ";
};
};
pulseaudio = { idle_inhibitor = {
format = "{icon} {volume:2}%"; format = "{icon}";
format-bluetooth = "{icon} {volume}%"; format-icons = {
format-muted = "MUTE"; activated = "";
format-icons = { deactivated = "";
headphones = ""; };
default = [ };
""
"" "group/hardware" = {
orientation = "inherit";
drawer = {
"transition-left-to-right" = false;
};
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"
]; ];
}; };
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 ../../../programs/waybar/style.css;
}; };
style = builtins.readFile ../../../programs/waybar/style.css; }
};
}
#+end_src #+end_src
**** Firefox **** Firefox

View file

@ -15,4 +15,5 @@ in
opacitytoggle = callPackage ./opacitytoggle { }; opacitytoggle = callPackage ./opacitytoggle { };
fs-diff = callPackage ./fs-diff { }; fs-diff = callPackage ./fs-diff { };
update-checker = callPackage ./update-checker { }; update-checker = callPackage ./update-checker { };
github-notifications = callPackage ./github-notifications { };
} }

View file

@ -0,0 +1,13 @@
{ writeShellApplication, jq }:
writeShellApplication {
name = "github-notifications";
runtimeInputs = [ jq ];
text = ''
count=$(curl -u Swarsel:"$(cat /run/user/1000/secrets/github_notif)" https://api.github.com/notifications | jq '. | length')
if [[ "$count" != "0" ]]; then
echo "{\"text\":\"$count\"}"
fi
'';
}

View file

@ -14,6 +14,7 @@
opacitytoggle opacitytoggle
fs-diff fs-diff
update-checker update-checker
github-notifications
(pkgs.writeScriptBin "project" '' (pkgs.writeScriptBin "project" ''
#! ${pkgs.bash}/bin/bash #! ${pkgs.bash}/bin/bash

View file

@ -16,6 +16,7 @@ in
nautilus = { path = "/run/user/1000/secrets/nautilus"; }; nautilus = { path = "/run/user/1000/secrets/nautilus"; };
leon = { path = "/run/user/1000/secrets/leon"; }; leon = { path = "/run/user/1000/secrets/leon"; };
swarselmail = { path = "/run/user/1000/secrets/swarselmail"; }; swarselmail = { path = "/run/user/1000/secrets/swarselmail"; };
github_notif = { path = "/run/user/1000/secrets/github_notif"; };
caldav = { path = "${config.home.homeDirectory}/.emacs.d/.caldav"; }; caldav = { path = "${config.home.homeDirectory}/.emacs.d/.caldav"; };
}; };
}; };

View file

@ -12,7 +12,7 @@
layer = "top"; layer = "top";
position = "top"; position = "top";
modules-left = [ "sway/workspaces" "custom/outer-right-arrow-dark" "sway/window" ]; modules-left = [ "sway/workspaces" "custom/outer-right-arrow-dark" "sway/window" ];
modules-center = [ "sway/mode" "custom/configwarn" "custom/nix-updates" ]; modules-center = [ "sway/mode" "privacy" "custom/github" "custom/configwarn" "custom/nix-updates" ];
"sway/mode" = { "sway/mode" = {
format = "<span style=\"italic\" font-weight=\"bold\">{}</span>"; format = "<span style=\"italic\" font-weight=\"bold\">{}</span>";
}; };
@ -29,13 +29,41 @@
interval = 60; 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" = { "custom/nix-updates" = {
exec = "update-checker"; exec = "update-checker";
on-click = "update-checker && notify-send 'The system has been updated'"; on-click = "update-checker && notify-send 'The system has been updated'";
interval = 3600; interval = 3600;
tooltip = true; tooltip = true;
return-type = "json"; return-type = "json";
format = "{} "; format = "{} {icon}";
format-icon = {
"has-updates" = "";
"updated" = " ";
};
};
idle_inhibitor = {
format = "{icon}";
format-icons = {
activated = "";
deactivated = "";
};
}; };
"group/hardware" = { "group/hardware" = {
@ -49,6 +77,7 @@
"power-profiles-daemon" "power-profiles-daemon"
"custom/left-arrow-light" "custom/left-arrow-light"
"custom/left-arrow-dark" "custom/left-arrow-dark"
"custom/scratchpad-indicator"
"custom/left-arrow-light" "custom/left-arrow-light"
"disk" "disk"
"custom/left-arrow-dark" "custom/left-arrow-dark"
@ -56,9 +85,18 @@
"custom/left-arrow-light" "custom/left-arrow-light"
"cpu" "cpu"
"custom/left-arrow-dark" "custom/left-arrow-dark"
"backlight/slider"
"idle_inhibitor"
]; ];
}; };
"backlight/slider" = {
min = 0;
max = 100;
orientation = "horizontal";
device = "intel_backlight";
};
power-profiles-daemon = { power-profiles-daemon = {
format = "{icon}"; format = "{icon}";
tooltip-format = "Power profile: {profile}\nDriver: {driver}"; tooltip-format = "Power profile: {profile}\nDriver: {driver}";

View file

@ -55,6 +55,7 @@ window#waybar.hidden {
padding: 0 3px; padding: 0 3px;
} }
#privacy,
#custom-configwarn { #custom-configwarn {
color: black; color: black;
padding: 0 3px; padding: 0 3px;
@ -97,7 +98,10 @@ window#waybar.hidden {
#memory, #memory,
#cpu, #cpu,
#temperature, #temperature,
#custom-scratchpad-indicator,
#power-profiles-daemon, #power-profiles-daemon,
#idle_inhibitor,
#backlight-slider,
#mpris, #mpris,
#tray { #tray {
background: @background; background: @background;
@ -151,6 +155,10 @@ window#waybar.hidden {
color: #9ee09e; color: #9ee09e;
} }
#custom-scratchpad-indicator {
color: #ffffff;
}
#disk.warning { #disk.warning {
color: @foreground-error; color: @foreground-error;
background-color: @background-error; background-color: @background-error;
@ -213,6 +221,26 @@ window#waybar.hidden {
animation-direction: alternate; animation-direction: alternate;
} }
#backlight-slider slider {
min-height: 0px;
min-width: 0px;
opacity: 0;
background-image: none;
border: none;
box-shadow: none;
}
#backlight-slider trough {
min-height: 5px;
min-width: 80px;
border-radius: 5px;
background-color: black;
}
#backlight-slider highlight {
min-width: 0px;
border-radius: 5px;
background-color: grey;
}
#clock.1, #clock.1,
#clock.2, #clock.2,
#clock.3 { #clock.3 {
@ -230,7 +258,8 @@ window#waybar.hidden {
#custom-vpn, #custom-vpn,
#mpris, #mpris,
#battery, #battery,
#custom-scratchpad-indicator,
#custom-pseudobat, #custom-pseudobat,
#disk { #disk {
padding: 0 3px; padding: 0 3px;
} }

14
scripts/update-checker.sh Normal file → Executable file
View file

@ -1,8 +1,14 @@
updates="$(cd ~/.dotfiles && nix flake lock --update-input nixpkgs && nix build .#nixosConfigurations."$HOSTNAME".config.system.build.toplevel && nvd diff /run/current-system ./result | grep -c '\[U')" updates="$( { cd /home/swarsel/.dotfiles && nix flake lock --update-input nixpkgs && nix build .#nixosConfigurations."$(eval hostname)".config.system.build.toplevel && nvd diff /run/current-system ./result | grep -c '\[U'; } || true)"
alt="has-updates"
if [[ $updates -eq 0 ]]; then
alt="updated"
fi
tooltip="System updated" tooltip="System updated"
if [[ $updates != 0 ]]; then if [[ $updates != 0 ]]; then
tooltip=$(cd ~/.dotfiles && nvd diff /run/current-system ./result | grep -e '\[U' | awk '{ for (i=3; i<NF; i++) printf $i " "; if (NF >= 3) print $NF; }' ORS='\\n' ) tooltip=$(cd ~/.dotfiles && nvd diff /run/current-system ./result | grep -e '\[U' | awk '{ for (i=3; i<NF; i++) printf $i " "; if (NF >= 3) print $NF; }' ORS='\\n' )
echo "{ \"text\":\"$updates\", \"alt\":\"$alt\", \"tooltip\":\"$tooltip\" }"
else
echo "{ \"text\":\"\", \"alt\":\"$alt\", \"tooltip\":\"\" }"
fi fi
echo "{ \"text\":\"$updates\", \"tooltip\":\"$tooltip\" }"

View file

@ -13,6 +13,7 @@ edupass: ENC[AES256_GCM,data:StcWMBpiRQk4tro=,iv:RGQ0i27eErOaTvHJINSgCh/sO48IJWo
handyhotspot: ENC[AES256_GCM,data:6XS3MI1sFbQ=,iv:2QQDbWre66cZxcQJqjMfYC6Uxfw6RBcgypWb31uJJxU=,tag:2gbd3tdFlSTv84GpTMQHiQ==,type:str] handyhotspot: ENC[AES256_GCM,data:6XS3MI1sFbQ=,iv:2QQDbWre66cZxcQJqjMfYC6Uxfw6RBcgypWb31uJJxU=,tag:2gbd3tdFlSTv84GpTMQHiQ==,type:str]
vpnuser: ENC[AES256_GCM,data:/fRpq/wyKuM=,iv:er+BKrfzihyRNzyTx3LIlecpyXlelh8OE8LZrGw6PNg=,tag:h7weTZXh43myaf35UwW0ZQ==,type:str] vpnuser: ENC[AES256_GCM,data:/fRpq/wyKuM=,iv:er+BKrfzihyRNzyTx3LIlecpyXlelh8OE8LZrGw6PNg=,tag:h7weTZXh43myaf35UwW0ZQ==,type:str]
vpnpass: ENC[AES256_GCM,data:Vrhex2J5MmGdxw==,iv:rauPM5/cGfj5btQaUVIeMpr/hjKInl31+semAfZchCQ=,tag:3hshXzNp9rtp2en1lxi5mg==,type:str] vpnpass: ENC[AES256_GCM,data:Vrhex2J5MmGdxw==,iv:rauPM5/cGfj5btQaUVIeMpr/hjKInl31+semAfZchCQ=,tag:3hshXzNp9rtp2en1lxi5mg==,type:str]
github_notif: ENC[AES256_GCM,data:1E4/5leailXfftRIs2iIW+FJV291R1QbbVD+M//e1HRLGSF1GG/7Ww==,iv:hQ3u0KRssbIWoM3+t3VFGJ9YRLhLZIBYN3bC2JKj7nE=,tag:eOIodKAjVPtmDOeIXw4UIw==,type:str]
sops: sops:
kms: [] kms: []
gcp_kms: [] gcp_kms: []
@ -64,8 +65,8 @@ sops:
cUxsRjB5MUVkQk14Mng5bEk2eW8xY0UKFcPwc3iVpmjPwogW2t48IdKOc/AiN+r1 cUxsRjB5MUVkQk14Mng5bEk2eW8xY0UKFcPwc3iVpmjPwogW2t48IdKOc/AiN+r1
AJryUc2CZ3PK/njAnIxKqkCwsR527Txn0ulpaimqfv9nyJSVdbVXIQ== AJryUc2CZ3PK/njAnIxKqkCwsR527Txn0ulpaimqfv9nyJSVdbVXIQ==
-----END AGE ENCRYPTED FILE----- -----END AGE ENCRYPTED FILE-----
lastmodified: "2024-08-02T00:34:14Z" lastmodified: "2024-08-10T20:57:39Z"
mac: ENC[AES256_GCM,data:vI3IAz0MQF9Ub1KQmHDuDSvoUaPlBhZjE66pS9ZWT5wsLKOjSdbFbXvpGGieUh9MdgALNPSXqDvNMExsiRHNTgbQHf0yA2Esni5WoHVgXDPRiq9dB6ixJwsO8UlygIsdQyKJo+DdbXRA15hR2I1xDpY6YnhdIOCDI/fyD95Nlt4=,iv:Vi/RDx1BPmSKnihP0NtkCf+GukeQojxhGtoSLH7fOtA=,tag:4MEZjDELRHlVxV/Kk1a0rA==,type:str] mac: ENC[AES256_GCM,data:unhftEeB+SE4lmTiJxfEGsiuBSPw2ClfGVvsNHWtVfjnkAJ0T6lQbFuxsuid0z6C5wvwabX1lFlzh5rilYyWZhWC58YTLa9RBigK07fq3y620JuOkczZ0puq9NOOv2+Uymp2k0R6B0VUJmIzKqDs4uIgwj4Jxged6m8B/FkDsc0=,iv:z1jeY2LoBtOZ9F56NGVgY+FytcIohD92oFLUempxUrg=,tag:kusyZHdKjCxhLv+U1P6cPg==,type:str]
pgp: pgp:
- created_at: "2024-08-02T00:34:07Z" - created_at: "2024-08-02T00:34:07Z"
enc: |- enc: |-