diff --git a/home/qtile/src/core/bar.py b/home/qtile/src/core/bar.py index 5a7d740..aecf5dd 100644 --- a/home/qtile/src/core/bar.py +++ b/home/qtile/src/core/bar.py @@ -40,16 +40,13 @@ def __init__(self, id_): widgets=self._build_widgets(), size=24, background=Color.BG_DARK, - margin=[0, 0, 8, 0], + margin=[0, 0, 8, 0] ) def _build_widgets(self): - widgets_copy = [ - widget_builder() - for widget_builder in self._widgets] + widgets_copy = [widget_cls() for widget_cls in self._widgets] if self.id == 0: widgets_copy.insert(13, Systray()) - return widgets_copy diff --git a/home/qtile/src/core/groups.py b/home/qtile/src/core/groups.py index 64fc531..945dcfd 100644 --- a/home/qtile/src/core/groups.py +++ b/home/qtile/src/core/groups.py @@ -1,6 +1,4 @@ -import re - -from libqtile.config import DropDown, Group, Key, ScratchPad, Match +from libqtile.config import DropDown, Group, Key, ScratchPad from libqtile.lazy import lazy from .keys import keys, mod @@ -33,38 +31,21 @@ def setup_keys(self): keys.extend((move, switch)) +_scratchpad_defaults = dict( + x=0.05, + y=0.05, + opacity=0.95, + height=0.9, + width=0.9, + on_focus_lost_hide=False +) _scratchpads = [ ScratchPad( - "scratchpad", [ - DropDown( - "term", - "kitty", - x=0.05, - y=0.05, - opacity=0.95, - 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.*")) - ) - ] + "scratchpad", + [DropDown("term", "kitty", **_scratchpad_defaults)] ) ] _Group.setup_single_keys() -groups = _scratchpads + [ - _Group(lb, k) for lb, k in zip( - "ζπδωλσς", "1234567" - ) -] +groups = _scratchpads + [_Group(lb, k) for lb, k in zip("ζπδωλσς", "1234567")] diff --git a/home/qtile/src/core/keys.py b/home/qtile/src/core/keys.py index 17370b0..6d33fe1 100644 --- a/home/qtile/src/core/keys.py +++ b/home/qtile/src/core/keys.py @@ -12,7 +12,6 @@ def _toggle(*args, **kwargs): def wrapper(func): state: bool = False - def wrapped(_): nonlocal state diff --git a/home/qtile/src/core/layouts.py b/home/qtile/src/core/layouts.py index 9b89df4..a850458 100644 --- a/home/qtile/src/core/layouts.py +++ b/home/qtile/src/core/layouts.py @@ -9,8 +9,7 @@ border_width=2, margin=4, border_focus=Color.BLUE_DARK, - border_normal=Color.BG_DARK, - ) + border_normal=Color.BG_DARK) ] floating_layout = Floating( @@ -19,14 +18,10 @@ border_normal=Color.BG_DARK, float_rules=[ *Floating.default_float_rules, - Match(wm_class="pavucontrol"), # gitk - Match(wm_class="confirmreset"), # gitk - Match(wm_class="makebranch"), # gitk - Match(wm_class="maketag"), # gitk - Match(wm_class="ssh-askpass"), # ssh-askpass - Match(title="branchdialog"), # gitk - Match(title="pinentry"), # GPG key password entry - Match(title="splash"), # .Idea loader + Match(wm_class="pavucontrol"), + Match(wm_class="confirmreset"), + Match(wm_class="ssh-askpass"), + Match(title="pinentry"), Match(title="kitty"), ], ) diff --git a/home/qtile/src/core/mouse.py b/home/qtile/src/core/mouse.py index 86ea583..2227470 100644 --- a/home/qtile/src/core/mouse.py +++ b/home/qtile/src/core/mouse.py @@ -8,13 +8,11 @@ [mod], "Button1", lazy.window.set_position_floating(), - start=lazy.window.get_position(), - ), + start=lazy.window.get_position()), Drag( [mod], "Button3", lazy.window.set_size_floating(), - start=lazy.window.get_size(), - ), + start=lazy.window.get_size()), Click([mod], "Button2", lazy.window.bring_to_front()), ] diff --git a/home/qtile/src/core/screens.py b/home/qtile/src/core/screens.py index 2ce08a4..11da501 100644 --- a/home/qtile/src/core/screens.py +++ b/home/qtile/src/core/screens.py @@ -1,4 +1,3 @@ -import pathlib import os from libqtile.bar import Gap @@ -6,23 +5,10 @@ from core.bar import Bar -gap = Gap(4) +_gap = Gap(4) +_screen_attr = dict( + bottom=_gap, left=_gap, right=_gap, + wallpaper=os.path.expanduser("~/assets/wallpaper.png"), + wallpaper_mode="fill") -_cwd = pathlib.Path(os.path.dirname(os.path.realpath(__file__))) - -wallpaper_path = os.path.expanduser("~/assets/wallpaper.png") - -if not os.path.exists(wallpaper_path): - wallpaper_path = str((_cwd / ".." / ".." / "wallpaper.png").absolute()) - -screens = [ - Screen( - top=Bar(i), - bottom=gap, - left=gap, - right=gap, - wallpaper=wallpaper_path, - wallpaper_mode="fill", - ) - for i in range(2) -] +screens = [Screen(top=Bar(i), **_screen_attr) for i in range(2)]