The python config for my daily driver WM
I feel very confortable being a keyboard user, and a WM provides that functionality out of the box
Well basically I'm in the path of learn python, so use QTile to play with python code seems to me a good excuse
My config.py
is pretty much the default QTile's config, but I tried to put my custom stuffs in a modular approach
import subprocess
from libqtile import bar, widget, hook
from libqtile.config import Group, Match, Screen
from libqtile.layout import floating
The userconfigs
local module will store the custom configuration to run QTile
# local imports
from userconfigs.keybinds import Keybinds
from userconfigs.layouts import Layouts
from userconfigs.userVariables import UserVars
keybinds = Keybinds()
screen = Layouts()
keys = keybinds.load_keys()
layouts = screen.init_layouts()
groups = [Group(i) for i in "123456789"]
widget_defaults = dict(
font="sans",
fontsize=12,
padding=3
)
extension_defaults = widget_defaults.copy()
screens = [
Screen(
bottom=bar.Bar(
[
widget.CurrentLayout(),
widget.GroupBox(),
widget.Prompt(),
widget.WindowName(),
widget.Chord(
chords_colors={
"launch": ("#ff0000", "#ffffff"),
},
name_transform=lambda name: name.upper(),
),
widget.TextBox("default config", name="default"),
widget.TextBox(
"Press <M-r> to spawn",
foreground="#d75f5f"
),
widget.Systray(),
widget.Clock(format="%Y-%m-%d %a %I:%M %p"),
widget.QuickExit(),
],
24,
),
),
]
Multiple QTile configs
dgroups_key_binder = None
dgroups_app_rules = [] # type: list
follow_mouse_focus = True
bring_front_click = False
cursor_warp = False
floating_layout = floating.Floating(
float_rules=[
*floating.Floating.default_float_rules,
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
]
)
auto_fullscreen = True
focus_on_window_activation = "smart"
reconfigure_screens = True
auto_minimize = True
wl_input_rules = None
wmname = "LG3D"
All apps that should start once (at startup), should be defined in the autostart
script
@hook.subscribe.startup_once
def start_once():
subprocess.call([f"{UserVars.home}/.config/qtile/autostart"])