diff options
author | Shubham Saini <shubham6405@gmail.com> | 2020-05-18 12:35:55 +0000 |
---|---|---|
committer | Shubham Saini <shubham6405@gmail.com> | 2020-05-18 12:35:55 +0000 |
commit | 8ea51c85accb4fb955bca4653ed3fb4140bb85e9 (patch) | |
tree | 099be4d58a54b6dc550fc7cf3ac6cdcca0f59245 | |
parent | e4d83078ce65ab64c79162bd59b8f57b84b7ff10 (diff) |
added bar script
-rwxr-xr-x | dwm/dwmbar | 24 | ||||
-rwxr-xr-x | dwm/startdwm | 6 |
2 files changed, 30 insertions, 0 deletions
diff --git a/dwm/dwmbar b/dwm/dwmbar new file mode 100755 index 0000000..d9e92ca --- /dev/null +++ b/dwm/dwmbar | |||
@@ -0,0 +1,24 @@ | |||
1 | #!/bin/bash | ||
2 | vol(){ | ||
3 | vol=$(pulsemixer --get-volume | awk '{print $1}') | ||
4 | echo -e "\x01vol \x02$vol%" | ||
5 | } | ||
6 | |||
7 | bat() { | ||
8 | power=$(cat /sys/class/power_supply/BAT0/capacity) | ||
9 | echo -e "\x01bat \x02$power%" | ||
10 | } | ||
11 | |||
12 | dte() { | ||
13 | dte=$(date +"%A, %B %d") | ||
14 | echo -e "\x01date \x02$dte" | ||
15 | } | ||
16 | |||
17 | tie() { | ||
18 | tme=$(date +"%I:%M %p") | ||
19 | echo -e "\x01time \x02$tme" | ||
20 | } | ||
21 | while true; do | ||
22 | xsetroot -name "$(vol) $(bat) $(tie) $(dte)" | ||
23 | sleep 3 | ||
24 | done | ||
diff --git a/dwm/startdwm b/dwm/startdwm new file mode 100755 index 0000000..afc5cab --- /dev/null +++ b/dwm/startdwm | |||
@@ -0,0 +1,6 @@ | |||
1 | while true; do | ||
2 | # Log stderror to a file | ||
3 | dwm 2> ~/.dwm.log | ||
4 | # No error logging | ||
5 | #dwm >/dev/null 2>&1 | ||
6 | done | ||