Skip to content

Instantly share code, notes, and snippets.

@0x3n0
Last active December 27, 2023 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0x3n0/4fa17c6ef69eb45019e4b89d814b05e3 to your computer and use it in GitHub Desktop.
Save 0x3n0/4fa17c6ef69eb45019e4b89d814b05e3 to your computer and use it in GitHub Desktop.
#!/bin/bash
battery_status=$(acpi | awk '{print $3}')
battery_percentage=$(acpi | awk '{print $4}' | sed 's/,//')
if [ "$battery_status" == "Discharging," ]; then
icon="🔋"
else
icon="🔌"
fi
echo "$icon $battery_percentage"
{"  ", "$HOME/.config/dwm/dwmblocks/scripts/battery", 5, 0},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment