Last active
October 6, 2022 15:06
-
-
Save cheeze2000/53fb2f44397a69c600a10a02f7b7ca32 to your computer and use it in GitHub Desktop.
tmux config script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Battery | |
battery_bg='' | |
battery_icon='' | |
battery_p="$(cat /sys/class/power_supply/BAT*/capacity)" | |
battery_c="$(cat /sys/class/power_supply/BAT*/status)" | |
if [ $battery_p -ge 60 ]; then | |
battery_bg="$green" | |
elif [ $battery_p -ge 40 ]; then | |
battery_bg="$yellow" | |
elif [ $battery_p -ge 20 ]; then | |
battery_bg="$orange" | |
else | |
battery_bg="$red" | |
fi | |
if [ $battery_c = 'Charging' ]; then | |
battery_icon='' | |
elif [ $battery_p -ge 95 ]; then | |
battery_icon='' | |
elif [ $battery_p -ge 85 ]; then | |
battery_icon='' | |
elif [ $battery_p -ge 75 ]; then | |
battery_icon='' | |
elif [ $battery_p -ge 65 ]; then | |
battery_icon='' | |
elif [ $battery_p -ge 55 ]; then | |
battery_icon='' | |
elif [ $battery_p -ge 45 ]; then | |
battery_icon='' | |
elif [ $battery_p -ge 35 ]; then | |
battery_icon='' | |
elif [ $battery_p -ge 25 ]; then | |
battery_icon='' | |
elif [ $battery_p -ge 15 ]; then | |
battery_icon='' | |
else | |
battery_icon='' | |
fi | |
echo "#[fg=$black,bg=$battery_bg] $battery_icon $battery_p% #[bg=$black] " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment