aboutsummaryrefslogtreecommitdiff
path: root/scripts/scripts/2bws.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/scripts/2bws.sh')
-rwxr-xr-xscripts/scripts/2bws.sh40
1 files changed, 0 insertions, 40 deletions
diff --git a/scripts/scripts/2bws.sh b/scripts/scripts/2bws.sh
deleted file mode 100755
index 6f81baa..0000000
--- a/scripts/scripts/2bws.sh
+++ /dev/null
@@ -1,40 +0,0 @@
1#!/usr/bin/env bash
2# display workspace status
3# requires wmctrl
4
5# get the current workspace
6ws=$( xprop -root _NET_CURRENT_DESKTOP | sed -e 's/_NET_CURRENT_DESKTOP(CARDINAL) = //' )
7
8# icons
9CURRENT=●
10OCCUPIED=●
11UNOCCUPIED=·
12
13# colors
14current="$( ~/scripts/get_xres color5 )"
15occupied="$( ~/scripts/get_xres color8 )"
16unoccupied="$( ~/scripts/get_xres color8 )"
17
18# print workspaces to stdout
19draw() {
20 for i in {0..5}; do
21 # get the number of windows in each workspace
22 windows=$( wmctrl -l | cut -d ' ' -f3 | grep $i | wc -l )
23
24
25 if [[ $i -eq $ws ]]
26 then
27 # current workspace
28 echo -ne "%{F$current} $CURRENT "
29 else
30 if [[ $windows -eq 0 ]]
31 then
32 echo -ne "%{F$unoccupied} $UNOCCUPIED "
33 else
34 echo -ne "%{F$occupied} $OCCUPIED "
35 fi
36 fi
37 done
38}
39
40draw