refactor: control panel slides

This commit is contained in:
hesam-init 2024-06-28 21:47:14 +03:30
parent f821a3d37b
commit 5a593d3ea1
4 changed files with 24 additions and 8 deletions

View file

@ -60,12 +60,12 @@
"notifications": [], "notifications": [],
"popups": [] "popups": []
}' }'
"./scripts/notifCatch" "./scripts/notif.py"
) )
; Playerctl ; Playerctl
(defpoll pstatus :initial "" :interval "1s" "playerctl status") (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 }}'") (defpoll partist :initial "" :interval "1s" "playerctl metadata --format '{{ artist }}'")
(deflisten pcover "./scripts/pollcover.sh") (deflisten pcover "./scripts/pollcover.sh")
(deflisten ptime (deflisten ptime

View file

@ -27,7 +27,7 @@
:height 160 :height 160
:halign "fill" :halign "fill"
(timer) (timer)
(bigslide)) (bigslides))
(box (box
:space-evenly false :space-evenly false
:orientation "v" :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 toggle" (label :style "padding-right: 3px;" :text { !matches(timerdis, ":") ? "󱎫" : "󱫎"}))
(button :onclick "./scripts/timer.py timeinc" (label :text "+"))))) (button :onclick "./scripts/timer.py timeinc" (label :text "+")))))
(defwidget bigslide [] (defwidget bigslides []
(box (box
:valign "fill" :valign "fill"
:halign "fill" :halign "fill"
@ -364,6 +364,7 @@
:hexpand true :hexpand true
:space-evenly true :space-evenly true
(bigvol) (bigvol)
(bigmic)
(bigbright))) (bigbright)))
(defwidget bigvol [] (defwidget bigvol []
@ -372,7 +373,7 @@
:width 50 :width 50
:class "bigslide" :class "bigslide"
:value volume :value volume
:onchange "pamixer --set-volume {}" :onchange "pactl set-sink-volume @DEFAULT_SINK@ {}%"
:orientation "v" :orientation "v"
:tooltip "${volume}%" :tooltip "${volume}%"
:max 100 :max 100
@ -383,6 +384,23 @@
:valign "end" :valign "end"
:text {volumemute == 'false' ? "󰕾" : "󰖁"}))) :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 [] (defwidget bigbright []
(overlay (overlay
(scale (scale

View file

@ -243,9 +243,7 @@
:orientation "v" :orientation "v"
:space-evenly false :space-evenly false
:class "sound" :class "sound"
(label :class "icon" :text {volumemute == 'false' ? "" : "󰖁"}) (label :class "icon" :text {volumemute == 'false' ? "" : "󰖁"}))
;; {volumemute == 'no' ? volume : " Muted"})
)
(scale (scale
:class "volslide" :class "volslide"
:value mic_volume :value mic_volume