mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
By changing CF_ICONS variable you can edit icons all across your system.
For example if you want to use material-design-icons-git (AUR) all you
need to do is to change the variable like below:
export CF_ICONS="/home=:/mnt=:android=:bat-charging=:\
bat-discharging=:bat-f=:bat-unknown=:bat=:\
batt=:btc=:cb=📋:clock-00=:clock-01=:clock-02=:\
clock-03=:clock-04=:clock-05=:\
clock-06=:clock-07=:clock-08=:clock-09=:clock-10=:\
clock-11=:clock-12=:cpu=:crypto=:disk=:\
down=:eth=:f-move=:help=:\
hib=:internet=:lan-x=:lan=:lbc=:leave=:lock=:\
mail=:mem=:music=:news=:pause=:pc=:\
pkg-down=:pkg=:q-add=:reboot=:\
rec-cam=:rec-screen=:rec-voice=:renew=:sheets=:\
shutdown=:sync=:temp=:tick-clock=:tick-cloud=:\
time=:tor=:torrent-add=:torrent-seed-x=:torrent-idle=:\
torrent-seed=:up=:usb=:vol-0=:vol-1=:\
vol-2=:vol-m=:vol-x=:vol=:vpn=:weather-h=:\
weather-l=:weather-perc=:weather=:\
wifi-x=:wifi=:🌑=:🌒=:🌓=:🌔=:🌕=:🌖=:🌗=:🌘=:"
35 lines
1.4 KiB
Bash
Executable File
35 lines
1.4 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
# Prints all batteries, their percentage remaining and an emoji corresponding
|
|
# to charge status (🔌 for plugged up, 🔋 for discharging on battery, etc.).
|
|
|
|
case $BLOCK_BUTTON in
|
|
3) notify-send "$(ico bat-discharging) Battery module" "$(ico bat-discharging): discharging
|
|
$(ico bat): not charging
|
|
$(ico bat-unknown): stagnant charge
|
|
$(ico bat-charging): charging
|
|
$(ico bat-f): charged
|
|
$(ico warn): battery very low!
|
|
- Scroll to change adjust xbacklight." ;;
|
|
4) xbacklight -inc 10 ;;
|
|
5) xbacklight -dec 10 ;;
|
|
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
|
esac
|
|
|
|
# acpi alternative
|
|
# acpi | sed "s/Battery [0-9]: //;s/[Dd]ischarging, /$(ico bat-discharging)/;s/[Nn]ot charging, /$(ico bat)/;s/[Cc]harging, /$(ico bat-charging)/;s/[Uu]nknown, /$(ico bat-unknown)/;s/[Ff]ull, /$(ico bat-f)/;s/ \(remaining\|until charged\)//"; exit
|
|
|
|
# Loop through all attached batteries.
|
|
for battery in /sys/class/power_supply/BAT?
|
|
do
|
|
# Get its remaining capacity and charge status.
|
|
capacity=$(cat "$battery"/capacity 2>/dev/null) || break
|
|
status=$(sed "s/[Dd]ischarging/$(ico bat-discharging)/;s/[Nn]ot charging/$(ico bat)/;s/[Cc]harging/$(ico bat-charging)/;s/[Uu]nknown/$(ico bat-unknown)/;s/[Ff]ull/$(ico bat-f)/" "$battery"/status)
|
|
|
|
# If it is discharging and 25% or less, we will add a ❗ as a warning.
|
|
[ "$capacity" -le 25 ] && [ "$status" = "$(ico bat)" ] && warn="$(ico warn)"
|
|
|
|
printf "%s%s%s%% " "$status" "$warn" "$capacity"
|
|
unset warn
|
|
done | sed 's/ *$//'
|