diff options
author | Vidhu Kant Sharma <bokuwakanojogahoshii@yahoo.com> | 2020-12-25 20:28:58 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <bokuwakanojogahoshii@yahoo.com> | 2020-12-25 20:28:58 +0530 |
commit | bc13d406e284d5c843a2744c9edc73e522cc0189 (patch) | |
tree | f41b13bd175a682ee072d4b81afacc4ce9d7ba9f /herbstluftwm/bar/ws_bar | |
parent | 2b1696744fa839f9adf05337e810472c299e3652 (diff) |
added a bar for hlwm
Diffstat (limited to 'herbstluftwm/bar/ws_bar')
-rwxr-xr-x | herbstluftwm/bar/ws_bar | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/herbstluftwm/bar/ws_bar b/herbstluftwm/bar/ws_bar new file mode 100755 index 00000000..f45b316c --- /dev/null +++ b/herbstluftwm/bar/ws_bar @@ -0,0 +1,25 @@ +#!/bin/python + +import datetime +import time +import os + +def getTags(): + tags = os.popen("herbstclient tag_status").read().split() # get tags in a list + + for i in range(len(tags)): + tag = tags[i] + + if tag[0] == ':': + tags[i] = ' ' + tag[1:-1] + ' ' # format occupied tags + elif tag[0] == '#': + tags[i] = '%{F#6c71c4}%{B#d33682}%{F-} ' + tag[1:-1] + '%{F#d33682} %{B#268bd2}%{F-}' # format active tag + else: + tags[i] = '%{F#443837} ' + tag[1:-1] + '%{F-} ' # format other tags + + return '%{B#6c71c4} ' + ' '.join((str(x) for x in tags)) + '%{B-}' + '%{F#268bd2}%{F-}' # return formatted list in a cleaner form + +while True: + time.sleep(0.3) # be nice to the CPU + output = getTags() + os.system("echo '" + output + "'") # for some reason print() messes up everythingt |