Swaybar bash script
This commit is contained in:
parent
91b00b403b
commit
455013d5c1
2 changed files with 20 additions and 2 deletions
17
.config/sway/swaybar.sh
Executable file
17
.config/sway/swaybar.sh
Executable file
|
@ -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…
Add table
Add a link
Reference in a new issue