first commit
This commit is contained in:
46
modules/hooks.py
Normal file
46
modules/hooks.py
Normal file
@@ -0,0 +1,46 @@
|
||||
# _ _ _ _ _
|
||||
# __ _| |_(_) | ___ | |__ ___ ___ | | _____
|
||||
# / _` | __| | |/ _ \ | '_ \ / _ \ / _ \| |/ / __|
|
||||
# | (_| | |_| | | __/ | | | | (_) | (_) | <\__ \
|
||||
# \__, |\__|_|_|\___| |_| |_|\___/ \___/|_|\_\___/
|
||||
# |_|
|
||||
# by cerberus
|
||||
# --------------------------------------------------------------------
|
||||
|
||||
# --------------------------------------------------------------------
|
||||
# Imports
|
||||
# --------------------------------------------------------------------
|
||||
from libqtile import hook, qtile
|
||||
import subprocess
|
||||
import os.path
|
||||
from libqtile.config import Match
|
||||
|
||||
# --------------------------------------------------------------------
|
||||
# HOOK startup
|
||||
# --------------------------------------------------------------------
|
||||
# Client management
|
||||
FULLSCREEN_RULES = [Match(wm_class="flameshot")]
|
||||
|
||||
|
||||
@hook.subscribe.startup_once
|
||||
def autostart():
|
||||
autostartscript = "~/.config/qtile/res/scripts/autostart.sh"
|
||||
home = os.path.expanduser(autostartscript)
|
||||
subprocess.Popen([home])
|
||||
|
||||
|
||||
@hook.subscribe.startup_complete
|
||||
def go_to_group1():
|
||||
qtile.focus_screen(0)
|
||||
qtile.groups_map["1"].toscreen()
|
||||
|
||||
|
||||
@hook.subscribe.client_managed
|
||||
def force_fullscreen(client) -> None:
|
||||
"""
|
||||
Some clients won't start fullscreen (exclusive to wayland)
|
||||
With this function we force clients defined in FULLSCREEN_RULES to enter fullscreen
|
||||
"""
|
||||
|
||||
if any(client.match(rule) for rule in FULLSCREEN_RULES):
|
||||
client.fullscreen = True
|
||||
Reference in New Issue
Block a user