Natural progress. Finished status notification and added some temporary programs (vms)

This commit is contained in:
Jurn Wubben 2025-02-17 14:17:57 +01:00
parent e706230566
commit f2222f56d8
15 changed files with 910 additions and 341 deletions

View file

@ -5,6 +5,7 @@
...
}: let
inherit (lib) getExe;
inherit (config.lib.stylix.colors) base0D;
runOnce = program: "pgrep ${program} || uwsm app -- ${program}";
uwsm = getExe pkgs.uwsm;
@ -72,6 +73,9 @@ in {
"$mod, A, exec, ${pulsemixer}"
"$mod, B, exec, ${bluetui}"
"$mod, N, exec, ${nmtui}"
''
$mod, S, exec, bash -c 'hyprctl notify -1 5000 "rgb(${base0D})" "$(${getExe (import ./status.nix {inherit pkgs;}).script})"'
''
"$mod, h, movefocus, l"
"$mod, l, movefocus, r"

View file

@ -0,0 +1,13 @@
{pkgs, ...}: {
script = pkgs.writeShellScriptBin "statusnotify" ''
DATE=$(date +%R)
upower -e | grep 'BAT' 2>&1 > /dev/null
if [ $? -eq 0 ]; then
BAT=$(upower -i $(upower -e | grep 'BAT') | sed -n -e 's/.*time [a-z \s]*: *\([0-9.]* \w*\).*/\1/p' -e 's/.*per\w*: *\([0-9]*%\).*/\1/p' | sed 'N;s/\n/ - /')
echo "$DATE - $BAT"
else
echo $DATE
fi
'';
}