aboutsummaryrefslogtreecommitdiff
path: root/scripts/scripts/bar.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/scripts/bar.sh')
-rwxr-xr-xscripts/scripts/bar.sh75
1 files changed, 75 insertions, 0 deletions
diff --git a/scripts/scripts/bar.sh b/scripts/scripts/bar.sh
new file mode 100755
index 0000000..1903462
--- /dev/null
+++ b/scripts/scripts/bar.sh
@@ -0,0 +1,75 @@
1#! /usr/bin/env bash
2
3
4fg="$(get_xres color15)"
5fg_light="$(get_xres color10)"
6bg="$(get_xres color0)"
7# %{F$fg} $(date +%d/%m) %{F$fg_light} $(date +%Y)
8
9(while true; do echo -e "\n$(date +%H)\n$(date +%M)\n"; sleep 10; done) | dzen2 \
10 -e "onstart=uncollapse;" \
11 -fg "$fg" \
12 -bg "$fg_light" \
13 -tw 0 \
14 -l 3 \
15 -x 20 \
16 -y 600 \
17 -w 70 \
18 -h 30 \
19 -sa c \
20 -p &
21
22(echo -e "\n"; while true; do echo -e "$(bat -i)"; sleep 1; done )| dzen2 \
23 -e "onstart=uncollapse;" \
24 -fg "$fg" \
25 -bg "$fg_light" \
26 -tw 70 \
27 -l 4 \
28 -x 20 \
29 -y 500 \
30 -w 70 \
31 -h 15 \
32 -sa c \
33 -p &
34
35ws=$( xprop -root _NET_CURRENT_DESKTOP | sed -e 's/_NET_CURRENT_DESKTOP(CARDINAL) = //' )
36
37# colors
38current="$( ~/scripts/get_xres color5 )"
39occupied="$( ~/scripts/get_xres color8 )"
40unoccupied="$( ~/scripts/get_xres color8 )"
41
42# print workspaces to stdout
43draw() {
44 for i in {0..5}; do
45 # get the number of windows in each workspace
46 windows=$( wmctrl -l | cut -d ' ' -f3 | grep $i | wc -l )
47
48
49 if [[ $i -eq $ws ]]
50 then
51 # current workspace
52 echo -ne "^($current)O"
53 else
54 if [[ $windows -eq 0 ]]
55 then
56 echo -ne "^($unoccupied)o"
57 else
58 echo -ne "^($occupied)x"
59 fi
60 fi
61 done
62}
63
64# echo -e "\n\n$(draw)\n" | dzen2 \
65# -e "onstart=uncollapse;" \
66# -fg "$fg" \
67# -bg "$fg_light" \
68# -tw 70 \
69# -l 4 \
70# -x 20 \
71# -y 500 \
72# -w 70 \
73# -h 15 \
74# -sa c \
75# -p &