summaryrefslogtreecommitdiff
path: root/.config/eww/eww.yuck
diff options
context:
space:
mode:
authorSam Nystrom <sam@samnystrom.dev>2026-01-12 21:42:08 -0500
committerSam Nystrom <sam@samnystrom.dev>2026-01-12 21:42:08 -0500
commit7c614992bb8f37c652d3770e68a690a45ec4402b (patch)
tree3c57cb55e0e4d9390a428e9c3ebb07b2a9b3cf5c /.config/eww/eww.yuck
parent23b11c67aa806462f7dcac464c05a190f7dd3d52 (diff)
update eww config
Diffstat (limited to '.config/eww/eww.yuck')
-rw-r--r--.config/eww/eww.yuck167
1 files changed, 6 insertions, 161 deletions
diff --git a/.config/eww/eww.yuck b/.config/eww/eww.yuck
index 03d8fa1..7dad079 100644
--- a/.config/eww/eww.yuck
+++ b/.config/eww/eww.yuck
@@ -3,8 +3,8 @@
:orientation "h"
:space-evenly false
(eventbox :class "eventbox"
- :onhover "eww update ${varname}=true"
- :onhoverlost "eww update ${varname}=false"
+ :onhover "${EWW_CMD} update ${varname}=true"
+ :onhoverlost "${EWW_CMD} update ${varname}=false"
(box :space-evenly false
(revealer :reveal var
:transition {transition ?: "slideright"}
@@ -12,162 +12,7 @@
(children :nth 0))
(children :nth 1)))))
-(defwindow applauncher
- :monitor 0
- :geometry (geometry :x "50%"
- :y "50%"
- :width "500px"
- :height "400px"
- :anchor "center center")
- :stacking "overlay"
- :exclusive false
- :focusable true
- (box :orientation "v"
- :class "applauncher"
- (input :onaccept `eww close applauncher`)
- ))
-
-(defwindow powermenu
- :monitor 0
- :geometry (geometry :x "0%"
- :y "0%"
- :width "100%"
- :height "100%"
- :anchor "top left")
- :stacking "overlay"
- :exclusive false
- :focusable false
- (box :orientation "v"
- :class "powermenu"
- (box :orientation "h"
- :class "powermenu-buttons"
- :spacing "20"
- (box :orientation "v" :space-evenly false
- (button :vexpand "true" "󰐥")
- (label :text "Power Off"))
- (box :orientation "v" :space-evenly false
- (button :vexpand "true" "󰜉")
- (label :text "Reboot"))
- (box :orientation "v" :space-evenly false
- (button :vexpand "true" "󰍁")
- (label :text "Lock"))
- (box :orientation "v" :space-evenly false
- (button :vexpand "true" "󰤄")
- (label :text "Sleep"))
- (box :orientation "v" :space-evenly false
- (button :vexpand "true" "󰗽")
- (label :text "Log Out"))
- (box :orientation "v" :space-evenly false
- (button :vexpand "true" :timeout "5000" :onclick `eww close powermenu` "󰅖")
- (label :text "Cancel")))))
-
-(defwindow bar
- :monitor 0
- :geometry (geometry :x "0%"
- :y "8px"
- :width "1904px"
- :height "32px"
- :anchor "top center")
- :stacking "fg"
- :exclusive true
- :focusable false
- (bar))
-
-(defwidget bar []
- (centerbox :orientation "h"
- :class "bar"
- (tags)
- (title)
- (status)))
-
-(deflisten tags_json :initial `[]` `river-bedload -minified -watch tags`)
-(deflisten wintitle :initial `[{"title":""}]` `river-bedload -minified -watch title`)
-
-(defwidget tags []
- (box :orientation "h"
- :halign "start"
- :class "tags"
- (button :onclick `riverctl set-focused-tags 1`
- :class {jq(tags_json, `.[] | select(.id == 1) | {focused, occupied} | to_entries | map(select(.value) | .key) | join(" ") | {"class": .}`).class}
- ;:visible {jq(tags_json, `.[] | select(.id == 1) | .occupied or .focused`)}
- )
- (button :onclick `riverctl set-focused-tags 2`
- :class {jq(tags_json, `.[] | select(.id == 2) | {focused, occupied} | to_entries | map(select(.value) | .key) | join(" ") | {"class": .}`).class}
- ;:visible {jq(tags_json, `.[] | select(.id == 2) | .occupied or .focused`)}
- )
- (button :onclick `riverctl set-focused-tags 4`
- :class {jq(tags_json, `.[] | select(.id == 3) | {focused, occupied} | to_entries | map(select(.value) | .key) | join(" ") | {"class": .}`).class}
- ;:visible {jq(tags_json, `.[] | select(.id == 3) | .occupied or .focused`)}
- )
- (button :onclick `riverctl set-focused-tags 8`
- :class {jq(tags_json, `.[] | select(.id == 4) | {focused, occupied} | to_entries | map(select(.value) | .key) | join(" ") | {"class": .}`).class}
- ;:visible {jq(tags_json, `.[] | select(.id == 4) | .occupied or .focused`)}
- )
- (button :onclick `riverctl set-focused-tags 16`
- :class {jq(tags_json, `.[] | select(.id == 5) | {focused, occupied} | to_entries | map(select(.value) | .key) | join(" ") | {"class": .}`).class}
- ;:visible {jq(tags_json, `.[] | select(.id == 5) | .occupied or .focused`)}
- )
- (button :onclick `riverctl set-focused-tags 32`
- :class {jq(tags_json, `.[] | select(.id == 6) | {focused, occupied} | to_entries | map(select(.value) | .key) | join(" ") | {"class": .}`).class}
- ;:visible {jq(tags_json, `.[] | select(.id == 6) | .occupied or .focused`)}
- )
- (button :onclick `riverctl set-focused-tags 64`
- :class {jq(tags_json, `.[] | select(.id == 7) | {focused, occupied} | to_entries | map(select(.value) | .key) | join(" ") | {"class": .}`).class}
- ;:visible {jq(tags_json, `.[] | select(.id == 7) | .occupied or .focused`)}
- )
- (button :onclick `riverctl set-focused-tags 128`
- :class {jq(tags_json, `.[] | select(.id == 8) | {focused, occupied} | to_entries | map(select(.value) | .key) | join(" ") | {"class": .}`).class}
- ;:visible {jq(tags_json, `.[] | select(.id == 8) | .occupied or .focused`)}
- )
- (button :onclick `riverctl set-focused-tags 256`
- :class {jq(tags_json, `.[] | select(.id == 9) | {focused, occupied} | to_entries | map(select(.value) | .key) | join(" ") | {"class": .}`).class}
- ;:visible {jq(tags_json, `.[] | select(.id == 9) | .occupied or .focused`)}
- )))
-
-
-(defwidget title []
- (label :text {wintitle[0].title}
- :class "title"
- :truncate true
- :show-truncated true
- :visible {wintitle[0].title != ""}
- :limit-width 55))
-
-(deflisten volume :initial "0" `monitor-volume`)
-(defpoll ssid :initial "" :interval "10s" `iwctl station wlan0 get-networks | awk -F' ' '/>/{print $3}'`)
-(deflisten brightness :initial "0" `brightctl -l`)
-(defpoll time :initial "" :interval "1s" `date '+%b %-d %H:%M:%S'`)
-
-(defvar showvol false)
-
-(defwidget status []
- (box :orientation "h"
- :halign "end"
- :class "status"
- :spacing 8
- :space-evenly false
- (revealer-on-hover :var showvol
- :varname "showvol"
- :icon "a"
- :transition "slideleft"
- :class "volume"
- (scale :orientation "h"
- :min 0
- :max 1
- :value {volume}
- :onchange `wpctl set-volume @DEFAULT_SINK@ {}`)
- (label :text "${matches(volume, "MUTED") ? " " : volume == 0 ? "" : volume < 50 ? "" : " "} ${volume}%"
- :class "volume"))
- (label :text "${ssid == "" ? "󰖪" : "󰖩"} ${ssid}"
- :class "network")
- (label :text " ${brightness}%"
- :class "brightness")
- (label :text "${`{"Discharging": ["󰁺","󰁻","󰁼","󰁽","󰁾","󰁿","󰂀","󰂁","󰂂","󰁹"], "Charging": ["󰢜","󰂆","󰂇","󰂈","󰢝","󰂉","󰢞","󰂊","󰂋","󰂅"]}`?.[EWW_BATTERY.BAT0.status]?.[round((EWW_BATTERY.BAT0.capacity - 1) / 10, 0)] ?: "󰂄"} ${EWW_BATTERY.BAT0.capacity}%"
- :class "battery")
- (label :text " ${time}"
- :class "clock")
- (label :text "󰍜"
- :class "menu")))
- ;(label :text "󰐥"
- ;:class "power")))
-
+(include "./bar.yuck")
+(include "./wall.yuck")
+(include "./applauncher.yuck")
+(include "./powermenu.yuck")