diff --git a/.config/qtile/config.py b/.config/qtile/config.py index 903632c..533a084 100644 --- a/.config/qtile/config.py +++ b/.config/qtile/config.py @@ -1,10 +1,10 @@ -from modules.keys import keys, mod from modules.groups import groups -from modules.layouts import layouts, floating_layout +from modules.keys import keys, mod +from modules.layouts import floating_layout, layouts from modules.mouse import mouse from modules.hooks import * -import os from modules.screens import screens + dgroups_key_binder = None dgroups_app_rules = [] # type: List main = None # WARNING: this is deprecated and will be removed soon @@ -15,7 +15,5 @@ auto_fullscreen = True focus_on_window_activation = "urgent" wmname = "LG3D" widget_defaults = dict( - font='Cascadia Code', - fontsize=13, - padding=3 + font="Cascadia Code", fontsize=16, padding=12, foreground="CEC8C6" ) diff --git a/.config/qtile/modules/groups.py b/.config/qtile/modules/groups.py index 8a65984..44af9cf 100644 --- a/.config/qtile/modules/groups.py +++ b/.config/qtile/modules/groups.py @@ -5,38 +5,48 @@ from .keys import keys, mod groups = [Group(i) for i in "1234567890"] -browsers = [ - Match(wm_class="firefox"), - Match(wm_class="Google-chrome")] +browsers = [Match(wm_class="firefox"), Match(wm_class="Google-chrome")] file_managers = [Match(wm_class="Thunar")] -video_players = [ - Match(wm_class="streamlink-twitch-gui"), - Match(wm_class="mpv")] +video_players = [Match(wm_class="streamlink-twitch-gui"), Match(wm_class="mpv")] groups = [ - Group('1'), - Group('2', matches=[Match(wm_class="VirtualBox Manager")]), - Group('3', matches=[Match(wm_class="Thunderbird")]), - Group('4', matches=[Match(wm_class="st-256color")]), - Group('5', matches=file_managers), - Group('6'), - Group('7', matches=browsers), - Group('8', matches=video_players), - Group('9'), - Group('0', matches=[Match(wm_class="TelegramDesktop")]), - ] -groups.append(ScratchPad("scratchpad", [ - # define a drop down terminal. - # it is placed in the upper third of screen by default. - DropDown("term", "st", opacity=1.0) - ])) + Group("1"), + Group("2", matches=[Match(wm_class="VirtualBox Manager")]), + Group("3", matches=[Match(wm_class="Thunderbird")]), + Group("4", matches=[Match(wm_class="st-256color")]), + Group("5", matches=file_managers), + Group("6"), + Group("7", matches=browsers), + Group("8", matches=video_players), + Group("9"), + Group("0", matches=[Match(wm_class="TelegramDesktop")]), +] +groups.append( + ScratchPad( + "scratchpad", + [ + # define a drop down terminal. + # it is placed in the upper third of screen by default. + DropDown("term", "st", opacity=1.0) + ], + ) +) -symbols = 'arstgmneio' +symbols = "arstgmneio" for i, j in zip(groups, symbols): - keys.extend([ - Key([mod], j, lazy.group[i.name].toscreen(), - desc="Switch to group {}".format(i.name)), - - Key([mod, "shift"], j, lazy.window.togroup(i.name, switch_group=True), - desc="Switch to & move focused window to group {}".format(i.name)), - ]) + keys.extend( + [ + Key( + [mod], + j, + lazy.group[i.name].toscreen(), + desc="Switch to group {}".format(i.name), + ), + Key( + [mod, "shift"], + j, + lazy.window.togroup(i.name, switch_group=True), + desc="Switch to & move focused window to group {}".format(i.name), + ), + ] + ) diff --git a/.config/qtile/modules/hooks.py b/.config/qtile/modules/hooks.py index 10da1f4..0eff306 100644 --- a/.config/qtile/modules/hooks.py +++ b/.config/qtile/modules/hooks.py @@ -6,13 +6,13 @@ from libqtile.command.client import InteractiveCommandClient @hook.subscribe.startup def autostart(): - subprocess.call(['autostart.sh']) + subprocess.call(["autostart.sh"]) @hook.subscribe.startup_complete def focus_group(): c = InteractiveCommandClient() - c.group['4'].toscreen() + c.group["4"].toscreen() @hook.subscribe.client_managed diff --git a/.config/qtile/modules/keys.py b/.config/qtile/modules/keys.py index 2554583..45c4daf 100644 --- a/.config/qtile/modules/keys.py +++ b/.config/qtile/modules/keys.py @@ -9,140 +9,132 @@ terminal = "st" home = os.path.expanduser keys = [ - # '`': 'grave', - # '-': 'minus', - # '=': 'equal', - # '[': 'bracketleft', - # ']': 'bracketright', - # '\\': 'backslash', - # ';': 'semicolon', - # '\'': 'quote', - # ',': 'comma', - # '.': 'dot', - 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], "Tab", lazy.screen.toggle_group(), - desc="Toggle back and forth between latest groups"), - Key([mod], "d", lazy.spawn("rofi -show combi"), desc="spawn rofi"), - - # Move windows between left/right columns or move up/down in current - # stack. Moving out of range in Columns layout will create new column. - Key([mod, "shift"], "h", - lazy.layout.shuffle_left(), desc="Move window to the left"), - Key([mod, "shift"], "l", - lazy.layout.shuffle_right(), desc="Move window to the right"), - Key([mod, "shift"], "j", - lazy.layout.shuffle_down(), desc="Move window down"), - Key([mod, "shift"], "k", - lazy.layout.shuffle_up(), desc="Move window up"), - - # Grow windows. If current window is on the edge of screen and direction - # will be to screen edge - window would shrink. - Key([mod, "control"], "h", - lazy.layout.grow_left(), desc="Grow window to the left"), - Key([mod, "control"], "l", - lazy.layout.grow_right(), desc="Grow window to the right"), - Key([mod, "control"], "j", - lazy.layout.grow_down(), desc="Grow window down"), - Key([mod, "control"], "k", - lazy.layout.grow_up(), desc="Grow window up"), - # KeyChord([mod], "w", [ - # Key([], "g", lazy.layout.grow()), - # Key([], "s", lazy.layout.shrink()), - # Key([], "n", lazy.layout.normalize(), desc="Reset all window sizes"), - # Key([], "m", lazy.layout.maximize())], - # mode="Windows" - # ), - Key([mod], "f", - lazy.window.toggle_fullscreen(), desc='Toggle fullscreen'), - Key([mod, "shift"], "f", - lazy.window.toggle_floating(), desc='Toggle floating'), - - # Toggle between split and unsplit sides of stack. - # Split = all windows displayed - # Unsplit = 1 window displayed, like Max layout, but still with - # multiple stack panes - Key([mod, "shift"], "Return", - lazy.layout.toggle_split(), - desc="Toggle between split and unsplit sides of stack"), - Key([mod], "Return", lazy.spawn(terminal), desc="Launch terminal"), - - # Toggle between different layouts as defined below - Key([mod], "space", lazy.next_layout(), desc="Toggle between layouts"), - Key([mod, 'shift'], "space", - lazy.spawn("chlayout"), desc="Next keyboard layout."), - Key([mod], "comma", - lazy.screen.prev_group(), desc="Move to the group on the left"), - Key([mod], "period", - lazy.screen.next_group(), desc="Move to the group on the right"), - Key([mod], "q", - lazy.window.kill(), desc="Kill focused window"), - Key([mod, "shift", "control"], "h", - lazy.layout.swap_column_left()), - Key([mod, "shift", "control"], "l", lazy.layout.swap_column_right()), - # Key([mod, "shift"], "space", lazy.layout.flip()), - Key([mod, "control"], "r", lazy.restart(), desc="Restart Qtile"), - Key([mod, "control"], "q", lazy.shutdown(), desc="Shutdown Qtile"), - Key([mod, "control"], "n", - lazy.spawn("lock-screen"), desc="Lock screen"), - Key([mod, "control"], "s", - lazy.spawn("toggle-screenkey"), desc="Show keys on screen"), - Key([mod, "shift"], "d", - lazy.spawncmd(), desc="Spawn a command using a prompt widget"), - Key([mod], "p", lazy.spawn("passmenu"), desc="Spawn passmenu"), - - # Key([mod, "shift"], "e", lazy.spawn("menu_powermenu"), desc="Spawn powermenu using rofi"), - - # Key([mod], "n", lazy.spawn(home("~/Desktop/GitRepositories/networkmanager-dmenu/networkmanager_dmenu")), desc="Launch network manager"), - # Key([mod], "i", lazy.spawn("sxiv " + home("~/Pictures/keyboard-layout.jpg")), desc="Show current keyboard layout"), - - Key([mod], "b", lazy.spawn('rofi-bluetooth'), - desc="Manage bluetooth devices"), - - Key([mod], "v", lazy.spawn('polybar-wireguard --toggle'), - desc="Manage VPN connections"), - - # Key([mod], "x", lazy.spawn(home("~/scripts/kill-process.sh")), - # desc="Kill processes using rofi"), - - # == audio - - Key([], "XF86AudioRaiseVolume", - lazy.spawn("pactl set-sink-volume @DEFAULT_SINK@ +5%")), - Key([], "XF86AudioLowerVolume", - lazy.spawn("pactl set-sink-volume @DEFAULT_SINK@ -5%")), - Key([], "XF86AudioMute", - lazy.spawn("pactl set-sink-mute @DEFAULT_SINK@ toggle")), - Key([], "XF86AudioMicMute", - lazy.spawn("pactl set-source-mute @DEFAULT_SOURCE@ toggle")), - - - # == backlight - Key([], "XF86MonBrightnessUp", - lazy.spawn("light -A 5")), - Key([], "XF86MonBrightnessDown", - lazy.spawn("light -U 5")), - - Key([], "Print", - lazy.spawn("flameshot gui")), - - Key(["shift"], "Print", - lazy.spawn("flameshot full")), - - Key(["control"], "Print", - lazy.spawn("flameshot full")), - - Key([], 'F12', lazy.group['scratchpad'].dropdown_toggle('term')), - - Key([], "XF86KbdBrightnessUp", - lazy.spawn("keyboard_backlight.sh inc")), - Key([], "XF86KbdBrightnessDown", - lazy.spawn("keyboard_backlight.sh dec")), - - - Key([], "XF86TouchpadToggle", - lazy.spawn("toggle-touchpad.sh")), + # '`': 'grave', + # '-': 'minus', + # '=': 'equal', + # '[': 'bracketleft', + # ']': 'bracketright', + # '\\': 'backslash', + # ';': 'semicolon', + # '\'': 'quote', + # ',': 'comma', + # '.': 'dot', + 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], + "Tab", + lazy.screen.toggle_group(), + desc="Toggle back and forth between latest groups", + ), + Key([mod], "d", lazy.spawn("rofi -show combi"), desc="spawn rofi"), + # Move windows between left/right columns or move up/down in current + # stack. Moving out of range in Columns layout will create new column. + Key( + [mod, "shift"], "h", lazy.layout.shuffle_left(), desc="Move window to the left" + ), + Key( + [mod, "shift"], + "l", + lazy.layout.shuffle_right(), + desc="Move window to the right", + ), + Key([mod, "shift"], "j", lazy.layout.shuffle_down(), desc="Move window down"), + Key([mod, "shift"], "k", lazy.layout.shuffle_up(), desc="Move window up"), + # Grow windows. If current window is on the edge of screen and direction + # will be to screen edge - window would shrink. + Key([mod, "control"], "h", lazy.layout.grow_left(), desc="Grow window to the left"), + Key( + [mod, "control"], "l", lazy.layout.grow_right(), desc="Grow window to the right" + ), + Key([mod, "control"], "j", lazy.layout.grow_down(), desc="Grow window down"), + Key([mod, "control"], "k", lazy.layout.grow_up(), desc="Grow window up"), + # KeyChord([mod], "w", [ + # Key([mod], "g", lazy.layout.grow()), + # Key([mod], "s", lazy.layout.shrink()), + # Key([mod], "n", lazy.layout.normalize(), desc="Reset all window sizes"), + # Key([mod], "m", lazy.layout.maximize())], + # mode="Windows" + # ), + Key([mod], "f", lazy.window.toggle_fullscreen(), desc="Toggle fullscreen"), + Key([mod, "shift"], "f", lazy.window.toggle_floating(), desc="Toggle floating"), + # Toggle between split and unsplit sides of stack. + # Split = all windows displayed + # Unsplit = 1 window displayed, like Max layout, but still with + # multiple stack panes + Key( + [mod, "shift"], + "Return", + lazy.layout.toggle_split(), + desc="Toggle between split and unsplit sides of stack", + ), + Key([mod], "Return", lazy.spawn(terminal), desc="Launch terminal"), + # Toggle between different layouts as defined below + Key([mod], "space", lazy.next_layout(), desc="Toggle between layouts"), + Key([mod, "shift"], "space", lazy.spawn("chlayout"), desc="Next keyboard layout."), + Key([mod], "comma", lazy.screen.prev_group(), desc="Move to the group on the left"), + Key( + [mod], "period", lazy.screen.next_group(), desc="Move to the group on the right" + ), + Key([mod], "q", lazy.window.kill(), desc="Kill focused window"), + Key([mod, "shift", "control"], "h", lazy.layout.swap_column_left()), + Key([mod, "shift", "control"], "l", lazy.layout.swap_column_right()), + # Key([mod, "shift"], "space", lazy.layout.flip()), + Key([mod, "control"], "r", lazy.restart(), desc="Restart Qtile"), + Key([mod, "control"], "q", lazy.shutdown(), desc="Shutdown Qtile"), + Key([mod, "control"], "n", lazy.spawn("lock-screen"), desc="Lock screen"), + Key( + [mod, "control"], + "s", + lazy.spawn("toggle-screenkey"), + desc="Show keys on screen", + ), + Key( + [mod, "shift"], + "d", + lazy.spawncmd(), + desc="Spawn a command using a prompt widget", + ), + Key([mod], "p", lazy.spawn("passmenu"), desc="Spawn passmenu"), + # Key([mod, "shift"], "e", lazy.spawn("menu_powermenu"), desc="Spawn powermenu using rofi"), + # Key([mod], "n", lazy.spawn(home("~/Desktop/GitRepositories/networkmanager-dmenu/networkmanager_dmenu")), desc="Launch network manager"), + # Key([mod], "i", lazy.spawn("sxiv " + home("~/Pictures/keyboard-layout.jpg")), desc="Show current keyboard layout"), + Key([mod], "b", lazy.spawn("rofi-bluetooth"), desc="Manage bluetooth devices"), + Key( + [mod], + "v", + lazy.spawn("polybar-wireguard --toggle"), + desc="Manage VPN connections", + ), + # Key([mod], "x", lazy.spawn(home("~/scripts/kill-process.sh")), + # desc="Kill processes using rofi"), + # == audio + Key( + [], + "XF86AudioRaiseVolume", + lazy.spawn("pactl set-sink-volume @DEFAULT_SINK@ +5%"), + ), + Key( + [], + "XF86AudioLowerVolume", + lazy.spawn("pactl set-sink-volume @DEFAULT_SINK@ -5%"), + ), + Key([], "XF86AudioMute", lazy.spawn("pactl set-sink-mute @DEFAULT_SINK@ toggle")), + Key( + [], + "XF86AudioMicMute", + lazy.spawn("pactl set-source-mute @DEFAULT_SOURCE@ toggle"), + ), + # == backlight + Key([], "XF86MonBrightnessUp", lazy.spawn("light -A 5")), + Key([], "XF86MonBrightnessDown", lazy.spawn("light -U 5")), + Key([], "Print", lazy.spawn("flameshot gui")), + Key(["shift"], "Print", lazy.spawn("flameshot full")), + Key(["control"], "Print", lazy.spawn("flameshot full")), + Key([], "F12", lazy.group["scratchpad"].dropdown_toggle("term")), + Key([], "XF86KbdBrightnessUp", lazy.spawn("keyboard_backlight.sh inc")), + Key([], "XF86KbdBrightnessDown", lazy.spawn("keyboard_backlight.sh dec")), + Key([], "XF86TouchpadToggle", lazy.spawn("toggle-touchpad.sh")), ] diff --git a/.config/qtile/modules/layouts.py b/.config/qtile/modules/layouts.py index 412eb0b..f9efdd0 100644 --- a/.config/qtile/modules/layouts.py +++ b/.config/qtile/modules/layouts.py @@ -7,9 +7,9 @@ from libqtile.config import Match # "border_focus": "#5294e2", # "border_normal": "#2c5380"} layouts = [ - # layout.MonadTall(margin=8, border_focus='#5294e2', - # border_normal='#2c5380'), - layout.Columns(margin=8, border_focus_stack='#d75f5f'), + # layout.MonadTall(margin=8, border_focus='#5294e2', + # border_normal='#2c5380'), + layout.Columns(margin=8, border_focus_stack="#d75f5f"), layout.Max(), # Try more layouts by unleashing below layouts. # layout.Stack(num_stacks=2), @@ -24,17 +24,19 @@ layouts = [ # layout.Zoomy(), ] -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(wm_class='sxiv'), - Match(wm_class='telegram-desktop'), - Match(wm_class='streamlink-twitch-gui'), - Match(wm_class='pinentry-gtk-2'), - Match(title='branchdialog'), # gitk - Match(title='pinentry'), # GPG key password entry -]) +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(wm_class="sxiv"), + Match(wm_class="telegram-desktop"), + Match(wm_class="streamlink-twitch-gui"), + Match(wm_class="pinentry-gtk-2"), + Match(title="branchdialog"), # gitk + Match(title="pinentry"), # GPG key password entry + ] +) diff --git a/.config/qtile/modules/mouse.py b/.config/qtile/modules/mouse.py index 81f5a23..b3360b3 100644 --- a/.config/qtile/modules/mouse.py +++ b/.config/qtile/modules/mouse.py @@ -4,9 +4,14 @@ from .keys import mod # 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()) + 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()), ]