From 5a593d3ea10277e067e4f450c5c69b22c5d991da Mon Sep 17 00:00:00 2001 From: hesam-init Date: Fri, 28 Jun 2024 21:47:14 +0330 Subject: [PATCH] refactor: control panel slides --- .../eww/scripts/{notifCatch => notif.py} | 0 .../hyprland/eww/src/_definitions.yuck | 4 ++-- .../hyprland/eww/src/control-panel/main.yuck | 24 ++++++++++++++++--- .../hyprland/eww/src/sidebar/main.yuck | 4 +--- 4 files changed, 24 insertions(+), 8 deletions(-) rename hypr-configs/hyprland/eww/scripts/{notifCatch => notif.py} (100%) diff --git a/hypr-configs/hyprland/eww/scripts/notifCatch b/hypr-configs/hyprland/eww/scripts/notif.py similarity index 100% rename from hypr-configs/hyprland/eww/scripts/notifCatch rename to hypr-configs/hyprland/eww/scripts/notif.py diff --git a/hypr-configs/hyprland/eww/src/_definitions.yuck b/hypr-configs/hyprland/eww/src/_definitions.yuck index 24d2f8e..f8627bd 100644 --- a/hypr-configs/hyprland/eww/src/_definitions.yuck +++ b/hypr-configs/hyprland/eww/src/_definitions.yuck @@ -60,12 +60,12 @@ "notifications": [], "popups": [] }' - "./scripts/notifCatch" + "./scripts/notif.py" ) ; Playerctl (defpoll pstatus :initial "" :interval "1s" "playerctl status") -(defpoll psong :initial "0" :interval "1s" "playerctl metadata --format '{{ title }}'") +(defpoll psong :initial "" :interval "1s" "playerctl metadata --format '{{ title }}'") (defpoll partist :initial "" :interval "1s" "playerctl metadata --format '{{ artist }}'") (deflisten pcover "./scripts/pollcover.sh") (deflisten ptime diff --git a/hypr-configs/hyprland/eww/src/control-panel/main.yuck b/hypr-configs/hyprland/eww/src/control-panel/main.yuck index 8da6a4f..2a09869 100644 --- a/hypr-configs/hyprland/eww/src/control-panel/main.yuck +++ b/hypr-configs/hyprland/eww/src/control-panel/main.yuck @@ -27,7 +27,7 @@ :height 160 :halign "fill" (timer) - (bigslide)) + (bigslides)) (box :space-evenly false :orientation "v" @@ -356,7 +356,7 @@ (button :onclick "./scripts/timer.py toggle" (label :style "padding-right: 3px;" :text { !matches(timerdis, ":") ? "󱎫" : "󱫎"})) (button :onclick "./scripts/timer.py timeinc" (label :text "+"))))) -(defwidget bigslide [] +(defwidget bigslides [] (box :valign "fill" :halign "fill" @@ -364,6 +364,7 @@ :hexpand true :space-evenly true (bigvol) + (bigmic) (bigbright))) (defwidget bigvol [] @@ -372,7 +373,7 @@ :width 50 :class "bigslide" :value volume - :onchange "pamixer --set-volume {}" + :onchange "pactl set-sink-volume @DEFAULT_SINK@ {}%" :orientation "v" :tooltip "${volume}%" :max 100 @@ -383,6 +384,23 @@ :valign "end" :text {volumemute == 'false' ? "󰕾" : "󰖁"}))) +(defwidget bigmic [] + (overlay + (scale + :width 50 + :class "bigslide" + :value mic_volume + :onchange "pactl set-source-volume @DEFAULT_SOURCE@ {}%" + :orientation "v" + :tooltip "${mic_volume}%" + :max 100 + :min 0 + :flipped true) + (label + :class "slideicon" + :valign "end" + :text {volumemute == 'false' ? "" : "󰖁"}))) + (defwidget bigbright [] (overlay (scale diff --git a/hypr-configs/hyprland/eww/src/sidebar/main.yuck b/hypr-configs/hyprland/eww/src/sidebar/main.yuck index e40d357..bec5fe3 100644 --- a/hypr-configs/hyprland/eww/src/sidebar/main.yuck +++ b/hypr-configs/hyprland/eww/src/sidebar/main.yuck @@ -243,9 +243,7 @@ :orientation "v" :space-evenly false :class "sound" - (label :class "icon" :text {volumemute == 'false' ? "" : "󰖁"}) - ;; {volumemute == 'no' ? volume : " Muted"}) - ) + (label :class "icon" :text {volumemute == 'false' ? "" : "󰖁"})) (scale :class "volslide" :value mic_volume