def init_group_keybindings(self, groups): # Key alias mod = "mod4" modalt = "mod1" altgr = "mod5" group_keys = [] group_keys += [str(i) for i in range(1, 10)] group_keys += ["0", "minus", "equal"] keys = [] # For all, less the group for "minimized" windows for i, group in enumerate(groups[0:-1]): # Switch to another group keys.append( Key([mod], group_keys[i], lazy.to_screen(group.screen_affinity), lazy.group[group.name].toscreen( screen=group.screen_affinity, toggle=False))) # Move current window to another group keys.append( Key([mod, "shift"], group_keys[i], lazy.window.togroup(group.name))) # Move with current window to another group # keys.append(Key([mod, "control"], group_keys[i], # lazy.window.togroup(group.name), # lazy.group[group.name].toscreen())) return keys
def init_keys(self): """ Initialize key bindings """ def move_window_to_screen(screen_num): """ Move the selected window to a different screen """ def inner(qtile): if qtile.currentWindow is not None: qtile.currentWindow.togroup(qtile.screens[ self.screen_layout[screen_num]].group.name) return inner return [ Key('M-j', lazy.layout.down()), Key('M-k', lazy.layout.up()), Key('M-h', lazy.layout.left()), Key('M-l', lazy.layout.right()), Key('M-S-j', lazy.layout.shuffle_down()), Key('M-S-k', lazy.layout.shuffle_up()), Key('M-S-h', lazy.layout.swap_left()), Key('M-S-l', lazy.layout.swap_right()), Key('A-<Tab>', lazy.next_layout()), Key('M-q', lazy.window.kill()), Key( 'A-S-r', lazy.spawn( "termite --name ranger -e '/usr/bin/tmux new -A -s ranger ranger'" )), Key('M-v', projectm_toggle), Key('M-e', lazy.spawn("termite")), Key('M-S-r', lazy.restart()), Key('M-b', lazy.hide_show_bar("all")), Key('M-S-q', lazy.shutdown()), Key('M-r', dm_run), Key('M-a', decrease_master_volume), Key('M-f', increase_master_volume), Key('M-s', decrease_mpd_volume), Key('M-d', increase_mpd_volume), Key('M-x', mpd_prev_song), Key('M-c', mpd_next_song), Key('M-<space>', mpd_toggle_play), ] + [ Key('M-%s' % str(index + 1), lazy.to_screen(screen)) for index, screen in enumerate(self.screen_layout) ] + [ Key('M-S-%s' % str(i + 1), lazy.function(move_window_to_screen(i))) for i in self.screen_layout ]
def init_keys(): keys = [ # Switch between windows in current stack pane Key([mod], "e", lazy.layout.down()), Key([mod], "u", lazy.layout.up()), Key([mod], "n", lazy.layout.left()), Key([mod], "i", lazy.layout.right()), # Move windows up or down in current stack Key([mod, "shift"], "u", lazy.layout.shuffle_up()), Key([mod, "shift"], "e", lazy.layout.shuffle_down()), Key([mod, "shift"], "n", lazy.layout.swap_left()), Key([mod, "shift"], "i", lazy.layout.swap_right()), Key([mod], "o", lazy.layout.swap_main()), # Grow and shink the windows Key([mod, "mod1"], "u", lazy.layout.grow()), Key([mod, "mod1"], "e", lazy.layout.shrink()), Key([mod, "shift"], "Return", lazy.window.toggle_floating()), # Toggle floating # Switch window focus to other pane(s) of stack Key([mod], "p", lazy.to_screen(0)), # Keyboard focus screen(1) Key([mod], "f", lazy.to_screen(1)), # Keyboard focus screen(2) Key([mod], "space", lazy.layout.next()), # Swap panes of split stack Key([mod, "shift"], "space", lazy.layout.rotate()), # multiple stack panes Key([mod, "shift"], "Return", lazy.layout.toggle_split()), # Toggle between different layouts as defined below Key([mod], "Tab", lazy.next_layout()), Key([mod], "q", lazy.window.kill()), Key([mod, "control"], "r", lazy.restart()), Key([mod, "control"], "q", lazy.shutdown()), Key([mod], "t", lazy.screen.toggle_group()), Key([mod, "mod1"], "t", lazy.screen.toscreen(1)), # Key([mod], "r", lazy.spawncmd()), ] return keys
Key( [mod, "shift"], "Return", lazy.spawn("dmenu_run -p 'Run: '"), # lazy.spawn("rofi -show drun -config ~/.config/rofi/themes/dt-dmenu.rasi -display-drun \"Run: \" -drun-display-format \"{name}\""), desc='Run Launcher'), Key([mod], "Tab", lazy.next_layout(), desc='Toggle through layouts'), Key([mod, "shift"], "c", lazy.window.kill(), desc='Kill active window'), Key([mod, "shift"], "r", lazy.restart(), desc='Restart Qtile'), Key([mod, "shift"], "q", lazy.shutdown(), desc='Shutdown Qtile'), Key(["control", "shift"], "e", lazy.spawn("emacsclient -c -a emacs"), desc='Doom Emacs'), ### Switch focus to specific monitor (out of three) Key([mod], "w", lazy.to_screen(0), desc='Keyboard focus to monitor 1'), Key([mod], "e", lazy.to_screen(1), desc='Keyboard focus to monitor 2'), Key([mod], "r", lazy.to_screen(2), desc='Keyboard focus to monitor 3'), ### Switch focus of monitors Key([mod], "period", lazy.next_screen(), desc='Move focus to next monitor'), Key([mod], "comma", lazy.prev_screen(), desc='Move focus to prev monitor'), ### Treetab controls Key([mod, "control"], "k", lazy.layout.section_up(), desc='Move up a section in treetab'), Key([mod, "control"], "j", lazy.layout.section_down(), desc='Move down a section in treetab'),
), Key( [mod, "shift"], "q", lazy.window.kill() # Kill active window ), Key( [mod, "shift"], "r", lazy.restart() # Restart Qtile ), Key( [mod, "shift"], "c", lazy.shutdown() # Shutdown Qtile ), ### Switch focus to specific monitor (out of three) Key([mod], "w", lazy.to_screen(0) # Keyboard focus to screen(0) ), Key([mod], "e", lazy.to_screen(1) # Keyboard focus to screen(1) ), Key([mod], "r", lazy.to_screen(2) # Keyboard focus to screen(2) ), ### Switch focus of monitors Key([mod], "period", lazy.next_screen() # Move monitor focus to next screen ), Key([mod], "comma", lazy.prev_screen() # Move monitor focus to prev screen ), ### Treetab controls
Key([mod, 'control'], 'l', lazy.layout.add().when('stack'), lazy.layout.increase_ratio().when('tile'), lazy.layout.maximize().when('xmonad-tall')), Key([mod, 'control'], 'h', lazy.layout.delete().when('stack'), lazy.layout.decrease_ratio().when('tile'), lazy.layout.normalize().when('xmonad-tall')), Key([mod, 'control'], 'j', lazy.layout.grow().when('xmonad-tall'), lazy.layout.increase_nmaster().when('tile')), Key([mod, 'control'], 'k', lazy.layout.shrink().when('xmonad-tall'), lazy.layout.decrease_nmaster().when('tile')), Key([mod], 'Left', lazy.to_screen(0)), Key([mod], 'Right', lazy.to_screen(1)), Key([alt], 'Tab', lazy.nextlayout()), # interact with prompts Key([mod], 'r', lazy.spawncmd()), Key([mod], 'g', lazy.switchgroup()), Key([mod], 's', lazy.spawncmd(prompt='Slack Team', command='google-chrome --app=https://%s.slack.com/', complete=None)), # Commands: Application Launchers Key([mod], 'space', lazy.spawn(Commands.dmenu)), Key([mod], 'n', lazy.spawn(Commands.browser)), Key([mod], 'e', lazy.spawn(Commands.file_manager)),
), # Key( # [MOD], "space", # lazy.layout.next() # ), # Key( # [MOD, "shift"], "space", # lazy.layout.rotate() # ), Key( [MOD, "shift"], "Return", lazy.layout.toggle_split() ), Key([MOD], "n", lazy.spawn("firefox")), Key([MOD], "h", lazy.to_screen(1)), Key([MOD], "l", lazy.to_screen(0)), # ~/bin/x starts a terminal program #Key([MOD], "Return", lazy.spawn("~/bin/x")), Key([MOD], "Return", lazy.spawn("terminator -p tango")), #Key([MOD], "Tab", lazy.nextlayout()), Key([MOD], "space", lazy.nextlayout()), Key([MOD, 'shift'], "space", lazy.prevlayout()), Key([MOD], "Tab", lazy.group.next_window()), Key([MOD, 'shift'], "Tab", lazy.group.prev_window()), Key([MOD, 'shift'], "c", lazy.window.kill()), Key([MOD], "f", lazy.window.toggle_floating()), Key([MOD], "m", lazy.window.toggle_minimize()), Key([MOD], "x", lazy.window.toggle_maximize()), Key([MOD], "u", lazy.window.toggle_fullscreen()), #Key([MOD], "[", lazy.window.move_floating(-10,0)),
qtile.currentWindow.togroup(qtile.screens[screen_order[idx]].group.name) return func keys = [ # terminal Key([mod], "Return", lazy.spawn("mlterm")), # move focus Key([mod], "h", lazy.layout.left()), Key([mod], "k", focus_prev_window), Key([mod], "j", focus_next_window), Key([mod], "l", lazy.layout.right()), # focus screen Key([mod], "p", lazy.to_screen(screen_order[0])), Key([mod], "bracketleft", lazy.to_screen(screen_order[1])), Key([mod], "bracketright", lazy.to_screen(screen_order[2])), Key([mod, "shift"], "p", move_window_to_the_screen(0)), Key([mod, "shift"], "bracketleft", move_window_to_the_screen(1)), Key([mod, "shift"], "bracketright", move_window_to_the_screen(2)), # reset groups Key([mod], "r", reset_default_group), # launcher Key([mod], "m", lazy.spawn("rofi -show window -font 'Ricty 14' -fg '#a0a0a0' -bg '#000000' -hlfg '#ffb964' -hlbg '#303030' -fg-active '#ffb0b0' -opacity 85")), Key([mod], "n", lazy.spawn("rofi -show run -font 'Ricty 14' -fg '#00ff00' -bg '#000000' -hlfg '#b9ff64' -hlbg '#303030' -opacity 85")), Key([mod], "d", lazy.spawn("rofi -show run -font 'Ricty 14' -fg '#00ff00' -bg '#000000' -hlfg '#b9ff64' -hlbg '#303030' -opacity 85")), #Key([mod], "d", lazy.spawn("xboomx")),
), Key( [alt], "Tab", lazy.group.next_window()), # this is usefull when floating windows get buried Key( [alt], "grave", lazy.window.bring_to_front() ), Key( [mod, alt], "Tab", lazy.window.to_next_screen() ), Key( [mod, alt], "1", lazy.to_screen(0), lazy.group.toscreen(0) ), Key( [mod, alt], "2", lazy.to_screen(1), lazy.group.toscreen(1) ), Key( [mod], "Left", lazy.group.prevgroup() ), Key( [mod], "Right", lazy.group.nextgroup() ),
), Key([mod, "shift"], "r", lazy.restart(), desc='Restart Qtile' ), Key([mod, "shift"], "q", lazy.shutdown(), desc='Shutdown Qtile' ), Key(["control", "shift"], "e", lazy.spawn("emacsclient -c -a emacs"), desc='Doom Emacs' ), ### Switch focus to specific monitor (out of three) Key([mod], "w", lazy.to_screen(0), desc='Keyboard focus to monitor 1' ), Key([mod], "e", lazy.to_screen(1), desc='Keyboard focus to monitor 2' ), Key([mod], "r", lazy.to_screen(2), desc='Keyboard focus to monitor 3' ), ### Switch focus of monitors Key([mod], "period", lazy.next_screen(), desc='Move focus to next monitor' ),
# Restart Qtile Key([mod, "control"], "r", lazy.restart()), # Kill window Key([mod], "w", lazy.window.kill()), # Switch between windows Key([mod], "k", lazy.layout.down()), Key([mod], "j", lazy.layout.up()), # Move windows up/down or left/right in current stack # It's like resizing the window Key([mod, "control"], "k", lazy.layout.shuffle_down()), Key([mod, "control"], "j", lazy.layout.shuffle_up()), Key([alt], "Tab", lazy.group.next_window()), # this is usefull when floating windows get buried # Key([alt], "grave", lazy.window.bring_to_front()), Key([mod, alt], "Tab", lazy.window.to_next_screen()), Key([mod, alt], "1", lazy.to_screen(0), lazy.group.toscreen(0)), Key([mod, alt], "2", lazy.to_screen(1), lazy.group.toscreen(1)), Key([mod], "Left", lazy.group.prevgroup()), Key([mod], "Right", lazy.group.nextgroup()), # Change layout to max Key([mod], "m", lazy.group.setlayout('max')), # Change layout to floating Key([mod], "f", lazy.group.setlayout('floating')), Key([mod], "a", lazy.group.setlayout('ratiotile')), Key([mod], "x", lazy.group.setlayout('xmonad-tall')), Key([mod], "t", lazy.group.setlayout('tile')), # Bindings to control the layouts Key([mod], "h", lazy.layout.previous()), Key([mod], "l", lazy.layout.next()), Key([mod], "j", lazy.layout.up()), Key([mod], "k", lazy.layout.down()),
subprocess.run(['xbacklight', f'-{action}', '1']) return f keys = [ Key([mod], 'k', lazy.layout.down()), Key([mod], 'j', lazy.layout.up()), Key([mod], 'space', lazy.layout.next()), Key([mod, 'control'], 'k', lazy.layout.shuffle_down()), Key([mod, 'control'], 'j', lazy.layout.shuffle_up()), Key([mod, 'shift'], 'h', lazy.layout.client_to_previous()), Key([mod, 'shift'], 'l', lazy.layout.client_to_next()), Key([mod, 'shift'], 'space', lazy.layout.rotate()), Key([mod, 'shift'], 'Return', lazy.layout.toggle_split()), Key([mod], '1', lazy.to_screen(1)), Key([mod], '2', lazy.to_screen(2)), Key([mod], 'Tab', lazy.next_layout()), Key([mod], 'x', lazy.window.kill()), Key([mod], 'r', lazy.spawncmd()), Key([mod, 'control'], 'r', lazy.restart()), Key([mod, 'control'], 'q', lazy.shutdown()), # Screen Key([], 'F7', lazy.spawn('xset dpms force off')), Key([], 'XF86MonBrightnessUp', lazy.function(backlight('inc'))), Key([], 'XF86MonBrightnessDown', lazy.function(backlight('dec'))),
lazy.layout.increase_nmaster()), # Tile Key([mod, ctrl], "l", lazy.layout.delete(), # Stack lazy.layout.increase_ratio(), # Tile lazy.layout.grow()), # xmonad-tall Key([mod, ctrl], "h", lazy.layout.add(), # Stack lazy.layout.decrease_ratio(), # Tile lazy.layout.shrink()), # xmonad-tall Key([mod], "k", lazy.layout.down()), Key([mod], "j", lazy.layout.up()), Key([mod], "h", lazy.layout.previous()), Key([mod], "l", lazy.layout.next()), Key([mod, alt], "h", lazy.to_screen(0)), Key([mod, alt], "l", lazy.to_screen(1)), Key([ctrl, alt], "Up", lazy.to_screen(0), lazy.screen.prevgroup()), Key([ctrl, alt], "Down", lazy.to_screen(0), lazy.screen.nextgroup()), Key([ctrl, alt, shift], "Up", lazy.to_screen(1), lazy.screen.prevgroup(), lazy.to_screen(0)), Key([ctrl, alt, shift], "Down", lazy.to_screen(1), lazy.screen.nextgroup(), lazy.to_screen(0)), Key([mod, "shift"], "k", lazy.layout.shuffle_up()), # Stack, xmonad-tall Key([mod, "shift"], "j", lazy.layout.shuffle_down()), # Stack, xmonad-tall Key([mod, shift], "space", lazy.layout.rotate(), lazy.layout.flip()), # xmonad-tall
TERMINAL = "gnome-terminal" SUSPEND = "dbus-send --system --print-reply --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend" keys = [ Key([super], g.name, lazy.group[g.name].toscreen()) for g in groups ] + [ Key([super, shift], g.name, lazy.window.togroup(g.name)) for g in groups ] + [ Key([super], "k", lazy.layout.down()), Key([super], "j", lazy.layout.up()), Key([super, control], "k", lazy.layout.shuffle_down()), Key([super, control], "j", lazy.layout.shuffle_up()), Key([alt], "Tab", lazy.layout.next()), Key([super, shift], "space", lazy.layout.rotate()), Key([super, shift], "Return", lazy.layout.toggle_split()), Key([super], "h", lazy.to_screen(1)), Key([super], "l", lazy.to_screen(0)), Key([], "F1", lazy.spawn(TERMINAL)), Key([alt], "F2", lazy.spawn(RUN)), Key([super], "Tab", lazy.nextlayout()), Key([super, shift], "c", lazy.window.kill()), Key([super], "Escape", lazy.spawn(SUSPEND)), ] layouts = [ layout.Max(), layout.Stack(stacks=2), layout.Tile(ratio=0.25), ] screens = [
[mod, "shift"], "Return", lazy.layout.toggle_split() ), Key([mod], "Return", lazy.spawn("konsole")), # Screen rotation Key([mod], "Left", lazy.spawn("xrandr --output VGA-1 --rotation left")), Key([mod], "Up", lazy.spawn("xrandr --output VGA-1 --rotation normal")), Key([mod], "Right", lazy.spawn("xrandr --output VGA-1 --rotation right")), # Toggle between different layouts as defined below Key([mod], "Tab", lazy.next_layout()), Key([mod, "shift"], "Tab", lazy.prev_layout()), # Focus screen Key([mod], "1", lazy.to_screen(1)), Key([mod], "2", lazy.to_screen(0)), # Window and qtile management Key([mod, "shift"], "c", lazy.window.kill()), Key([mod, "control"], "r", lazy.restart()), Key([mod, "control"], "q", lazy.shutdown()), Key([mod], "r", lazy.spawncmd()), ] #Keys to map to groups letters = ["a", "q", "s", "w", "d", "e", "f"] #Names of groups
# Switch between windows in current stack pane Key( [mod], "k", lazy.layout.down() ), Key( [mod], "j", lazy.layout.up() ), # switch between groups # Key([mod], "h", lazy.screen.prevgroup(skip_managed=True)), # Key([mod], "l", lazy.screen.nextgroup(skip_managed=True)), # switch between screens, Key([mod], "h", lazy.to_screen(0)), # left Key([mod], "l", lazy.to_screen(1)), # right # Move windows up or down in current stack Key( [mod, "control"], "j", lazy.layout.shuffle_down() ), Key( [mod, "control"], "k", lazy.layout.shuffle_up() ), # quit the window manager Key( [mod, "shift"], "q", lazy.shutdown() ), # Switch window focus to other pane(s) of stack
Key([modkey, "shift"], "q", lazy.shutdown()), # kill qtile # layout controls Key([modkey], "t", lazy.window.disable_floating()), # embed float Key([modkey, "shift"], "t", lazy.window.enable_floating()), # pop tile Key([modkey], "k", lazy.layout.down()), # focus left Key([modkey], "j", lazy.layout.up()), # focus right Key([modkey, "shift"], "k", lazy.layout.shuffle_down()), # move tile left Key([modkey, "shift"], "j", lazy.layout.shuffle_up()), # move tile right Key([modkey], "h", lazy.layout.grow()), # increase tile size Key([modkey], "l", lazy.layout.shrink()), # decrease tile size Key([modkey], "n", lazy.layout.normalize()), # equalize tiles Key([modkey], "o", lazy.layout.maximize()), # maximize tile Key([modkey], "Tab", lazy.layout.toggle_split()), Key([modkey], "space", lazy.next_layout()), Key([modkey], "e", lazy.to_screen(screen_left)), Key([modkey], "w", lazy.to_screen(screen_right)), ] mouse = [ # pop tile Drag([modkey], "Button1", lazy.window.set_position_floating(), start=lazy.window.get_position()), # resize float Drag([modkey], "Button3", lazy.window.set_size_floating(), start=lazy.window.get_size()), # show float Click([modkey], "Button2", lazy.window.bring_to_front()), ] # Ten virtual-workspaces
keys = [ # Switch between windows in current stack pane Key([mod], "k", lazy.layout.down()), Key([mod], "j", lazy.layout.up()), # Move windows up or down in current stack Key([mod, "control"], "k", lazy.layout.shuffle_down()), Key([mod, "control"], "j", lazy.layout.shuffle_up()), # Switch window focus to other pane(s) of stack Key([mod], "space", lazy.layout.next()), # Swap panes of split stack Key([mod, "shift"], "space", lazy.layout.rotate()), # 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()), Key([mod], "h", lazy.to_screen(1)), Key([mod], "l", lazy.to_screen(0)), Key([mod], "Return", lazy.spawn("xterm")), # Toggle between different layouts as defined below Key([mod], "Tab", lazy.nextlayout()), Key([mod], "w", lazy.window.kill()), Key([mod, "control"], "r", lazy.restart()), Key([mod], "r", lazy.spawncmd()), ] groups = [Group("a"), Group("s"), Group("d"), Group("f"), Group("u"), Group("i"), Group("o"), Group("p")] for i in groups: # mod1 + letter of group = switch to group keys.append(Key([mod], i.name, lazy.group[i.name].toscreen())) # mod1 + shift + letter of group = switch to & move focused window to group
Key([MODKEY], SPACE, lazy.nextlayout()), Key([MODKEY], 'q', lazy.window.kill()), Key([MODKEY], 'p', lazy.spawncmd()), Key([MODKEY], 't', lazy.window.toggle_floating()), Key([MODKEY], 'f', lazy.window.toggle_fullscreen()), # Move Focus Key([MODKEY], TAB, lazy.layout.next()), Key([MODKEY, SHIFT], TAB, lazy.layout.previous()), Key([MODKEY], 'h', lazy.layout.left()), Key([MODKEY], 'j', lazy.layout.down()), Key([MODKEY], 'k', lazy.layout.up()), Key([MODKEY], 'l', lazy.layout.right()), Key([MODKEY], 'w', lazy.prev_screen()), Key([MODKEY], 'e', lazy.next_screen()), Key([WIN], '1', lazy.to_screen(0)), Key([WIN], '2', lazy.to_screen(1)), Key([WIN], '3', lazy.to_screen(2)), # Move Window Key([MODKEY, SHIFT], 'j', lazy.layout.shuffle_down()), Key([MODKEY, SHIFT], 'k', lazy.layout.shuffle_up()), Key([MODKEY], 'i', lazy.layout.swap_main()), # Alter Window Size Key([MODKEY, SHIFT], 'h', lazy.layout.shrink()), Key([MODKEY, SHIFT], 'l', lazy.layout.grow()), Key([MODKEY, SHIFT], 'n', lazy.layout.reset()), Key([MODKEY], 'm', lazy.layout.maximize()), Key([MODKEY], 'n', lazy.layout.normalize()),
), # Swap panes of split stack Key( [mod, "shift"], "space", lazy.layout.rotate() ), # 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() ), Key([mod], "h", lazy.to_screen(1)), Key([mod], "l", lazy.to_screen(0)), Key([mod], "Return", lazy.spawn("xterm")), # Toggle between different layouts as defined below Key([mod], "Tab", lazy.nextlayout()), Key([mod], "w", lazy.window.kill()), Key([mod, "control"], "r", lazy.restart()), Key([mod], "r", lazy.spawncmd()), ] groups = [ Group("a"), Group("s"), Group("d"),
# 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(["control", "mod1"], "t", lazy.spawn(terminal), desc="Launch terminal"), # Toggle between different layouts as defined below Key([mod], "Tab", lazy.next_layout(), desc="Toggle between layouts"), Key(["control", "shift"], "w", 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], "Return", lazy.spawncmd(), desc="Spawn a command using a prompt widget"), Key(["control", "mod1"], "w", lazy.to_screen(0), desc='Keyboard focus to monitor 1'), Key(["control", "mod1"], "q", lazy.to_screen(1), desc='Keyboard focus to monitor 2'), Key(["control", "mod1"], "e", lazy.to_screen(2), desc='Keyboard focus to monitor 3'), Key(["control", "shift"], "f", lazy.spawn("firefox")), Key([mod, "control"], "l", lazy.spawn(terminal+" -e dm-tool lock")), ] ### GROUPS ### group_names = [("TERM", {"layout": "monadtall"}), ("WWW", {"layout": "max"}), ("FILE", {"layout": "monadtall"}), ("VBOX", {"layout": "monadtall"}), ("NOTES", {"layout": "max"}), ("MUSIC", {"layout": "max"}),
), # Also allow changing volume the old fashioned way. Key([mod], "equal", lazy.spawn("amixer -c 0 -q set Master 2dB+")), Key([mod], "minus", lazy.spawn("amixer -c 0 -q set Master 2dB-")), # restart qtile Key([mod, "control"], "r", lazy.restart()), # Move windows up or down in current stack Key([mod, "control"], "k", lazy.layout.shuffle_down()), Key([mod, "control"], "j", lazy.layout.shuffle_up()), # Switch screens Key([mod], "1", lazy.to_screen(0), lazy.group.to_screen(0)), Key([mod], "2", lazy.to_screen(1), lazy.group.to_screen(1)), # Print screen Key([mod], "F10", lazy.spawn("import -window root ~/screenshot.png")), # Full screen Key([mod], "F11", lazy.window.toggle_fullscreen()), ] # This allows you to drag windows around with the mouse if you want. mouse = [ Drag([mod], "Button1", lazy.window.set_position_floating(), start=lazy.window.get_position()),
def init_keys(): mod = "mod4" keys = [ Key([mod], "j", lazy.layout.down()), Key([mod], "k", lazy.layout.up()), Key([mod], "h", lazy.layout.left()), Key([mod], "l", lazy.layout.right()), Key([mod, "shift"], "j", lazy.layout.shuffle_down()), Key([mod, "shift"], "k", lazy.layout.shuffle_up()), Key([mod, "shift"], "h", lazy.layout.shuffle_left()), Key([mod, "shift"], "l", lazy.layout.shuffle_right()), Key([mod, "mod1"], "j", lazy.layout.flip_down()), Key([mod, "mod1"], "k", lazy.layout.flip_up()), Key([mod, "mod1"], "h", lazy.layout.flip_left()), Key([mod, "mod1"], "l", lazy.layout.flip_right()), Key([mod, "control"], "j", lazy.layout.grow_down()), Key([mod, "control"], "k", lazy.layout.grow_up()), Key([mod, "control"], "h", lazy.layout.grow_left()), Key([mod, "control"], "l", lazy.layout.grow_right()), Key([mod, "shift"], "n", lazy.layout.normalize()), Key([mod], "space", lazy.layout.toggle_split()), # Switch between windows in current stack pane #Key([mod], "j", lazy.layout.down()), #Key([mod], "k", lazy.layout.up()), # Move windows up or down in current stack #Key([mod, "control"], "j", lazy.layout.shuffle_down()), #Key([mod, "control"], "k", lazy.layout.shuffle_up()), # Switch window focus to other pane(s) of stack #Key([mod], "space", lazy.layout.next()), # Swap panes of split stack #Key([mod, "shift"], "space", lazy.layout.rotate()), # 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()), # Open terminal Key([mod], "Return", lazy.spawn(terminal)), # Toggle between different layouts as defined below Key([mod], "Tab", lazy.next_layout()), # Kill active window Key([mod, "shift"], "c", lazy.window.kill()), # Restart Qtile Key([mod, "control"], "r", lazy.restart()), # Shutdown Qtile Key([mod, "control"], "q", lazy.shutdown()), # Lock Qtile Key([mod, "control"], "p", lazy.spawn("i3lock -c 1d1f21")), # Suspend Qtile Key([mod, "control"], "x", lazy.spawn("/home/rschwalk/dotfiles/scripts/lock_suspend.sh")), Key([ mod, ], "d", lazy.spawn( "dmenu_run -fn 'Source Code Pro:size=12' -nb '#1d1f21' -nf '#b5bd68' -sb '#81a2be' -sf '#1d1f21' -p 'dmenu:'" )), Key([mod], "r", lazy.spawncmd()), Key([mod], "F5", lazy.spawn("firefox")), Key([mod], "F6", lazy.spawn("thunar")), Key([mod], "F11", lazy.spawn("rofi -show run -fullscreen")), Key([mod], "F12", lazy.spawn("rofi -show run")), Key([mod, "shift"], "F12", lazy.spawn("rofi -show window")), # Keyboard focus screen(0) Key([mod], "w", lazy.to_screen(1)), # Keyboard focus screen(1) Key([mod], "e", lazy.to_screen(0)), #Key( # [mod, "shift"], "l", # lazy.layout.grow(), # Grow size of current window (XmonadTall) # lazy.layout.increase_nmaster(), # Increase number in master pane (Tile) # ), #Key( # [mod, "shift"], "h", # lazy.layout.shrink(), # Shrink size of current window (XmonadTall) # lazy.layout.decrease_nmaster(), # Decrease number in master pane (Tile) # ), Key( [mod, "shift"], "Left", # Move window to workspace to the left window_to_prev_group), Key( [mod, "shift"], "Right", # Move window to workspace to the right window_to_next_group), #Key( # [mod], "n", # lazy.layout.normalize() # Restore all windows to default size ratios # ), Key( [mod], "m", lazy.layout.maximize( ) # Toggle a window between minimum and maximum sizes ), Key( [mod, "shift"], "f", lazy.window.toggle_floating() # Toggle floating ), Key( [], "XF86AudioRaiseVolume", lazy.spawn("amixer -q set Master 2%+") # Volume up ), Key( [], "XF86AudioLowerVolume", lazy.spawn("amixer -q set Master 2%-") # Volume down ), Key( [], "XF86AudioMute", lazy.spawn("amixer -q set Master toggle") # Mute volume ), ] return keys
], size=17, **bar_defaults) ), ] keys = [ Key([ALT_KEY, CONTROL_KEY, MOD_KEY, SHIFT_KEY], 'q', lazy.shutdown()), Key([ALT_KEY, CONTROL_KEY, MOD_KEY, SHIFT_KEY], 'r', lazy.restart()), Key([MOD_KEY], 'k', lazy.layout.up()), Key([MOD_KEY], 'j', lazy.layout.down()), Key([MOD_KEY], 'h', lazy.layout.previous()), Key([MOD_KEY], 'l', lazy.layout.next()), Key([MOD_KEY], RETURN_KEY, lazy.layout.maximize()), Key([MOD_KEY, SHIFT_KEY], RETURN_KEY, lazy.layout.normalize()), Key([CONTROL_KEY, MOD_KEY], 'h', lazy.layout.prev_screen()), Key([CONTROL_KEY, MOD_KEY], 'l', lazy.layout.next_screen()), Key([MOD_KEY], '1', lazy.to_screen(0)), Key([MOD_KEY], '2', lazy.to_screen(1)), Key([MOD_KEY], '3', lazy.to_screen(2)), Key([ALT_KEY, CONTROL_KEY, MOD_KEY, SHIFT_KEY], 'x', lazy.window.kill()), Key([MOD_KEY], RETURN_KEY, lazy.spawn('urxvt -title term -e zsh')), Key([SHIFT_KEY, MOD_KEY], RETURN_KEY, lazy.spawn('urxvt -title miscterm -e zsh')), Key([MOD_KEY], PAUSE_KEY, lazy.spawn('~/bin/lock.sh')), Key([ALT_KEY, CONTROL_KEY, MOD_KEY], PAUSE_KEY, lazy.spawn('~/bin/suspend.sh')), Key([MOD_KEY], 'equal', lazy.spawn('amixer -c 0 -q set Master 2dB+')), Key([MOD_KEY], 'minus', lazy.spawn('amixer -c 0 -q set Master 2dB-')), Key([CONTROL_KEY, MOD_KEY], 'equal', lazy.spawn('amixer -c 0 -q set Master mute')), Key([CONTROL_KEY, MOD_KEY], 'minus', lazy.spawn('amixer -c 0 -q set Master unmute')), ]
Group('5', label='●'), Group('6', label='●'), Group('7', label='●'), Group('8', label='●'), Group('9', label='●'), Group('0', label='●', matches=[Match(wm_class=['Spotify'])]), ] for index, group in enumerate(groups): screen = index // 5 # mod + group's number = switch group # moves group to screen and then sets focus on screen # if group < 5 sets screen 0, else screen 1 keys.append( Key([mod], group.name, lazy.group[group.name].toscreen(screen), lazy.to_screen(screen))) # mod + shift + group's number = switch to & move focused window to group keys.append(Key([mod, shift], group.name, lazy.window.togroup(group.name))) # Layouts layouts = [ layout.bsp.Bsp(border_focus='#0c91ac', border_normal='#222222', border_width=2, margin=5), ] floating_layout = layout.Floating() group_box_config = {
Key([mod], "h", lazy.layout.left()), Key([mod], "l", lazy.layout.right()), Key([mod], "j", lazy.layout.down()), Key([mod], "k", lazy.layout.up()), Key([mod, "shift"], "h", lazy.layout.swap_left()), Key([mod, "shift"], "l", lazy.layout.swap_right()), Key([mod, "shift"], "j", lazy.layout.shuffle_down()), Key([mod, "shift"], "k", lazy.layout.shuffle_up()), Key([mod], "i", lazy.layout.grow()), Key([mod], "m", lazy.layout.shrink()), Key([mod], "n", lazy.layout.normalize()), Key([mod], "o", lazy.layout.maximize()), Key([mod, "shift"], "space", lazy.layout.flip()), # Select screen focus Key([mod, alt], group_numbers_current[0], lazy.to_screen(0)), Key([mod, alt], group_numbers_current[1], lazy.to_screen(1)), Key([mod, alt], group_numbers_current[2], lazy.to_screen(2)), # Shift keyboard layout Key(["shift", alt], "e", lazy.spawn("setxkbmap es")), Key(["shift", alt], "f", lazy.spawn("setxkbmap fr")), # Open Firefox Key([mod], "f", lazy.spawn("firefox")), # Open Tor Browser Key([mod], "t", lazy.spawn("torbrowser-launcher")), # Open Pavucontrol Key([mod], "p", lazy.spawn("pavucontrol")), # Open Session Key([mod], "s",
# Key Bindings # ---------------- keys = [ # Switch between windows in current stack pane Key([mod], "k", lazy.layout.down()), Key([mod], "j", lazy.layout.up()), Key([mod, "shift"], "k", lazy.layout.shuffle_down()), Key([mod, "shift"], "j", lazy.layout.shuffle_up()), Key([mod], "l", lazy.layout.grow()), Key([mod], "h", lazy.layout.shrink()), Key([mod], "m", lazy.layout.maximize()), Key([mod, "shift"], "m", lazy.layout.normalize()), Key([mod, "shift"], "space", lazy.layout.flip()), Key(["control"], "1", lazy.to_screen(0)), Key(["control"], "2", lazy.to_screen(1)), # Switch window focus to other pane(s) of stack Key([mod], "Tab", lazy.layout.next()), # Swap panes of split stack Key([mod, "shift"], "space", lazy.layout.rotate()), # 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()), # Start Applications
Key([mod], "Down", lazy.layout.normalize()), Key([mod], "Up", lazy.layout.maximize()), # Switch window focus to other pane(s) of stack Key([mod], "space", lazy.layout.next()), # Swap panes of split stack Key([mod, "shift"], "space", lazy.layout.rotate()), # 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()), Key([mod], "x", lazy.to_screen(0)), Key([mod], "z", lazy.to_screen(1)), # Toggle between different layouts as defined below Key([mod], "Tab", lazy.next_layout()), Key([mod], "w", lazy.window.kill()), Key([mod, "control"], "r", lazy.restart()), Key([mod, "control"], "q", lazy.shutdown()), Key([mod], "r", lazy.spawn("lighthouse-launcher")), Key([mod], "e", lazy.spawncmd()), Key([mod], "q", lazy.spawn("change-wallpaper")), Key([mod], "Return", lazy.spawn("urxvt")), Key([mod], "c", lazy.spawn("chrome")), Key([mod], "v", lazy.spawn("code")), ]
lazy.spawn("amixer -c 0 -q set Master 2dB-")), Key([], "XF86AudioMute", lazy.spawn("amixer -c 0 -q set Master toggle")), # Also allow changing volume the old fashioned way. Key([mod], "equal", lazy.spawn("amixer -c 0 -q set Master 2dB+")), Key([mod], "minus", lazy.spawn("amixer -c 0 -q set Master 2dB-")), # restart qtile Key([mod, "control"], "r", lazy.restart()), # Move windows up or down in current stack Key([mod, "control"], "k", lazy.layout.shuffle_down()), Key([mod, "control"], "j", lazy.layout.shuffle_up()), # Switch screens Key([mod], "1", lazy.to_screen(0), lazy.group.to_screen(0)), Key([mod], "2", lazy.to_screen(1), lazy.group.to_screen(1)), # Print screen Key([mod], "F10", lazy.spawn("import -window root ~/screenshot.png")), # Full screen Key([mod], "F11", lazy.window.toggle_fullscreen()), ] # This allows you to drag windows around with the mouse if you want. mouse = [ Drag([mod], "Button1", lazy.window.set_position_floating(), start=lazy.window.get_position()),
Key( [mod, "shift"], "q", lazy.shutdown() # Shutdown Qtile ), # cycle to next group Key([mod], "p", lazy.screen.prev_group()), Key([mod], "n", lazy.screen.next_group()), # Switch focus to specific monitor (out of three) Key( [mod], "w", # Keyboard focus to screen(0) lazy.to_screen(0)), Key( [mod], "e", # Keyboard focus to screen(1) lazy.to_screen(1)), Key( [mod], "r", # Keyboard focus to screen(2) lazy.to_screen(2)), # Switch focus of monitors Key([mod], "period", lazy.next_screen()), Key([mod], "comma", lazy.prev_screen()), Key([mod], "Tab", lazy.screen.toggle_group()),
# Switch groups Key([mod], 'Left', lazy.screen.prev_group()), Key([mod], 'Right', lazy.screen.next_group()), # Key([mod], '`', lazy.screen.next_group()), # Cycle layouts Key([mod], 'Up', lazy.next_layout()), Key([mod], 'Down', lazy.prev_layout()), # Change window focus Key([mod], 'Tab', lazy.layout.next()), Key([mod, 'shift'], 'Tab', lazy.layout.previous()), # Switch focus to other screens Key([mod], 'h', lazy.to_screen(0)), # left Key([mod], 'l', lazy.to_screen(1)), # right # Commands: Application Launchers Key([mod], 'space', lazy.spawn(Commands.dmenu)), Key([mod], 'n', lazy.spawn(Commands.browser)), Key([mod], 'm', lazy.spawn(Commands.mail)), Key([mod], 'e', lazy.spawn(Commands.file_manager)), Key([mod], 'Return', lazy.spawn(Commands.terminal)), # Commands: Volume Controls Key([], 'XF86AudioRaiseVolume', lazy.spawn(Commands.volume_up)), Key([], 'XF86AudioLowerVolume', lazy.spawn(Commands.volume_down)), Key([], 'XF86AudioMute', lazy.spawn(Commands.volume_toggle)), Key([], 'XF86TouchpadToggle', lazy.spawn(Commands.trackpad_toggle)),
Key([mod, "shift"], "j", lazy.layout.shuffle_up()), Key([mod], "Tab", lazy.layout.next()), Key([mod, "shift"], "Tab", lazy.layout.client_to_next()), Key([mod, "shift"], "space", lazy.layout.rotate()), Key([mod, "shift"], "Return", lazy.layout.toggle_split()), Key([mod], "space", lazy.nextlayout()), Key([mod], "t", lazy.window.toggle_floating()), # for MonadTall layout Key([mod], "l", lazy.layout.grow()), Key([mod], "h", lazy.layout.shrink()), Key([mod], "n", lazy.layout.normalize()), Key([mod], "m", lazy.layout.maximize()), Key([mod], "w", lazy.to_screen(0)), Key([mod], "e", lazy.to_screen(1)), Key([mod], "Return", lazy.spawn("urxvt")), Key([mod], "p", lazy.spawn("dmenu_run")), Key([mod, "shift"], "c", lazy.window.kill()), Key([mod], "q", lazy.restart()), Key([mod, "shift"], "q", lazy.shutdown()), ] mouse = [ # XXX: Drag+Click on same button are not working! #Click([mod], "Button1", lazy.window.bring_to_front()),
("z", "x"), ] for upkey, downkey in layout_switch_keys: keys.append(Key([mod], upkey, lazy.nextlayout())) keys.append(Key([mod], downkey, lazy.prevlayout())) # Switch between screens. screen_switch_keys = [ # Super + the two keys on both sides of the middle row of the keyboard to switch windows. ("semicolon", "apostrophe"), ("s", "d"), ] for firstkey, secondkey in screen_switch_keys: keys.append(Key([mod], firstkey, lazy.to_screen(0))) keys.append(Key([mod], secondkey, lazy.to_screen(1))) keys.append(Key([mod, ctrl], "r", lazy.restart())) keys.append(Key([mod, ctrl, shift, alt], "q", lazy.spawn("echo \"quit\" > /tmp/hevents%s" % (os.environ["DISPLAY"].replace(":", "_"))), lazy.shutdown())) keys.append(Key([mod, ctrl, alt, shift], "1", lazy.spawn(os.path.expanduser("~/.bin/screenconf 1")))) keys.append(Key([mod, ctrl, alt, shift], "2", lazy.spawn(os.path.expanduser("~/.bin/screenconf 2")))) #### Application Launching # Slock for screen locking. keys.append(Key([mod], "l", lazy.spawn("slock")))
Key([mod], "t", lazy.layout.up()), # Move windows up or down in current stack Key([mod, "shift"], "h", lazy.layout.shuffle_down()), Key([mod, "shift"], "t", lazy.layout.shuffle_up()), # Change size of panels Key([mod], "m", lazy.layout.grow()), Key([mod], "b", lazy.layout.shrink()), Key([mod], "s", lazy.layout.normalize()), # Swap side of main monad pane Key([mod], "space", lazy.layout.flip()), # Move to left and right screens Key([mod], "d", lazy.to_screen(0)), Key([mod], "n", lazy.to_screen(1)), # Toggle between different layouts as defined below Key([mod], "Tab", lazy.nextlayout()), Key([mod, "shift"], "w", lazy.window.kill()), # Toggle floating windows Key([mod], "f", lazy.window.toggle_floating()), Key([mod, "shift"], "r", lazy.restart()), Key([mod, "shift"], "q", lazy.shutdown()), Key([mod], "r", lazy.spawncmd()), # Applications Key([mod], "c", lazy.spawn("firefox")), Key([mod], "l", lazy.spawn("clementine")),
Key([MOD], "j", lazy.group.next_window()), Key([MOD], "k", lazy.group.prev_window()), Key([MOD], "h", lazy.layout.shrink_main()), Key([MOD], "l", lazy.layout.grow_main()), Key([MOD, SHIFT], "h", lazy.layout.shrink()), Key([MOD, SHIFT], "l", lazy.layout.grow()), Key([MOD], "n", lazy.layout.normalize()), Key([MOD], "m", lazy.layout.maximize()), # Move windows up or down in current stack Key([MOD, SHIFT], "j", lazy.layout.shuffle_down()), Key([MOD, SHIFT], "k", lazy.layout.shuffle_up()), Key([MOD], ENTER, lazy.layout.swap_main()), # Multi-monitor support Key([MOD], "w", lazy.to_screen(1)), Key([MOD], "e", lazy.to_screen(0)), # Swap main pane Key([MOD], "f", lazy.layout.flip()), Key([MOD, SHIFT], "f", lazy.window.toggle_fullscreen()), # Floating Key([MOD], "t", lazy.window.toggle_floating()), # Open a new terminal Key([MOD, SHIFT], ENTER, lazy.spawn("terminator")), # Toggle between different layouts as defined below Key([MOD], SPACE, lazy.next_layout()), Key([MOD, SHIFT], "c", lazy.window.kill()),
# Shrink/Grow Key([mod], "i", lazy.layout.grow()), Key([mod], "m", lazy.layout.shrink()), Key([mod, "shift"], "f", lazy.window.toggle_fullscreen()), # Toggle between different layouts as defined below Key([mod], "Tab", lazy.next_layout()), Key([mod, "shift"], "q", lazy.window.kill()), Key([mod, "control"], "r", lazy.restart()), Key([mod, "control"], "q", lazy.shutdown()), Key([mod], "r", lazy.spawncmd()), # Screens?!?jedi=0, ?!? (*args, *_***kwargs*_*) ?!?jedi?!? Key([mod, "control"], "1", lazy.to_screen(0)), Key([mod, "control"], "2", lazy.to_screen(1)) ] system = [ Key([mod, "shift"], "x", lazy.function(lock_screen())), Key([], 'XF86MonBrightnessUp', lazy.function(change_backlight('up'))), Key([], 'XF86MonBrightnessDown', lazy.function(change_backlight('down'))), Key([], 'XF86AudioRaiseVolume', lazy.spawn('pactl set-sink-volume 0 +5%')), Key([], 'XF86AudioLowerVolume', lazy.spawn('pactl set-sink-volume 0 -5%')), Key([], 'XF86AudioMute', lazy.spawn('pactl set-sink-mute 0 toggle')) ] rofi = [ Key([mod], "d", lazy.spawn("rofi -show drun")), ]
if common.num_screens == 4: g = [0, 0, 1, 1, 2, 2, 3, 3, 0] elif common.num_screens == 3: g = [0, 0, 0, 0, 1, 1, 2, 2, 0] elif common.num_screens == 2: g = [0, 0, 0, 0, 1, 1, 1, 1, 0] else: g = [0, 0, 0, 0, 0, 0, 0, 0, 0] # Loop over the groups, and setup keys for each group to move groups to screens and move focus to screens/groups for index, i in enumerate(groups): keys.extend([ # mod + number of group (starting with 1) = switch to group Key([mod], k[index], lazy.group[i.name].toscreen(g[index]), lazy.to_screen(g[index])), # mod + shift + number of group (starting with 1) = switch to & move focused window to group Key([mod, "shift"], k[index], lazy.window.togroup(i.name)), ]) # Drag floating layouts todo learn why the hell it does not work 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()),
# Shrink/Grow Key([mod], "i", lazy.layout.grow()), Key([mod], "m", lazy.layout.shrink()), Key([mod], "f", lazy.window.toggle_fullscreen()), # Toggle between different layouts as defined below Key([mod], "Tab", lazy.next_layout()), Key([mod], "q", lazy.window.kill()), Key([mod, ctrl], "r", lazy.restart()), Key([mod, ctrl], "q", lazy.shutdown()), Key([mod], "r", lazy.spawncmd()), # Screens Key([mod, ctrl], "1", lazy.to_screen(0)), Key([mod, ctrl], "2", lazy.to_screen(1)) ] system = [ # Key([mod, shift], "x", lazy.function(lock_screen())), Key([mod, shift], "x", lazy.spawn("./.script/wm/lock")), Key([], 'XF86MonBrightnessUp', lazy.function(change_backlight('up'))), Key([], 'XF86MonBrightnessDown', lazy.function(change_backlight('down'))), Key([], 'XF86AudioRaiseVolume', lazy.spawn('pactl set-sink-volume 0 +5%')), Key([], 'XF86AudioLowerVolume', lazy.spawn('pactl set-sink-volume 0 -5%')), Key([], 'XF86AudioMute', lazy.spawn('pactl set-sink-mute 0 toggle')) ] rofi = [ Key([mod], "d", lazy.spawn("rofi -show drun")),
#Key([mod, 'shift'], 'space', lazy.layout.flip()), # Switch groups Key([mod], 'Left', lazy.screen.prevgroup()), Key([mod], 'Right', lazy.screen.nextgroup()), # Cycle layouts Key([mod], 'Up', lazy.nextlayout()), Key([mod], 'Down', lazy.prevlayout()), # Change window focus Key([mod], 'Tab', lazy.layout.next()), Key([mod, 'shift'], 'Tab', lazy.layout.previous()), # Switch focus to other screens Key([mod], 'h', lazy.to_screen(0)), # left Key([mod], 'l', lazy.to_screen(1)), # right # Commands: Application Launchers Key([mod], 'space', lazy.spawn(Commands.dmenu)), Key([mod], 'n', lazy.spawn(Commands.browser)), Key([mod], 'e', lazy.spawn(Commands.file_manager)), Key([mod], 'Return', lazy.spawn(Commands.terminal)), # Commands: Volume Controls Key([], 'XF86AudioRaiseVolume', lazy.spawn(Commands.volume_up)), Key([], 'XF86AudioLowerVolume', lazy.spawn(Commands.volume_down)), Key([], 'XF86AudioMute', lazy.spawn(Commands.volume_toggle)), Key([], 'XF86TouchpadToggle', lazy.spawn(Commands.trackpad_toggle)), # TODO: What does the PrtSc button map to?
Key([mod], 'k', lazy.layout.down()), Key([mod], 'Tab', lazy.layout.down()), Key([mod], 'j', lazy.layout.up()), Key([mod, 'shift'], 'Tab', lazy.layout.up()), Key([mod], 't', lazy.window.toggle_floating()), # Move windows up or down in current stack Key([mod, 'shift'], 'k', lazy.layout.shuffle_down()), Key([mod, 'shift'], 'j', lazy.layout.shuffle_up()), Key([mod], 'Return', lazy.layout.swap_left()), # Switch window focus to other pane(s) of stack # Key([mod], 'space', lazy.layout.next()), # Swap panes of split stack Key([mod, 'shift'], 'space', lazy.layout.rotate()), # switch monitors Key([mod], 'comma', lazy.to_screen(0)), Key([mod], 'period', lazy.to_screen(1)), # restarting qtile Key([mod, 'shift'], 'q', lazy.shutdown()), Key([mod], 'q', lazy.restart()), # app launches Key([mod, control], 't', lazy.spawn('gnome-terminal --hide-menubar')), Key([mod, control], 'f', lazy.spawn('firefox')), Key([mod], 'p', lazy.spawn('j4-dmenu-desktop')), Key([mod, 'shift'], 'p', lazy.spawn('gmrun')), Key([mod, control], 'l', lazy.spawn('gnome-screensaver-command -l')), # kill Key([mod, 'shift'], 'c', lazy.window.kill()), # toggle touchpad
def init_keys(): keys = [ Key( [mod], "Return", lazy.spawn(myTerm) # Open terminal ), Key( [mod], "Tab", lazy.next_layout() # Toggle through layouts ), Key( [mod, "shift"], "c", lazy.window.kill() # Kill active window ), Key( [mod, "shift"], "r", lazy.restart() # Restart Qtile ), Key( [mod, "shift"], "q", lazy.shutdown() # Shutdown Qtile ), Key([mod], "w", lazy.to_screen(2) # Keyboard focus screen(0) ), Key([mod], "e", lazy.to_screen(0) # Keyboard focus screen(1) ), Key([mod], "r", lazy.to_screen(1) # Keyboard focus screen(2) ), Key([mod, "control"], "k", lazy.layout.section_up() # Move up a section in treetab ), Key([mod, "control"], "j", lazy.layout.section_down() # Move down a section in treetab ), ### Window controls Key( [mod], "k", lazy.layout.down() # Switch between windows in current stack pane ), Key( [mod], "j", lazy.layout.up() # Switch between windows in current stack pane ), Key( [mod, "shift"], "k", lazy.layout.shuffle_down() # Move windows down in current stack ), Key( [mod, "shift"], "j", lazy.layout.shuffle_up() # Move windows up in current stack ), Key( [mod, "shift"], "l", lazy.layout.grow(), # Grow size of current window (XmonadTall) lazy.layout.increase_nmaster(), # Increase number in master pane (Tile) ), Key( [mod, "shift"], "h", lazy.layout.shrink(), # Shrink size of current window (XmonadTall) lazy.layout.decrease_nmaster(), # Decrease number in master pane (Tile) ), Key( [mod, "shift"], "Left", # Move window to workspace to the left window_to_prev_group ), Key( [mod, "shift"], "Right", # Move window to workspace to the right window_to_next_group ), Key( [mod], "n", lazy.layout.normalize() # Restore all windows to default size ratios ), Key( [mod], "m", lazy.layout.maximize() # Toggle a window between minimum and maximum sizes ), Key( [mod, "shift"], "KP_Enter", lazy.window.toggle_floating() # Toggle floating ), Key( [mod, "shift"], "space", lazy.layout.rotate(), # Swap panes of split stack (Stack) lazy.layout.flip() # Switch which side main pane occupies (XmonadTall) ), ### Stack controls Key( [mod], "space", lazy.layout.next() # Switch window focus to other pane(s) of stack ), Key( [mod, "control"], "Return", lazy.layout.toggle_split() # Toggle between split and unsplit sides of stack ), ### Dmenu Run Launcher Key( ["mod1", "control"], "Return", lazy.spawn("dmenu_run -fn 'UbuntuMono Nerd Font:size=10' -nb '#292d3e' -nf '#bbc5ff' -sb '#82AAFF' -sf '#292d3e' -p 'dmenu:'") ), ### Dmenu scripts launched with ALT + CTRL + KEY Key( ["mod1", "control"], "e", lazy.spawn("./.dmenu/dmenu-edit-configs.sh") ), Key( ["mod1", "control"], "m", lazy.spawn("./.dmenu/dmenu-sysmon.sh") ), Key( ["mod1", "control"], "p", lazy.spawn("passmenu") ), Key( ["mod1", "control"], "r", lazy.spawn("./.dmenu/dmenu-reddio.sh") ), Key( ["mod1", "control"], "s", lazy.spawn("./.dmenu/dmenu-surfraw.sh") ), Key( ["mod1", "control"], "t", lazy.spawn("./.dmenu/dmenu-trading.sh") ), ### My applications launched with SUPER + ALT + KEY Key( [mod, "mod1"], "l", lazy.spawn(myTerm+" -e lynx -cfg=~/.lynx/lynx.cfg -lss=~/.lynx/lynx.lss gopher://distro.tube") ), Key( [mod, "mod1"], "n", lazy.spawn(myTerm+" -e newsboat") ), Key( [mod, "mod1"], "r", lazy.spawn(myTerm+" -e rtv") ), Key( [mod, "mod1"], "e", lazy.spawn(myTerm+" -e neomutt") ), Key( [mod, "mod1"], "m", lazy.spawn(myTerm+" -e sh ./scripts/toot.sh") ), Key( [mod, "mod1"], "t", lazy.spawn(myTerm+" -e sh ./scripts/tig-script.sh") ), Key( [mod, "mod1"], "f", lazy.spawn(myTerm+" -e sh ./.config/vifm/scripts/vifmrun") ), Key( [mod, "mod1"], "j", lazy.spawn(myTerm+" -e joplin") ), Key( [mod, "mod1"], "c", lazy.spawn(myTerm+" -e cmus") ), Key( [mod, "mod1"], "i", lazy.spawn(myTerm+" -e irssi") ), Key( [mod, "mod1"], "y", lazy.spawn(myTerm+" -e youtube-viewer") ), Key( [mod, "mod1"], "a", lazy.spawn(myTerm+" -e ncpamixer") ), ] return keys
def backlight(action): def f(qtile): brightness = int(subprocess.run(['xbacklight', '-get'], stdout=subprocess.PIPE).stdout) if brightness != 1 or action != 'dec': if (brightness > 49 and action == 'dec') \ or (brightness > 39 and action == 'inc'): subprocess.run(['xbacklight', f'-{action}', '10', '-fps', '10']) else: subprocess.run(['xbacklight', f'-{action}', '1']) return f keys = [ # Switch between screens Key([mod], "1", lazy.to_screen(0)), Key([mod], "2", lazy.to_screen(1)), Key([mod], "3", lazy.to_screen(2)), # Switch between windows in current stack pane Key([mod], "j", lazy.layout.down()), Key([mod], "k", lazy.layout.up()), Key([mod], "h", lazy.layout.left()), Key([mod], "l", lazy.layout.right()), Key([mod, "shift"], "j", lazy.layout.shuffle_down()), Key([mod, "shift"], "k", lazy.layout.shuffle_up()), Key([mod, "shift"], "h", lazy.layout.shuffle_left()), Key([mod, "shift"], "l", lazy.layout.shuffle_right()), Key([mod, "control"], "j", lazy.layout.grow_down()),
("M-C-t", lazy.spawn("thunar")), ("M-C-w", lazy.spawn(TERMINAL + ' -e "weechat"')), # Scratchpad toggles ("M-<slash>", lazy.group['scratchpad'].dropdown_toggle('term')), ("M-S-<slash>", lazy.group['scratchpad'].dropdown_toggle('ipython')), # ("M-<slash>", lazy.window.function(to_scratchpad)), # ("M-S-<slash>", lazy.function(show_scratchpad)), # .: Layout / Focus Manipulation :. # ("M-f", lazy.window.toggle_fullscreen()), # Toggle between the available layouts. ("M-<grave>", lazy.next_layout()), ("A-<grave>", lazy.prev_layout()), # Switch focus between two screens ("M-<bracketleft>", lazy.to_screen(0)), ("M-<bracketright>", lazy.to_screen(1)), # Move the focused group to one of the screens and follow it ("M-S-<bracketleft>", switch_screens(0), lazy.to_screen(0)), ("M-S-<bracketright>", switch_screens(1), lazy.to_screen(1)), # Toggle between the two most recently used groups # TODO :: Write my own version of this that has the same # screen preserving behaviour ("M-<Tab>", lazy.screen.next_group()), ("M-S-<Tab>", lazy.screen.prev_group()), # Close the current window: NO WARNING! ("A-<F4>", lazy.window.kill()), ("A-<Tab>", lazy.layout.next()), ("A-S-<Tab>", lazy.layout.prev()), # .: Sys + Utils :. #
'fontsize': fontsize, 'foreground': foreground, } keys = [ Key([mod], "k", lazy.layout.down()), Key([mod], "j", lazy.layout.up()), Key([mod, "shift"], "k", lazy.layout.shuffle_down()), Key([mod, "shift"], "j", lazy.layout.shuffle_up()), Key([mod], "Tab", lazy.layout.next()), Key([mod, "shift"], "Tab", lazy.layout.client_to_next()), Key([mod, "shift"], "space", lazy.layout.rotate()), Key([mod, "shift"], "Return", lazy.layout.toggle_split()), Key([mod], "space", lazy.nextlayout()), Key([mod], "t", lazy.window.toggle_floating()), Key([mod], "w", lazy.to_screen(0)), Key([mod, "shift"], "w", lazy.function(move_window_to_screen(0))), Key([mod], "e", lazy.to_screen(1)), Key([mod, "shift"], "e", lazy.function(move_window_to_screen(1))), Key([mod], "Return", lazy.spawn("urxvt")), Key([mod], "p", lazy.spawn("dmenu_run -fn '%s:pixelsize=%d'" % (font, fontsize))), Key([mod, "shift"], "c", lazy.window.kill()), Key([mod], "q", lazy.restart()), Key([mod, "shift"], "q", lazy.shutdown()), ] mouse = [ Click([mod], "Button1", lazy.window.bring_to_front()), Drag([mod], "Button1",
Key([mod], "Return", lazy.spawn(terminal)), # Toggle between different layouts as defined below Key([mod], "Tab", lazy.next_layout()), Key([mod], "w", lazy.window.kill()), Key([mod, "control"], "r", lazy.restart()), Key([mod, "control"], "q", lazy.shutdown()), Key([mod], "r", lazy.spawncmd()), # add key to navigate to certain layout # Navigate to Tile Key([mod, "control"], "t", lazy.to_layout_index(0)), # Navigate to Max Key([mod, "control"], "m", lazy.to_layout_index(1)), # Key([], "XF86MonBrightnessUp", lazy.widget['backlight'].change_backlight(backlight.ChangeDirection.UP)), # Key([], "XF86MonBrightnessDown", lazy.widget['backlight'].change_backlight(backlight.ChangeDirection.DOWN)), Key([mod], "comma", lazy.to_screen(0)), Key([mod], "period", lazy.to_screen(1)), # Screenshot Key Key([mod, "control"], "s", lazy.spawn(screenshot_handler[0])) ] groups = [Group(i) for i in "asdf1234"] for i in groups: keys.extend([ # mod1 + letter of group = switch to group Key([mod], i.name, lazy.group[i.name].toscreen()), # 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)), # Or, use below if you prefer not to switch to that group.
keys = [ # Log out; note that this doesn't use mod3: that's intentional in case mod3 # gets hosed (which happens if you unplug and replug your usb keyboard # sometimes, or on ubuntu upgrades). This way you can still log back out # and in gracefully. Key(["shift", "mod1"], "q", lazy.shutdown()), Key([mod], "k", lazy.layout.down()), Key([mod], "j", lazy.layout.up()), Key([mod], "h", lazy.layout.previous()), Key([mod], "l", lazy.layout.previous()), Key([mod, "shift"], "space", lazy.layout.rotate()), Key([mod, "shift"], "Return", lazy.layout.toggle_split()), Key(["mod1"], "Tab", lazy.nextlayout()), Key([mod, "mod1"], "h", lazy.to_screen(0)), Key([mod, "mod1"], "l", lazy.to_screen(1)), Key([mod], "x", lazy.window.kill()), # interact with prompts Key([mod], "r", lazy.spawncmd()), Key([mod], "g", lazy.switchgroup()), # start specific apps Key([mod], "n", lazy.function(app_or_group("www", "firefox"))), Key([mod], "m", lazy.function(app_or_group("music", "clementine"))), Key([mod], "c", lazy.function(app_or_group("io", "pidgin"))), Key([mod], "Return", lazy.spawn("xterm")), # Change the volume if our keyboard has keys Key([], "XF86AudioRaiseVolume",
update_interval=10), widget.volume.Volume(), widget.battery.Battery(low_percentage=0.3), widget.backlight.Backlight(backlight_name='intel_backlight'), widget.Clock(format='%Y-%m-%e %H:%M:%S'), widget.Systray(), ], size=30, background=['000000'], ), ), ] screen_name = 'qwer' for i in range(0, count_screen()): keys.append( Key([mod], screen_name[i], lazy.to_screen(i), lazy.function(lambda x: focus_transset(x.currentWindow)))) if i != 0: screens.append( Screen(bottom=bar.Bar( widgets=[ widget.AGroupBox(), widget.currentlayout.CurrentLayout(), widget.currentscreen.CurrentScreen(), widget.Prompt(), widget.WindowName(), widget.Clock(format='%Y-%m-%e %H:%M:%S'), ], size=30, background=['000000'], ), ))
# Just a static list, nothing fancy # k is the key/group # g is which screen it should go on if num_screens[hostname] == 4: k = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "minus", "equal"] g = [3, 3, 0, 0, 0, 1, 2, 2, 2, 2, 2, 2] else: k = ["1", "2", "3", "4", "equal"] g = [0, 0, 0, 0, 0] # Loop over the groups, and setup keys for each group to move groups to screens # and move focus to screens/groups for index, i in enumerate(groups): keys.extend([ # mod1 + number of group (starting with 1) = switch to group Key([mod], k[index], lazy.group[i.name].toscreen(g[index]), lazy.to_screen(g[index])), # mod1 + shift + number of group (starting with 1) = switch to & move focused window to group Key([mod, "shift"], k[index], lazy.window.togroup(i.name)), ]) # 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()) ]
[mod], "l", lazy.layout.increase_ratio() ), # Switch window focus to other pane(s) of stack Key( [mod], "space", lazy.layout.next() ), Key( [mod], "Return", lazy.layout.zoom() ), Key([mod], "apostrophe", lazy.to_screen(0)), Key([mod], "comma", lazy.to_screen(1)), Key([mod], "period", lazy.to_screen(2)), Key([mod], "t", lazy.spawn("termite")), Key([mod], "q", lazy.spawn('slock')), # click with the keyboard ... perfect with a trackpoint Key([mod], "g", lazy.spawn("xdotool click 1")), Key([mod], "c", lazy.spawn("xdotool click 2")), Key([mod], "r", lazy.spawn("xdotool click 3")), # scroll in any window with the same shortcut ! Key([mod], "b", lazy.spawn("xdotool click 4")), Key([mod], "m", lazy.spawn("xdotool click 5")),
# MOVE WINDOW TO SELECTED WORKSPACE 1-10 AND GO TO WORKSPACE Key([mod, "shift"], i.name, lazy.window.togroup(i.name), lazy.group[i.name].toscreen()), ]) else: for i in groups: # ASSIGN WORKSPACE TO SPECIFIC MONITOR # MOVE WINDOW TO SELECTED WORKSPACE 1-10 AND GO TO WORKSPACE IN # SPECIFIC MONITOR # Cardoso Approach if i.name in groups_screen_0: keys.extend([ # Key([mod], i.name, lazy.group[i.name].toscreen(0), # lazy.to_screen(0)), Key([mod], i.name, lazy.to_screen(0), lazy.group[i.name].toscreen(0)), # Key([mod, "shift"], i.name, lazy.window.togroup(i.name) , # lazy.group[i.name].toscreen(0), lazy.to_screen(0)) Key([mod, "shift"], i.name, lazy.window.togroup(i.name), lazy.to_screen(0), lazy.group[i.name].toscreen(0)) ]) elif i.name in groups_screen_1: keys.extend([ # Key([mod], i.name, lazy.group[i.name].toscreen(1), # lazy.to_screen(1)), Key([mod], i.name, lazy.to_screen(1), lazy.group[i.name].toscreen(1)), # Key([mod, "shift"], i.name, lazy.window.togroup(i.name) , # lazy.group[i.name].toscreen(1), lazy.to_screen(1)), Key([mod, "shift"], i.name, lazy.window.togroup(i.name),
), Key( ["mod1"], "space", lazy.layout.next() ), Key( ["mod1", "shift"], "space", lazy.layout.rotate() ), Key( ["mod1", "shift"], "Return", lazy.layout.toggle_split() ), Key(["mod1"], "n", lazy.spawn("firefox")), Key(["mod1"], "h", lazy.to_screen(1)), Key(["mod1"], "l", lazy.to_screen(0)), # ~/bin/x starts a terminal program Key(["mod1"], "Return", lazy.spawn("~/bin/x")), Key(["mod1"], "Tab", lazy.nextlayout()), Key(["mod1"], "w", lazy.window.kill()), # The bindings below control Amarok, and my sound volume. Key( ["mod1", "shift"], "k", lazy.spawn("amixer -c 1 -q set Speaker 2dB+") ), Key( ["mod1", "shift"], "j", lazy.spawn("amixer -c 1 -q set Speaker 2dB-") ),
Key([mod], "comma", lazy.layout.increase_nmaster()), Key([mod], "period", lazy.layout.decrease_nmaster()), Key([mod], "Tab", lazy.group.next_window()), Key([mod, "shift"], "Tab", lazy.group.prev_window()), Key([mod, "shift"], "Return", lazy.layout.rotate()), Key([mod, "shift"], "space", lazy.layout.toggle_split()), Key([mod], "w", lazy.to_screen(0)), Key([mod], "e", lazy.to_screen(1)), Key([mod], "Left", lazy.prevgroup()), Key([mod], "Right", lazy.nextgroup()), Key([mod], "space", lazy.nextlayout()), Key([mod], "c", lazy.window.kill()), Key([mod], "t", lazy.window.disable_floating()), Key([mod, "shift"], "t", lazy.window.enable_floating()),
subprocess.run(['xbacklight', f'-{action}', '1']) return f keys = [ Key([mod], 'k', lazy.layout.down()), Key([mod], 'j', lazy.layout.up()), Key([mod], 'space', lazy.layout.next()), Key([mod, 'control'], 'k', lazy.layout.shuffle_down()), Key([mod, 'control'], 'j', lazy.layout.shuffle_up()), Key([mod, 'shift'], 'h', lazy.layout.client_to_previous()), Key([mod, 'shift'], 'l', lazy.layout.client_to_next()), Key([mod, 'shift'], 'space', lazy.layout.rotate()), Key([mod, 'shift'], 'Return', lazy.layout.toggle_split()), Key([mod], '1', lazy.to_screen(1)), Key([mod], '2', lazy.to_screen(2)), Key([mod], 'Tab', lazy.next_layout()), Key([mod], 'x', lazy.window.kill()), Key([mod], 'r', lazy.spawncmd()), Key([mod, 'control'], 'r', lazy.restart()), Key([mod, 'control'], 'q', lazy.shutdown()), # Screen Key([], 'F7', lazy.spawn('xset dpms force off')), Key([], 'XF86MonBrightnessUp', lazy.function(backlight('inc'))), Key([], 'XF86MonBrightnessDown', lazy.function(backlight('dec'))), # Audio Key([], 'XF86AudioMute', lazy.spawn('ponymix toggle')), Key([], 'XF86AudioRaiseVolume', lazy.spawn('ponymix increase 5')),
Key([mod], "t", lazy.layout.up()), # Move windows up or down in current stack Key([mod, "shift"], "h", lazy.layout.shuffle_down()), Key([mod, "shift"], "t", lazy.layout.shuffle_up()), # Change size of panels Key([mod], "m", lazy.layout.grow()), Key([mod], "b", lazy.layout.shrink()), Key([mod], "s", lazy.layout.normalize()), # Swap side of main monad pane Key([mod], "space", lazy.layout.flip()), # Move to left and right screens Key([mod], "d", lazy.to_screen(0)), Key([mod], "n", lazy.to_screen(1)), # Toggle between different layouts as defined below Key([mod], "Tab", lazy.nextlayout()), Key([mod, "shift"], "w", lazy.window.kill()), # Toggle floating windows Key([mod], "f", lazy.window.toggle_floating()), Key([mod, "shift"], "r", lazy.restart()), Key([mod, "shift"], "q", lazy.shutdown()), Key([mod], "r", lazy.spawncmd()), # Applications Key([mod], "c", lazy.spawn("firefox")),