Files
dotfiles_i3_notebook_arch/polybar/scripts/toggle_module_batter_label.sh
2025-09-22 08:27:51 +02:00

17 lines
335 B
Bash
Executable File

#!/bin/bash
TOGGLE_FILE=~/.config/polybar/scripts/battery_toggle_state
# Read the current state
CURRENT_STATE=$(cat $TOGGLE_FILE)
# Toggle the state
if [ "$CURRENT_STATE" == "icon" ]; then
echo "percentage" > $TOGGLE_FILE
else
echo "icon" > $TOGGLE_FILE
fi
# Notify Polybar to refresh the module
polybar-msg hook battery 1