From cdd3a10a5d357fdc29a58a1490ff493303cf4b59 Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Tue, 13 Dec 2022 21:02:19 +0100 Subject: [PATCH] Format the qtile config with black --- home-manager/configs/qtile/config.py | 181 ++++++++++++++------------- 1 file changed, 91 insertions(+), 90 deletions(-) diff --git a/home-manager/configs/qtile/config.py b/home-manager/configs/qtile/config.py index c40924f..0457e91 100644 --- a/home-manager/configs/qtile/config.py +++ b/home-manager/configs/qtile/config.py @@ -29,38 +29,30 @@ keys = [ Key([mod], "k", lazy.layout.up()), Key([mod], "h", lazy.layout.left()), Key([mod], "l", lazy.layout.right()), - Key([mod], "space", lazy.next_layout(), desc="Toggle between layouts"), - # Move windows around - Key([mod, "shift"], "j", - lazy.layout.shuffle_down(), - lazy.layout.move_down()), - Key([mod, "shift"], "k", - lazy.layout.shuffle_up(), - lazy.layout.move_up()), + Key([mod, "shift"], "j", lazy.layout.shuffle_down(), lazy.layout.move_down()), + Key([mod, "shift"], "k", lazy.layout.shuffle_up(), lazy.layout.move_up()), Key([mod, "shift"], "h", lazy.layout.shuffle_left()), Key([mod, "shift"], "l", lazy.layout.shuffle_right()), Key([mod, "shift"], "q", lazy.window.kill()), - Key([mod, "shift"], "space", add_treetab_section), - Key([mod, "shift"], "Return", + Key( + [mod, "shift"], + "Return", lazy.layout.toggle_split(), - desc="Toggle between split and unsplit sides of stack"), - + desc="Toggle between split and unsplit sides of stack", + ), # Resize windows Key([mod, "control"], "j", lazy.layout.grow_down()), Key([mod, "control"], "k", lazy.layout.grow_up()), Key([mod, "control"], "h", lazy.layout.grow_left()), Key([mod, "control"], "l", lazy.layout.grow_right()), - Key([mod, "control"], "q", lazy.shutdown(), desc="Shutdown qtile"), Key([mod, "control"], "r", lazy.restart(), desc="Restart qtile"), - # Move windows between sections Key([mod, "control", "shift"], "j", lazy.layout.section_down()), Key([mod, "control", "shift"], "k", lazy.layout.section_up()), - Key([mod], "Return", lazy.spawn(terminal), desc="Launch terminal"), Key([mod], "c", lazy.spawn("i3lock -c 000000")), Key([mod], "d", lazy.spawn("rofi -show drun")), @@ -123,27 +115,29 @@ def toscreen(qtile, group_name): groups = [Group(name=i, matches=group_matches[int(i)]) for i in "1234567890"] for i in groups: - keys.extend([ - # mod1 + letter of group = switch to group - Key( - [mod], - i.name, - lazy.function(toscreen, i.name), - desc="Switch to group {}".format(i.name), - ), - # mod1 + shift + letter of group = switch to & move focused window to - # group Key([mod, "shift"], i.name, lazy.window.togroup(i.name, - # switch_group=True), desc="Switch to & move focused window to group - # {}".format(i.name)), Or, use below if you prefer not to switch to - # that group. # mod1 + shift + letter of group = move focused window to - # group - Key( - [mod, "shift"], - i.name, - lazy.window.togroup(i.name), - desc="move focused window to group {}".format(i.name), - ), - ]) + keys.extend( + [ + # mod1 + letter of group = switch to group + Key( + [mod], + i.name, + lazy.function(toscreen, i.name), + desc="Switch to group {}".format(i.name), + ), + # mod1 + shift + letter of group = switch to & move focused window to + # group Key([mod, "shift"], i.name, lazy.window.togroup(i.name, + # switch_group=True), desc="Switch to & move focused window to group + # {}".format(i.name)), Or, use below if you prefer not to switch to + # that group. # mod1 + shift + letter of group = move focused window to + # group + Key( + [mod, "shift"], + i.name, + lazy.window.togroup(i.name), + desc="move focused window to group {}".format(i.name), + ), + ] + ) border = dict(border_width=1, border_focus="#000000") @@ -198,38 +192,44 @@ def top_bar_widgets(): screens = [ - Screen(top=bar.Bar( - top_bar_widgets(), - 24, - ), ), - Screen(top=bar.Bar( - [ - widget.GroupBox(), - widget.Sep(padding=5), - widget.WindowName(), - widget.Sep(padding=5), - widget.CurrentLayout(), - widget.Sep(padding=5), - widget.Volume(), - widget.Sep(padding=5), - widget.Clock(format="%Y-%m-%d %a %H:%M"), - ], - 24, - ), ), - Screen(top=bar.Bar( - [ - widget.GroupBox(), - widget.Sep(padding=5), - widget.WindowName(), - widget.Sep(padding=5), - widget.CurrentLayout(), - widget.Sep(padding=5), - widget.Volume(), - widget.Sep(padding=5), - widget.Clock(format="%Y-%m-%d %a %H:%M"), - ], - 24, - ), ), + Screen( + top=bar.Bar( + top_bar_widgets(), + 24, + ), + ), + Screen( + top=bar.Bar( + [ + widget.GroupBox(), + widget.Sep(padding=5), + widget.WindowName(), + widget.Sep(padding=5), + widget.CurrentLayout(), + widget.Sep(padding=5), + widget.Volume(), + widget.Sep(padding=5), + widget.Clock(format="%Y-%m-%d %a %H:%M"), + ], + 24, + ), + ), + Screen( + top=bar.Bar( + [ + widget.GroupBox(), + widget.Sep(padding=5), + widget.WindowName(), + widget.Sep(padding=5), + widget.CurrentLayout(), + widget.Sep(padding=5), + widget.Volume(), + widget.Sep(padding=5), + widget.Clock(format="%Y-%m-%d %a %H:%M"), + ], + 24, + ), + ), ] # Drag floating layouts. @@ -240,10 +240,9 @@ mouse = [ lazy.window.set_position_floating(), start=lazy.window.get_position(), ), - Drag([mod], - "Button3", - lazy.window.set_size_floating(), - start=lazy.window.get_size()), + Drag( + [mod], "Button3", lazy.window.set_size_floating(), start=lazy.window.get_size() + ), Click([mod], "Button2", lazy.window.toggle_floating()), ] @@ -263,24 +262,26 @@ def autostart(): subprocess.run([home]) -floating_layout = layout.Floating(float_rules=[ - # Run the utility of `xprop` to see the wm class and name of an X client. - *layout.Floating.default_float_rules, - Match(wm_class="confirm"), - Match(wm_class="dialog"), - Match(wm_class="download"), - Match(wm_class="error"), - Match(wm_class="file_progress"), - Match(wm_class="notification"), - Match(wm_class="splash"), - Match(wm_class="toolbar"), - Match(wm_class="confirmreset"), # gitk - Match(wm_class="makebranch"), # gitk - Match(wm_class="maketag"), # gitk - Match(title="branchdialog"), # gitk - Match(title="pinentry"), # GPG key password entry - Match(wm_class="ssh-askpass"), # ssh-askpass -]) +floating_layout = layout.Floating( + float_rules=[ + # Run the utility of `xprop` to see the wm class and name of an X client. + *layout.Floating.default_float_rules, + Match(wm_class="confirm"), + Match(wm_class="dialog"), + Match(wm_class="download"), + Match(wm_class="error"), + Match(wm_class="file_progress"), + Match(wm_class="notification"), + Match(wm_class="splash"), + Match(wm_class="toolbar"), + Match(wm_class="confirmreset"), # gitk + Match(wm_class="makebranch"), # gitk + Match(wm_class="maketag"), # gitk + Match(title="branchdialog"), # gitk + Match(title="pinentry"), # GPG key password entry + Match(wm_class="ssh-askpass"), # ssh-askpass + ] +) # XXX: Gasp! We're lying here. In fact, nobody really uses or cares about this # string besides java UI toolkits; you can see several discussions on the