Qtile správce oken
Qtile je správce oken pro Linux, který je napsaný v Pythonu a je známý svou flexibilitou a konfigurovatelností.
Instalace
Qtile lze nainstalovat tímto způsobem:
sudo pacman -S qtile
Konfigurace
Konfigurační soubor Qtile je napsán v Pythonu, což umožňuje velkou flexibilitu. Soubor se obvykle nachází v ~/.config/qtile/config.py. Zde je základní struktura konfiguračního souboru:
from libqtile import bar, layout, widget
from libqtile.config import Click, Drag, Group, Key, Match, Screen
from libqtile.lazy import lazy
from libqtile.utils import guess_terminal
mod = "mod4" # Mod key (usually the Windows key)
terminal = guess_terminal()
keys = [
Key([mod], "h", lazy.layout.left(), desc="Move focus to left"),
Key([mod], "l", lazy.layout.right(), desc="Move focus to right"),
Key([mod], "j", lazy.layout.down(), desc="Move focus down"),
Key([mod], "k", lazy.layout.up(), desc="Move focus up"),
Key([mod], "Return", lazy.spawn(terminal), desc="Launch terminal"),
# Add more keybindings here
]
groups = [Group(i) for i in "123456789"]
for i in groups:
keys.extend([
Key([mod], i.name, lazy.group[i.name].toscreen(),
desc="Switch to group {}".format(i.name)),
Key([mod, "shift"], i.name, lazy.window.togroup(i.name, switch_group=True),
desc="Switch to & move focused window to group {}".format(i.name)),
])
layouts = [
layout.Columns(border_focus_stack=['#d75f5f', '#8f3d3d'], border_width=4),
layout.Max(),
# Add more layouts here
]
widget_defaults = dict(
font='sans',
fontsize=12,
padding=3,
)
extension_defaults = widget_defaults.copy()
screens = [
Screen(
top=bar.Bar(
[
widget.CurrentLayout(),
widget.GroupBox(),
widget.Prompt(),
widget.WindowName(),
widget.Chord(
chords_colors={
'launch': ("#ff0000", "#ffffff"),
},
name_transform=lambda name: name.upper(),
),
widget.Systray(),
widget.Clock(format='%Y-%m-%d %a %I:%M %p'),
widget.QuickExit(),
],
24,
),
),
]
# Drag floating layouts.
mouse = [
Drag([mod], "Button1", lazy.window.set_position_floating(),
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())
]
dgroups_key_binder = None
dgroups_app_rules = [] # type: List
follow_mouse_focus = True
bring_front_click = False
cursor_warp = False
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='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
# If things like steam games want to auto-minimize themselves when losing
# focus, should we respect this or not?
auto_minimize = True
# 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
# mailing lists, GitHub issues, and other WM documentation that suggest setting
# this string if your java app doesn't work correctly. We may as well just lie
# and say that we're a working one by default.
#
# We choose LG3D to maximize irony: it is a 3D non-reparenting WM written in
# java that happens to be on java's whitelist.
wmname = "LG3D"
Další konfigurační soubory jsou:
- Main config file: ~/.config/qtile/config.py
- Keybindings: ~/.config/qtile/modules/keys.py
- Bar: ~/.config/qtile/modules/screens.py
- Widgets: ~/.config/qtile/modules/widgets.py
- Auto-start: ~/.config/qtile/autostart.sh
KLávesové zkratky
Klávesové zkratky jsou definovány v sekci keys. Například:
keys = [
Key([mod], "h", lazy.layout.left(), desc="Move focus to left"),
Key([mod], "l", lazy.layout.right(), desc="Move focus to right"),
Key([mod], "j", lazy.layout.down(), desc="Move focus down"),
Key([mod], "k", lazy.layout.up(), desc="Move focus up"),
Key([mod], "Return", lazy.spawn(terminal), desc="Launch terminal"),
# Add more keybindings here
]
Rozvržení
Rozvržení oken lze konfigurovat v sekci layouts. Například:
layouts = [
layout.Columns(border_focus_stack=['#d75f5f', '#8f3d3d'], border_width=4),
layout.Max(),
# Add more layouts here
]
Widgety
Widgety jsou malé aplikace, které se zobrazují na panelu. Například:
widget_defaults = dict(
font='sans',
fontsize=12,
padding=3,
)
extension_defaults = widget_defaults.copy()
screens = [
Screen(
top=bar.Bar(
[
widget.CurrentLayout(),
widget.GroupBox(),
widget.Prompt(),
widget.WindowName(),
widget.Chord(
chords_colors={
'launch': ("#ff0000", "#ffffff"),
},
name_transform=lambda name: name.upper(),
),
widget.Systray(),
widget.Clock(format='%Y-%m-%d %a %I:%M %p'),
widget.QuickExit(),
],
24,
),
),
]
Spouštění
Po konfiguraci můžete Qtile spustit pomocí příkazu:
qtile start
Dokumentace a komunita
Pro další informace a podporu můžete navštívit oficiální dokumentaci Qtile na docs.qtile.org nebo se připojit k komunitě na GitHub a Reddit.