Fix qtile groups

This commit is contained in:
stephan.raabe 2023-01-31 08:57:01 +01:00
parent 1cb6212327
commit 632d87274a
3 changed files with 48 additions and 29 deletions

View File

@ -1,3 +1,6 @@
Packages:
exa neomutt htop picom xfce-power-manager nitrogen dunst
Disable Suspend Disable Suspend
https://wiki.archlinux.org/title/Power_management#Disabling_suspend https://wiki.archlinux.org/title/Power_management#Disabling_suspend

View File

@ -25,17 +25,26 @@
# SOFTWARE. # SOFTWARE.
import os import os
import re
import socket
import subprocess import subprocess
from libqtile import hook
from libqtile import bar, layout, widget, hook from libqtile import qtile
from libqtile.config import Click, Drag, Group, Key, Match, Screen from typing import List
from libqtile import bar, layout, widget
from libqtile.config import Click, Drag, Group, Key, Match, Screen, ScratchPad, DropDown
from libqtile.lazy import lazy from libqtile.lazy import lazy
from libqtile.utils import guess_terminal from libqtile.utils import guess_terminal
from libqtile.widget import Spacer, Backlight
from libqtile.widget.image import Image
from libqtile.dgroups import simple_key_binder
mod = "mod4" mod = "mod4"
terminal = guess_terminal("alacritty") terminal = guess_terminal("alacritty")
browser = "chromium" browser = "chromium"
# KEYBINDINGS
keys = [ keys = [
# A list of available commands that can be bound to keys can be found # A list of available commands that can be bound to keys can be found
# at https://docs.qtile.org/en/latest/manual/config/lazy.html # at https://docs.qtile.org/en/latest/manual/config/lazy.html
@ -59,6 +68,7 @@ keys = [
Key([mod, "control"], "Up", lazy.layout.grow_up(), desc="Grow window up"), Key([mod, "control"], "Up", lazy.layout.grow_up(), desc="Grow window up"),
Key([mod], "n", lazy.layout.normalize(), desc="Reset all window sizes"), Key([mod], "n", lazy.layout.normalize(), desc="Reset all window sizes"),
# Toggle between split and unsplit sides of stack. # Toggle between split and unsplit sides of stack.
Key([mod], "t", lazy.window.toggle_floating(), desc='Toggle floating'),
# 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
@ -80,31 +90,33 @@ keys = [
# Key([mod], "r", lazy.spawncmd(), desc="Spawn a command using a prompt widget"), # Key([mod], "r", lazy.spawncmd(), desc="Spawn a command using a prompt widget"),
] ]
groups = [Group(i) for i in "123456789"] # GROUPS
for i in groups: groups = [Group("DEV", layout='monadtall'),
keys.extend( Group("WWW", layout='monadtall'),
[ Group("SYS", layout='monadtall'),
# mod1 + letter of group = switch to group Group("SYS", layout='monadtall'),
Key( Group("DOC", layout='monadtall'),
[mod], Group("VBOX", layout='monadtall'),
i.name, Group("CHAT", layout='monadtall'),
lazy.group[i.name].toscreen(), Group("MUS", layout='monadtall'),
desc="Switch to group {}".format(i.name), Group("VID", layout='monadtall'),
), Group("GFX", layout='floating')]
# mod1 + shift + letter of group = switch to & move focused window to group
Key( dgroups_key_binder = simple_key_binder(mod)
[mod, "shift"],
i.name, # SCRATCHPADS
lazy.window.togroup(i.name, switch_group=True),
desc="Switch to & move focused window to group {}".format(i.name), # Append scratchpad with dropdowns to groups
), groups.append(ScratchPad('scratchpad', [
# Or, use below if you prefer not to switch to that group. DropDown('terminal', terminal, width=0.8, height=0.8, x=0.1, y=0.1, opacity=1.0),
# # mod1 + shift + letter of group = move focused window to group # DropDown('dmnotes', terminal, width=0.8,height=0.8, x=0.1,y=0.1, opacity=1.0),
# Key([mod, "shift"], i.name, lazy.window.togroup(i.name), ]))
# desc="move focused window to group {}".format(i.name)), # extend keys list with keybinding for scratchpad
] keys.extend([
) Key(["control"], "1", lazy.group['scratchpad'].dropdown_toggle('terminal')),
# Key(["control"], "2", lazy.gtoup['scratchpad'].dropdown_toggle('dmnotes'))
])
layout_theme = { "border_width": 2, layout_theme = { "border_width": 2,
"margin": 15, "margin": 15,
@ -157,7 +169,12 @@ screens = [
widget.Systray(), widget.Systray(),
widget.Volume(fmt='Vol: {}'), widget.Volume(fmt='Vol: {}'),
# widget.Clipboard(), # widget.Clipboard(),
widget.CheckUpdates(distro="Arch_yay",no_update_string="No updates"), widget.CheckUpdates(
distro="Arch",
no_update_string="No updates",
update_interval=600,
mouse_callbacks={"Button1": lambda: qtile.cmd_spawn(terminal + ' -e yay')}
),
widget.Clock(format="%Y-%m-%d %a %I:%M %p"), widget.Clock(format="%Y-%m-%d %a %I:%M %p"),
widget.QuickExit(countdown_start=3), widget.QuickExit(countdown_start=3),
], ],
@ -176,7 +193,6 @@ mouse = [
Click([mod], "Button2", lazy.window.bring_to_front()), Click([mod], "Button2", lazy.window.bring_to_front()),
] ]
dgroups_key_binder = None
dgroups_app_rules = [] # type: list dgroups_app_rules = [] # type: list
follow_mouse_focus = True follow_mouse_focus = True
bring_front_click = False bring_front_click = False