Swaybar bash script
This commit is contained in:
parent
91b00b403b
commit
455013d5c1
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
Loading…
Reference in New Issue