diff options
author | Sam Chudnick <sam@chudnick.com> | 2023-06-11 07:49:11 -0400 |
---|---|---|
committer | Sam Chudnick <sam@chudnick.com> | 2023-06-11 07:49:11 -0400 |
commit | dfcc303e7cc284a45f55bae81ed888dc256432b8 (patch) | |
tree | b76835f53c0324c436c98e6838603c7bf838593f /.local/bin/bar | |
parent | c833f67b5970dcd4f7e69ddabe4cb15300ef6749 (diff) |
Consolidated status bar scripts for dwmstatus
Diffstat (limited to '.local/bin/bar')
-rwxr-xr-x | .local/bin/bar | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/.local/bin/bar b/.local/bin/bar new file mode 100755 index 0000000..1648119 --- /dev/null +++ b/.local/bin/bar | |||
@@ -0,0 +1,53 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | black='#1d2021' | ||
4 | green='#b8bb26' | ||
5 | white='#ebdbb2' | ||
6 | grey='#a89984' | ||
7 | blue='#6f8faf' | ||
8 | red='#fb4934' | ||
9 | darkblue='#458588' | ||
10 | blue='#83a598' | ||
11 | darkred="#cc241d" | ||
12 | darkgreen="#98971a" | ||
13 | darkyellow="#d79921" | ||
14 | darkblue="#458588" | ||
15 | darkmagenta="#b16286" | ||
16 | darkcyan="#689d6a" | ||
17 | darkgrey="#928374" | ||
18 | yellow="#fabd2f" | ||
19 | magenta="#d3869b" | ||
20 | cyan="#8ec07c" | ||
21 | bground="#282828" | ||
22 | |||
23 | cpu() { | ||
24 | cpu="$(mpstat 1 1 | awk '/Average/ { printf "%.2f ",100-$12 }')" | ||
25 | temp="$(sensors | awk '/Tctl/ { print $2 } ' | tr -d '+')" | ||
26 | |||
27 | printf "^c$black^^b$cyan^ CPU" | ||
28 | printf "^c$black^^b$cyan^ $cpu%%" | ||
29 | printf "^c$black^^b$cyan^ $temp " | ||
30 | printf "^c$bground^^b$bground^" | ||
31 | } | ||
32 | |||
33 | mem() { | ||
34 | printf "^c$blue^^b$bground^$(free -h | awk '/^Mem/ { print $3}' | sed s/i//g)" | ||
35 | } | ||
36 | |||
37 | |||
38 | volume() { | ||
39 | stats=$(amixer sget Master | grep "Front Left:" | cut -d ' ' -f 7,8 | tr -d '[]') | ||
40 | [ "${stats##* }" = "on" ] && echo -n "^c$green^^b$black^ ${stats%% *}" || echo -n "^c$yellow^^b$darkgrey^ ${stats%% *}" | ||
41 | } | ||
42 | |||
43 | storage() { | ||
44 | printf "^c$darkyellow^^b$bground^ $(df -H | awk '/\/$/ { print $4 }')" | ||
45 | } | ||
46 | |||
47 | clock() { | ||
48 | printf "^c$black^^b$blue^ $(date +'%r') ^c$black^^b$darkblue^ $(date +'%A %D')" | ||
49 | } | ||
50 | |||
51 | while true; do | ||
52 | sleep 1 && xsetroot -name "$(cpu) $(mem) $(volume) $(storage) $(clock) " | ||
53 | done | ||