Reformat qtile config with black

This commit is contained in:
Şahin Akkaya 2022-03-20 20:01:58 +03:00
parent ed4235db43
commit 03e6b3a4d5
6 changed files with 203 additions and 196 deletions

View File

@ -1,10 +1,10 @@
from modules.keys import keys, mod
from modules.groups import groups from modules.groups import groups
from modules.layouts import layouts, floating_layout from modules.keys import keys, mod
from modules.layouts import floating_layout, layouts
from modules.mouse import mouse from modules.mouse import mouse
from modules.hooks import * from modules.hooks import *
import os
from modules.screens import screens from modules.screens import screens
dgroups_key_binder = None dgroups_key_binder = None
dgroups_app_rules = [] # type: List dgroups_app_rules = [] # type: List
main = None # WARNING: this is deprecated and will be removed soon main = None # WARNING: this is deprecated and will be removed soon
@ -15,7 +15,5 @@ auto_fullscreen = True
focus_on_window_activation = "urgent" focus_on_window_activation = "urgent"
wmname = "LG3D" wmname = "LG3D"
widget_defaults = dict( widget_defaults = dict(
font='Cascadia Code', font="Cascadia Code", fontsize=16, padding=12, foreground="CEC8C6"
fontsize=13,
padding=3
) )

View File

@ -5,38 +5,48 @@ from .keys import keys, mod
groups = [Group(i) for i in "1234567890"] groups = [Group(i) for i in "1234567890"]
browsers = [ browsers = [Match(wm_class="firefox"), Match(wm_class="Google-chrome")]
Match(wm_class="firefox"),
Match(wm_class="Google-chrome")]
file_managers = [Match(wm_class="Thunar")] file_managers = [Match(wm_class="Thunar")]
video_players = [ video_players = [Match(wm_class="streamlink-twitch-gui"), Match(wm_class="mpv")]
Match(wm_class="streamlink-twitch-gui"),
Match(wm_class="mpv")]
groups = [ groups = [
Group('1'), Group("1"),
Group('2', matches=[Match(wm_class="VirtualBox Manager")]), Group("2", matches=[Match(wm_class="VirtualBox Manager")]),
Group('3', matches=[Match(wm_class="Thunderbird")]), Group("3", matches=[Match(wm_class="Thunderbird")]),
Group('4', matches=[Match(wm_class="st-256color")]), Group("4", matches=[Match(wm_class="st-256color")]),
Group('5', matches=file_managers), Group("5", matches=file_managers),
Group('6'), Group("6"),
Group('7', matches=browsers), Group("7", matches=browsers),
Group('8', matches=video_players), Group("8", matches=video_players),
Group('9'), Group("9"),
Group('0', matches=[Match(wm_class="TelegramDesktop")]), Group("0", matches=[Match(wm_class="TelegramDesktop")]),
] ]
groups.append(ScratchPad("scratchpad", [ groups.append(
# define a drop down terminal. ScratchPad(
# it is placed in the upper third of screen by default. "scratchpad",
DropDown("term", "st", opacity=1.0) [
])) # define a drop down terminal.
# it is placed in the upper third of screen by default.
DropDown("term", "st", opacity=1.0)
],
)
)
symbols = 'arstgmneio' symbols = "arstgmneio"
for i, j in zip(groups, symbols): for i, j in zip(groups, symbols):
keys.extend([ keys.extend(
Key([mod], j, lazy.group[i.name].toscreen(), [
desc="Switch to group {}".format(i.name)), Key(
[mod],
Key([mod, "shift"], j, lazy.window.togroup(i.name, switch_group=True), j,
desc="Switch to & move focused window to group {}".format(i.name)), lazy.group[i.name].toscreen(),
]) desc="Switch to group {}".format(i.name),
),
Key(
[mod, "shift"],
j,
lazy.window.togroup(i.name, switch_group=True),
desc="Switch to & move focused window to group {}".format(i.name),
),
]
)

View File

@ -6,13 +6,13 @@ from libqtile.command.client import InteractiveCommandClient
@hook.subscribe.startup @hook.subscribe.startup
def autostart(): def autostart():
subprocess.call(['autostart.sh']) subprocess.call(["autostart.sh"])
@hook.subscribe.startup_complete @hook.subscribe.startup_complete
def focus_group(): def focus_group():
c = InteractiveCommandClient() c = InteractiveCommandClient()
c.group['4'].toscreen() c.group["4"].toscreen()
@hook.subscribe.client_managed @hook.subscribe.client_managed

View File

@ -9,140 +9,132 @@ terminal = "st"
home = os.path.expanduser home = os.path.expanduser
keys = [ keys = [
# '`': 'grave', # '`': 'grave',
# '-': 'minus', # '-': 'minus',
# '=': 'equal', # '=': 'equal',
# '[': 'bracketleft', # '[': 'bracketleft',
# ']': 'bracketright', # ']': 'bracketright',
# '\\': 'backslash', # '\\': 'backslash',
# ';': 'semicolon', # ';': 'semicolon',
# '\'': 'quote', # '\'': 'quote',
# ',': 'comma', # ',': 'comma',
# '.': 'dot', # '.': 'dot',
Key([mod], "h", lazy.layout.left(), desc="Move focus to left"), Key([mod], "h", lazy.layout.left(), desc="Move focus to left"),
Key([mod], "l", lazy.layout.right(), desc="Move focus to right"), Key([mod], "l", lazy.layout.right(), desc="Move focus to right"),
Key([mod], "j", lazy.layout.down(), desc="Move focus down"), Key([mod], "j", lazy.layout.down(), desc="Move focus down"),
Key([mod], "k", lazy.layout.up(), desc="Move focus up"), Key([mod], "k", lazy.layout.up(), desc="Move focus up"),
Key(
Key([mod], "Tab", lazy.screen.toggle_group(), [mod],
desc="Toggle back and forth between latest groups"), "Tab",
Key([mod], "d", lazy.spawn("rofi -show combi"), desc="spawn rofi"), lazy.screen.toggle_group(),
desc="Toggle back and forth between latest groups",
# Move windows between left/right columns or move up/down in current ),
# stack. Moving out of range in Columns layout will create new column. Key([mod], "d", lazy.spawn("rofi -show combi"), desc="spawn rofi"),
Key([mod, "shift"], "h", # Move windows between left/right columns or move up/down in current
lazy.layout.shuffle_left(), desc="Move window to the left"), # stack. Moving out of range in Columns layout will create new column.
Key([mod, "shift"], "l", Key(
lazy.layout.shuffle_right(), desc="Move window to the right"), [mod, "shift"], "h", lazy.layout.shuffle_left(), desc="Move window to the left"
Key([mod, "shift"], "j", ),
lazy.layout.shuffle_down(), desc="Move window down"), Key(
Key([mod, "shift"], "k", [mod, "shift"],
lazy.layout.shuffle_up(), desc="Move window up"), "l",
lazy.layout.shuffle_right(),
# Grow windows. If current window is on the edge of screen and direction desc="Move window to the right",
# will be to screen edge - window would shrink. ),
Key([mod, "control"], "h", Key([mod, "shift"], "j", lazy.layout.shuffle_down(), desc="Move window down"),
lazy.layout.grow_left(), desc="Grow window to the left"), Key([mod, "shift"], "k", lazy.layout.shuffle_up(), desc="Move window up"),
Key([mod, "control"], "l", # Grow windows. If current window is on the edge of screen and direction
lazy.layout.grow_right(), desc="Grow window to the right"), # will be to screen edge - window would shrink.
Key([mod, "control"], "j", Key([mod, "control"], "h", lazy.layout.grow_left(), desc="Grow window to the left"),
lazy.layout.grow_down(), desc="Grow window down"), Key(
Key([mod, "control"], "k", [mod, "control"], "l", lazy.layout.grow_right(), desc="Grow window to the right"
lazy.layout.grow_up(), desc="Grow window up"), ),
# KeyChord([mod], "w", [ Key([mod, "control"], "j", lazy.layout.grow_down(), desc="Grow window down"),
# Key([], "g", lazy.layout.grow()), Key([mod, "control"], "k", lazy.layout.grow_up(), desc="Grow window up"),
# Key([], "s", lazy.layout.shrink()), # KeyChord([mod], "w", [
# Key([], "n", lazy.layout.normalize(), desc="Reset all window sizes"), # Key([mod], "g", lazy.layout.grow()),
# Key([], "m", lazy.layout.maximize())], # Key([mod], "s", lazy.layout.shrink()),
# mode="Windows" # Key([mod], "n", lazy.layout.normalize(), desc="Reset all window sizes"),
# ), # Key([mod], "m", lazy.layout.maximize())],
Key([mod], "f", # mode="Windows"
lazy.window.toggle_fullscreen(), desc='Toggle fullscreen'), # ),
Key([mod, "shift"], "f", Key([mod], "f", lazy.window.toggle_fullscreen(), desc="Toggle fullscreen"),
lazy.window.toggle_floating(), desc='Toggle floating'), Key([mod, "shift"], "f", lazy.window.toggle_floating(), desc="Toggle floating"),
# Toggle between split and unsplit sides of stack.
# Toggle between split and unsplit sides of stack. # Split = all windows displayed
# Split = all windows displayed # Unsplit = 1 window displayed, like Max layout, but still with
# Unsplit = 1 window displayed, like Max layout, but still with # multiple stack panes
# multiple stack panes Key(
Key([mod, "shift"], "Return", [mod, "shift"],
lazy.layout.toggle_split(), "Return",
desc="Toggle between split and unsplit sides of stack"), lazy.layout.toggle_split(),
Key([mod], "Return", lazy.spawn(terminal), desc="Launch terminal"), desc="Toggle between split and unsplit sides of stack",
),
# Toggle between different layouts as defined below Key([mod], "Return", lazy.spawn(terminal), desc="Launch terminal"),
Key([mod], "space", lazy.next_layout(), desc="Toggle between layouts"), # Toggle between different layouts as defined below
Key([mod, 'shift'], "space", Key([mod], "space", lazy.next_layout(), desc="Toggle between layouts"),
lazy.spawn("chlayout"), desc="Next keyboard layout."), Key([mod, "shift"], "space", lazy.spawn("chlayout"), desc="Next keyboard layout."),
Key([mod], "comma", Key([mod], "comma", lazy.screen.prev_group(), desc="Move to the group on the left"),
lazy.screen.prev_group(), desc="Move to the group on the left"), Key(
Key([mod], "period", [mod], "period", lazy.screen.next_group(), desc="Move to the group on the right"
lazy.screen.next_group(), desc="Move to the group on the right"), ),
Key([mod], "q", Key([mod], "q", lazy.window.kill(), desc="Kill focused window"),
lazy.window.kill(), desc="Kill focused window"), Key([mod, "shift", "control"], "h", lazy.layout.swap_column_left()),
Key([mod, "shift", "control"], "h", Key([mod, "shift", "control"], "l", lazy.layout.swap_column_right()),
lazy.layout.swap_column_left()), # Key([mod, "shift"], "space", lazy.layout.flip()),
Key([mod, "shift", "control"], "l", lazy.layout.swap_column_right()), Key([mod, "control"], "r", lazy.restart(), desc="Restart Qtile"),
# Key([mod, "shift"], "space", lazy.layout.flip()), Key([mod, "control"], "q", lazy.shutdown(), desc="Shutdown Qtile"),
Key([mod, "control"], "r", lazy.restart(), desc="Restart Qtile"), Key([mod, "control"], "n", lazy.spawn("lock-screen"), desc="Lock screen"),
Key([mod, "control"], "q", lazy.shutdown(), desc="Shutdown Qtile"), Key(
Key([mod, "control"], "n", [mod, "control"],
lazy.spawn("lock-screen"), desc="Lock screen"), "s",
Key([mod, "control"], "s", lazy.spawn("toggle-screenkey"),
lazy.spawn("toggle-screenkey"), desc="Show keys on screen"), desc="Show keys on screen",
Key([mod, "shift"], "d", ),
lazy.spawncmd(), desc="Spawn a command using a prompt widget"), Key(
Key([mod], "p", lazy.spawn("passmenu"), desc="Spawn passmenu"), [mod, "shift"],
"d",
# Key([mod, "shift"], "e", lazy.spawn("menu_powermenu"), desc="Spawn powermenu using rofi"), lazy.spawncmd(),
desc="Spawn a command using a prompt widget",
# Key([mod], "n", lazy.spawn(home("~/Desktop/GitRepositories/networkmanager-dmenu/networkmanager_dmenu")), desc="Launch network manager"), ),
# Key([mod], "i", lazy.spawn("sxiv " + home("~/Pictures/keyboard-layout.jpg")), desc="Show current keyboard layout"), Key([mod], "p", lazy.spawn("passmenu"), desc="Spawn passmenu"),
# Key([mod, "shift"], "e", lazy.spawn("menu_powermenu"), desc="Spawn powermenu using rofi"),
Key([mod], "b", lazy.spawn('rofi-bluetooth'), # Key([mod], "n", lazy.spawn(home("~/Desktop/GitRepositories/networkmanager-dmenu/networkmanager_dmenu")), desc="Launch network manager"),
desc="Manage bluetooth devices"), # Key([mod], "i", lazy.spawn("sxiv " + home("~/Pictures/keyboard-layout.jpg")), desc="Show current keyboard layout"),
Key([mod], "b", lazy.spawn("rofi-bluetooth"), desc="Manage bluetooth devices"),
Key([mod], "v", lazy.spawn('polybar-wireguard --toggle'), Key(
desc="Manage VPN connections"), [mod],
"v",
# Key([mod], "x", lazy.spawn(home("~/scripts/kill-process.sh")), lazy.spawn("polybar-wireguard --toggle"),
# desc="Kill processes using rofi"), desc="Manage VPN connections",
),
# == audio # Key([mod], "x", lazy.spawn(home("~/scripts/kill-process.sh")),
# desc="Kill processes using rofi"),
Key([], "XF86AudioRaiseVolume", # == audio
lazy.spawn("pactl set-sink-volume @DEFAULT_SINK@ +5%")), Key(
Key([], "XF86AudioLowerVolume", [],
lazy.spawn("pactl set-sink-volume @DEFAULT_SINK@ -5%")), "XF86AudioRaiseVolume",
Key([], "XF86AudioMute", lazy.spawn("pactl set-sink-volume @DEFAULT_SINK@ +5%"),
lazy.spawn("pactl set-sink-mute @DEFAULT_SINK@ toggle")), ),
Key([], "XF86AudioMicMute", Key(
lazy.spawn("pactl set-source-mute @DEFAULT_SOURCE@ toggle")), [],
"XF86AudioLowerVolume",
lazy.spawn("pactl set-sink-volume @DEFAULT_SINK@ -5%"),
# == backlight ),
Key([], "XF86MonBrightnessUp", Key([], "XF86AudioMute", lazy.spawn("pactl set-sink-mute @DEFAULT_SINK@ toggle")),
lazy.spawn("light -A 5")), Key(
Key([], "XF86MonBrightnessDown", [],
lazy.spawn("light -U 5")), "XF86AudioMicMute",
lazy.spawn("pactl set-source-mute @DEFAULT_SOURCE@ toggle"),
Key([], "Print", ),
lazy.spawn("flameshot gui")), # == backlight
Key([], "XF86MonBrightnessUp", lazy.spawn("light -A 5")),
Key(["shift"], "Print", Key([], "XF86MonBrightnessDown", lazy.spawn("light -U 5")),
lazy.spawn("flameshot full")), Key([], "Print", lazy.spawn("flameshot gui")),
Key(["shift"], "Print", lazy.spawn("flameshot full")),
Key(["control"], "Print", Key(["control"], "Print", lazy.spawn("flameshot full")),
lazy.spawn("flameshot full")), Key([], "F12", lazy.group["scratchpad"].dropdown_toggle("term")),
Key([], "XF86KbdBrightnessUp", lazy.spawn("keyboard_backlight.sh inc")),
Key([], 'F12', lazy.group['scratchpad'].dropdown_toggle('term')), Key([], "XF86KbdBrightnessDown", lazy.spawn("keyboard_backlight.sh dec")),
Key([], "XF86TouchpadToggle", lazy.spawn("toggle-touchpad.sh")),
Key([], "XF86KbdBrightnessUp",
lazy.spawn("keyboard_backlight.sh inc")),
Key([], "XF86KbdBrightnessDown",
lazy.spawn("keyboard_backlight.sh dec")),
Key([], "XF86TouchpadToggle",
lazy.spawn("toggle-touchpad.sh")),
] ]

View File

@ -7,9 +7,9 @@ from libqtile.config import Match
# "border_focus": "#5294e2", # "border_focus": "#5294e2",
# "border_normal": "#2c5380"} # "border_normal": "#2c5380"}
layouts = [ layouts = [
# layout.MonadTall(margin=8, border_focus='#5294e2', # layout.MonadTall(margin=8, border_focus='#5294e2',
# border_normal='#2c5380'), # border_normal='#2c5380'),
layout.Columns(margin=8, border_focus_stack='#d75f5f'), layout.Columns(margin=8, border_focus_stack="#d75f5f"),
layout.Max(), layout.Max(),
# Try more layouts by unleashing below layouts. # Try more layouts by unleashing below layouts.
# layout.Stack(num_stacks=2), # layout.Stack(num_stacks=2),
@ -24,17 +24,19 @@ layouts = [
# layout.Zoomy(), # layout.Zoomy(),
] ]
floating_layout = layout.Floating(float_rules=[ floating_layout = layout.Floating(
# Run the utility of `xprop` to see the wm class and name of an X client. float_rules=[
*layout.Floating.default_float_rules, # Run the utility of `xprop` to see the wm class and name of an X client.
Match(wm_class='confirmreset'), # gitk *layout.Floating.default_float_rules,
Match(wm_class='makebranch'), # gitk Match(wm_class="confirmreset"), # gitk
Match(wm_class='maketag'), # gitk Match(wm_class="makebranch"), # gitk
Match(wm_class='ssh-askpass'), # ssh-askpass Match(wm_class="maketag"), # gitk
Match(wm_class='sxiv'), Match(wm_class="ssh-askpass"), # ssh-askpass
Match(wm_class='telegram-desktop'), Match(wm_class="sxiv"),
Match(wm_class='streamlink-twitch-gui'), Match(wm_class="telegram-desktop"),
Match(wm_class='pinentry-gtk-2'), Match(wm_class="streamlink-twitch-gui"),
Match(title='branchdialog'), # gitk Match(wm_class="pinentry-gtk-2"),
Match(title='pinentry'), # GPG key password entry Match(title="branchdialog"), # gitk
]) Match(title="pinentry"), # GPG key password entry
]
)

View File

@ -4,9 +4,14 @@ from .keys import mod
# Drag floating layouts. # Drag floating layouts.
mouse = [ mouse = [
Drag([mod], "Button1", lazy.window.set_position_floating(), Drag(
start=lazy.window.get_position()), [mod],
Drag([mod], "Button3", lazy.window.set_size_floating(), "Button1",
start=lazy.window.get_size()), lazy.window.set_position_floating(),
Click([mod], "Button2", lazy.window.bring_to_front()) start=lazy.window.get_position(),
),
Drag(
[mod], "Button3", lazy.window.set_size_floating(), start=lazy.window.get_size()
),
Click([mod], "Button2", lazy.window.bring_to_front()),
] ]