fix
This commit is contained in:
72
hooks.py
Normal file
72
hooks.py
Normal file
@@ -0,0 +1,72 @@
|
||||
# _ _ _ _ _
|
||||
# __ _| |_(_) | ___ | |__ ___ ___ | | _____
|
||||
# / _` | __| | |/ _ \ | '_ \ / _ \ / _ \| |/ / __|
|
||||
# | (_| | |_| | | __/ | | | | (_) | (_) | <\__ \
|
||||
# \__, |\__|_|_|\___| |_| |_|\___/ \___/|_|\_\___/
|
||||
# |_|
|
||||
# by cerberus
|
||||
# --------------------------------------------------------------------
|
||||
|
||||
# --------------------------------------------------------------------
|
||||
# Imports
|
||||
# --------------------------------------------------------------------
|
||||
from libqtile import hook, qtile
|
||||
import subprocess
|
||||
import os.path
|
||||
from libqtile.config import Match
|
||||
import asyncio
|
||||
|
||||
# --------------------------------------------------------------------
|
||||
# HOOK startup
|
||||
# --------------------------------------------------------------------
|
||||
# Client management
|
||||
FULLSCREEN_RULES = [Match(wm_class="flameshot")]
|
||||
|
||||
|
||||
@hook.subscribe.startup_once
|
||||
def autostart():
|
||||
autostartscript = "~/.config/qtile/assets/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
|
||||
|
||||
|
||||
@hook.subscribe.client_new
|
||||
def tile_mpv(client):
|
||||
if client.name == "mpv" or "mpvk":
|
||||
client.floating = False
|
||||
|
||||
|
||||
# @hook.subscribe.client_new
|
||||
# def tile_mpv(client):
|
||||
# # wm_class gibt oft eine liste zurück, z.b. ['mpv', 'mpv']
|
||||
# if "mpv" in client.get_wm_class():
|
||||
# client.floating = false
|
||||
|
||||
|
||||
# @hook.subscribe.client_new
|
||||
# def tile_mpv(client):
|
||||
# if client.name == "mpv":
|
||||
# # Wartet 0.1 Sekunden, bevor das Floating deaktiviert wird
|
||||
# asyncio.create_task(set_tile(client))
|
||||
#
|
||||
#
|
||||
# async def set_tile(client):
|
||||
# await asyncio.sleep(0.1)
|
||||
# client.floating = False
|
||||
Reference in New Issue
Block a user