summaryrefslogtreecommitdiff
path: root/.config/eww/eww.yuck
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-08-23 06:47:03 +0300
committerThomas Voss <mail@thomasvoss.com> 2023-08-23 06:47:03 +0300
commit7ff798534a6fb9c99611d18ee22757346798ef61 (patch)
tree1f6603ff9f3eede365e6963b3ac66b5edbd232fb /.config/eww/eww.yuck
parent8f7cbf4ad87d63fe82173645ecb590ebb0f12354 (diff)
eww: Add an eww configuration
Diffstat (limited to '.config/eww/eww.yuck')
-rw-r--r--.config/eww/eww.yuck105
1 files changed, 105 insertions, 0 deletions
diff --git a/.config/eww/eww.yuck b/.config/eww/eww.yuck
new file mode 100644
index 0000000..0257506
--- /dev/null
+++ b/.config/eww/eww.yuck
@@ -0,0 +1,105 @@
+;; Listeners
+(deflisten active-workspace
+ `scripts/active-workspace-listener`)
+
+(deflisten workspace-list :initial "[1]"
+ `scripts/workspace-list-listener`)
+
+(deflisten datetime
+ `scripts/datetime-listener`)
+
+(deflisten brightness
+ `scripts/backlight-listener`)
+
+(deflisten volume
+ `scripts/volume-listener`)
+
+(deflisten keymap
+ `scripts/keymap-listener`)
+
+;; Pollers
+(defpoll battery :interval "1s"
+ `scripts/battery`)
+
+(defpoll wireless :interval "1s"
+ `scripts/wireless`)
+
+;; Windows
+(defwindow bar
+ :monitor 0
+ :stacking "fg"
+ :exclusive true
+ :geometry (geometry :width "100%" :height "40px" :anchor "top center")
+ (bar))
+
+(defwindow calendar-1
+ :monitor 0
+ :geometry (geometry :x "10%" :width "20%" :anchor "center left")
+ (calendar :class "cal"
+ :month {datetime.month - 1}))
+
+(defwindow calendar-2
+ :monitor 0
+ :geometry (geometry :width "20%" :anchor "center")
+ (calendar :class "cal"))
+
+(defwindow calendar-3
+ :monitor 0
+ :geometry (geometry :x "10%" :width "20%" :anchor "center right")
+ (calendar :class "cal"
+ :month {datetime.month + 1}))
+
+(defwidget bar []
+ (centerbox
+ (start)
+ (middle)
+ (end)))
+
+(defwidget start []
+ (workspaces))
+
+(defwidget middle []
+ (clock))
+
+(defwidget end []
+ (box :halign "end"
+ :class "end"
+ :space-evenly false
+ (keymap)
+ (wireless)
+ (brightness)
+ (volume)
+ (battery)))
+
+(defwidget workspaces []
+ (box :class "workspaces"
+ :space-evenly false
+ (for id in workspace-list
+ (button :class {active-workspace == id ? "active" : ""}
+ :onclick `hyprctl dispatch workspace ${id}`
+ id))))
+
+(defwidget clock []
+ (box (button :onclick `scripts/toggle calendar-1 calendar-2 calendar-3`
+ {datetime.pretty})))
+
+(defwidget wireless []
+ (pair :icon "" :text wireless))
+
+(defwidget keymap []
+ (pair :icon "" :text keymap))
+
+(defwidget brightness []
+ (pair :icon "" :text brightness))
+
+(defwidget volume []
+ (pair :icon {volume.icon} :text {volume.percentage}))
+
+(defwidget battery []
+ (pair :icon {battery.icon} :text {battery.percentage}))
+
+(defwidget pair [icon text]
+ (box :width 70
+ :space-evenly false
+ (label :text icon)
+ (label :text text)))