Updated
This commit is contained in:
parent
a85feb8163
commit
7e47d0983b
3 changed files with 11 additions and 3 deletions
|
@ -19,7 +19,7 @@ options="$option1\n$option2\n$option3\n$option4\n$option5\n$option6\n$option7"
|
||||||
## POWER PROFILE OPTIONS ##
|
## POWER PROFILE OPTIONS ##
|
||||||
pwr1="🔥 Performance"
|
pwr1="🔥 Performance"
|
||||||
pwr2="⚖ Balanced"
|
pwr2="⚖ Balanced"
|
||||||
pwr3="🔋 Power Saver"
|
pwr3="⏱ Power Saver"
|
||||||
pwr4="❌Cancel"
|
pwr4="❌Cancel"
|
||||||
|
|
||||||
## POWER PROFILES ARRAY ##
|
## POWER PROFILES ARRAY ##
|
||||||
|
|
|
@ -95,7 +95,7 @@ static const Rule rules[] = {
|
||||||
{ "Carla2-Control", NULL, NULL, 1 << 4, 0, -1 },
|
{ "Carla2-Control", NULL, NULL, 1 << 4, 0, -1 },
|
||||||
{ "QjackCtl", NULL, NULL, 1 << 5, 1, -1 },
|
{ "QjackCtl", NULL, NULL, 1 << 5, 1, -1 },
|
||||||
{ "lsp-plugins", 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 },
|
{ "Gimp-2.10", NULL, NULL, 1 << 6, 0, -1 },
|
||||||
{ "krita", NULL, NULL, 1 << 6, 0, -1 },
|
{ "krita", NULL, NULL, 1 << 6, 0, -1 },
|
||||||
{ "Inkscape", NULL, NULL, 1 << 6, 0, -1 },
|
{ "Inkscape", NULL, NULL, 1 << 6, 0, -1 },
|
||||||
|
|
|
@ -1,5 +1,13 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Loop through all attached batteries and format the info
|
# 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
|
for battery in /sys/class/power_supply/BAT?*; do
|
||||||
# If non-first battery, print a space separator.
|
# If non-first battery, print a space separator.
|
||||||
[ -n "${capacity+x}" ] && printf " "
|
[ -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
|
# Will make a warn variable if discharging and low
|
||||||
[ "$status" = "🔋" ] && [ "$capacity" -le 25 ] && warn="❗"
|
[ "$status" = "🔋" ] && [ "$capacity" -le 25 ] && warn="❗"
|
||||||
# Prints the info
|
# 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"
|
done && printf "\\n"
|
||||||
|
|
Loading…
Reference in a new issue