Commit a084e1a4068e
Changed files (2)
dots
config
niri
dots/bin/power-profile-cycle
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+# Cycle through tuned power profiles and notify
+set -euo pipefail
+
+current=$(tuned-adm active 2>/dev/null | sed 's/.*: //')
+
+case "$current" in
+ powersave) next="balanced-battery" ;;
+ balanced-battery) next="balanced" ;;
+ balanced) next="latency-performance" ;;
+ latency-performance) next="powersave" ;;
+ *) next="balanced" ;;
+esac
+
+tuned-adm profile "$next"
+notify-send --icon=battery --category=info "Power: $next"
dots/config/niri/config.kdl
@@ -223,6 +223,7 @@ binds {
Mod+T { spawn "bash" "-c" "notify-send --icon=clock --category=info --urgency=critical \"$(date +\"%I:%M\")\""; }
Mod+B { spawn "bash" "-c" "notify-send --icon=battery --category=info --urgency=critical \"$(acpi)\""; }
+ Mod+P hotkey-overlay-title="Cycle Power Profile" { spawn "power-profile-cycle"; }
Mod+Shift+T hotkey-overlay-title="Toggle Color Scheme" { spawn "toggle-color-scheme"; }
Mod+Shift+B { spawn "pkill" "-USR1" "waybar"; }