Swaybar bash script
This commit is contained in:
parent
91b00b403b
commit
455013d5c1
2 changed files with 20 additions and 2 deletions
|
@ -218,8 +218,9 @@ bar {
|
||||||
|
|
||||||
# When the status_command prints a new line to stdout, swaybar updates.
|
# When the status_command prints a new line to stdout, swaybar updates.
|
||||||
# The default just shows the current date and time.
|
# 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 {
|
colors {
|
||||||
statusline #ffffff
|
statusline #ffffff
|
||||||
background #323232
|
background #323232
|
||||||
|
|
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