diff --git a/.config/sx/sxrc b/.config/sx/sxrc index 03464ba..bec46c3 100755 --- a/.config/sx/sxrc +++ b/.config/sx/sxrc @@ -1,3 +1,3 @@ # start the wm -sxhkd & +mode sxhkdrc bspwm diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index e531a21..940dcf6 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -50,5 +50,6 @@ super + {_,shift + } {1-9,0} super + {t,f,s} bspc node -t {tiled,floating,fullscreen} +# x230t specific -- activate the tablet menu XF86RotateWindows tabletmenu diff --git a/builds/statusbar/statusbar/statusbar.py b/builds/statusbar/statusbar/statusbar.py index 2fef7ed..ffa3827 100644 --- a/builds/statusbar/statusbar/statusbar.py +++ b/builds/statusbar/statusbar/statusbar.py @@ -38,6 +38,22 @@ def generate_desktop_string(monitor_array): return ' '.join(output) +def filemodfactory(filename: str, modname: str): + def filemod(queue, _): + orig = 0 + while True: + new = os.path.getmtime(filename) + if(new > orig): + with open(filename, 'r') as f: + queue.put({ + "module": modname, + "data": f.read().rstrip() + }) + orig = new + time.sleep(0.1) + + return filemod + def bspwm(queue, monitor): client = socket.socket( socket.AF_UNIX, @@ -90,11 +106,12 @@ def filecheckerfactory(filename: str, modname: str, timeout=60): battery = filecheckerfactory("/sys/class/power_supply/BAT0/capacity", "bat") batterystatus = filecheckerfactory("/sys/class/power_supply/BAT0/status", "batstat") +sxhkdmode = filemodfactory("/home/usr/.cache/sxhkd_mode", "sxhkdmode") def render(modules) -> str: columns, _ = os.get_terminal_size(0) - left = "{} | {}".format(modules["clock"], modules["bspwm"]) + left = "{} | {}({})".format(modules["clock"], modules["bspwm"], modules["sxhkdmode"]) right = "{}({})".format(modules["bat"], modules["batstat"]) padding = " " * (columns - len(left) - len(right) - 0) @@ -146,7 +163,7 @@ def main(): )) return queue = Queue() - modules = [bspwm, clock, battery, batterystatus] + modules = [bspwm, clock, battery, batterystatus, sxhkdmode] [Process(target=module, args=(queue, argv[1])).start() for module in modules] module_outputs = defaultdict(lambda: "") diff --git a/builds/utils/sh/mode b/builds/utils/sh/mode index 8aaf7e2..d020d65 100755 --- a/builds/utils/sh/mode +++ b/builds/utils/sh/mode @@ -4,6 +4,7 @@ if [ -n "$1" ]; then pkill sxhkd sxhkd -c ~/.config/sxhkd/$1 & disown [ -f "~/.config/sxhkd/$1.sh" ] && ~/.config/sxhkd/$1.sh + echo "$1" > ~/.cache/sxhkd_mode exit fi