From 1cfb12afdddce77ab2a8c430b53faf9d8d31d920 Mon Sep 17 00:00:00 2001 From: Caroline Larimore Date: Sat, 8 Feb 2025 20:28:49 -0800 Subject: migration: eww --- roles/home/desktop/eww/panels/bar.css | 39 ----------- roles/home/desktop/eww/panels/bar.yuck | 102 ---------------------------- roles/home/desktop/eww/panels/cpu.yuck | 45 ------------ roles/home/desktop/eww/panels/default.css | 4 -- roles/home/desktop/eww/panels/default.yuck | 7 -- roles/home/desktop/eww/panels/fs.css | 13 ---- roles/home/desktop/eww/panels/fs.yuck | 74 -------------------- roles/home/desktop/eww/panels/launcher.css | 7 -- roles/home/desktop/eww/panels/launcher.yuck | 27 -------- roles/home/desktop/eww/panels/memory.yuck | 28 -------- roles/home/desktop/eww/panels/music.css | 38 ----------- roles/home/desktop/eww/panels/music.yuck | 102 ---------------------------- roles/home/desktop/eww/panels/volume.yuck | 40 ----------- 13 files changed, 526 deletions(-) delete mode 100644 roles/home/desktop/eww/panels/bar.css delete mode 100644 roles/home/desktop/eww/panels/bar.yuck delete mode 100644 roles/home/desktop/eww/panels/cpu.yuck delete mode 100644 roles/home/desktop/eww/panels/default.css delete mode 100644 roles/home/desktop/eww/panels/default.yuck delete mode 100644 roles/home/desktop/eww/panels/fs.css delete mode 100644 roles/home/desktop/eww/panels/fs.yuck delete mode 100644 roles/home/desktop/eww/panels/launcher.css delete mode 100644 roles/home/desktop/eww/panels/launcher.yuck delete mode 100644 roles/home/desktop/eww/panels/memory.yuck delete mode 100644 roles/home/desktop/eww/panels/music.css delete mode 100644 roles/home/desktop/eww/panels/music.yuck delete mode 100644 roles/home/desktop/eww/panels/volume.yuck (limited to 'roles/home/desktop/eww/panels') diff --git a/roles/home/desktop/eww/panels/bar.css b/roles/home/desktop/eww/panels/bar.css deleted file mode 100644 index a07c3b1..0000000 --- a/roles/home/desktop/eww/panels/bar.css +++ /dev/null @@ -1,39 +0,0 @@ -.bar .shutdown { - color: @brightRed; -} - -.bar .restart { - color: @brightGreen; -} - -.bar .sleep { - color: @brightYellow; -} - -.bar .dismiss { - color: @red; -} - -.bar .ws { - font-family: 'Symbols Nerd Font Mono'; - font-size: 18; - - color: @bg2; -} - -.bar .ws.active { - color: @fg4; -} - -.bar .ws.visible { - color: @fg; -} - -.bar .ws.focused { - background: @bg1; - color: @fg0; -} - -.bar .ws.urgent { - background: @red; -} diff --git a/roles/home/desktop/eww/panels/bar.yuck b/roles/home/desktop/eww/panels/bar.yuck deleted file mode 100644 index 6dc4771..0000000 --- a/roles/home/desktop/eww/panels/bar.yuck +++ /dev/null @@ -1,102 +0,0 @@ -(defwidget bar [] - (centerbox :class "bar" - :orientation "h" - - (box - :orientation "h" - :spacing 8 - :space-evenly false - - (tooltip :class "panel" - {EWW_TIME} - {formattime(EWW_TIME, "%T", "America/Los_Angeles")} - ) - - (tooltip :class "panel" - {formattime(EWW_TIME, "%F", "America/Los_Angeles")} - {formattime(EWW_TIME, "%A, %B %d, %Y", "America/Los_Angeles")} - ) - ) - - (box - :orientation "h" - :spacing 8 - :space-evenly false - - ;(label :class "panel" - ; :text "i have no idea what to put here :3" - ;) - - (box :class "unpadded panel" - (ws :num 0 :icon "󱄅" :name "Main") - (ws :num 1 :icon "" :name "Terminal") - (ws :num 2 :icon "󰈹" :name "Browser") - (ws :num 3 :icon "󰙯" :name "Chat") - (ws :num 4 :icon "󰓓" :name "Gaming") - (ws :num 5 :icon "󰎱" :name "5") - (ws :num 6 :icon "󰎳" :name "6") - (ws :num 7 :icon "󰎶" :name "7") - (ws :num 8 :icon "󰄛" :name "Meow") - (ws :num 9 :icon "󰲸" :name "Music") - (ws :num 10 :icon "󰁴" :name "Misc") - ) - ) - - (box - :orientation "h" - :spacing 8 - :space-evenly false - :halign "end" - - (box :class "unpadded panel" - :space-evenly false - (button :class "sleep icon" - :width 31 - "󰤄" - ) - - (button :class "restart icon" - :width 33 - "󰜉" - ) - - (button :class "shutdown icon" - :width 31 - "󰐥" - ) - ) - - (box :class "unpadded panel" - (button :class "dismiss icon" - :width 29 - :onclick `${EWW_CMD} close sys` - "󰅖" - ) - ) - ) - ) -) - -(defwidget ws [num icon name] - (tooltip {name} - (button :class {"ws" - + (ws-status[num].active ? " active" : "") - + (ws-status[num].visible ? " visible" : "") - + (ws-status[num].focused ? " focused" : "") - + (ws-status[num].urgent ? " urgent" : "") - } - :width { - num == 0 ? 31 : - num == 10 ? 31 : - 33 - } - - {icon} - ) - ) -) - -(defpoll ws-status - :interval "0.1s" - `i3-msg -t get_workspaces | jq -caM 'map({"ws-\\(.num)": {visible, focused, urgent, active: true}}) | add as $orig | [range(0;11)] | [.[] as $i | $orig."ws-\\($i)" // {visible: false, focused: false, urgent: false, active: false}]'` -) diff --git a/roles/home/desktop/eww/panels/cpu.yuck b/roles/home/desktop/eww/panels/cpu.yuck deleted file mode 100644 index ef57fa6..0000000 --- a/roles/home/desktop/eww/panels/cpu.yuck +++ /dev/null @@ -1,45 +0,0 @@ -(defwidget cpu [] - (box :class "panel" - :orientation "h" - :spacing 8 - :space-evenly false - - (tooltip :class "cutout" - {round(EWW_CPU.avg, 2) + "%"} - (graph - :value {EWW_CPU.avg} - :time-range "30s" - :width 76 - :height 76 - :hexpand true - ) - ) - - (box :orientation "v" - :spacing 8 - :space-evenly false - :hexpand true - - (label :halign "start" :markup {"" + cpu-name + ""}) - - (stat :key "Temperature" :value {round(EWW_TEMPS.K10TEMP_TCTL, 2) + "°C"}) - (stat :key "Frequency" :value {round(cpu-max-freq * cpu-freq/100, 0) + " MHz"}) - (stat :key "Usage" :value {round(EWW_CPU.avg, 2) + "%"}) - ) - ) -) - -(defpoll cpu-freq - :interval "2s" - `lscpu | sed -n '/CPU(s) scaling MHz/ s/.*:\\s*\\(.*\\)%/\\1/p'` -) - -(defpoll cpu-max-freq - :interval "9999s" - `lscpu | sed -n '/CPU max MHz/ s/.*:\\s*\\(.*\\)/\\1/p'` -) - -(defpoll cpu-name - :interval "9999s" - `lscpu | sed -n '/Model name/ s/.*:\\s*\\(.*\\)/\\1/p'` -) diff --git a/roles/home/desktop/eww/panels/default.css b/roles/home/desktop/eww/panels/default.css deleted file mode 100644 index 8cd39a3..0000000 --- a/roles/home/desktop/eww/panels/default.css +++ /dev/null @@ -1,4 +0,0 @@ -@import "bar.css"; -@import "fs.css"; -@import "launcher.css"; -@import "music.css"; diff --git a/roles/home/desktop/eww/panels/default.yuck b/roles/home/desktop/eww/panels/default.yuck deleted file mode 100644 index 3c20c4b..0000000 --- a/roles/home/desktop/eww/panels/default.yuck +++ /dev/null @@ -1,7 +0,0 @@ -(include "./panels/bar.yuck") -(include "./panels/cpu.yuck") -(include "./panels/fs.yuck") -(include "./panels/launcher.yuck") -(include "./panels/memory.yuck") -(include "./panels/music.yuck") -(include "./panels/volume.yuck") diff --git a/roles/home/desktop/eww/panels/fs.css b/roles/home/desktop/eww/panels/fs.css deleted file mode 100644 index 8ca2dd2..0000000 --- a/roles/home/desktop/eww/panels/fs.css +++ /dev/null @@ -1,13 +0,0 @@ -.disks .meter.almost-full .progress { - color: @orange; - background: rgba(0, 0, 0, 0); -} - -.disks .meter.full .progress { - color: @red; - background: rgba(0, 0, 0, 0); -} - -.zfs .total { - font-weight: bold; -} diff --git a/roles/home/desktop/eww/panels/fs.yuck b/roles/home/desktop/eww/panels/fs.yuck deleted file mode 100644 index 54bbd46..0000000 --- a/roles/home/desktop/eww/panels/fs.yuck +++ /dev/null @@ -1,74 +0,0 @@ -(defwidget disks [] - (box :class "panel disks" - :orientation "h" - :spacing 8 - :space-evenly false - :height {100+16} - - (disk :mount "total" - :zfs true - :name "zpool" - ) - - (disk :mount "/mnt/4tb" - :name "4tb" - ) - (disk :mount "/mnt/ssd" - :name "ssd" - ) - ) -) - -(defwidget zfs [] - (box :class "panel zfs" - :orientation "v" - :spacing 8 - :space-evenly false - :hexpand true - - (label :halign "start" :markup "ZFS Volumes") - - (zvol :mount "/nix") - (zvol :mount "/persist") - - (zvol :class "faint" - :mount "/home" - ) - - (zvol :class "faint" - :mount "/" - ) - - (zvol :class "total" - :mount "total" - :name "Total" - ) - ) -) - -(defwidget disk [mount ?name ?zfs] - (meter - :value { - (zfs == true ? zpool : disks)[mount].used / ((zfs == true ? zpool : disks)[mount].used + (zfs == true ? zpool : disks)[mount].free) * 100} - :label {name != "" ? name : mount} - - {round((zfs == true ? zpool : disks)[mount].used/1024/1024, 0) + " GiB"} - ) -) - -(defwidget zvol [mount ?name ?class] - (stat :class {class} - :key {name != "" ? name : mount} - :value {round(zpool[mount].used/1024/1024, 2) + " GiB"} - ) -) - -(defpoll disks - :interval "10s" - `df -x fuse -x tmpfs -x efivarfs -x devtmpfs -x zfs | tail -n +2 | awk '{ printf "%s free %d\\n%s used %d\\n", $6, $4, $6, $3 }' | xargs printf '{"%s": {"%s": %d}}\\n' | jq -scaM 'map(to_entries) | flatten | group_by(.key) | map({"\\(.[0].key)": map(.value | to_entries) | flatten | from_entries}) | add'` -) - -(defpoll zpool - :interval "10s" - `df -t zfs --total | tail -n +2 | awk '{ printf "%s free %d\\n%s used %d\\n", $6, $4, $6, $3 }' | xargs printf '{"%s": {"%s": %d}}\\n' | jq -scaM 'map(to_entries) | flatten | group_by(.key) | map({"\\(.[0].key)": map(.value | to_entries) | flatten | from_entries}) | add | .total = ."-" | del(."-") | .total.free = ."/zpool".free'` -) diff --git a/roles/home/desktop/eww/panels/launcher.css b/roles/home/desktop/eww/panels/launcher.css deleted file mode 100644 index 5055191..0000000 --- a/roles/home/desktop/eww/panels/launcher.css +++ /dev/null @@ -1,7 +0,0 @@ -.launcher entry { - border-radius: 0; -} - -.launcher entry:focus { - box-shadow: 0 0 0 2px @accent inset; -} diff --git a/roles/home/desktop/eww/panels/launcher.yuck b/roles/home/desktop/eww/panels/launcher.yuck deleted file mode 100644 index a568346..0000000 --- a/roles/home/desktop/eww/panels/launcher.yuck +++ /dev/null @@ -1,27 +0,0 @@ -(defwidget launcher [] - (box :class "launcher panel" - :orientation "v" - :spacing 8 - :space-evenly false - :height {556 - ((128 + 16 + 4) + 8)} - :width 768 - - (input - :valign "start" - ) - - (scroll - :vscroll true - :hscroll false - :vexpand true - - (literal :content {lunch}) - ) - ) -) - -(defpoll lunch - :interval "60s" - ;`~/lunch.sh` - `~/code/lunch/zig-out/bin/lunch` -) diff --git a/roles/home/desktop/eww/panels/memory.yuck b/roles/home/desktop/eww/panels/memory.yuck deleted file mode 100644 index 4f6633a..0000000 --- a/roles/home/desktop/eww/panels/memory.yuck +++ /dev/null @@ -1,28 +0,0 @@ -(defwidget memory [] - (box :class "panel" - :orientation "v" - :spacing 8 - :space-evenly false - - (box - (label :markup "Memory" - :halign "start" - ) - - (label :markup {round(EWW_RAM.used_mem/1024/1024/1024, 2) + " GiB / " + round(EWW_RAM.total_mem/1024/1024/1024, 2) + " GiB"} - :halign "end" - ) - ) - - (tooltip :class "cutout" - {round(EWW_RAM.used_mem_perc, 2) + "%"} - (graph - :hexpand true - :value {EWW_RAM.used_mem} - :max {EWW_RAM.total_mem} - :time-range "30s" - :height 100 - ) - ) - ) -) diff --git a/roles/home/desktop/eww/panels/music.css b/roles/home/desktop/eww/panels/music.css deleted file mode 100644 index e5bbc60..0000000 --- a/roles/home/desktop/eww/panels/music.css +++ /dev/null @@ -1,38 +0,0 @@ -.music { - padding: 8px; - opacity: 1.0; -} - -.music .right { - margin-top: 8px; -} - -.music .song-title { - font-size: 17px; - font-weight: bold; -} - -.music .song-album { - color: @fg2; -} - -.music .song-artist { - color: @fg2; -} - -.music scale trough { - background: @bg2; - min-height: 4px; -} - -.music scale highlight { - background: @accent; -} - -.music scale slider { - box-shadow: none; - background: @accent; - margin: -6px; - min-height: 0; - min-width: 0; -} diff --git a/roles/home/desktop/eww/panels/music.yuck b/roles/home/desktop/eww/panels/music.yuck deleted file mode 100644 index 757efd5..0000000 --- a/roles/home/desktop/eww/panels/music.yuck +++ /dev/null @@ -1,102 +0,0 @@ - -(defwidget music [] - (box :class "panel music" - :orientation "h" - :spacing 8 - :space-evenly false - :height {128 + 16 + 4} - - (image - :path song-cover - :image-width 128 - :image-height 128 - ) - - (box :class "right" - :orientation "v" - :spacing 0 - :space-evenly true - :hexpand true - - (box :class "info" - :orientation "v" - :space-evenly false - :valign "center" - - (tooltip {song.title} - (label :class "song-title" - :text {song.title} - :halign "start" - :truncate true - ) - ) - (tooltip {song.album} - (label :class "song-album" - :text {song.album} - :halign "start" - :truncate true - ) - ) - (tooltip {song.artist} - (label :class "song-artist" - :text {song.artist} - :halign "start" - :truncate true - ) - ) - ) - - (box - :valign "end" - :space-evenly false - - (box :class "control" - :space-evenly false - - (button :class "icon" - :width 36 - :onclick `playerctl --player=cmus,firefox,%any previous` - - "󰒮" - ) - (button :class "icon" - :onclick `playerctl --player=cmus,firefox,%any play-pause` - :width 36 - - { song.status == "Playing" ? "󰏤" : "󰐊" } - ) - (button :class "icon" - :width 36 - :onclick `playerctl --player=cmus,firefox,%any next` - - "󰒭" - ) - ) - - (scale - :hexpand true - :value {song-position} - :max {song.length/1000/1000} - ;:onchange `/home/c/seek.sh {}` - ) - - {formattime(round(song-position, 0), "%M:%S") + " / " + formattime(round(song.length/1000/1000, 0), "%M:%S")} - - (box :width 16) - ) - ) - ) -) - -(deflisten song-cover - `playerctl --player=cmus,firefox,%any -F metadata title | get-album-art` -) - -(deflisten song - `playerctl --player=cmus,firefox,%any -F metadata --format='{"title": "{{title}}", "album": "{{album}}", "artist": "{{artist}}", "status": "{{status}}", "length": "{{mpris:length}}"}'` -) - -(defpoll song-position - :interval "0.2s" - `playerctl --player=cmus,firefox,%any position` -) \ No newline at end of file diff --git a/roles/home/desktop/eww/panels/volume.yuck b/roles/home/desktop/eww/panels/volume.yuck deleted file mode 100644 index 0c342c3..0000000 --- a/roles/home/desktop/eww/panels/volume.yuck +++ /dev/null @@ -1,40 +0,0 @@ -(defwidget volume [] - (box :class "volume panel" - :orientation "v" - :space-evenly false - - (label :markup "Volume") - - (box - :orientation "h" - :vexpand true - - (box - :orientation "v" - :space-evenly false - :vexpand true - - (scale - :orientation "v" - :flipped true - :value {sink-volume} - :max 101 - :onchange `pactl set-sink-volume @DEFAULT_SINK@ {}%` - :vexpand true - ) - - {sink-volume + "%"} - ) - ) - ) -) - -(defpoll sink-volume - :interval "0.2s" - `pactl get-sink-volume @DEFAULT_SINK@ | head -n1 | awk '{print substr($5, 1, length($5)-1)}'` -) - -;(defpoll source-volume -; :interval "0.2s" -; `pactl get-source-volume @DEFAULT_SOURCE@ | head -n1 | awk '{print substr($5, 1, length($5)-1)}'` -;) -- cgit v1.2.3