diff --git a/.config/sway/config b/.config/sway/config index cb49076..818aacd 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -218,8 +218,9 @@ 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 %l:%M:%S %p'; do sleep 1; done - + # + #status_command while date +'%Y-%m-%d %l:%M:%S %p'; do sleep 1; done + status_command ~/.config/sway/swaybar.sh colors { statusline #ffffff background #323232 diff --git a/.config/sway/swaybar.sh b/.config/sway/swaybar.sh new file mode 100755 index 0000000..9b408d2 --- /dev/null +++ b/.config/sway/swaybar.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +function getPowerValue() { + POWER=$(cat /sys/class/power_supply/BAT0/capacity)% + echo $POWER +} + +function getDate() { + echo $(date +'%Y-%m-%d %H:%M') +} + + +while [ True ]; do + echo "$(getPowerValue) | $(getDate)" + sleep 30 +done +