diff options
author | Vidhu Kant Sharma <bokuwakanojogahoshii@yahoo.com> | 2020-11-04 15:34:15 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <bokuwakanojogahoshii@yahoo.com> | 2020-11-04 15:34:15 +0530 |
commit | 4eed1fd5f8f3e5ed623bf8d96f37c94247517f0f (patch) | |
tree | 969c5e544033b4f3aed27e275dfcff23e594b5cb | |
parent | b9a497d860c968f074c9e8857e06794de361ff14 (diff) |
Added a really sexy lemonbar written in python
-rwxr-xr-x | lemonbar/launch | 7 | ||||
-rwxr-xr-x | lemonbar/mainbar | 53 |
2 files changed, 60 insertions, 0 deletions
diff --git a/lemonbar/launch b/lemonbar/launch new file mode 100755 index 00000000..e8ef57ad --- /dev/null +++ b/lemonbar/launch @@ -0,0 +1,7 @@ +#!/bin/bash + +./mainbar | lemonbar -g 1366x23 -b -B '#171520' -p -F '#ffffff' -f "Roboto:style=Regular:size=9" -f "RobotoMono Nerd Font:style=Regular:size=14" -f "Source Han Sans JP:size=9" + +echo "lemonbar launched" + +exit diff --git a/lemonbar/mainbar b/lemonbar/mainbar new file mode 100755 index 00000000..2158556e --- /dev/null +++ b/lemonbar/mainbar @@ -0,0 +1,53 @@ +#!/bin/python + +import datetime +import time +import os + + +day_name = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday','Sunday'] # to make day names more readable + +tag_names = { + '1':'一', + '2':'二', + '3':'三', + '4':'四', + '5':'五', + '6':'六', + '7':'七', + '8':'八', + '9':'九', + '0':'十' +} + +# decoration variables + +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_names[tag[1]] + ' ' # format occupied tags + elif tag[0] == '#': + tags[i] = '%{F#6c71c4}%{B#d33682}%{F-} ' + tag_names[tag[1]] + '%{F#d33682} %{B#268bd2}%{F-}' # format active tag + else: + tags[i] = '%{F#443837} ' + tag_names[tag[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 + + +def getTime(): + date = datetime.datetime.today().strftime("%d/%m") # date in DD/MM format + day_raw = datetime.datetime.today().weekday() # get number of day + day = "(" + day_name[day_raw] + ")" # day but in a more readable form + time = datetime.datetime.now().strftime("%H:%M") # time in H:M format + + return date + day + ' ' + time + + +while True: + time.sleep(0.3) + output = getTags() + '%{r}' + getTime() + os.system("echo ' " + output + " '") |