import os import subprocess import libqtile.resources from libqtile import bar, layout, qtile, widget, hook from libqtile.config import Click, Drag, Group, Key, Match, Screen from libqtile.lazy import lazy from libqtile.utils import guess_terminal # --- AUTOSTART --- @hook.subscribe.startup_once def autostart(): script = os.path.expanduser("~/.config/qtile/autostart.sh") if os.path.isfile(script): subprocess.Popen([script]) # NOTE: I removed the 'place_window' hook that was here. # It was likely causing the "double window" placement issue. mod = "mod4" terminal = guess_terminal() keys = [ # Switch between windows 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], "space", lazy.layout.next(), desc="Move window focus to other window"), # Move windows Key([mod, "shift"], "h", lazy.layout.shuffle_left()), Key([mod, "shift"], "l", lazy.layout.shuffle_right()), Key([mod, "shift"], "j", lazy.layout.shuffle_down()), Key([mod, "shift"], "k", lazy.layout.shuffle_up()), # Resize windows Key([mod, "control"], "h", lazy.layout.grow_left()), Key([mod, "control"], "l", lazy.layout.grow_right()), Key([mod, "control"], "j", lazy.layout.grow_down()), Key([mod, "control"], "k", lazy.layout.grow_up()), Key([mod], "n", lazy.layout.normalize()), Key([mod], "t", lazy.spawn("xfce4-terminal --hide-menubar"), desc="Launch terminal"), Key([mod], "Return", lazy.spawn("rofi -show drun"), desc="Launch rofi"), Key([mod], "Tab", lazy.next_layout(), desc="Toggle between layouts"), Key([mod, "control"], "w", lazy.window.kill(), desc="Kill focused window"), Key([mod], "f", lazy.window.toggle_fullscreen()), Key([mod, "control"], "r", lazy.reload_config(), desc="Reload the config"), Key([mod, "control"], "q", lazy.shutdown(), desc="Shutdown Qtile"), ] # Workspace Navigation keys.extend([ Key(["control", "mod1"], "Left", lazy.screen.prev_group()), Key(["control", "mod1"], "Right", lazy.screen.next_group()), ]) keys.extend([ Key([mod, "shift"], "End", lazy.spawn("waller-rofi"), desc="Wallpaper selector"), ]) # Groups setup groups = [Group(i) for i in "123456789"] for i in groups: keys.extend([ Key([mod], i.name, lazy.group[i.name].toscreen(), desc=f"Switch to group {i.name}"), Key([mod, "shift"], i.name, lazy.window.togroup(i.name, switch_group=True)), ]) layouts = [ layout.Columns(border_focus_stack=["#E5B680", "#E54865"], border_width=4), layout.Max(), layout.MonadTall(), layout.MonadWide(), ] widget_defaults = dict( font="sans", fontsize=12, padding=3, ) extension_defaults = widget_defaults.copy() # --- SCREENS CONFIGURATION --- def init_widgets_list(): widgets_list = [ widget.CurrentLayout(), widget.GroupBox(), widget.Prompt(), widget.WindowName(), widget.Clock(format="%Y-%m-%d %a %I:%M %p"), widget.QuickExit(), ] return widgets_list # Monitor 1 (Primary - Right) screens = [ Screen( top=bar.Bar( init_widgets_list() + [widget.Systray()], # Systray only on primary 24, ), ), # Monitor 2 (Vertical - Left) Screen( top=bar.Bar( init_widgets_list(), # No Systray here 24, ), ), ] # Mouse and other settings 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 = [] follow_mouse_focus = True bring_front_click = False floats_kept_above = True cursor_warp = False floating_layout = layout.Floating( float_rules=[ *layout.Floating.default_float_rules, Match(wm_class="confirmreset"), Match(wm_class="makebranch"), Match(wm_class="maketag"), Match(wm_class="ssh-askpass"), Match(title="branchdialog"), Match(title="pinentry"), ] ) auto_fullscreen = True focus_on_window_activation = "smart" reconfigure_screens = True auto_minimize = True wmname = "LG3D"