This commit is contained in:
Clay Gomera 2022-07-27 10:20:26 -04:00
parent a85feb8163
commit 7e47d0983b
3 changed files with 11 additions and 3 deletions

View file

@ -19,7 +19,7 @@ options="$option1\n$option2\n$option3\n$option4\n$option5\n$option6\n$option7"
## POWER PROFILE OPTIONS ##
pwr1="🔥 Performance"
pwr2="⚖ Balanced"
pwr3="🔋 Power Saver"
pwr3=" Power Saver"
pwr4="❌Cancel"
## POWER PROFILES ARRAY ##

View file

@ -95,7 +95,7 @@ static const Rule rules[] = {
{ "Carla2-Control", NULL, NULL, 1 << 4, 0, -1 },
{ "QjackCtl", NULL, NULL, 1 << 5, 1, -1 },
{ "lsp-plugins", NULL, NULL, 1 << 5, 1, -1 },
{ "qpwgraph", NULL, NULL, 1 << 5, 1, -1 },
{ "qpwgraph", NULL, NULL, 1 << 5, 0, -1 },
{ "Gimp-2.10", NULL, NULL, 1 << 6, 0, -1 },
{ "krita", NULL, NULL, 1 << 6, 0, -1 },
{ "Inkscape", NULL, NULL, 1 << 6, 0, -1 },

View file

@ -1,5 +1,13 @@
#!/bin/bash
# Loop through all attached batteries and format the info
currntpwr=$(powerprofilesctl get)
if [ "${currntpwr}" = "performance" ]; then
pwr="| 🔥 Performance"
elif [ "${currntpwr}" = "balanced" ]; then
pwr="| ⚖ Balanced"
elif [ "${currntpwr}" = "power-saver" ]; then
pwr="| ⏱ Power Saver"
fi
for battery in /sys/class/power_supply/BAT?*; do
# If non-first battery, print a space separator.
[ -n "${capacity+x}" ] && printf " "
@ -16,5 +24,5 @@ for battery in /sys/class/power_supply/BAT?*; do
# Will make a warn variable if discharging and low
[ "$status" = "🔋" ] && [ "$capacity" -le 25 ] && warn="❗"
# Prints the info
printf "%s%s%d%% " " $status" "$warn " "$capacity "; unset warn
printf "%s%s%d%%%s " " $status" "$warn " "$capacity " " $pwr"; unset warn
done && printf "\\n"