mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 09:07:21 +01:00
feat: finish nix-update, add idle/github/bright.
This commit is contained in:
parent
40ccc0a9e9
commit
220451e8ac
9 changed files with 377 additions and 218 deletions
14
scripts/update-checker.sh
Normal file → Executable file
14
scripts/update-checker.sh
Normal file → Executable 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"
|
||||
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
|
||||
|
||||
echo "{ \"text\":\"$updates\", \"tooltip\":\"$tooltip\" }"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue