From f755cd46cca7ca4ff84c343a495d8a1b73de05ba Mon Sep 17 00:00:00 2001 From: Christian Date: Sat, 18 Jul 2026 07:35:13 -0500 Subject: Fix fish battery alias/function --- hosts/laptop/configuration.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'hosts/laptop') diff --git a/hosts/laptop/configuration.nix b/hosts/laptop/configuration.nix index 2044bc1..1253734 100644 --- a/hosts/laptop/configuration.nix +++ b/hosts/laptop/configuration.nix @@ -42,10 +42,17 @@ }; programs.fish.shellAliases = { - battery = "echo (math (cat /sys/class/power_supply/BAT0/charge_now) * 100 / (cat /sys/class/power_supply/BAT0/charge_full))%"; hibernate = "systemctl hibernate"; }; + home-manager.users.christian.programs.fish.functions = { + battery.body = '' + set now (cat /sys/class/power_supply/BAT0/charge_now) + set full (cat /sys/class/power_supply/BAT0/charge_full) + echo (math "$now * 100 / $full")% + ''; + }; + services.logind.settings.Login = { HandlePowerKey = "ignore"; HandlePowerKeyLongPress = "ignore"; -- cgit v1.2.3