Files
dotfiles/qtile/modules/hooks.py
2025-08-17 11:53:12 +02:00

32 lines
780 B
Python

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