diff options
Diffstat (limited to '.config')
| -rw-r--r-- | .config/eww/eww.scss | 116 | ||||
| -rw-r--r-- | .config/eww/eww.yuck | 173 |
2 files changed, 289 insertions, 0 deletions
diff --git a/.config/eww/eww.scss b/.config/eww/eww.scss new file mode 100644 index 0000000..c37d1e6 --- /dev/null +++ b/.config/eww/eww.scss @@ -0,0 +1,116 @@ +$bg: #100F0F; +$bg2: #1C1B1A; +$ui: #282726; +$ui2: #343331; +$ui3: #403E3C; +$tx3: #575653; +$tx2: #878580; +$tx: #CECDC3; + +$re: #D14D41; +$or: #DA702C; +$ye: #D0A215; +$gr: #879A39; +$cy: #3AA99F; +$bl: #4385BE; +$pu: #8B7EC8; +$ma: #CE5D97; + +$re2: #AF3029; +$or2: #BC5215; +$ye2: #AD8301; +$gr2: #66800B; +$cy2: #24837B; +$bl2: #205EA6; +$pu2: #5E409D; +$ma2: #A02F6F; + +* { + all: unset; +} + +.bar { + background-color: transparent; + color: $tx; + font-family: 'FiraCode Nerd Font'; +} + +.title { + background-color: $bg; + border-radius: 999px; + padding: 0 16px; +} + +.status { + background-color: $bg; + border-radius: 999px; + padding: 0 1px; +} + +.status > * { + margin: 0 8px; +} + +.volume { color: $re; } +.network { color: $or; } +.brightness { color: $ye; } +.battery { color: $gr; } +.clock { color: $bl; } +.menu { + color: $pu; + font-size: 1.3em; +} + +.tags { + background-color: $bg; + border-radius: 999px; + padding: 8px; +} + +.tags button { + color: $tx; + border: 2.5px solid $ui3; + border-radius: 999px; + padding: 8px 8px; + margin: 0 3px; +} + +.tags .focused { + border-color: $ui3; + background-color: $ui3; +} + +.tags .occupied.focused { + border-color: $bl; + background-color: $bl; +} + +.tags .occupied { + border-color: $bl; +} + +scale { + padding: 0 16px; +} + +scale trough { + min-width: 100px; + background-color: $re; +} + +.powermenu { + background-color: rgba(0 0 0 / 20%); +} + +.powermenu-buttons { + margin: 420px 200px; +} + +.powermenu button { + background-color: $bg; + font-size: 20px; +} +.powermenu label { + margin-top: 8px; + font-size: 1.25rem; +} diff --git a/.config/eww/eww.yuck b/.config/eww/eww.yuck new file mode 100644 index 0000000..03d8fa1 --- /dev/null +++ b/.config/eww/eww.yuck @@ -0,0 +1,173 @@ +(defwidget revealer-on-hover [var varname ?class ?duration ?transition] + (box :class "${class} revealer-on-hover" + :orientation "h" + :space-evenly false + (eventbox :class "eventbox" + :onhover "eww update ${varname}=true" + :onhoverlost "eww update ${varname}=false" + (box :space-evenly false + (revealer :reveal var + :transition {transition ?: "slideright"} + :duration {duration ?: "500ms"} + (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"))) + |
