From e6917bde531cb3bafd6fa0c9892163888078c67d Mon Sep 17 00:00:00 2001 From: Leon Vatthauer Date: Mon, 29 Jul 2024 18:04:01 +0200 Subject: [PATCH] work on eww --- absol/configuration.nix | 2 -- absol/eww/config/widgets/resources/eww.yuck | 2 +- .../config/widgets/window-title/get-window-title.sh | 3 --- .../config/widgets/workspaces/get-active-workspace.sh | 2 +- absol/eww/config/widgets/workspaces/get-workspaces.sh | 2 +- common/eww/config/widgets/window-title/eww.yuck | 7 ------- gunther/configuration.nix | 2 -- {common => gunther}/eww/config/eww.scss | 10 ++++------ {common => gunther}/eww/config/eww.yuck | 0 .../eww/config/widgets/resources/eww.yuck | 4 ++-- .../eww/config/widgets/resources/network.sh | 0 .../eww/config/widgets/window-title/eww.yuck | 2 +- .../config/widgets/window-title/get-window-title.sh | 2 +- .../widgets/workspaces/change-active-workspace.sh | 0 .../eww/config/widgets/workspaces/eww.yuck | 0 .../config/widgets/workspaces/get-active-workspace.sh | 0 .../eww/config/widgets/workspaces/get-workspaces.sh | 0 {common => gunther}/eww/default.nix | 0 gunther/leonv.nix | 2 +- 19 files changed, 12 insertions(+), 28 deletions(-) delete mode 100644 absol/eww/config/widgets/window-title/get-window-title.sh delete mode 100644 common/eww/config/widgets/window-title/eww.yuck rename {common => gunther}/eww/config/eww.scss (95%) rename {common => gunther}/eww/config/eww.yuck (100%) rename {common => gunther}/eww/config/widgets/resources/eww.yuck (91%) rename {common => gunther}/eww/config/widgets/resources/network.sh (100%) rename {absol => gunther}/eww/config/widgets/window-title/eww.yuck (73%) rename {common => gunther}/eww/config/widgets/window-title/get-window-title.sh (90%) rename {common => gunther}/eww/config/widgets/workspaces/change-active-workspace.sh (100%) rename {common => gunther}/eww/config/widgets/workspaces/eww.yuck (100%) rename {common => gunther}/eww/config/widgets/workspaces/get-active-workspace.sh (100%) rename {common => gunther}/eww/config/widgets/workspaces/get-workspaces.sh (100%) rename {common => gunther}/eww/default.nix (100%) diff --git a/absol/configuration.nix b/absol/configuration.nix index d126916..f6ed92a 100755 --- a/absol/configuration.nix +++ b/absol/configuration.nix @@ -124,8 +124,6 @@ services.blueman.enable = true; # Enable sound with pipewire. - sound.enable = true; - hardware.pulseaudio.enable = false; security.rtkit.enable = true; services.pipewire = { enable = true; diff --git a/absol/eww/config/widgets/resources/eww.yuck b/absol/eww/config/widgets/resources/eww.yuck index 8384839..cb7cd18 100644 --- a/absol/eww/config/widgets/resources/eww.yuck +++ b/absol/eww/config/widgets/resources/eww.yuck @@ -86,7 +86,7 @@ ; VOLUME -(defpoll volume_percent :interval "0.1s" :initial "40" "amixer sget Master | grep 'Left:' | awk -F'[][]' '{ print $2 }' | tr -d '%'") +(defpoll volume_percent :interval "0.1s" :initial "40" "wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk -F. '{print $2}'") (defwidget volume [] (eventbox diff --git a/absol/eww/config/widgets/window-title/get-window-title.sh b/absol/eww/config/widgets/window-title/get-window-title.sh deleted file mode 100644 index f5a494a..0000000 --- a/absol/eww/config/widgets/window-title/get-window-title.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash -hyprctl activewindow -j | jq --raw-output .title -socat -u UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | stdbuf -o0 awk -F '>>|,' '/^activewindow>>/{print $3}' \ No newline at end of file diff --git a/absol/eww/config/widgets/workspaces/get-active-workspace.sh b/absol/eww/config/widgets/workspaces/get-active-workspace.sh index 0ebac7b..c317202 100755 --- a/absol/eww/config/widgets/workspaces/get-active-workspace.sh +++ b/absol/eww/config/widgets/workspaces/get-active-workspace.sh @@ -2,5 +2,5 @@ hyprctl monitors -j | jq '.[] | select(.focused) | .activeWorkspace.id' -socat -u UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | +socat -u UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | stdbuf -o0 awk -F '>>|,' -e '/^workspace>>/ {print $2}' -e '/^focusedmon>>/ {print $3}' \ No newline at end of file diff --git a/absol/eww/config/widgets/workspaces/get-workspaces.sh b/absol/eww/config/widgets/workspaces/get-workspaces.sh index fa7d904..6aaf995 100755 --- a/absol/eww/config/widgets/workspaces/get-workspaces.sh +++ b/absol/eww/config/widgets/workspaces/get-workspaces.sh @@ -6,6 +6,6 @@ spaces (){ } spaces -socat -u UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | while read -r line; do +socat -u UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | while read -r line; do spaces done \ No newline at end of file diff --git a/common/eww/config/widgets/window-title/eww.yuck b/common/eww/config/widgets/window-title/eww.yuck deleted file mode 100644 index 66ff506..0000000 --- a/common/eww/config/widgets/window-title/eww.yuck +++ /dev/null @@ -1,7 +0,0 @@ -(deflisten window :initial "" "sh ./widgets/window-title/get-window-title.sh") -(defwidget windowtitle [] - (box :class "title" - (label :text {window == "null" ? "" : window} :class "title" - ) - ) -) \ No newline at end of file diff --git a/gunther/configuration.nix b/gunther/configuration.nix index 11c20a7..401b58c 100755 --- a/gunther/configuration.nix +++ b/gunther/configuration.nix @@ -102,8 +102,6 @@ services.blueman.enable = true; # Enable sound with pipewire. - sound.enable = true; - hardware.pulseaudio.enable = false; security.rtkit.enable = true; services.pipewire = { enable = true; diff --git a/common/eww/config/eww.scss b/gunther/eww/config/eww.scss similarity index 95% rename from common/eww/config/eww.scss rename to gunther/eww/config/eww.scss index c053b74..f560fd9 100644 --- a/common/eww/config/eww.scss +++ b/gunther/eww/config/eww.scss @@ -27,16 +27,11 @@ $base: #24273a; $mantle: #1e2030; $crust: #181926; -*{ +* { all: unset; font-family: "monospace"; } -// .bar { -// background-color: $base; -// border-radius: 16px; -// } - .container { background-color: $base; border-radius: 16px; @@ -71,16 +66,19 @@ tooltip label { color: $green; margin: 0px 10px 0px 10px; } + .bluetooth_icon { font-size: 18px; color: $blue; margin: 0px 10px 0px 10px; } + .cpu_text { font-size: 18px; color: $maroon; margin: 0px 10px 0px 10px; } + .mem_text { font-size: 18px; color: $yellow; diff --git a/common/eww/config/eww.yuck b/gunther/eww/config/eww.yuck similarity index 100% rename from common/eww/config/eww.yuck rename to gunther/eww/config/eww.yuck diff --git a/common/eww/config/widgets/resources/eww.yuck b/gunther/eww/config/widgets/resources/eww.yuck similarity index 91% rename from common/eww/config/widgets/resources/eww.yuck rename to gunther/eww/config/widgets/resources/eww.yuck index 306588f..3a38f39 100644 --- a/common/eww/config/widgets/resources/eww.yuck +++ b/gunther/eww/config/widgets/resources/eww.yuck @@ -74,13 +74,13 @@ ; VOLUME -(defpoll volume_percent :interval "0.1s" :initial "40" "amixer sget Master | grep 'Left:' | awk -F'[][]' '{ print $2 }' | tr -d '%'") +(defpoll volume_percent :interval "0.1s" :initial "40" "wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk -F. '{print $2}'") (defwidget volume [] (eventbox :active true :onclick "/usr/bin/env pavucontrol &" - :onscroll "if [ {} = 'up' ]; then wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+; else wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%-; fi" ; wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%- + :onscroll "if [ {} = 'up' ]; then wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+; else wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%-; fi" (box :space-evenly false :orientation "h" diff --git a/common/eww/config/widgets/resources/network.sh b/gunther/eww/config/widgets/resources/network.sh similarity index 100% rename from common/eww/config/widgets/resources/network.sh rename to gunther/eww/config/widgets/resources/network.sh diff --git a/absol/eww/config/widgets/window-title/eww.yuck b/gunther/eww/config/widgets/window-title/eww.yuck similarity index 73% rename from absol/eww/config/widgets/window-title/eww.yuck rename to gunther/eww/config/widgets/window-title/eww.yuck index 66ff506..bec8851 100644 --- a/absol/eww/config/widgets/window-title/eww.yuck +++ b/gunther/eww/config/widgets/window-title/eww.yuck @@ -1,6 +1,6 @@ (deflisten window :initial "" "sh ./widgets/window-title/get-window-title.sh") (defwidget windowtitle [] - (box :class "title" + (box :class "title" :visible {window == "null" ? false : true} (label :text {window == "null" ? "" : window} :class "title" ) ) diff --git a/common/eww/config/widgets/window-title/get-window-title.sh b/gunther/eww/config/widgets/window-title/get-window-title.sh similarity index 90% rename from common/eww/config/widgets/window-title/get-window-title.sh rename to gunther/eww/config/widgets/window-title/get-window-title.sh index 7120055..2c0a8f1 100644 --- a/common/eww/config/widgets/window-title/get-window-title.sh +++ b/gunther/eww/config/widgets/window-title/get-window-title.sh @@ -1,3 +1,3 @@ -#!/usr/bin/env bash +#!/bin/sh hyprctl activewindow -j | jq --raw-output .title socat -u UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | stdbuf -o0 awk -F '>>|,' '/^activewindow>>/{print $3}' \ No newline at end of file diff --git a/common/eww/config/widgets/workspaces/change-active-workspace.sh b/gunther/eww/config/widgets/workspaces/change-active-workspace.sh similarity index 100% rename from common/eww/config/widgets/workspaces/change-active-workspace.sh rename to gunther/eww/config/widgets/workspaces/change-active-workspace.sh diff --git a/common/eww/config/widgets/workspaces/eww.yuck b/gunther/eww/config/widgets/workspaces/eww.yuck similarity index 100% rename from common/eww/config/widgets/workspaces/eww.yuck rename to gunther/eww/config/widgets/workspaces/eww.yuck diff --git a/common/eww/config/widgets/workspaces/get-active-workspace.sh b/gunther/eww/config/widgets/workspaces/get-active-workspace.sh similarity index 100% rename from common/eww/config/widgets/workspaces/get-active-workspace.sh rename to gunther/eww/config/widgets/workspaces/get-active-workspace.sh diff --git a/common/eww/config/widgets/workspaces/get-workspaces.sh b/gunther/eww/config/widgets/workspaces/get-workspaces.sh similarity index 100% rename from common/eww/config/widgets/workspaces/get-workspaces.sh rename to gunther/eww/config/widgets/workspaces/get-workspaces.sh diff --git a/common/eww/default.nix b/gunther/eww/default.nix similarity index 100% rename from common/eww/default.nix rename to gunther/eww/default.nix diff --git a/gunther/leonv.nix b/gunther/leonv.nix index d214113..5529c53 100755 --- a/gunther/leonv.nix +++ b/gunther/leonv.nix @@ -3,7 +3,7 @@ imports = [ ./../common ./hypr/hyprland.nix - ./../common/eww + ./eww ]; /* The home.stateVersion option does not have a default and must be set */ home.stateVersion = "24.05";