From 0d5900b5512b1ac20daaf1bde93d9c5563b7e11f Mon Sep 17 00:00:00 2001 From: Shadow Cat Date: Fri, 16 Jun 2023 10:11:41 -0400 Subject: [PATCH] updated sway binary, gonna merge soon --- bar/widget.yuck | 4 ++-- bar/widgets/sys.yuck | 11 +++++++++-- bar/widgets/wss.yuck | 4 ++-- scripts/getwss | 8 +++++--- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/bar/widget.yuck b/bar/widget.yuck index b3b0005..53fcb56 100644 --- a/bar/widget.yuck +++ b/bar/widget.yuck @@ -18,7 +18,7 @@ :class "metric mod" :space-evenly false (box :class {class ?: ""} {icon}) - (revealer :transition "slideleft" + (revealer :transition "slideright" :reveal reveal :duration "300ms" (scale :min 0 @@ -33,7 +33,7 @@ :class "metric mod" :space-evenly false (box :class {class ?: ""} {icon}) - (revealer :transition "slideleft" + (revealer :transition "slideright" :reveal net_reveal :duration "300ms" (label :text {value} diff --git a/bar/widgets/sys.yuck b/bar/widgets/sys.yuck index 037f436..9fc5e78 100644 --- a/bar/widgets/sys.yuck +++ b/bar/widgets/sys.yuck @@ -18,8 +18,15 @@ :icon "" :class "red")) +(defpoll bat_stat :interval "30s" "cat /") (defwidget bat [] + (box (circle :value {EWW_BATTERY.BAT0.capacity} - :icon "⏻" - :class "green")) + ;; :icon "⏻" + :icon { + EWW_BATTERY.BAT0.status == "Charging" ? "󱐋" + : EWW_BATTERY.BAT0.status == "Not charging" ? "" + : "󰁹" + } + :class "green"))) diff --git a/bar/widgets/wss.yuck b/bar/widgets/wss.yuck index b71fe09..ae3a745 100644 --- a/bar/widgets/wss.yuck +++ b/bar/widgets/wss.yuck @@ -1,7 +1,7 @@ ;; (deflisten wslist0 -;; "scripts/getwss eDP-1") +;; "scripts/getwsss eDP-1") ;; (deflisten wslist1 -;; "scripts/getwss DP-") +;; "scripts/getwsss DP-") (deflisten wslist0 "scripts/getwss 0") (deflisten wslist1 diff --git a/scripts/getwss b/scripts/getwss index 4dab8b2..2689b77 100755 --- a/scripts/getwss +++ b/scripts/getwss @@ -38,7 +38,8 @@ def handle(state: State, event: str, data: str = None): wid = int(data) if state.prev_active in wss.keys(): wss[state.prev_active]['focused'] = False - wss[wid]['focused'] = True + if wid in wss.keys(): + wss[wid]['focused'] = True state.prev_active = wid return output(state) if event == "createworkspace": @@ -46,7 +47,8 @@ def handle(state: State, event: str, data: str = None): state.wss = dict(sorted(wss.items())) return output(state) if event == "destroyworkspace": - del wss[int(data)] + if int(data) in wss: + del wss[int(data)] return output(state) def output(state: State): @@ -91,7 +93,7 @@ def get_state(mid: str): focused = m['focused'] break if mname is None: - print("Error: monitor not found") + print("Error: monitor not found", file=sys.stderr) sys.exit(1) wss = dict()