From c0333b8bd91b164d452e515fb4176089823aa65a Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Tue, 1 Dec 2020 12:10:20 +0530 Subject: fixed the temperature being blank if weather stat wasn't haze; currently only supports haze and smoke --- lemonbar/button-actions | 14 ---------- lemonbar/mainbar | 65 ---------------------------------------------- lemonbar/sys_bar | 14 ++++++++++ lemonbar/ws_bar | 65 ++++++++++++++++++++++++++++++++++++++++++++++ lemonbar/ws_button_actions | 14 ++++++++++ 5 files changed, 93 insertions(+), 79 deletions(-) delete mode 100755 lemonbar/button-actions delete mode 100755 lemonbar/mainbar create mode 100755 lemonbar/sys_bar create mode 100755 lemonbar/ws_bar create mode 100755 lemonbar/ws_button_actions (limited to 'lemonbar') diff --git a/lemonbar/button-actions b/lemonbar/button-actions deleted file mode 100755 index bebf6635..00000000 --- a/lemonbar/button-actions +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/python - -# this script is a somewhat hacky way to switch workspaces -# by clicking the workspaces on the lemonbar -# written by Vidhu Kant Sharma for his herbstluftwm lemonbar -# the output from the launch script should be piped into this - -import os - -print('scripts launched') -while True: - action = input() - - os.system('herbstclient use_index ' + action) diff --git a/lemonbar/mainbar b/lemonbar/mainbar deleted file mode 100755 index d8d1674e..00000000 --- a/lemonbar/mainbar +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/python - -# kinda minimal lemonbar script by Vidhu Kant Sharma -# for herbstluftwm -# needs japanese fonts and powerline fonts to be installed -# edit the fonts in the launch script - -# changing the color schemes is going to be hell - -import datetime -import time -import os - - -day_name = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday','Sunday'] # to make day names more readable - -# japanese tag names -tag_names = { - '1':'%{A:0:}一%{A}', - '2':'%{A:1:}二%{A}', - '3':'%{A:2:}三%{A}', - '4':'%{A:3:}四%{A}', - '5':'%{A:4:}五%{A}', - '6':'%{A:5:}六%{A}', - '7':'%{A:6:}七%{A}', - '8':'%{A:7:}八%{A}', - '9':'%{A:8:}九%{A}', - '0':'%{A:9:}十%{A}' -} - - -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 '%{B#171520}%{F#CB4B16}%{F-}%{B#CB4B16} ' + date + day + ' ' + time + ' %{B-}' - -def sleepNotifier(): - if int(datetime.datetime.now().strftime("%H")) < 6: # executes between 12 and 6 a.m. - return "%{F#dc322f}%{F-}%{B#dc322f} Go to sleep! %{F#171520}%{B-}%{F-}" # prompt me to go to sleep when it's late - else: - return "" - -while True: - time.sleep(0.3) # be nice to the CPU - output = getTags() + '%{r}' + sleepNotifier() + getTime() - os.system("echo '" + output + "'") # for some reason print() messes up everything diff --git a/lemonbar/sys_bar b/lemonbar/sys_bar new file mode 100755 index 00000000..f55e26d0 --- /dev/null +++ b/lemonbar/sys_bar @@ -0,0 +1,14 @@ +#!/bin/python + +import time +import os + +def getMem(): + mem = os.popen('free -m | grep Mem').read().split() + return 'Mem: ' + str(int(int(mem[2]) / int(mem[1]) * 100)) + +print(getMem()) + +def getCPU(): + + diff --git a/lemonbar/ws_bar b/lemonbar/ws_bar new file mode 100755 index 00000000..d8d1674e --- /dev/null +++ b/lemonbar/ws_bar @@ -0,0 +1,65 @@ +#!/bin/python + +# kinda minimal lemonbar script by Vidhu Kant Sharma +# for herbstluftwm +# needs japanese fonts and powerline fonts to be installed +# edit the fonts in the launch script + +# changing the color schemes is going to be hell + +import datetime +import time +import os + + +day_name = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday','Sunday'] # to make day names more readable + +# japanese tag names +tag_names = { + '1':'%{A:0:}一%{A}', + '2':'%{A:1:}二%{A}', + '3':'%{A:2:}三%{A}', + '4':'%{A:3:}四%{A}', + '5':'%{A:4:}五%{A}', + '6':'%{A:5:}六%{A}', + '7':'%{A:6:}七%{A}', + '8':'%{A:7:}八%{A}', + '9':'%{A:8:}九%{A}', + '0':'%{A:9:}十%{A}' +} + + +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 '%{B#171520}%{F#CB4B16}%{F-}%{B#CB4B16} ' + date + day + ' ' + time + ' %{B-}' + +def sleepNotifier(): + if int(datetime.datetime.now().strftime("%H")) < 6: # executes between 12 and 6 a.m. + return "%{F#dc322f}%{F-}%{B#dc322f} Go to sleep! %{F#171520}%{B-}%{F-}" # prompt me to go to sleep when it's late + else: + return "" + +while True: + time.sleep(0.3) # be nice to the CPU + output = getTags() + '%{r}' + sleepNotifier() + getTime() + os.system("echo '" + output + "'") # for some reason print() messes up everything diff --git a/lemonbar/ws_button_actions b/lemonbar/ws_button_actions new file mode 100755 index 00000000..bebf6635 --- /dev/null +++ b/lemonbar/ws_button_actions @@ -0,0 +1,14 @@ +#!/bin/python + +# this script is a somewhat hacky way to switch workspaces +# by clicking the workspaces on the lemonbar +# written by Vidhu Kant Sharma for his herbstluftwm lemonbar +# the output from the launch script should be piped into this + +import os + +print('scripts launched') +while True: + action = input() + + os.system('herbstclient use_index ' + action) -- cgit v1.2.3