def get_keys(): return [ Key([mod], "j", lazy.layout.down(), desc="Move focus down"), Key([mod], "k", lazy.layout.up(), desc="Move focus up"), Key([mod], "h", lazy.layout.shrink_main(), desc="Shrink main window"), Key([mod], "l", lazy.layout.grow_main(), desc="Expand main window"), Key([mod, "shift"], "h", lazy.layout.shrink(), desc="Shrink current window"), Key([mod, "shift"], "l", lazy.layout.grow(), desc="Expand current window"), Key([mod, "shift"], "space", lazy.window.toggle_floating(), desc="toggle floating"), Key([mod, "shift"], "j", lazy.layout.shuffle_down(), desc="Move window down"), Key([mod, "shift"], "k", lazy.layout.shuffle_up(), desc="Move window up"), Key([mod], "n", lazy.layout.normalize(), desc="Reset all window sizes"), Key([mod], "Tab", lazy.next_layout(), desc="Go to next layout"), Key([mod, "shift"], "Tab", lazy.prev_layout(), desc="Go to previous layout"), Key([mod], "q", lazy.window.kill(), desc="Close focused window"), Key([mod, "control", "shift"], "r", lazy.restart(), desc="Restart Qtile"), Key([mod, "control", "shift"], "e", lazy.shutdown(), desc="Leave Qtile"), # FIXME: fullscreen seems glitchy Key([mod], "f", lazy.window.toggle_fullscreen(), desc="Toggle fullscreen window"), Key([mod], "u", manual_updates, desc="Manual update"), Key([mod], "s", switch_to_window, desc="Switch to window"), ]
def __get_window_keys(self) -> list: """ Creates a list of keys for navigating and manipulating windows. """ KC_FOCUS_DOWN = Key(self.mod, "j", lazy.layout.down()) KC_FOCUS_UP = Key(self.mod, "k", lazy.layout.up()) KC_MOVE_DOWN = Key(self.mod, "j", lazy.layout.shuffle_up()) KC_MOVE_UP = Key(self.mod, "k", lazy.layout.shuffle_down()) KC_NEXT_LAYOUT = Key(self.mod, "Tab", lazy.next_layout()) KC_PREV_LAYOUT = Key(self.mod_shift, "Tab", lazy.prev_layout()) KC_KILL = Key(self.mod, "q", lazy.window.kill()) return [ KC_FOCUS_DOWN, KC_FOCUS_UP, KC_MOVE_DOWN, KC_MOVE_UP, KC_NEXT_LAYOUT, KC_PREV_LAYOUT, KC_KILL ]
Key([mod, ctrl], "k", lazy.layout.grow_up(), desc="Grow focused Window up"), ]) keys.extend([ # Switch focus between monitors Key([mod], "comma", lazy.prev_screen(), desc="Move focus to prev Screen"), Key([mod], "period", lazy.next_screen(), desc="Move focus to next Screen"), Key([mod], "F1", lazy.to_screen(0), desc="Move focus to 1st Screen"), Key([mod], "F2", lazy.to_screen(1), desc="Move focus to 2nd Screen"), ]) keys.extend([ # Switch between layouts Key([mod], "space", lazy.next_layout(), desc="Switch Laouts"), Key([mod, shift], "space", lazy.prev_layout(), desc="Switch Laouts"), Key([mod, alt], "space", lazy.to_layout_index(0), desc="Switch to default Layout"), Key([mod], "equal", lazy.layout.normalize(), desc="Reset all window sizes"), # 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], "n", lazy.spawn(term + " -e newsboat"), desc="Open newsboat"), Key([mod], "p", lazy.spawn("discord"), desc="Open discord"), Key([mod], "q", lazy.window.kill(), desc="Close window"), Key([mod], "r", lazy.spawncmd(), desc="open prompt (if enable prompt widget)"), Key([mod], "w", lazy.spawn(browser), desc="Open default browser"), Key([mod], "F2", lazy.spawn("edconf.sh"), desc="Fast config file open"), # Key([mod], "F6", lazy.spawn(termfloat + " -e cava")), # Key([mod], "F4", lazy.spawn("maim_save")), # Key([mod], "F5", lazy.spawn("maimpick")), Key([mod], "F9", lazy.spawn("dmenumount"), desc="Fast phone mount"), Key([mod], "F10", lazy.spawn("dmenuumount"), desc="Fast phone umount"), Key([mod], "Return", lazy.spawn(term), desc="Open default terminal"), Key([mod], "space", lazy.prev_layout(), desc="Prev layout"), Key([mod], "Scroll_Lock", lazy.spawn("run_screenkey"), desc="Screenkey on/off"), Key([mod], "KP_Home", lazy.spawn("dmenurecord"), desc="Open demenu record"), Key([mod], "KP_End", lazy.spawn("live.sh"), desc="Open live.sh"), # opacity Key([mod], "comma", lazy.window.down_opacity(), desc="Down opacity"), Key([mod, "shift"], "comma", lazy.window.up_opacity(), desc="Up opacity"), # ######### LAYOUT ################ Key([mod], "j", lazy.layout.down(), desc="Layout down"), Key([mod], "k", lazy.layout.up(), desc="Layout up"),
lazy.layout.section_up().when('treetab')), # Key([mod, 'control'], 'Left', lazy.layout.move_left().when('treetab')), # Key([mod, 'control'], 'Right', lazy.layout.move_right().when('treetab')), Key([mod], 'less', lazy.layout.flip()), Key([mod, 'shift'], 'Down', lazy.layout.shuffle_down(), lazy.layout.move_down().when('treetab')), Key([mod, 'shift'], 'Up', lazy.layout.shuffle_up(), lazy.layout.move_up().when('treetab')), Key([mod, 'shift'], 'Left', lazy.layout.swap_left()), Key([mod, 'shift'], 'Right', lazy.layout.swap_right()), Key([mod], 'plus', lazy.layout.grow(), lazy.layout.increase_ratio().when('tile')), Key([mod], 'minus', lazy.layout.shrink(), lazy.layout.decrease_ratio().when('tile')), Key([mod], 'Tab', lazy.next_layout()), Key([mod, 'shift'], 'Tab', lazy.prev_layout()), # NOTE: window Key([mod], 'F11', lazy.window.toggle_fullscreen()), Key([mod, 'shift'], 'F11', lazy.window.toggle_floating()), Key([mod], 'period', lazy.window.toggle_minimize()), Key([mod], 'numbersign', lazy.window.toggle_maximize()), # # Key([mod, 'control'], 'numbersign', lazy.group.unminimize_all()), # Key([mod], 'F4', lazy.window.kill()), Key([mod_alt], 'F4', lazy.window.kill()), # NOTE: fancy goto prompt: Key([mod], 'g', lazy.switchgroup(prompt='g')), Key([mod, 'shift'], 'g', lazy.togroup(prompt='g>')), Key([mod], 'b', lazy.hide_show_bar(position='top')), ]
Key([mod], "n", lazy.screen.next_group()), Key([mod], "p", lazy.screen.prev_group()), # 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], "e", lazy.next_layout(), desc="Toggle between layouts"), Key([mod, "shift"], "e", lazy.prev_layout(), desc="Toggle between layouts"), Key([mod], "q", lazy.window.kill(), desc="Kill focused window"), Key([mod], "w", lazy.to_layout_index(1), desc="full layouts"), Key([mod], "s", lazy.to_layout_index(0), desc="columns layouts"), Key([mod], "o", lazy.window.toggle_fullscreen(), desc="full layouts"), Key([mod, "shift"], "o", lazy.window.toggle_floating(), desc="full layouts"), Key([mod, "shift"], "r", lazy.restart(), desc="Restart Qtile"), Key([mod, "shift"], "q", lazy.shutdown(), desc="Shutdown Qtile"), Key([mod], "r", lazy.spawncmd(), desc="Spawn a command using a prompt widget"),
Key([mod, "shift"], "k", lazy.layout.shuffle_up(), desc="Move focused window up"), Key([mod, "shift"], "h", lazy.layout.shuffle_left(), desc="Move focused window left"), Key([mod, "shift"], "l", lazy.layout.shuffle_right(), desc="Move focused window right"), # layout modifires Key([mod], "n", lazy.next_layout(), desc="Toggle next layout"), Key([mod], "p", lazy.prev_layout(), desc="Toggle prev layout"), Key([mod, "control"], "f", lazy.window.toggle_fullscreen(), desc="Toggle Full Screen"), Key([mod, "control"], "t", lazy.window.toggle_floating(), desc="Toggle Full Screen"), # screenshots Key([mod, "shift"], "s", lazy.spawn("flameshot gui"), desc="Take full screen shot"),
def my_keys(): return [ # Launch terminal Key([mod], 'Return', lazy.spawn(my_term)), # Toggle between different layouts as defined below Key([mod], 'Tab', lazy.next_layout()), Key([mod, 'shift'], 'Tab', lazy.prev_layout()), # Kill a window Key([mod, 'shift'], 'w', lazy.window.kill()), # Kill and restart qtile Key([mod, 'control'], 'q', lazy.shutdown()), Key([mod, 'control'], 'r', lazy.restart()), # Switch keyboard focus from monitors Key([mod], 'q', lazy.to_screen(1)), Key([mod], 'w', lazy.to_screen(0)), # Switch window focus to other pane(s) of stack Key([mod], 'space', lazy.layout.next()), # Switch between windows in current stack pane Key([mod], 'j', lazy.layout.down()), Key([mod], 'k', lazy.layout.up()), Key([mod], 'l', lazy.layout.right()), Key([mod], 'h', lazy.layout.left()), Key([mod], 'Up', lazy.window.bring_to_front()), Key([mod], 'Down', lazy.window.toggle_minimize()), # Move windows in pane Key([mod, 'shift'], 'j', lazy.layout.shuffle_down()), Key([mod, 'shift'], 'k', lazy.layout.shuffle_up()), Key([mod, 'shift'], 'l', lazy.layout.shuffle_right()), Key([mod, 'shift'], 'h', lazy.layout.shuffle_left()), # Swap panes of split stack Key([mod, 'shift'], 'space', lazy.layout.rotate(), lazy.layout.flip()), Key([mod, 'shift'], 'Return', lazy.layout.toggle_split()), # Window size controls Key([mod, 'control'], 'l', lazy.layout.grow_right(), lazy.layout.grow(), lazy.layout.increase_ratio(), lazy.layout.delete()), Key([mod, 'control'], 'h', lazy.layout.grow_left(), lazy.layout.shrink(), lazy.layout.decrease_ratio(), lazy.layout.add()), Key([mod, 'control'], 'k', lazy.layout.grow_up(), lazy.layout.grow(), lazy.layout.decrease_nmaster()), Key([mod, 'control'], 'j', lazy.layout.grow_down(), lazy.layout.shrink(), lazy.layout.increase_nmaster()), # Toggle fullscreen and floating Key([mod, 'shift'], 'f', lazy.window.toggle_floating()), Key([mod, 'shift'], 'm', lazy.window.toggle_fullscreen()), # Toggle maximized and normalize pane sizes Key([mod], 'm', lazy.window.toggle_maximize()), Key([mod], 'n', lazy.layout.normalize()), # Open file manager Key([mod], 'e', lazy.spawn(my_filemanager)), # Rofi commands Key([mod], 's', lazy.spawn('rofi -show drun')), Key(['mod1'], 'Tab', lazy.spawn('rofi -show windowcd')), # Launch Utilities Key([mod], 'r', lazy.spawncmd()), Key([mod], 'c', lazy.spawn('galculator')), # DropDown Key([mod], 'd', lazy.group['scratchpad'].dropdown_toggle('term')), Key([mod], 'o', lazy.group['scratchpad'].dropdown_toggle('mpd')), Key([mod], 'i', lazy.group['scratchpad'].dropdown_toggle('mutt')), Key([mod], 'u', lazy.group['scratchpad'].dropdown_toggle('top')), ]
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()), Key("M-j", lazy.layout.down()), Key("M-k", lazy.layout.up()),
Key([MOD, SHIFT], RIGHT, lazy.layout.shrink()), #move in stack Key([MOD, SHIFT], DOWN, lazy.layout.suffle_down()), Key([MOD, SHIFT], UP, lazy.layout.suffle_up()), #kill windows Key([MOD], "q", lazy.window.kill()), #restart shutdown Key([MOD, CONTROL, SHIFT], "r", lazy.restart()), Key([MOD, CONTROL, SHIFT], "q", lazy.shutdown()), #change layout Key([MOD], "Tab", lazy.next_layout()), Key([MOD, SHIFT], "Tab", lazy.prev_layout()), #spawn windows Key([MOD], "Return", lazy.spawn("alacritty")), Key([], "XF86AudioLowerVolume", lazy.spawn("pactl set-sink-volume @DEFAULT_SINK@ -5%")), Key([], "XF86AudioRaiseVolume", lazy.spawn("pactl set-sink-volume @DEFAULT_SINK@ +5%")), Key([], "XF86AudioMute", lazy.spawn("pactl set-sink-mute @DEFAULT_SINK@ toggle")), Key([], "XF86MonBrightnessUp", lazy.spawn("brightnessctl set +10%")), Key([], "XF86MonBrightnessDown", lazy.spawn("brightnessctl set 10%-")), #menu Key([MOD], "d", lazy.spawn("rofi -show drun -show-icons -disable-history")),
# 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], "Return", lazy.spawn(default_term)), Key([mod, 'control'], "Return", lazy.spawn('firefox')), Key([mod], 'f', lazy.window.toggle_floating()), Key([mod], 'F11', lazy.window.toggle_fullscreen()), # Toggle between different layouts as defined below Key([mod], "Tab", lazy.next_layout()), Key([mod, 'shift'], "Tab", lazy.prev_layout()), Key([mod, 'control'], "w", lazy.window.kill()), Key([mod, "control"], "r", lazy.restart()), Key([mod, "control"], "q", lazy.shutdown()), Key([mod], "r", lazy.spawncmd()), Key([mod, 'shift'], "r", lazy.spawn(commands.rofi)), Key([mod], "p", lazy.spawn('xrandr --output eDP1 --off'), lazy.restart()), Key([], "Print", lazy.spawn(commands.ss)), Key([mod], "Print", lazy.spawn(commands.ss_mod)), Key(['shift'], "Print", lazy.spawn(commands.ss_doc)), Key([mod, 'shift'], "Print", lazy.spawn(commands.ss_doc_mod)), # Media keys setup Key([], "XF86AudioPlay", lazy.spawn("cmus-remote -u")), Key([], "XF86AudioNext", lazy.spawn("cmus-remote -n")),
([_mod], 'v', lazy.layout.decrease_ratio(), 'Decrease ratio (Tile)'), ([_mod], 'j', lazy.layout.increase_ratio(), 'Increase ratio (Tile)'), # Switch window focus to other pane(s) of stack ([_mod], 'space', lazy.layout.next(), 'Switch window focus to other pane(s) of stack'), # Swap panes of split stack ([_mod, 'shift'], 'space', lazy.layout.rotate(), 'Swap panes of split stack'), # Toggle between different layouts ([_mod], 'Tab', lazy.next_layout(), 'Toggle between layouts'), ([_mod, 'shift'], 'Tab', lazy.prev_layout(), 'Toggle between layouts'), # Close window ([_mod], ['c', 'eacute'], lazy.window.kill(), 'Close focused window'), ([_alt], 'F4', lazy.window.kill(), 'Close focused window'), # Qtile session ([_mod, 'control'], 'o', lazy.restart(), 'Restart qtile'), ([_mod, 'control'], 'q', lazy.shutdown(), 'Shutdown qtile'), # Run prompt ([_mod], 'x', lazy.spawncmd(), 'Spawn a command using a prompt widget'), # Switch between groups ([_mod], ['t'], lazy.screen.prev_group(), 'Move to the group on the left'),
Key([mod, "shift"], "j", lazy.layout.shuffle_up(), desc="Move window up in current stack "), Key([mod, "shift"], "l", lazy.layout.right(), desc='Move focus right in the stack pane'), Key([mod, "shift"], "h", lazy.layout.left(), desc='Move focus left in the stack pane'), # Change layout Key([mod], "y", lazy.next_layout(), desc='Goes to the next layout'), Key([mod], "t", lazy.prev_layout(), desc='Goes to the last layout'), # Grow or shrink windows up and down Key([mod], "l", lazy.layout.grow(), lazy.layout.increase_nmaster(), desc='Expand window (MonadTall), increase number in master pane (Tile)' ), Key([mod], "h", lazy.layout.shrink(), lazy.layout.decrease_nmaster(), desc='Shrink window (MonadTall), decrease number in master pane (Tile)' ), Key([mod],
# Switch between monitors Key([mod], "comma", lazy.prev_screen()), Key([mod], "period", lazy.next_screen()), # Windows and layout behaviour Key([mod, sft], "r", lazy.restart()), Key([mod, sft], "q", lazy.window.kill()), Key([mod, sft], "n", lazy.layout.normalize()), Key([mod, sft], "f", lazy.window.toggle_floating()), Key([mod], "plus", lazy.layout.grow(), lazy.layout.increase_nmaster()), Key([mod], "minus", lazy.layout.shrink(), lazy.layout.decrease_nmaster()), # Toggle between different layouts Key([mod], "Tab", lazy.next_layout()), Key([mod, sft], "Tab", lazy.prev_layout()), # Terminal and rofi Key([mod], "Return", lazy.spawn(term)), Key([mod], "space", lazy.spawn("rofi -modi drun,run -show drun")), Key([mod, sft], "e", lazy.spawn("rofi -modi menu:rofi-power-menu -show menu")), Key([mod, sft], "x", lazy.spawn("rofi -modi menu:rofi-xrandr-menu -show menu")), Key([mod, sft], "d", lazy.spawn("rofi -modi menu:rofi-dotfiles-menu -show menu")), # App spawning Key([mod], "f", lazy.spawn("firefox")), Key([mod], "c", lazy.spawn("chromium")), Key([mod], "g", lazy.spawn("galculator")),
lazy.layout.shuffle_left(), desc="Move window left in current stack "), Key([mod, shift], "l", lazy.layout.shuffle_right(), desc="Move window right in current stack "), # Terminal y firefox Key([mod], "Return", lazy.spawn(terminal), desc="Inicia terminal"), Key([mod], "b", lazy.spawn("firefox"), desc="Inicia firefox"), # Cambiar Layout, y Eliminar ventanas. Key([mod], "Tab", lazy.next_layout(), desc="Cambia layout"), Key([mod, "shift"], "Tab", lazy.prev_layout(), desc="cambiar layout anterior"), Key([mod], "w", lazy.window.kill(), desc="Cerrar ventana"), # Reiniciar Qtile, Ejecutar comando Key([mod, ctrl], "r", lazy.restart(), desc="Reiniciar qtile"), # Flip Layout Key([mod], "t", lazy.flip()), # Explorador de archivos Key([mod], "e", lazy.spawn("pcmanfm-qt")), # Switch focus of monitors Key([mod], "period", lazy.next_screen()), Key([mod], "comma", lazy.prev_screen()),
# Swap panes of split stack Key([mod, "shift"], "space", lazy.layout.rotate(), desc="Swap panes of split stack"), # 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('emacsclient --no-wait -c -e "(+vterm/here 1)"'), desc="Launch terminal"), # Toggle between different layouts as defined below Key([mod], "Tab", lazy.next_layout(), desc="Toggle between layouts"), Key([mod, "shift"], "Tab", lazy.prev_layout(), desc="Toggle between layouts"), Key([mod], "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], "r", lazy.spawncmd(), desc="Spawn a command using a prompt widget"), ] groups = [Group(i) for i in "asdfuiop"] for i in groups: keys.extend([ # mod1 + letter of group = switch to group Key([mod], i.name, lazy.group[i.name].toscreen(), desc="Switch to group {}".format(i.name)),
# 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], "s", lazy.layout.toggle_split()), # Key([mod, "shift"], "Return", lazy.layout.toggle_split()), Key([mod], "Return", lazy.spawn("alacritty")), Key([mod], "g", lazy.spawn("alacritty --command nvim +GhostStart")), # Toggle between different layouts as defined below Key([mod], "Tab", lazy.next_layout()), Key([mod, "shift"], "Tab", lazy.prev_layout()), Key([mod, "shift"], "q", lazy.window.kill()), # Toggle fullscreen on window Key([mod], "f", lazy.window.toggle_fullscreen()), # Toggle floating on window Key([mod, "shift"], "f", lazy.window.toggle_floating()), # Restart and close qtile Key([mod, "control"], "r", lazy.restart()), Key([mod, "control"], "q", lazy.shutdown()), # Run commands # Key([mod], "d", lazy.spawncmd(prompt="Run command")), Key([mod], "d", lazy.spawn("dmenu_run -l 20 -p 'Run command:'")),
# Move windows Key([MOD, "shift"], "k", lazy.layout.shuffle_down()), Key([MOD, "shift"], "j", lazy.layout.shuffle_up()), # Doing things with windows Key([MOD], "f", lazy.window.toggle_fullscreen()), Key([MOD, "shift"], "q", lazy.window.kill()), Key([MOD], "space", lazy.window.toggle_floating()), # Qtile specific Key([MOD, "shift"], "r", lazy.restart()), Key([MOD, "control"], "q", lazy.shutdown()), # Layouts movement Key([MOD], "Tab", lazy.next_layout()), Key([MOD, "shift"], "Tab", lazy.prev_layout()), # Apps launching Key([MOD], "Return", lazy.spawn(TERMINAL)), Key([MOD], "d", lazy.spawn(APP_LAUNCHER)), Key([MOD], "w", lazy.spawn(BROWSER)), Key([MOD], "m", lazy.spawn(MUSIC_PLAYER)), ] # Groups groups = [Group(name) for name in GROUPS] for idx, name in enumerate(GROUPS, start=1): keys.extend([ Key([MOD], str(idx), lazy.group[name].toscreen()), Key([MOD, "shift"], str(idx), lazy.window.togroup(name)), ])