From 84420733bb21f15bb0d16f352d46a988fa71be01 Mon Sep 17 00:00:00 2001 From: The_miro Date: Wed, 8 Jul 2026 21:56:51 +0200 Subject: [PATCH] adjustments for astal+ewwbar --- desktopenvs/hyprlua/astal-menu/main.py | 41 ++++++++++++++++++++++++++ desktopenvs/hyprlua/eww-touch/eww.scss | 6 ++-- desktopenvs/hyprlua/eww-touch/eww.yuck | 4 +-- 3 files changed, 46 insertions(+), 5 deletions(-) diff --git a/desktopenvs/hyprlua/astal-menu/main.py b/desktopenvs/hyprlua/astal-menu/main.py index 3784951..4dfb146 100755 --- a/desktopenvs/hyprlua/astal-menu/main.py +++ b/desktopenvs/hyprlua/astal-menu/main.py @@ -53,8 +53,49 @@ class AstalMenuApp(Gtk.Application): settings = Settings() services = Services() self.window = MenuWindow(self, settings, services) + self._register_actions() self.hold() # stay alive with no visible window + def _register_actions(self) -> None: + # Mirrors the --show/--hide/--toggle/--appdrawer verbs from do_command_line, but + # reachable via org.gtk.Actions.Activate. menu-toggle.sh calls these directly with + # `gdbus call` for already-running instances, which skips spawning a whole second + # python3 + GTK process (~0.5s) just to forward one verb over D-Bus. + def add(name: str, callback, has_side: bool) -> None: + action = Gio.SimpleAction.new(name, GLib.VariantType.new("s") if has_side else None) + action.connect("activate", callback) + self.add_action(action) + + def side_of(param: GLib.Variant | None) -> str: + return param.get_string() if param is not None else "" + + def on_show(_action, param) -> None: + assert self.window is not None + if side_of(param): + self.window.set_side(side_of(param)) + self.window.show_menu() + + def on_hide(_action, _param) -> None: + assert self.window is not None + self.window.hide_menu() + + def on_toggle(_action, param) -> None: + assert self.window is not None + if side_of(param): + self.window.set_side(side_of(param)) + self.window.toggle() + + def on_appdrawer(_action, param) -> None: + assert self.window is not None + if side_of(param): + self.window.set_side(side_of(param)) + self.window.show_menu(focus_appdrawer=True) + + add("show", on_show, has_side=True) + add("hide", on_hide, has_side=False) + add("toggle", on_toggle, has_side=True) + add("appdrawer", on_appdrawer, has_side=True) + def do_command_line(self, cmdline: Gio.ApplicationCommandLine) -> int: args = list(cmdline.get_arguments()[1:]) # Optional "--side top|bottom|left|right": the menu slides in from and pins to diff --git a/desktopenvs/hyprlua/eww-touch/eww.scss b/desktopenvs/hyprlua/eww-touch/eww.scss index f581e3d..c7270ec 100644 --- a/desktopenvs/hyprlua/eww-touch/eww.scss +++ b/desktopenvs/hyprlua/eww-touch/eww.scss @@ -1,7 +1,7 @@ * { all: unset; // Unsets everything so you can style everything from scratch font-family: Agave Nerd Font Mono, sans-serif; - font-size: 13pt; + font-size: 20pt; } tooltip { @@ -72,8 +72,8 @@ tooltip { color: #5018dd; margin: 2px 3px; - min-width: 26px; - min-height: 26px; + min-width: 40px; + min-height: 40px; border-radius: 50%; } diff --git a/desktopenvs/hyprlua/eww-touch/eww.yuck b/desktopenvs/hyprlua/eww-touch/eww.yuck index c853fd3..1591e92 100644 --- a/desktopenvs/hyprlua/eww-touch/eww.yuck +++ b/desktopenvs/hyprlua/eww-touch/eww.yuck @@ -6,7 +6,7 @@ :geometry (geometry :x "0%" :y "1%" :width "99%" - :height "44px" + :height "60px" :anchor "top center") :exclusive true (bar :monitor_ monitor)) @@ -26,7 +26,7 @@ (box :orientation "h" :space-evenly false :halign "start" (osk) (box :class "music" {"${battery}"}) - (button :onclick "~/.config/scripts/menu-toggle.sh toggle top" :class "icon-btn" :valign "center" :width 26 :height 26 {""}) + (button :onclick "~/.config/scripts/menu-toggle.sh" :class "icon-btn" :valign "center" :width 26 :height 26 {""}) (metric :label "󰓃 " :value volume :onchange "pactl set-sink-volume @DEFAULT_SINK@ {}%"