diff options
Diffstat (limited to '.config/eww')
| -rw-r--r-- | .config/eww/.editorconfig | 11 | ||||
| -rw-r--r-- | .config/eww/applauncher.yuck | 13 | ||||
| -rw-r--r-- | .config/eww/bar.scss | 74 | ||||
| -rw-r--r-- | .config/eww/bar.yuck | 87 | ||||
| -rw-r--r-- | .config/eww/cava.ini | 8 | ||||
| -rw-r--r-- | .config/eww/cava.py | 5 | ||||
| -rw-r--r-- | .config/eww/eww.scss | 88 | ||||
| -rw-r--r-- | .config/eww/eww.yuck | 167 | ||||
| -rw-r--r-- | .config/eww/powermenu.scss | 16 | ||||
| -rw-r--r-- | .config/eww/powermenu.yuck | 33 | ||||
| -rw-r--r-- | .config/eww/wall.scss | 26 | ||||
| -rw-r--r-- | .config/eww/wall.yuck | 32 |
12 files changed, 314 insertions, 246 deletions
diff --git a/.config/eww/.editorconfig b/.config/eww/.editorconfig new file mode 100644 index 0000000..1e8dd63 --- /dev/null +++ b/.config/eww/.editorconfig @@ -0,0 +1,11 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 2 + +[*.scss] +indent_style = tab diff --git a/.config/eww/applauncher.yuck b/.config/eww/applauncher.yuck new file mode 100644 index 0000000..7a02e8b --- /dev/null +++ b/.config/eww/applauncher.yuck @@ -0,0 +1,13 @@ +(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`))) diff --git a/.config/eww/bar.scss b/.config/eww/bar.scss new file mode 100644 index 0000000..c3ae24c --- /dev/null +++ b/.config/eww/bar.scss @@ -0,0 +1,74 @@ +.bar { + background-color: transparent; + color: $tx; + font-family: 'FiraCode Nerd Font'; +} + +.song, .cava { + background-color: $bg; + color: $tx; + padding: 0 16px; +} + +.song { + border-radius: 24px 4px 4px 24px; +} + +.cava { + border-radius: 4px 24px 24px 4px; +} + +.status { + background-color: $bg; + border-radius: 999px; + padding: 0 12px; +} + +.status > * { + margin: 0 8px; +} + +.volume { color: $re; } +.network { color: $or; } +.brightness { color: $ye; } +.battery { color: $gr; } +.clock { color: $bl; } +.power { + color: $pu; + font-size: 1.5em; +} + +.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 { + background-color: $ui3; +} + +.tags .occupied { + border-color: $re; +} + +.tags .occupied.focused { + background-color: $re; +} + +scale { + padding: 0 16px; +} + +scale trough { + min-width: 100px; + background-color: $re; +} diff --git a/.config/eww/bar.yuck b/.config/eww/bar.yuck new file mode 100644 index 0000000..a691155 --- /dev/null +++ b/.config/eww/bar.yuck @@ -0,0 +1,87 @@ +(deflisten tags_json :initial `[]` `river-bedload -minified -watch tags`) +(deflisten wintitle :initial `[{"title":""}]` `river-bedload -minified -watch title`) +(defpoll song :initial "" :interval "5s" `rmpc song`) +(deflisten cava :initial "" `cava -p ~/.config/eww/cava.ini | python3 ~/.config/eww/cava.py`) + +(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) + (center) + (status))) + +(defwidget tags [] + (box :orientation "h" + :halign "start" + :class "tags" + (for tag in "[1, 2, 3, 4, 5, 6, 7, 8, 9]" + (button :onclick `riverctl set-focused-tags $(dc -e"2 ${tag} 1- ^p")` + :class {jq(tags_json, `.[] | select(.id == ${tag}) | {focused, occupied} | to_entries | map(select(.value) | .key) | join(" ") | {"class": .}`).class})))) + + +(defwidget center [] + (box :orientation "h" + :spacing 4 + :space-evenly false + :class "music" + (label :text "${song.metadata.artist} - ${song.metadata.title}" :class "song") + (label :text {cava} :class "cava"))) + + +(defwidget title [] + (label :text {wintitle[0].title} + :class "title" + :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 bartime :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 " ${bartime}" + :class "clock") + ;(label :text "" + ;:class "menu"))) + (label :text "" + :class "power"))) + diff --git a/.config/eww/cava.ini b/.config/eww/cava.ini new file mode 100644 index 0000000..40e2576 --- /dev/null +++ b/.config/eww/cava.ini @@ -0,0 +1,8 @@ +[general] +framerate=30 +bars=8 +[output] +method=raw +raw_target=/dev/stdout +data_format=ascii +ascii_max_range=7 diff --git a/.config/eww/cava.py b/.config/eww/cava.py new file mode 100644 index 0000000..a7b40b8 --- /dev/null +++ b/.config/eww/cava.py @@ -0,0 +1,5 @@ +#!/usr/bin/env python3 +import sys; +for line in sys.stdin: + sys.stdout.write(''.join("▁▂▃▄▅▆▇█"[int(x)] for x in line.rstrip().split(";") if x) + '\n') + sys.stdout.flush() diff --git a/.config/eww/eww.scss b/.config/eww/eww.scss index c37d1e6..4837d8f 100644 --- a/.config/eww/eww.scss +++ b/.config/eww/eww.scss @@ -29,88 +29,6 @@ $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; -} +@import "./bar.scss"; +@import "./wall.scss"; +@import "./powermenu.scss"; 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") diff --git a/.config/eww/powermenu.scss b/.config/eww/powermenu.scss new file mode 100644 index 0000000..f9b44c3 --- /dev/null +++ b/.config/eww/powermenu.scss @@ -0,0 +1,16 @@ +.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/powermenu.yuck b/.config/eww/powermenu.yuck new file mode 100644 index 0000000..ce3c0a8 --- /dev/null +++ b/.config/eww/powermenu.yuck @@ -0,0 +1,33 @@ +(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"))))) diff --git a/.config/eww/wall.scss b/.config/eww/wall.scss new file mode 100644 index 0000000..4ab994a --- /dev/null +++ b/.config/eww/wall.scss @@ -0,0 +1,26 @@ +.wall { + margin: 96px 32px; + color: $bg; + font-size: 2rem; + font-family: Poppins; +} + +.time { + font-size: 7rem; + font-weight: 800; +} + +.date { + font-weight: 300; +} + +.sysmon { + font-size: 1.75rem; + font-weight: bold; + margin-top: 48px; + margin-bottom: 12px; +} + +.sysmon-item { + font-weight: 400; +} diff --git a/.config/eww/wall.yuck b/.config/eww/wall.yuck new file mode 100644 index 0000000..a2516f8 --- /dev/null +++ b/.config/eww/wall.yuck @@ -0,0 +1,32 @@ +; shamelessly stolen from https://www.reddit.com/r/unixporn/comments/1hpe0lv/cinnamon_making_my_working_space_less_boring_with/ + +(defpoll time :initial "" :interval "1s" `date '+%H:%M'`) +(defpoll date :initial "" :interval "60s" `date '+%B %d, %Y'`) +(defpoll netup :initial "0" :interval "2s" `ifstat -t2 | awk '$1 == "wlan0" { print $6 }' | format-bytes`) +(defpoll netdown :initial "0" :interval "2s" `ifstat -t2 | awk '$1 == "wlan0" { print $8 }' | format-bytes`) + +(defwindow wall + :monitor 0 + :geometry (geometry :x "0" + :y "0" + :width "1920px" + :height "1080px" + :anchor "center") + :stacking "bottom" + :exclusive false + :focusable false + (box :orientation "v" + :class "wall" + :valign "start" + :halign "start" + :spacing 0 + :space-evenly false + (label :class "time" :halign "start" :text {time}) + (label :class "date" :halign "start" :text {date}) + (label :class "sysmon" :halign "start" :text "System Monitor") + (label :class "sysmon-item" :halign "start" :text " ${round(EWW_CPU.avg, 0)}%") + (label :class "sysmon-item" :halign "start" :text " ${round(EWW_RAM.used_mem_perc, 0)}%") + (label :class "sysmon-item" :halign "start" :text " ${round(EWW_DISK["/"].used_perc, 0)}%") + (label :class "sysmon-item" :halign "start" :text " ${netup}/s") + (label :class "sysmon-item" :halign "start" :text " ${netdown}/s") + )) |
