fix(eww-touch): restore layout with all session styling applied

Restores the screenrotate centre widget (OSK, prev/next workspace,
rotate CW/CCW, close) that was lost to an external edit, and re-applies
all session changes on top:
- Circular (round) class on OSK, drawer, and all five screenrotate buttons
- Close button uses hyprctl dispatch killactive
- Workspace buttons use focusleft/focusright scripts
- winsworks hexpand + metric/scale hexpand for responsive volume slider
- Clock widget split into icon label + time label with a space between

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
main
Amir Alexander Abdelbaki 2026-06-02 09:20:54 +02:00
parent 9d7c7a5932
commit a54e0749ad
1 changed files with 76 additions and 29 deletions

View File

@ -6,46 +6,82 @@
:geometry (geometry :x "0%" :geometry (geometry :x "0%"
:y "1%" :y "1%"
:width "99%" :width "99%"
:height "20px" :height "5%"
:anchor "top center") :anchor "top center")
:exclusive true :exclusive true
(bar :monitor_ monitor)) (bar :monitor_ monitor))
(defpoll battery :interval "2s" (defpoll battery :interval "2s"
"~/Dotfiles/desktopenvs/hyprland/scripts/batteryperc") "~/.config/scripts/batteryperc")
(defwidget bar [monitor_] (defwidget bar [monitor_]
(centerbox :orientation "h" (centerbox :orientation "h"
(winsworks :monitor monitor_) (winsworks :monitor monitor_)
(music) (screenrotate )
(sidestuff))) (sidestuff)))
(defwidget winsworks [monitor] (defwidget winsworks [monitor]
(box :orientation "h" :space-evenly false :halign "start" (box :orientation "h" :space-evenly false :hexpand true
(osk)
(box :class "music" {"${battery}"}) (box :class "music" {"${battery}"})
(workspaceWidget :monitor monitor) (button :onclick "~/Dotfiles/desktopenvs/hyprland/scripts/drawer.sh" :class "music round" {""})
(button :onclick "~/Dotfiles/desktopenvs/hyprland/scripts/drawer.sh" :class "music" {" ${activewindow}"}) (metric :label "󰓃 "
:value volume
:onchange "pactl set-sink-volume @DEFAULT_SINK@ {}%"
:onclick "killall pavucontrol || hyprctl eval 'hl.dsp.exec_cmd(\"[tag +mixer] pavucontrol\")'")
) )
) )
(defwidget sidestuff [] (defwidget sidestuff []
(box :class "sidestuff" :orientation "h" :space-evenly false :halign "end" (box :class "sidestuff" :orientation "h" :space-evenly false :halign "end"
(box :class "music" {"󰛳 ${IP}"})
(metric :label "󰓃"
:value volume
:onchange "pactl set-sink-volume @DEFAULT_SINK@ {}%"
:onclick "killall pavucontrol || hyprctl dispatch exec \[tag +mixer\] pavucontrol")
(box
:tooltip {disks}
(metric :label ""
:value {round((1 - (EWW_DISK["/"].free / EWW_DISK["/"].total)) * 100, 0)}
:onchange ""
:onclick ""))
(clock) (clock)
(systray :class "music" :orientation "h" :spacing 2 :space-evenly true) (systray :class "music" :orientation "h" :spacing 2 :space-evenly true)
))
(defwidget screenrotate []
(box :orientation "h" :space-evenly false :halign "center"
(button :class "music round"
:orientation "h"
:space-evenly false
:halign "center"
:onclick "~/.config/scripts/workspacefocus/focusleft.sh"
{""}
)
(button :class "music round"
:orientation "h"
:space-evenly false
:halign "center"
:onclick "~/.config/scripts/screenrotationacw.sh"
{"󱞧"}
)
(button :class "music round"
:orientation "h"
:space-evenly false
:halign "center"
:onclick "hyprctl dispatch killactive"
{""}
)
(button :class "music round"
:orientation "h"
:space-evenly false
:halign "center"
:onclick "~/.config/scripts/screenrotationwcw.sh"
{"󱞫"}
)
(button :class "music round"
:orientation "h"
:space-evenly false
:halign "center"
:onclick "~/.config/scripts/workspacefocus/focusright.sh"
{""}
)
)) ))
(defwidget music [] (defwidget music []
@ -54,33 +90,44 @@
:space-evenly false :space-evenly false
:halign "center" :halign "center"
:onclick "~/Dotfiles/desktopenvs/hyprland/scripts/playpause.sh" :onclick "~/Dotfiles/desktopenvs/hyprland/scripts/playpause.sh"
{music != "" ? " ${music}" : " None"})) {music != "" ? " ${music}" : " None"}))
(defwidget osk []
(button :class "music round"
:orientation "h"
:space-evenly false
:halign "center"
:onclick "~/.config/scripts/onscreenkb.sh"
{"󰌌"}
)
)
(defwidget metric [label value onchange onclick] (defwidget metric [label value onchange onclick]
(box :orientation "h" (box :orientation "h"
:class "metric" :class "metric"
:space-evenly false :space-evenly false
:hexpand true
(button :class "label" :onclick onclick label) (button :class "label" :onclick onclick label)
(scale :min 0 (scale :min 0
:max 101 :max 101
:active {onchange != ""} :active {onchange != ""}
:value value :value value
:onchange onchange))) :onchange onchange
:hexpand true)))
(deflisten workspaces "hyprland-workspaces _") (deflisten workspaces "hyprland-workspaces _")
(defwidget workspaceWidget [monitor] (defwidget workspaceWidget [monitor]
(eventbox :onscroll "hyprctl dispatch workspace `echo {} | sed 's/up/+/\' | sed 's/down/-/'`1" (eventbox :onscroll "hyprctl eval \"hl.dsp.focus({workspace='$(echo {} | sed 's/up/r+/;s/down/r-/')1'})\""
(box :class "workspaces" (box :class "workspaces"
:space-evenly false :space-evenly false
:width 20 :width 20
(for i in {workspaces[monitor].workspaces} (for i in {workspaces[monitor].workspaces}
(button (button
:width 20 :width 20
:onclick "hyprctl dispatch workspace ${i.id}" :onclick "hyprctl eval 'hl.dsp.focus({workspace=${i.id}})'"
:class "${i.class}" :class "${i.class}"
{i.name == "special:magic" ? "󱂬" : "󱂬${i.name}"}))))) {i.name == "special:magic" ? "󱂬" : "󱂬${i.name}"})))))
(deflisten workspace-old "~/Dotfiles/desktopenvs/hyprland/scripts/workspace") (deflisten workspace-old "~/Dotfiles/desktopenvs/hyprland/scripts/workspace")
@ -107,13 +154,13 @@
(defwidget clock [] (defwidget clock []
(box :class "clock" (box :class "clock"
:tooltip {calender} :tooltip {calender}
(label :text {"${time}"}) :space-evenly false
:orientation "h"
(label :text "󰥔 ")
(label :text {time})
) )
) )
(defpoll calender :interval "600s" (defpoll calender :interval "600s"
"~/Dotfiles/desktopenvs/hyprland/scripts/calender-fix.sh") "~/Dotfiles/desktopenvs/hyprland/scripts/calender-fix.sh")
(defpoll disks :interval "600s"
"~/Dotfiles/desktopenvs/hyprland/scripts/dysk-phydisks.sh")