summaryrefslogtreecommitdiff
path: root/hosts/laptop
diff options
context:
space:
mode:
authorChristian <[email protected]>2026-07-18 07:35:13 -0500
committerChristian <[email protected]>2026-07-18 07:35:13 -0500
commitf755cd46cca7ca4ff84c343a495d8a1b73de05ba (patch)
tree0b170655b978094f1c1a625f4d046608903103a2 /hosts/laptop
parenta70806e0908793d138ee0a584f1ade372690f0d8 (diff)
Fix fish battery alias/function
Diffstat (limited to 'hosts/laptop')
-rw-r--r--hosts/laptop/configuration.nix9
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";