eww: refactor and add calendar widget
This commit is contained in:
parent
4cd16133e9
commit
33f4d22664
1 changed files with 61 additions and 33 deletions
|
@ -1,13 +1,11 @@
|
|||
;;;; (defpoll time :interval "1s" 'date +%s')
|
||||
;; VARIABLE DEFINITIONS
|
||||
|
||||
(defwidget clock []
|
||||
(box :orientation "vertical"
|
||||
:halign "center"
|
||||
:valign "end"
|
||||
(box :class "clock" {formattime(EWW_TIME, "%H")})
|
||||
(box :class "clock" {formattime(EWW_TIME, "%M")})
|
||||
))
|
||||
|
||||
;; Audio
|
||||
(deflisten vol "cat ~/.cache/eww/vol && inotifywait -q -m -e close_write ~/.cache/eww/vol | while read -r filename event; do cat ~/.cache/eww/vol; done")
|
||||
(defpoll micvol :interval "1m" "wpctl get-volume @DEFAULT_AUDIO_SOURCE@ | awk '{print $2}'")
|
||||
|
||||
;; Workspace Stuff
|
||||
(deflisten workspaces :initial "[]" "bash ~/.config/eww/scripts/get-workspaces")
|
||||
(deflisten current_workspace :initial "..." "bash ~/.config/eww/scripts/get-active-workspace")
|
||||
(deflisten urgent_workspace :initial "..." "bash ~/.config/eww/scripts/get-urgent-workspaces")
|
||||
|
@ -21,6 +19,21 @@
|
|||
(label :text "${workspace.id}")
|
||||
))))))
|
||||
|
||||
;; Screen
|
||||
(deflisten backlight "brightnessctl g && inotifywait -q -m -e modify /sys/class/backlight/intel_backlight/actual_brightness | while read -r filename event; do cat /sys/class/backlight/intel_backlight/actual_brightness; done")
|
||||
|
||||
|
||||
;; Widgets
|
||||
|
||||
(defwidget clock []
|
||||
(eventbox
|
||||
:onhover "eww open cal"
|
||||
(box :orientation "vertical"
|
||||
:halign "center"
|
||||
:valign "end"
|
||||
(box :class "clock" {formattime(EWW_TIME, "%H")})
|
||||
(box :class "clock" {formattime(EWW_TIME, "%M")})
|
||||
)))
|
||||
|
||||
(defwidget circle [val prog sty char]
|
||||
(box :halign "center"
|
||||
|
@ -43,24 +56,18 @@
|
|||
:val {EWW_BATTERY.BAT1.capacity}
|
||||
:char ""))
|
||||
|
||||
(deflisten vol "cat ~/.cache/eww/vol && inotifywait -q -m -e close_write ~/.cache/eww/vol | while read -r filename event; do cat ~/.cache/eww/vol; done")
|
||||
|
||||
(defwidget volume []
|
||||
(circle :prog {vol * 7/10}
|
||||
:sty "font-size: 12; margin-right: 2px;"
|
||||
:val {vol + 1 - 1}
|
||||
:char ""))
|
||||
|
||||
(defpoll micvol :interval "1m" "wpctl get-volume @DEFAULT_AUDIO_SOURCE@ | awk '{print $2}'")
|
||||
|
||||
(defwidget mic []
|
||||
(circle :prog {micvol * 70}
|
||||
:sty "margin-left: 1px;"
|
||||
:val {micvol *100}
|
||||
:char ""))
|
||||
|
||||
(deflisten backlight "brightnessctl g && inotifywait -q -m -e modify /sys/class/backlight/intel_backlight/actual_brightness | while read -r filename event; do cat /sys/class/backlight/intel_backlight/actual_brightness; done")
|
||||
|
||||
(defwidget brightness []
|
||||
(circle :prog {(backlight / 960) * 7/10}
|
||||
:sty "font-size: 12; margin-right: 3px;"
|
||||
|
@ -73,28 +80,49 @@
|
|||
(defwidget tray []
|
||||
(systray :orientation "v" :icon-size 20))
|
||||
|
||||
|
||||
;; Upper Level Widgets
|
||||
|
||||
|
||||
(defwidget bar []
|
||||
(centerbox :orientation "vertical"
|
||||
:halign "center"
|
||||
:space-evenly false
|
||||
(_workspaces)
|
||||
(clock)
|
||||
(box :orientation "vertical" :spacing -25 :valign "end"
|
||||
(brightness)
|
||||
(mic)
|
||||
(volume)
|
||||
(battery)
|
||||
(tray)
|
||||
(power))))
|
||||
:halign "center"
|
||||
:space-evenly false
|
||||
(_workspaces)
|
||||
(clock)
|
||||
(box :orientation "vertical" :spacing -25 :valign "end"
|
||||
(brightness)
|
||||
(mic)
|
||||
(volume)
|
||||
(battery)
|
||||
(tray)
|
||||
(power))))
|
||||
|
||||
(defwidget cal []
|
||||
(eventbox
|
||||
:onhoverlost "eww close cal"
|
||||
(calendar)))
|
||||
|
||||
|
||||
;; Windows
|
||||
|
||||
(defwindow bar
|
||||
:monitor 0
|
||||
:geometry (geometry :x "4px"
|
||||
:y "1%"
|
||||
:height "98%"
|
||||
:anchor "left center")
|
||||
:stacking "fg"
|
||||
:exclusive true
|
||||
:class "bar"
|
||||
:monitor 0
|
||||
:geometry (geometry :x "4px"
|
||||
:y "1%"
|
||||
:height "98%"
|
||||
:anchor "left center")
|
||||
:stacking "fg"
|
||||
:exclusive true
|
||||
:class "bar"
|
||||
(bar))
|
||||
|
||||
(defwindow cal
|
||||
:monitor 0
|
||||
:geometry (geometry :x "1%"
|
||||
:y "5%"
|
||||
:anchor "left center")
|
||||
:stacking "fg"
|
||||
:exclusive false
|
||||
:class "bar"
|
||||
(cal))
|
||||
|
|
Loading…
Reference in a new issue