tos/packages/tos-desktop-wm/config.py
2023-09-09 09:17:02 +02:00

89 lines
2.6 KiB
Python

from libqtile.config import Click, Drag, Group, Key, Screen
from libqtile.lazy import lazy
from libqtile import layout
# ============== #
# === GROUPS === #
# ============== #
group_names = ["zic", "dev", "web"]
groups = [Group(name) for name in group_names]
# ============ #
# === KEYS === #
# ============ #
MOD = "mod4"
SHIFT = "shift"
CTRL = "control"
ALT = "mod1"
keys = [
# Actions
Key([MOD, SHIFT], "r", lazy.reload_config(), desc="Reload the config"),
Key([MOD, SHIFT], "a", lazy.window.kill(), desc="Kill focused window"),
# Switch between windows
Key([MOD], "n", lazy.layout.left(), desc="Move focus left"),
Key([MOD], "o", lazy.layout.right(), desc="Move focus right"),
Key([MOD], "e", lazy.layout.down(), desc="Move focus down"),
Key([MOD], "i", lazy.layout.up(), desc="Move focus up"),
# Move windows
Key([CTRL, MOD], "n", lazy.layout.shuffle_left(), desc="Move window left"),
Key([CTRL, MOD], "o", lazy.layout.shuffle_right(), desc="Move window right"),
Key([CTRL, MOD], "e", lazy.layout.shuffle_down(), desc="Move window down"),
Key([CTRL, MOD], "i", lazy.layout.shuffle_up(), desc="Move window up"),
# Grow windows
Key([MOD, ALT], "n", lazy.layout.grow_left(), desc="Grow window left"),
Key([MOD, ALT], "o", lazy.layout.grow_right(), desc="Grow window right"),
Key([MOD, ALT], "e", lazy.layout.grow_down(), desc="Grow window down"),
Key([MOD, ALT], "i", lazy.layout.grow_up(), desc="Grow window up"),
Key([MOD, ALT], "m", lazy.layout.normalize(), desc="Reset all window sizes"),
# Launch applications
Key([MOD], "t", lazy.spawn("alacritty"), desc="Launch terminal"),
]
# Group keys
for i, name in enumerate(group_names):
keys.extend(
[
Key([MOD], str(i), lazy.group[name].toscreen(), desc=f"Switch to group {name}"),
Key([MOD, SHIFT], str(i), lazy.window.togroup(name, switch_group=True), desc=f"Switch to & move focused window to group {name}"),
]
)
# ============= #
# === MOUSE === #
# ============= #
# 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()),
]
# =============== #
# === LAYOUTS === #
# =============== #
layouts = [
layout.Columns(border_focus_stack=["#d75f5f", "#8f3d3d"], border_width=4),
layout.Max(),
]
# =============== #
# === SCREENS === #
# =============== #
screens = [Screen()]
# ================ #
# === SETTINGS === #
# ================ #
auto_minimize = False