Add battery percent to sway
This commit is contained in:
parent
5ee3726a9e
commit
9688f5c7a3
2 changed files with 6 additions and 1 deletions
|
@ -212,7 +212,7 @@ bar {
|
|||
|
||||
# When the status_command prints a new line to stdout, swaybar updates.
|
||||
# The default just shows the current date and time.
|
||||
status_command while date +'%Y-%m-%d %X'; do sleep 1; done
|
||||
status_command while ~/.config/sway/status.sh; do sleep 1; done
|
||||
|
||||
colors {
|
||||
statusline #ffffff
|
||||
|
|
5
sway/.config/sway/status.sh
Executable file
5
sway/.config/sway/status.sh
Executable file
|
@ -0,0 +1,5 @@
|
|||
date_formatted=$(date "+%a %F %H:%M")
|
||||
|
||||
battery_status=$(cat /sys/class/power_supply/BAT1/capacity)
|
||||
|
||||
echo $battery_status'% -' $date_formatted
|
Loading…
Reference in a new issue