From 8035c74d446d3f76074d7b286325e6d75c911362 Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Tue, 4 Feb 2025 23:51:05 -0500 Subject: [PATCH] eww: updates --- etcnixos/common.nix | 5 +- etcnixos/flake.lock | 12 +- home-manager/flake.lock | 30 +-- home-manager/progs/eww/config/eww.scss | 53 +++--- home-manager/progs/eww/config/eww.yuck | 173 ++++++++++-------- .../eww/config/scripts/currentWindow.fish | 2 +- .../progs/eww/config/scripts/dateInfo.fish | 2 - 7 files changed, 143 insertions(+), 134 deletions(-) delete mode 100755 home-manager/progs/eww/config/scripts/dateInfo.fish diff --git a/etcnixos/common.nix b/etcnixos/common.nix index 0f0c21e..9524adb 100644 --- a/etcnixos/common.nix +++ b/etcnixos/common.nix @@ -48,9 +48,8 @@ # kernel options boot = { - #cachyos-lto currently broken - # kernelPackages = pkgs.linuxPackages_cachyos-lto; - kernelPackages = pkgs.linuxPackages_latest; + kernelPackages = pkgs.linuxPackages_cachyos-lto; + # kernelPackages = pkgs.linuxPackages_latest; kernel.sysctl = { # dmesg shushhhhh diff --git a/etcnixos/flake.lock b/etcnixos/flake.lock index 691061a..4359537 100644 --- a/etcnixos/flake.lock +++ b/etcnixos/flake.lock @@ -34,11 +34,11 @@ ] }, "locked": { - "lastModified": 1738675414, - "narHash": "sha256-DwKipTgF2DEyNm6+Rj6FXg0DbNNNbt+h4fj9aTO4Q68=", + "lastModified": 1738707394, + "narHash": "sha256-XXrOqNs9a4L6p6/KXxIGotHOxzjPxva1queN3JK0E4c=", "owner": "chaotic-cx", "repo": "nyx", - "rev": "59029b0faeee6d2d5284af29830d85fb2caa30ee", + "rev": "236da2b18bfbddf782f85ee664fdfb9d50606229", "type": "github" }, "original": { @@ -310,11 +310,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1738546358, - "narHash": "sha256-nLivjIygCiqLp5QcL7l56Tca/elVqM9FG1hGd9ZSsrg=", + "lastModified": 1738680400, + "narHash": "sha256-ooLh+XW8jfa+91F1nhf9OF7qhuA/y1ChLx6lXDNeY5U=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c6e957d81b96751a3d5967a0fd73694f303cc914", + "rev": "799ba5bffed04ced7067a91798353d360788b30d", "type": "github" }, "original": { diff --git a/home-manager/flake.lock b/home-manager/flake.lock index 240b2ae..7f7caa1 100644 --- a/home-manager/flake.lock +++ b/home-manager/flake.lock @@ -54,11 +54,11 @@ ] }, "locked": { - "lastModified": 1738667255, - "narHash": "sha256-sMMQb9NydZqQ/MvvtPp+Ny0W9P0Jk0moU7SrTBlO5Vo=", + "lastModified": 1738709900, + "narHash": "sha256-8Bo5xFlCH5q72ExvAnH7TzStMlLZldKOSLMClRSfmTc=", "owner": "nix-community", "repo": "home-manager", - "rev": "7abcf59a365430b36f84eaa452a466b11e469e33", + "rev": "f2d32e46fac9d51da6912948ae1156044c71774b", "type": "github" }, "original": { @@ -79,11 +79,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1738659223, - "narHash": "sha256-fr3uPkLEDdmyD3CQwFBcRDl96VmkK0Lgr21BIxqk+gY=", + "lastModified": 1738707843, + "narHash": "sha256-0DMn9YbqU7ODIOBzu15vcrBnSKe72HUDkOtxHcpjK4A=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "297a7208e396ab6e9de88363c538baec8d75ccbb", + "rev": "a81adb09eb7eb2ffad1ac3b91d1e59083c8e5918", "type": "github" }, "original": { @@ -127,11 +127,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1738546358, - "narHash": "sha256-nLivjIygCiqLp5QcL7l56Tca/elVqM9FG1hGd9ZSsrg=", + "lastModified": 1738680400, + "narHash": "sha256-ooLh+XW8jfa+91F1nhf9OF7qhuA/y1ChLx6lXDNeY5U=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c6e957d81b96751a3d5967a0fd73694f303cc914", + "rev": "799ba5bffed04ced7067a91798353d360788b30d", "type": "github" }, "original": { @@ -174,11 +174,11 @@ ] }, "locked": { - "lastModified": 1738635966, - "narHash": "sha256-5MbJhh6nz7tx8FYVOJ0+ixMaEn0ibGzV/hScPMmqVTE=", + "lastModified": 1738722444, + "narHash": "sha256-DHVyKCiIQVDqjYoVU2j7UaLNIlOnpB9sP1cPRNRpqvY=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "1ff8663cd75a11e61f8046c62f4dbb05d1907b44", + "rev": "347fb01821c3cd8d54e563d244a599c1e27a393d", "type": "github" }, "original": { @@ -242,11 +242,11 @@ ] }, "locked": { - "lastModified": 1738682295, - "narHash": "sha256-Jx0SfHYrCFWztBYV6ySVBCcYlEA90NVNOUZLEm9DSu4=", + "lastModified": 1738710976, + "narHash": "sha256-/Zyfku2FxQKMs3LHI90Hy61o8VuXtI16RfvK/d849B0=", "owner": "0xc000022070", "repo": "zen-browser-flake", - "rev": "c49f8dcb66ff8cb75fd8de4ca40ea953a97a140a", + "rev": "0622c0eb2ab953e40e3d167eebe885a1f3bbe8f9", "type": "github" }, "original": { diff --git a/home-manager/progs/eww/config/eww.scss b/home-manager/progs/eww/config/eww.scss index 4bee480..5f01ceb 100644 --- a/home-manager/progs/eww/config/eww.scss +++ b/home-manager/progs/eww/config/eww.scss @@ -18,12 +18,29 @@ $surface: #585b70; padding: 0 1px; } -.red { color: $red; } -.maroon { color: $maroon; } -.peach { color: $peach; } -.yellow { color: $yellow; } -.green { color: $green; } -.lavendar { color: $lavendar; } +.red { + color: $red; +} + +.maroon { + color: $maroon; +} + +.peach { + color: $peach; +} + +.yellow { + color: $yellow; +} + +.green { + color: $green; +} + +.lavendar { + color: $lavendar; +} .symbol { color: $lavendar; @@ -34,9 +51,10 @@ $surface: #585b70; * { all: unset; margin: 0 5px; - font-size:14pt; + font-size: 14pt; transition: color 0.2s ease-in-out; } + &:hover * { color: $pink; } @@ -47,7 +65,7 @@ $surface: #585b70; padding: 0 0.3em; } -.padded > *:not(:last-child) { +.padded>*:not(:last-child) { padding: 0 10px; border-right: 1px solid $surface; } @@ -82,27 +100,10 @@ scale trough { } } -.workspaces * { - padding: 0 8px; - font-size: 14pt; - transition: color 0.2s ease-in-out; - - &:hover * { - color: $pink; - } - - .empty * { - color: $subtext; - } - .current * { - color: $green; - } -} - .clipboard { color: $subtext; } .time { padding-right: 10px; -} +} \ No newline at end of file diff --git a/home-manager/progs/eww/config/eww.yuck b/home-manager/progs/eww/config/eww.yuck index f780f97..0470a89 100644 --- a/home-manager/progs/eww/config/eww.yuck +++ b/home-manager/progs/eww/config/eww.yuck @@ -1,114 +1,125 @@ (defwindow statusbar - :monitor 0 - :stacking "fg" - :exclusive true - :geometry (geometry - :y "0.5%" - :width "100%" - :height "24px" - :anchor "top center") - (statusbar)) + :monitor 0 + :stacking "fg" + :exclusive true + :geometry (geometry + :y "0.5%" + :width "100%" + :height "24px" + :anchor "top center") + (statusbar)) (defwidget statusbar [] - (centerbox - (brightness-ctl) - ; (window-title) - (time) - (box :space-evenly false :halign 'end' :class 'padded' - (clipboard) - (battery) - (bluetooth) - (wifi)) - ) -) + (centerbox + (box :space-evenly false :halign 'start' :class 'padded' + (window-title)) + (time) + (box :space-evenly false :halign 'end' :class 'padded' + (brightness-ctl) + (brightness-ctl-opener) + ; (clipboard) + (battery) + (bluetooth) + (wifi)))) -(defwidget cmd-slider [?symbol value command max colour] - (box :space-evenly false - (label :text symbol :class "symbol") - (scale - :min 0 :max max - :value value - :round-digits 0 - :timeout "200ms" - :onchange command) - (label :text "${value}%" :class colour))) +(defwidget cmd-slider [?symbol value command max color] + (box :space-evenly false + (label :text symbol :class "symbol") + (scale + :min 0 :max max + :value value + :round-digits 0 + :timeout "200ms" + :onchange command) + (label :text "${value}%" :class color))) (defwidget window-title [] - (label + (label :text windowtitle)) (defpoll windowtitle :interval "1s" `scripts/currentWindow.fish`) (defpoll currentworkspace :interval "1s" `scripts/currentWorkspace.fish`) (defwidget brightness-ctl [] - (cmd-slider :symbol "󰃠" :value brightness - :command `brightnessctl set {}%` - :max 101 :colour "${ - brightness >= 80 ? "green" : - brightness >= 50 ? "yellow" : - brightness >= 30 ? "peach" : - brightness >= 10 ? "maroon" : "red" - }")) -(defpoll brightness :interval "1s" `brightnessctl -m | awk -F, '{print $4+0}'`) + (box :visible brightnessctl-open + (cmd-slider :symbol "󰃠" :value brightness + :command `brightnessctl set {}%` + :max 101 :color "${ + brightness >= 80 ? "green" : + brightness >= 50 ? "yellow" : + brightness >= 30 ? "peach" : + brightness >= 10 ? "maroon" : "red" + }"))) + + +(defpoll brightness :interval "1s" :run-while brightnessctl-open `brightnessctl -m | awk -F, '{print $4+0}'`) + + +(defvar brightnessctl-open false) +(defwidget brightness-ctl-opener [] + (eventbox :class "button" + (button + :onclick `${EWW_CMD} update brightnessctl-open=${!brightnessctl-open}` + "󰃠"))) (defwidget clipboard [] - (label :text clipboard-short :tooltip clipboard :class "clipboard")) + (label :text clipboard-short :tooltip clipboard :class "clipboard")) (defpoll clipboard :interval "5s" `scripts/clipboardInfo.zsh all`) -(defpoll clipboard-short :interval "5s" `scripts/clipboardInfo.zsh head`) +(defpoll clipboard-short :interval "5s" `scripts/clipboardInfo.zsh head`) (defwidget wifi [] - (eventbox - :class "button ${wifi-strength.colour}" - (label - :text {wifi-strength.icon} - :tooltip "Connected To: ${wifi-name}"))) + (eventbox + :class "button ${wifi-strength.colour}" + (label + :text {wifi-strength.icon} + :tooltip "Connected To: ${wifi-name}"))) (defpoll wifi-strength :interval "10s" `scripts/wifiInfo.zsh strength`) (defpoll wifi-name :interval "1m" `scripts/wifiInfo.zsh name`) (defwidget bluetooth [] - (eventbox - :class "bluetooth button ${ bluetooth-name != "" ? "green" : "lavendar" }" - :onclick `blueman-manager &` - (label - :text "${bluetooth-name} 󰂯"))) + (eventbox + :class "bluetooth button ${ bluetooth-name != "" ? "green" : "lavendar" }" + :onclick `blueman-manager &` + (label + :text "${bluetooth-name} 󰂯"))) (defpoll bluetooth-name :interval "10s" `bluetoothctl devices Connected | awk '{print $3}'`) (defwidget time [] - (box - :space-evenly false - :class "time" - :tooltip {time.long} - (label :class "yellow" :text {time.hour}) - (label :text ":") - (label :class "yellow" :text {time.minute}))) + (box + :space-evenly false + :class "time" + :tooltip {time.long} + (label :class "yellow" :text {time.hour}) + (label :text ":") + (label :class "yellow" :text {time.minute}))) -(defpoll time :interval "1s" `scripts/dateInfo.fish`) +(defpoll time :interval "1s" `date +'{"long":"%a %b %e %H:%M:%S %Z %Y","hour":"%H","minute":"%M"}'`) ; TODO: make this a package or something, not using rust-script (defpoll powerstats :interval "2s" `~/Documents/power_bat.rs`) (defwidget battery [] - (box :space-evenly false - :tooltip powerstats - (label - :text "${EWW_BATTERY.BAT1.status == "Charging" ? "󰂄" : - EWW_BATTERY.BAT1.capacity >= 90 ? "󰁹" : - EWW_BATTERY.BAT1.capacity >= 80 ? "󰂂" : - EWW_BATTERY.BAT1.capacity >= 70 ? "󰂁" : - EWW_BATTERY.BAT1.capacity >= 60 ? "󰂀" : - EWW_BATTERY.BAT1.capacity >= 50 ? "󰁿" : - EWW_BATTERY.BAT1.capacity >= 40 ? "󰁾" : - EWW_BATTERY.BAT1.capacity >= 30 ? "󰁽" : - EWW_BATTERY.BAT1.capacity >= 20 ? "󰁼" : - EWW_BATTERY.BAT1.capacity >= 10 ? "󰁻" : "󰁺" - } " - :class "${ - EWW_BATTERY.BAT1.capacity >= 80 ? "green" : - EWW_BATTERY.BAT1.capacity >= 50 ? "yellow" : - EWW_BATTERY.BAT1.capacity >= 30 ? "peach" : - EWW_BATTERY.BAT1.capacity >= 10 ? "maroon" : "red" - }") - (label :text "${EWW_BATTERY.BAT1.capacity}%" :class "yellow"))) + (box :space-evenly false + :tooltip powerstats + (label + :text "${EWW_BATTERY.BAT1.status == "Charging" ? "󰂄" : + EWW_BATTERY.BAT1.capacity >= 90 ? "󰁹" : + EWW_BATTERY.BAT1.capacity >= 80 ? "󰂂" : + EWW_BATTERY.BAT1.capacity >= 70 ? "󰂁" : + EWW_BATTERY.BAT1.capacity >= 60 ? "󰂀" : + EWW_BATTERY.BAT1.capacity >= 50 ? "󰁿" : + EWW_BATTERY.BAT1.capacity >= 40 ? "󰁾" : + EWW_BATTERY.BAT1.capacity >= 30 ? "󰁽" : + EWW_BATTERY.BAT1.capacity >= 20 ? "󰁼" : + EWW_BATTERY.BAT1.capacity >= 10 ? "󰁻" : "󰁺" + } " + :class "${ + EWW_BATTERY.BAT1.capacity >= 80 ? "green" : + EWW_BATTERY.BAT1.capacity >= 50 ? "yellow" : + EWW_BATTERY.BAT1.capacity >= 30 ? "peach" : + EWW_BATTERY.BAT1.capacity >= 10 ? "maroon" : "red" + }") + (label :text "${EWW_BATTERY.BAT1.capacity}%" :class "yellow"))) diff --git a/home-manager/progs/eww/config/scripts/currentWindow.fish b/home-manager/progs/eww/config/scripts/currentWindow.fish index d9159ce..e8df299 100755 --- a/home-manager/progs/eww/config/scripts/currentWindow.fish +++ b/home-manager/progs/eww/config/scripts/currentWindow.fish @@ -1,2 +1,2 @@ #!/usr/bin/env fish -niri msg focused-window | rg Title | sed -E "s/[[:space:]]+Title\: //g" | sed "s/\"//g" +niri msg focused-window | rg Title | sed -E "s/[[:space:]]+Title\: //g" | sed "s/\"//g" | head -c 55 diff --git a/home-manager/progs/eww/config/scripts/dateInfo.fish b/home-manager/progs/eww/config/scripts/dateInfo.fish deleted file mode 100755 index 77cf08f..0000000 --- a/home-manager/progs/eww/config/scripts/dateInfo.fish +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env fish -date +'{"long":"%a %b %e %H:%M:%S %Z %Y","hour":"%H","minute":"%M"}'