Changes to hooks.

This commit is contained in:
Bartek Stalewski 2023-10-15 13:47:14 +02:00
parent 0b7d4b8c54
commit 3e224c15c7

View File

@ -1,6 +1,6 @@
import os
import subprocess
from libqtile import bar, extension, hook, layout
from libqtile import bar, extension, hook, layout, qtile
from libqtile.lazy import lazy
from libqtile.config import Click, Drag, DropDown, Group, Key, Match, ScratchPad, Screen
from libqtile.backend.wayland import InputConfig
@ -19,17 +19,16 @@ wl_input_rules = {
@hook.subscribe.startup_once
def autostart():
autostart = os.path.expanduser('~/.config/qtile/autostart.sh')
subprocess.Popen([autostart])
subprocess.run([autostart])
@hook.subscribe.shutdown
def autostop():
autostop = os.path.expanduser('~/.config/qtile/stop.sh')
subprocess.Popen([autostop])
subprocess.run([autostop])
@hook.subscribe.resume
def resume():
wallpaper = os.path.expanduser('~/.config/qtile/wallpaper.img')
subprocess.Popen(['swaylock', '--image', wallpaper])
@hook.subscribe.suspend
def suspend():
qtile.spawn("swaylock --image ~/.config/qtile/wallpaper.img")
mod = "mod4"
groups = [