infinidoge/qtile: make calculator and arandr scratchpad windows

This commit is contained in:
Infinidoge 2023-08-11 00:19:32 -04:00
parent bfae938917
commit 191ec9c3b7

View file

@ -11,7 +11,17 @@ import os
from typing import List, Any # noqa: F401 from typing import List, Any # noqa: F401
from libqtile import bar, layout, widget, hook 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.lazy import lazy
from libqtile.utils import guess_terminal from libqtile.utils import guess_terminal
@ -401,21 +411,21 @@ keys = [
lazy.spawn("discordcanary"), lazy.spawn("discordcanary"),
desc="Launch Discord", desc="Launch Discord",
), ),
Key( # Key(
[Keys.SUPER, Keys.ALT], "c", # [Keys.SUPER, Keys.ALT], "c",
lazy.spawn("speedcrunch"), # lazy.spawn("speedcrunch"),
desc="Launch Speedcrunch", # desc="Launch Speedcrunch",
), # ),
Key( Key(
[Keys.SUPER, Keys.ALT], "s", [Keys.SUPER, Keys.ALT], "s",
lazy.spawn("flameshot gui"), lazy.spawn("flameshot gui"),
desc="Launch screenshot tool", desc="Launch screenshot tool",
), ),
Key( # Key(
[Keys.SUPER, Keys.ALT], "m", # [Keys.SUPER, Keys.ALT], "m",
lazy.spawn("arandr"), # lazy.spawn("arandr"),
desc="Launch arandr", # desc="Launch arandr",
), # ),
] ]
# fmt: on # 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 = [ layouts = [
layout.Columns(border_focus_stack="#d75f5f"), layout.Columns(border_focus_stack="#d75f5f"),
layout.Max(), layout.Max(),