added nvim

This commit is contained in:
2025-09-30 19:35:36 +02:00
parent 70c935e1a9
commit 82b0f111c2
21 changed files with 663 additions and 90 deletions

Binary file not shown.

View File

@@ -7,7 +7,7 @@ from libqtile.config import Screen
from themes.colors import gruvbox_dark
from modules.keys import keybinds, mousebinds
from modules.groups import groups
from modules.groups import groups, get_group_keys
from modules.widgets import widgets_main, widgets_portrait, widgets_media
from modules.hooks import *
from modules.layouts import layouts
@@ -63,7 +63,9 @@ widget_defaults = dict(
)
# Essentials
mod = "mod4"
keys = keybinds()
keys.extend(get_group_keys(mod))
mouse = mousebinds()
groups = groups
layouts = layouts

View File

@@ -1,9 +1,12 @@
# groups.py (überarbeitete Version)
import re
from libqtile.lazy import lazy
from libqtile.config import Group, EzKey as Key, Match, DropDown, ScratchPad
from modules.keys import keybinds
# WICHTIG: Definiere hier group_screen_map und groups
group_screen_map = {
"0": 0,
"1": 1,
"2": 1,
"3": 1,
@@ -31,10 +34,7 @@ groups = [
Group(
name="0",
label="󰓓",
matches=[
Match(wm_class=re.compile(r"^(steam)")),
Match(wm_class=re.compile(r"^(Minecraft*)")),
],
matches=[Match(wm_class=re.compile(r"^(steam|Minecraft*)"))],
),
Group(name="1", label="󰲡"),
Group(name="2", label="󰲣"),
@@ -46,43 +46,17 @@ groups = [
Group(name="8", label="󰲯"),
Group(name="9", label="󰲱"),
# Groups on function-keys
Group(
name="f1",
label="",
matches=[
Match(wm_class=re.compile(r"^(firefox)$")),
],
),
Group(name="f1", label="", matches=[Match(wm_class=re.compile(r"^(firefox)$"))]),
Group(name="f2", label="", matches=[Match(wm_class="discord")]),
Group(
name="f3",
label="",
matches=[Match(wm_class=re.compile(r"^(joplin)$"))],
),
Group(name="f3", label="", matches=[Match(wm_class=re.compile(r"^(joplin)$"))]),
Group(
name="f4",
label="",
matches=[
Match(
wm_class=re.compile(r"^(com.github.th_ch.youtube_music)$"),
),
],
),
Group(
name="f5",
label="󱦹",
matches=[Match(wm_class="rnote")],
),
Group(
name="f6",
label="󰟵",
matches=[Match(wm_class="bitwarden")],
),
Group(
name="f7",
label=" 󰣀",
matches=[Match(wm_class=re.compile(r"^(XPipe)$"))],
matches=[Match(wm_class=re.compile(r"^(com.github.th_ch.youtube_music)$"))],
),
Group(name="f5", label="󱦹", matches=[Match(wm_class="rnote")]),
Group(name="f6", label="󰟵", matches=[Match(wm_class="bitwarden")]),
Group(name="f7", label=" 󰣀", matches=[Match(wm_class=re.compile(r"^(XPipe)$"))]),
Group(name="f8", label="󱊲"),
Group(name="f9", label="󱊳"),
Group(name="f10", label="󱊴"),
@@ -90,54 +64,7 @@ groups = [
Group(name="f12", label="󱊶"),
]
def create_group_keys(groups, go_to_group, go_to_group_and_move_window):
additional_keys = []
def go_to_group(name: str):
def _inner(qtile):
screen = group_screen_map.get(name, 0)
if len(qtile.screens) <= 2:
qtile.groups_map[name].toscreen()
else:
qtile.focus_screen(screen)
qtile.groups_map[name].toscreen()
return _inner
# for i in groups:
# keys.append(Key([mod], i.name, lazy.function(go_to_group(i.name))))
for i in groups:
keys.append(
Key(f"M-{i.name}", lazy.function(go_to_group(i.name))),
)
def go_to_group_and_move_window(name: str):
def _inner(qtile):
screen = group_screen_map.get(name, 0)
if len(qtile.screens) <= 2:
qtile.current_window.togroup(name, switch_group=False)
else:
qtile.current_window.togroup(name, switch_group=False)
qtile.focus_screen(screen)
qtile.groups_map[name].toscreen()
return _inner
for i in groups:
keys.append(
Key(f"M-S-{i.name}", lazy.function(go_to_group_and_move_window(i.name))),
)
for i in range(1, 12):
group_name = f"<f{i}>"
key = f"<f{i}>"
keys.append
# Füge die Scratchpad-Gruppe zur Gruppenliste hinzu
groups.append(
ScratchPad(
"scratchpad",
@@ -165,3 +92,53 @@ groups.append(
],
)
)
def go_to_group(name: str):
def _inner(qtile):
screen = group_screen_map.get(name, 0)
if len(qtile.screens) <= 2:
qtile.groups_map[name].toscreen()
else:
qtile.focus_screen(screen)
qtile.groups_map[name].toscreen()
return _inner
def go_to_group_and_move_window(name: str):
def _inner(qtile):
screen = group_screen_map.get(name, 0)
qtile.current_window.togroup(name, switch_group=False)
if len(qtile.screens) > 2:
qtile.focus_screen(screen)
qtile.groups_map[name].toscreen()
return _inner
def get_group_keys(mod: str) -> list:
"""
Diese Funktion erstellt und gibt alle Key-Bindings für die Gruppen zurück.
Sie nimmt den Modifier-Key (z.B. "M") als Argument.
"""
keys = []
# Fügt Keys für reguläre Gruppen und F-Tasten-Gruppen hinzu
for group in groups:
# Hier wird der Name der Gruppe als Key verwendet, außer bei Scratchpads
if group.name != "scratchpad":
# Normale Gruppen wechseln
keys.append(
Key(f"M-{group.name}", lazy.function(go_to_group(group.name))),
)
# Fenster in Gruppe verschieben
keys.append(
Key(
f"M-S-{group.name}",
lazy.function(go_to_group_and_move_window(group.name)),
),
)
return keys

View File

@@ -1,10 +1,11 @@
from libqtile.lazy import lazy
from libqtile.config import EzKey as Key
from libqtile.config import EzClick as Click, EzDrag as Drag
from modules.groups import groups
def keybinds():
from config import APPS
# from ..config import APPS
keys = (
[
@@ -51,8 +52,8 @@ def keybinds():
lazy.window.toggle_fullscreen(),
desc="Toggles wiondow between tiled/floating and fullscreen",
),
Key("<M-Tab>", lazy.next_layout(), desc="Switches between layouts"),
Key("<M-C-r>", lazy.reload_config(), desc="Reload config"),
Key("M-<Tab>", lazy.next_layout(), desc="Switches between layouts"),
Key("M-C-r", lazy.reload_config(), desc="Reload config"),
# Audio and media control
Key("<F86AudioMute>", lazy.spawn("pamixer -t"), desc="Mutes Audio"),
Key(
@@ -112,6 +113,22 @@ def keybinds():
Key("M-<Return>", lazy.spawn(APPS["terminal"])),
],
)
for group in groups:
# Hier wird der Name der Gruppe als Key verwendet, außer bei Scratchpads
if group.name != "scratchpad":
# Normale Gruppen wechseln
keys.append(
Key(f"M-{group.name}", lazy.function(go_to_group(group.name))),
)
# Fenster in Gruppe verschieben
keys.append(
Key(
f"M-S-{group.name}",
lazy.function(go_to_group_and_move_window(group.name)),
),
)
return keys

View File

@@ -47,6 +47,7 @@ floating_layout = layout.Floating(
Match(wm_class="pavucontrol"),
Match(wm_class="org.gnome.FileRoller"),
Match(wm_class="lximage-qt"),
Match(wm_class="matplotlib"),
],
**floating_layout_defaults,
)

View File

@@ -42,7 +42,6 @@ widgets_media = [
fontsize=24,
foreground=gruvbox_dark["blue"],
mouse_callbacks={"Button1": lazy.function(start_menu)},
**widget_defaults,
),
widget.GroupBox2(
padding=6,

Binary file not shown.