From aa46a5b7e24b292a278415a49e598f880418cd29 Mon Sep 17 00:00:00 2001 From: cerberus Date: Sun, 17 Aug 2025 11:53:12 +0200 Subject: [PATCH] added hooks --- qtile/modules/hooks.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/qtile/modules/hooks.py b/qtile/modules/hooks.py index e69de29..57d0023 100644 --- a/qtile/modules/hooks.py +++ b/qtile/modules/hooks.py @@ -0,0 +1,31 @@ +import os.path +import subprocess +from libqtile import hook, qtile +from libqtile.config import Match + + +# Autostart +@hook.subscribe.startup_once +def autostart(): + script = "~/.config/qtile/assets/scripts/autostart.sh" + home = os.path.expanduser(script) + subprocess.Popen([home]) + + +@hook.subscribe.startup_complete +def go_to_group_1(): + qtile.focus_screen(0) + qtile.groups_map["1"].toscreen() + + +""" + Some clients won't start fullscreen (exclusive to wayland) + With this function we force clients defined in FULLSCREEN_RULES to enter fullscreen +""" +FULLSCREEN_RULES = [Match(wm_class="flameshot")] + + +@hook.subscribe.client_managed +def force_fullscreen(client) -> None: + if any(client.match(rule) for rule in FULLSCREEN_RULES): + client.fullscreen = True