diff options
Diffstat (limited to 'hosts/laptop')
| -rw-r--r-- | hosts/laptop/configuration.nix | 9 |
1 files changed, 8 insertions, 1 deletions
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"; |
