From 191ec9c3b71294d1b15993529ceda9d3f7a4a4ab Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Fri, 11 Aug 2023 00:19:32 -0400 Subject: [PATCH] infinidoge/qtile: make calculator and arandr scratchpad windows --- users/infinidoge/config/qtile/config.py | 57 ++++++++++++++++++++----- 1 file changed, 46 insertions(+), 11 deletions(-) diff --git a/users/infinidoge/config/qtile/config.py b/users/infinidoge/config/qtile/config.py index 94435bd..cd4e23c 100644 --- a/users/infinidoge/config/qtile/config.py +++ b/users/infinidoge/config/qtile/config.py @@ -11,7 +11,17 @@ import os from typing import List, Any # noqa: F401 from libqtile import bar, layout, widget, hook -from libqtile.config import Click, Drag, Group, Key, KeyChord, Match, Screen +from libqtile.config import ( + Click, + Drag, + DropDown, + Group, + Key, + KeyChord, + Match, + ScratchPad, + Screen, +) from libqtile.lazy import lazy from libqtile.utils import guess_terminal @@ -401,21 +411,21 @@ keys = [ lazy.spawn("discordcanary"), desc="Launch Discord", ), - Key( - [Keys.SUPER, Keys.ALT], "c", - lazy.spawn("speedcrunch"), - desc="Launch Speedcrunch", - ), + # Key( + # [Keys.SUPER, Keys.ALT], "c", + # lazy.spawn("speedcrunch"), + # desc="Launch Speedcrunch", + # ), Key( [Keys.SUPER, Keys.ALT], "s", lazy.spawn("flameshot gui"), desc="Launch screenshot tool", ), - Key( - [Keys.SUPER, Keys.ALT], "m", - lazy.spawn("arandr"), - desc="Launch arandr", - ), + # Key( + # [Keys.SUPER, Keys.ALT], "m", + # lazy.spawn("arandr"), + # desc="Launch arandr", + # ), ] # fmt: on @@ -448,6 +458,31 @@ for i in groups: ] ) +groups.append( + ScratchPad( + "scratchpad", + [ + DropDown("calculator", "speedcrunch", x=0.2, y=0.2, width=0.6, height=0.6), # type: ignore + DropDown("arandr", "arandr", x=0.3, y=0.1, width=0.6, height=0.4), # type: ignore + ], + ) +) + +# fmt: off +keys.extend( + [ + Key( + [Keys.SUPER, Keys.ALT], "c", + lazy.group["scratchpad"].dropdown_toggle("calculator"), + ), + Key( + [Keys.SUPER, Keys.ALT], "m", + lazy.group["scratchpad"].dropdown_toggle("arandr"), + ), + ] +) +# fmt: on + layouts = [ layout.Columns(border_focus_stack="#d75f5f"), layout.Max(),