[], 'w', lazy.spawn(settings.applications['web_browser']), desc='Launch web browser', ), Key( [], 'd', lazy.spawn(settings.applications['messenger']), desc='Launch messaging application', ) ]), # Media Key( [], 'XF86AudioPlay', lazy.function(mpc.play), desc='Play/pause MPD reproduction', ), Key( [], 'XF86AudioStop', lazy.function(mpc.stop), desc='Stop MPD reproduction', ), Key( [], 'XF86AudioPrev', lazy.function(mpc.prev), desc='Play previous item in the MPD playlist', ), Key( [], 'XF86AudioNext', lazy.function(mpc.next),
Key([mod], "k", lazy.layout.up()), Key([mod], "j", lazy.layout.down()), Key([mod], "h", lazy.layout.left()), Key([mod], "l", lazy.layout.right()), Key([mod, "mod1"], "h", lazy.layout.previous()), # Stack Key([mod, "mod1"], "l", lazy.layout.next()), # Stack # Switch focus to a physical monitor (dual/triple set up) # Key([mod], "period", lazy.next_screen()), # Key([mod], "comma", lazy.prev_screen()), # Key([mod], "a", lazy.to_screen(0)), # Key([mod], "b", lazy.to_screen(1)), # Key([mod], "c", lazy.to_screen(2)), # Move windows to different physical screens Key([mod, "shift"], "period", lazy.function(window_to_previous_screen)), Key([mod, "shift"], "comma", lazy.function(window_to_next_screen)), Key([mod], "t", lazy.function(switch_screens)), # Resize layout Key( [mod, "control"], "l", lazy.layout.grow_right(), lazy.layout.grow(), lazy.layout.increase_ratio(), lazy.layout.delete(), ), Key( [mod, "control"], "Right",
lazy.spawn(expanduser("~/scripts/sc -s")), desc="Take screenshot of selected area"), Key([mod, "control"], "Print", lazy.spawn(expanduser("~/scripts/sc -cs")), desc="Cpoy selected area to clipboard"), # run prompts and menu return Key([mod], "space", lazy.spawn("dmenu_run"), desc="Rofi run menu"), Key([mod, "control"], "a", lazy.spawn("rofi -show window"), desc="Rofi window menu"), Key([mod], "x", lazy.function(lambda qtile: qtile.cmd_spawn( expanduser("~/.config/xmenu/xmenu.sh"))), desc="Run xmenu"), Key([mod, "control"], "p", lazy.run_extension( CommandSet(commands={ "suspend": "systemctl suspend", "shutdown": "systemctl poweroff", "reboot": "systemctl reboot", }, )), desc="Power prompt"), # brightness Key([], "XF86MonBrightnessUp", lazy.spawn("xbacklight -inc +5"),
if win is None: return else: x, y = win.x, win.y screens_candidates = get_candidates_screens( qtile, x, y, key, exclude_screens=[qtile.current_screen]) screen = closest_screen(x, y, screens_candidates) if screen is not None: screen_idx = screen.index qtile.current_window.togroup(screen.group.name) qtile.focus_screen(screen_idx, warp=False) keys = [ # Switch between windows in current stack pane Key([mod], "h", lazy.function(focus_smart, "h")), Key([mod], "j", lazy.function(focus_smart, "j")), Key([mod], "k", lazy.function(focus_smart, "k")), Key([mod], "l", lazy.function(focus_smart, "l")), Key([mod, "shift"], "h", lazy.function(swap_screen, "h")), Key([mod, "shift"], "j", lazy.function(swap_screen, "j")), Key([mod, "shift"], "k", lazy.function(swap_screen, "k")), Key([mod, "shift"], "l", lazy.function(swap_screen, "l")), # Move windows up or down in current stack Key([mod, "control"], "k", lazy.layout.shuffle_up(), desc="Move window down in current stack "), Key([mod, "control"], "j", lazy.layout.shuffle_down(),
from groups import groups import traverse keys = [ # 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 # Switch between windows Key([mod], "f", lazy.window.toggle_fullscreen(), desc="Toggle fullscreen"), Key([mod, "shift"], "d", lazy.window.kill(), desc="Close window"), Key([mod, "shift"], "space", lazy.window.toggle_floating(), desc="Toggle floating"), Key([mod, "shift"], "s", lazy.window.static(), desc="Make window static"), Key([mod], "h", lazy.function(traverse.left), desc="Move focus to left"), Key([mod], "l", lazy.function(traverse.right), desc="Move focus to right"), Key([mod], "j", lazy.function(traverse.down), desc="Move focus down"), Key([mod], "k", lazy.function(traverse.up), desc="Move focus up"), Key([mod], "i", lazy.screen.prev_group(), desc="Previous group on screen"), Key([mod], "o", lazy.screen.next_group(), desc="Next group on screen"), Key([mod], "space", lazy.layout.next(), desc="Move window focus to other window"), # 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(),
if group_name == qtile.current_screen.group.name: return qtile.current_screen.set_group( qtile.current_screen.previous_group) for i, group in enumerate(qtile.groups): if group_name == group.name: return qtile.current_screen.set_group(qtile.groups[i]) groups = [Group(i) for i in "123456789"] for i in groups: keys.extend([ # mod1 + letter of group = switch to group Key([mod], i.name, lazy.function(toscreen, i.name), desc="Switch to group {}".format(i.name)), # mod1 + shift + letter of group = switch to & move focused window to group # Key([mod, "shift"], i.name, lazy.window.togroup(i.name, switch_group=True), # desc="Switch to & move focused window to group {}".format(i.name)), # Or, use below if you prefer not to switch to that group. # # mod1 + shift + letter of group = move focused window to group Key([mod, "shift"], i.name, lazy.window.togroup(i.name), desc="move focused window to group {}".format(i.name)), ]) layout_theme = { "border_width": 1,
for w in qtile.current_window.group.windows: if w._x < qtile.current_window._x: qtile.current_layout.cmd_left() return qtile.cmd_prev_screen() if qtile.current_window: for w in qtile.current_window.group.windows: if w._x > qtile.current_window._x: w.cmd_focus() keys = [ # 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 # Switch between windows Key([mod], "h", lazy.function(focus_left), desc="Move focus to left"), Key([mod], "l", lazy.function(focus_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], "Left", lazy.function(focus_left), desc="Move focus to left"), Key([mod], "Right", lazy.function(focus_right), desc="Move focus to right"), Key([mod], "Down", lazy.layout.down(), desc="Move focus down"), Key([mod], "Up", lazy.layout.up(), desc="Move focus up"), Key([mod], "space", lazy.layout.next(), desc="Move window focus to other window"), # 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"],
# 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"), Key([mod], "n", lazy.layout.normalize(), desc="Reset all window sizes"), Key([mod], "Tab", lazy.function(latest_group), desc="Alt tab like thing"), # 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], "i", lazy.spawn(terminal), desc="Launch terminal"), # Toggle between different layouts as defined below Key([mod], "u", lazy.next_layout(), desc="Toggle between layouts"), Key([mod], "m", lazy.group.setlayout("max")), Key([mod], "t", lazy.group.setlayout("columns")),
KeyChord([mod], "b", [ Key([], "b", lazy.spawn("brave-browser")), Key([], "c", lazy.spawn("chromium")), Key([], "f", lazy.spawn("firefox")), Key([], "i", lazy.spawn(home + "/apps/LibreWolf-84.0.2-1.x86_64.AppImage")), Key([], "l", lazy.spawn(term + " -e lynx")), Key([], "p", lazy.spawn("palemoon")), Key([], "q", lazy.spawn("qutebrowser")), Key([], "t", lazy.spawn("/opt/tor-browser_en-US/Browser/start-tor-browser")), ], mode="Browsers: (b) brave; (c) chromium; (f) firefox; (i) librewolf; " \ "(l) lynx; (p) palemoon; (q) qutebrowser; (t) tor;"), # playerctl controls Key( [], "XF86AudioPlay", lazy.function(playpause), ), Key( [], "XF86AudioNext", lazy.function(playnext), ), Key( [], "XF86AudioPrev", lazy.function(playprev), ), Key( [], "XF86AudioStop", lazy.function(stopplay), ), # pactl controls
Key([mod], "r", lazy.spawn("rofi -show run -theme ~/.cache/wal/colors-rofi-dark.rasi"), desc="Spawn a command using a prompt widget"), Key([mod], "b", lazy.spawn("firefox"), desc="spawn firefox"), # hardware # Volume Key([], "XF86AudioMute", lazy.spawn("amixer sset 'Master' toggle")), Key([], "XF86AudioLowerVolume", lazy.spawn("amixer sset 'Master' 5%-")), Key([], "XF86AudioRaiseVolume", lazy.spawn("amixer sset 'Master' 5%+")), # Media keys Key([], "XF86AudioPlay", lazy.spawn("playerctl play-pause")), Key([], "XF86AudioNext", lazy.spawn("playerctl next")), Key([], "XF86AudioPrev", lazy.spawn("playerctl previous")), # screenshot keys Key([], "Print", lazy.function(screenshot(selection=False, copy=False))), Key([mod, "shift"], "c", lazy.function(screenshot(copy=False))), Key([mod, "control"], "c", lazy.function(screenshot(save=False))), # copyq keys # Key([mod], "c", lazy.spawn(copyq())), # power options KeyChord([mod], "p", [ Key([], "s", lazy.function(shutdown())), Key([], "r", lazy.function(shutdown(restart=True))), Key([], "l", lazy.shutdown()) ]) ] colors = [] cache = "/home/treverhibbs/.cache/wal/colors"
Key([mod, "shift"], "Return", lazy.layout.toggle_split(), desc="Toggle between split and unsplit sides of stack"), Key([mod], "Return", lazy.spawn('st -e tmux'), desc="Launch terminal"), # Toggle between different layouts as defined below Key([mod], "m", lazy.next_layout(), desc="Toggle between layouts"), # Toggle fullscreen Key([mod], "f", lazy.window.toggle_fullscreen(), desc="Toggle fullscreen"), Key([mod, 'shift'], "w", lazy.window.kill(), desc="Kill focused window"), Key([mod, "mod1"], "r", lazy.restart(), desc="Restart qtile"), Key([mod, "mod1"], "q", lazy.shutdown(), desc="Shutdown qtile"), Key([mod], "r", lazy.spawncmd(), desc="Spawn a command using a prompt widget"), # custom applications Key([mod], "d", lazy.function(custom_dmenu)), Key([mod, "shift"], "n", lazy.spawn('networkmanager_dmenu'), desc="launch networmanager_dmenu"), # Multimedia Key([], "XF86AudioRaiseVolume", lazy.spawn("/home/martin/bin/increase_volume")), Key([], "XF86AudioLowerVolume", lazy.spawn("/home/martin/bin/decrease_volume")), Key([], "XF86AudioMute", lazy.spawn("pactl set-sink-mute 0 toggle") ), Key([], "XF86MonBrightnessUp", lazy.spawn("xbacklight -inc 5")), Key([], "XF86MonBrightnessDown", lazy.spawn("xbacklight -dec 5")), # Screen Toggling Key([mod, "mod1"], "period", lazy.function(focus_to_other_screen), desc='Next monitor'), Key([mod, "mod1"], "comma", lazy.function(window_to_other_screen), desc='Next monitor'), # Resize Bsp windows
Key([mod, "shift"], "g", lazy.spawn("google-chrome-stable"), desc="Launch browser"), Key([mod, "control"], "g", lazy.spawn("firefox"), desc="Launch browser"), Key([mod], "g", lazy.spawn(browser), desc="Launch browser"), Key([mod], "slash", lazy.window.toggle_floating(), desc="Toggle Floating"), Key([mod], "f", lazy.window.toggle_fullscreen(), desc="Toggle Fullscreen"), Key([mod], "w", lazy.prev_screen()), Key([mod], "o", lazy.layout.flip(), desc="Shrink Main"), Key([mod], "y", lazy.layout.maximize(), desc="Shrink Main"), Key([mod], "x", lazy.function(kick_to_next_screen)), Key([mod], "bracketleft", lazy.findwindow(), desc='Find window'), Key([mod], "b", lazy.hide_show_bar("top"), desc='Toggle bar' ), Key([mod], "t", lazy.function(toggleMargins)), Key([mod], "z", lazy.function(incMargins)), Key([mod, "shift"], "z", lazy.function(decMargins)), # Screens Key([mod], "m", lazy.screen.toggle_group(), ), Key([mod], "period", lazy.layout.shuffle_down() ), Key([mod], "comma", lazy.layout.shuffle_up() ), #Key([mod], "bracketleft", lazy.prev_screen() ),
# 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()), # terminal Key([mod], 'Return', lazy.spawn('alacritty')), # Toggle between different layouts as defined below Key([mod], 'Tab', lazy.next_layout()), Key([mod, 'shift'], 'q', lazy.window.kill()), Key([mod, 'shift'], 'r', lazy.restart()), Key([mod, 'shift'], 'e', lazy.shutdown()), Key([mod], 'd', lazy.function(spawncmd)), # Key([mod], 'w', lazy.to_screen(0)), # Key([mod], 'r', lazy.to_screen(1)), # Key([mod, 'shift'], 'j', lazy.group.toscreen(0, focus=True)), # TODO Key([mod, 'shift'], 'j', lazy.function(move_to_screen, 0)), Key([mod, 'shift'], 'l', lazy.function(move_to_screen, 1)), ] groups = [ Group('1', label=''), Group('2', label=''), Group('3', label=''), Group('4', label='4: ', layout='stack'), Group('5', label=''),
Key([mod], "v", lazy.spawn('copyq previous')), Key([mod, 'control'], "c", lazy.spawn('copyq menu')), Key([mod], "Escape", lazy.spawn("screensaver.sh")), Key([mod, 'shift'], "Escape", lazy.spawn("systemctl suspend")), Key([mod], "Return", lazy.spawn("kitty")), Key([mod, 'shift', 'control'], "Return", lazy.spawn("kitty zsh -c 'cmatrix -u 10 -s; zsh -i'")), Key([mod, 'shift'], "Return", lazy.spawn("kitty /bin/zsh -c -i sd")), Key([mod], "backslash", lazy.spawn("google-chrome")), Key([mod], "y", lazy.spawn("kitty /bin/zsh -c dl-and-play-yt.bash")), # Toggle between different layouts as defined below Key([mod], "Tab", lazy.next_layout()), Key([mod], "x", lazy.window.kill()), Key([mod, "control"], "r", lazy.restart()), Key([mod, "control"], "t", lazy.function(hard_restart)), Key([mod, "control"], "q", lazy.shutdown()), Key([mod], "space", lazy.spawn("j4-dmenu-desktop")), ] mouse = [ # Drag floating layouts. 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()),
Key([mod, "shift"], "q", lazy.window.kill(), desc="Kill focused window"), Key([mod, "control"], "r", lazy.restart(), desc="Restart qtile"), Key([mod, "control"], "q", lazy.shutdown(), desc="Shutdown qtile"), # Key([mod], "d", lazy.spawncmd(), # desc="Spawn a command using a prompt widget"), Key([mod, 'control'], "o", lazy.spawn('chromium')), Key([mod, "shift"], "f", lazy.window.toggle_floating(), desc='toggle floating'), Key([], 'XF86AudioMute', lazy.spawn('amixer -D pulse set Master toggle')), Key([], 'XF86AudioRaiseVolume', lazy.spawn('pactl set-sink-volume @DEFAULT_SINK@ +5%')), Key([], 'XF86AudioLowerVolume', lazy.spawn('pactl set-sink-volume @DEFAULT_SINK@ -5%')), Key([], 'XF86MonBrightnessUp', lazy.function(backlight('inc'))), Key([], 'XF86MonBrightnessDown', lazy.function(backlight('dec'))), Key([mod, "shift"], 'v', lazy.spawn('copyq menu')), Key(["control", "shift"], 'p', lazy.spawn('flameshot gui')), Key([mod, "shift"], 'l', lazy.spawn( 'sh -c "i3lock -i /home/tsuyoshi/Pictures/wallpapers/wallpaper.png & sleep 5 && xset dpms force off"' )), Key([mod, "shift"], 's', lazy.spawn('systemctl suspend')), Key([mod], 'd', lazy.spawn( 'rofi -show run -hide-scrollbar -lines 3 -eh 1 -width 40 -location 8 -xoffset 170 -yoffset 70 -padding 30 -disable-history -font "monospace 18"' )), ] groups = [Group(i) for i in "1234567890"]
Key([mod], "s", lazy.window.toggle_floating()), Key([mod], "f", lazy.window.toggle_fullscreen()), Key([mod], "n", lazy.window.toggle_minimize()), Key([mod], "t", lazy.spawn(APP_FILES)), Key([mod], "w", lazy.spawn(APP_WEB)), Key([mod], "b", lazy.hide_show_bar()), Key([mod], 'Escape', lazy.screen.togglegroup()), # Switch between windows in current stack pane Key([mod], "Down", lazy.layout.down()), Key([mod], "Up", lazy.layout.up()), Key([mod], "Left", lazy.layout.left()), Key([mod], "Right", lazy.layout.right()), # Move to group: Key([mod], "j", lazy.function(moveToGroup, -1), desc="prev group"), Key([mod], "k", lazy.function(moveToGroup, 1), desc="next group"), Key([mod, "shift"], "j", lazy.function(moveToGroup, -1, True), desc="prev used group"), Key([mod, "shift"], "k", lazy.function(moveToGroup, 1, True), desc="next used group"), # move to group + carry window: Key([mod, "mod1"], "j", lazy.function(moveToGroup, -1, False, True), desc="move to prev group"),
lazy.layout.shuffle_down(), lazy.layout.rotate()), Key([mod, "control"], "j", lazy.layout.shuffle_up(), lazy.layout.rotate()), # Resize Windows Key([mod, "control"], "i", lazy.layout.shrink()), Key([mod, "control"], "o", lazy.layout.grow()), # Move focus to different monitor Key([mod], "period", lazy.prev_screen()), Key([mod], "comma", lazy.next_screen()), # Move windows to different screens Key([mod, "control"], "period", lazy.function(window_to_previous_screen)), Key([mod, "control"], "comma", lazy.function(window_to_next_screen)), # Switch window focus to other pane(s) of stack Key([mod], "n", lazy.layout.next()), # Toggle Floating Key([mod], "t", lazy.window.toggle_floating()), # Toggle Fullscreen Key([mod, "shift"], "t", lazy.window.toggle_floating()), # Swap panes of split stack Key([mod], "r", lazy.layout.rotate()), # Toggle between different layouts as defined below
def easy_async(coro, *args, **kwargs): return lazy.function(_easy_add_task, coro, *args, **kwargs)
terminal = guess_terminal() modifier_keys = dict( M="mod4", A="mod1", S="shift", C="control", ) # current = qtile.current_layout.name keys = [ ### The essentials # Key("M-<Enter>", lazy.spawn(terminal)), # Key("M-S-<Enter>" lazy.spawn(dmenu_run)), Key("M-d", lazy.group["scratchpad"].dropdown_toggle("term")), Key("M-a", lazy.function(KbdOverview().toggle)), Key("M-<Tab>", lazy.next_layout()), Key("M-S-<Tab>", lazy.prev_layout()), Key("M-S-r", lazy.restart()), Key("M-S-q", lazy.shutdown()), Key("M-S-c", lazy.window.kill()), ### Switch focus to specific monitor (out of three) # M-w, lazy.to_screen(0)), # M-e, lazy.to_screen(1)), # M-r, lazy.to_screen(2)), ### Switch focus of monitors Key("M-<period>", lazy.next_screen()), Key("M-<comma>", lazy.prev_screen()), ### Window controls ## Change focus Key("M-h", lazy.layout.left()),
# Unsplit = 1 window displayed, like Max layout, but still with # multiple stack panes Key([mod, "shift"], "Return", lazy.layout.toggle_split(), desc="Split"), # Switch between workspaces / groups Key(["control", "mod1"], "Left", lazy.screen.prev_group(), desc="Previous workspace"), Key(["control", "mod1"], "Right", lazy.screen.next_group(), desc="Next workspace"), Key(["mod1"], "Tab", lazy.function(latest_group), desc="Switch between 2 workspaces"), # Open terminal with Super+Return and CTRL+ALT+T Key([mod], "Return", lazy.spawn(terminal), desc="Launch terminal"), Key(["control", "mod1"], "t", lazy.spawn(terminal), desc="Launch terminal (alt)"), # Open webbrowser with Super+W Key([mod], "w", lazy.spawn(browser), desc="Launch webbrowser"), # Lock the screen with Super+L Key([mod], "l", lazy.spawn("light-locker-command -l"), desc="Lock screen"),