Add status bar idle inhibitor module
This commit is contained in:
parent
9e28e6eebc
commit
e304f05642
3 changed files with 55 additions and 21 deletions
|
|
@ -106,13 +106,13 @@
|
|||
|
||||
|
||||
(defwidget bar_scale [?class reveal-name reveal value symbol onchange ?onclick]
|
||||
(eventbox :onhover "${EWW_CMD} update ${reveal_name}=true"
|
||||
:onhoverlost "${EWW_CMD} update ${reveal_name}=false"
|
||||
(eventbox :onhover "${EWW_CMD} update ${reveal-name}=true"
|
||||
:onhoverlost "${EWW_CMD} update ${reveal-name}=false"
|
||||
:onclick onclick
|
||||
(box :class "bar-scale ${class}"
|
||||
:space-evenly false
|
||||
(eventbox :onclick onclick
|
||||
(label :class "symbol"
|
||||
:text symbol))
|
||||
(label :class "symbol"
|
||||
:text symbol)
|
||||
(revealer :transition "slideright"
|
||||
:reveal reveal
|
||||
:duration "400ms"
|
||||
|
|
@ -225,6 +225,16 @@
|
|||
(box :class "bar-bluetooth ${bluetooth == "{}" ? "disabled" : ""}"
|
||||
(label :text {bluetooth != "{}" ? "" : ""})))
|
||||
|
||||
;; Idle Inhibitor
|
||||
|
||||
(defpoll idleinhibit :interval "1s" :initial "0"
|
||||
"pgrep -c -f wayland\"\"-idle-inhibitor || true")
|
||||
|
||||
(defwidget bar_idleinhibit []
|
||||
(eventbox :onclick "~/.config/eww/scripts/toggle-idle-inhibit"
|
||||
(box :class "bar-idleinhibit ${idleinhibit > 0 ? "active" : ""}"
|
||||
(label :text {idleinhibit > 0 ? "" : ""}))))
|
||||
|
||||
;; Separator
|
||||
|
||||
(defwidget bar_sep []
|
||||
|
|
@ -236,7 +246,7 @@
|
|||
|
||||
;; Bar Layout
|
||||
|
||||
(defwidget bar_left_edge []
|
||||
(defwidget laptop_bar_left_edge []
|
||||
(box :orientation "h"
|
||||
:space-evenly false
|
||||
:halign "start"
|
||||
|
|
@ -244,17 +254,17 @@
|
|||
(bar_window :class-limit 60
|
||||
:title-limit 55)))
|
||||
|
||||
(defwidget bar_left_wing []
|
||||
(defwidget laptop_bar_left_wing []
|
||||
(box :orientation "h"
|
||||
:space-evenly false
|
||||
:halign "end"
|
||||
:hexpand true
|
||||
(bar_time :width 195)))
|
||||
|
||||
(defwidget bar_center []
|
||||
(defwidget laptop_bar_center []
|
||||
(bar_workspaces))
|
||||
|
||||
(defwidget bar_right_wing []
|
||||
(defwidget laptop_bar_right_wing []
|
||||
(box :orientation "h"
|
||||
:space-evenly false
|
||||
:hexpand true
|
||||
|
|
@ -275,7 +285,9 @@
|
|||
(bar_sep)
|
||||
(bar_storage)
|
||||
(bar_ram)
|
||||
(bar_battery)))
|
||||
(bar_battery)
|
||||
(bar_sep)
|
||||
(bar_idleinhibit)))
|
||||
|
||||
(defwidget laptop_bar_layout []
|
||||
(centerbox :class "bar"
|
||||
|
|
@ -283,12 +295,12 @@
|
|||
(box :orientation "h"
|
||||
:space-evenly false
|
||||
:hexpand true
|
||||
(bar_left_edge)
|
||||
(bar_left_wing))
|
||||
(bar_center)
|
||||
(laptop_bar_left_edge)
|
||||
(laptop_bar_left_wing))
|
||||
(laptop_bar_center)
|
||||
(box :orientation "h"
|
||||
:space-evenly false
|
||||
(bar_right_wing)
|
||||
(laptop_bar_right_wing)
|
||||
(laptop_bar_right_edge))))
|
||||
|
||||
|
||||
|
|
@ -305,7 +317,7 @@
|
|||
:space-evenly false
|
||||
:halign "end"
|
||||
:hexpand true
|
||||
(bar_time)))
|
||||
(bar_time :width 195)))
|
||||
|
||||
(defwidget desktop_bar_center []
|
||||
(bar_workspaces))
|
||||
|
|
@ -314,7 +326,9 @@
|
|||
(box :orientation "h"
|
||||
:space-evenly false
|
||||
:hexpand true
|
||||
(bar_music)))
|
||||
(bar_music :width 195
|
||||
:artist-limit 30
|
||||
:title-limit 25)))
|
||||
|
||||
(defwidget desktop_bar_right_edge []
|
||||
(box :orientation "h"
|
||||
|
|
@ -345,6 +359,7 @@
|
|||
|
||||
|
||||
(defwindow laptop_bar
|
||||
:monitor 0
|
||||
:geometry (geometry :width "100%"
|
||||
:height "3%"
|
||||
:anchor "top center")
|
||||
|
|
@ -355,6 +370,7 @@
|
|||
(laptop_bar_layout))
|
||||
|
||||
(defwindow desktop_bar
|
||||
:monitor 0
|
||||
:geometry (geometry :width "100%"
|
||||
:height "3%"
|
||||
:anchor "top center")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue