From 51ff8ce10ee74f1c2842705527cd2064e619662a Mon Sep 17 00:00:00 2001 From: Sigmanificient Date: Sat, 21 Oct 2023 17:46:04 +0200 Subject: [PATCH] Add a scratchpad for discord --- home/qtile/src/core/groups.py | 26 ++++++++++++++++++++++---- home/qtile/src/core/layouts.py | 3 +++ 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/home/qtile/src/core/groups.py b/home/qtile/src/core/groups.py index f9f7ff1..22d20b1 100644 --- a/home/qtile/src/core/groups.py +++ b/home/qtile/src/core/groups.py @@ -1,4 +1,6 @@ -from libqtile.config import DropDown, Group, Key, ScratchPad +import re + +from libqtile.config import DropDown, Group, Key, ScratchPad, Match from libqtile.lazy import lazy from .keys import keys, mod @@ -20,12 +22,17 @@ def setup_keys(self): lazy.window.togroup(self.name, switch_group=True), ) - toggle_scratchpad = Key( + toggle_term = Key( [mod, "shift"], "space", lazy.group["scratchpad"].dropdown_toggle("term"), ) - keys.extend((move, switch, toggle_scratchpad)) + toggle_discord = Key( + [mod, "shift"], "d", + lazy.group["scratchpad"].dropdown_toggle("discord"), + ) + + keys.extend((move, switch, toggle_term, toggle_discord)) _scratchpads = [ @@ -40,8 +47,19 @@ def setup_keys(self): height=0.9, width=0.9, on_focus_lost_hide=False, + ), + DropDown( + "discord", + "discord", + x=0.05, + y=0.05, + opacity=0.95, + height=0.9, + width=0.9, + on_focus_lost_hide=False, + match=Match(title=re.compile(".*(d|D)iscord.*")) ) - ], + ] ) ] diff --git a/home/qtile/src/core/layouts.py b/home/qtile/src/core/layouts.py index 9b89df4..d1ebe3b 100644 --- a/home/qtile/src/core/layouts.py +++ b/home/qtile/src/core/layouts.py @@ -1,3 +1,5 @@ +import re + from libqtile.layout.columns import Columns from libqtile.layout.floating import Floating from libqtile.config import Match @@ -27,6 +29,7 @@ Match(title="branchdialog"), # gitk Match(title="pinentry"), # GPG key password entry Match(title="splash"), # .Idea loader + Match(title=re.compile(".*(d|D)iscord.*")), # Discord Match(title="kitty"), ], )