Move the status bar configuration to a script

This commit is contained in:
Ohad Livne 2025-06-04 22:44:36 +03:00
parent 28764d0d9f
commit c917476f21
Signed by: libohad-dev
GPG key ID: 34FDC68B51191A4D
2 changed files with 7 additions and 1 deletions

View file

@ -251,7 +251,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 echo $(date +'%Y-%m-%d %H:%M:%S') 🔋$(cat /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0A:00/power_supply/BAT0/capacity)%; do sleep 1; done
status_command while echo $(print-status); do sleep 1; done
colors {
statusline #ffffff

6
.local/bin/print-status Executable file
View file

@ -0,0 +1,6 @@
#! /usr/bin/sh
battery=$(cat /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0A:00/power_supply/BAT0/capacity)
now=$(date +'%Y-%m-%d %H:%M:%S')
echo ${now} 🔋${battery}%