def init_groups(ks): group_names = init_group_names() groups = [Group(name, **kwargs) for name, kwargs in group_names] for i, (name, _) in enumerate(group_names, 1): ks.extend([ EzKey("M-" + str(i), lazy.group[name].toscreen()), EzKey("M-S-" + str(i), lazy.window.togroup(name)), ]) return groups
def bind_keys(*config): bindings = [] for c in config: keydef = c[0] actions = c[1] if type(c[1]) is list else [c[1]] desc = c[2] if type(actions[0]) is tuple: bindings.append(EzKeyChord(keydef, bind_keys(*actions))) else: bindings.append(EzKey(keydef, *actions, desc=desc)) return bindings
def __init__(self, mod): self.mod = mod self.keys = [ Key([self.mod], "j", lazy.layout.down()), Key([self.mod], "k", lazy.layout.up()), Key([self.mod], "h", lazy.layout.left()), Key([self.mod], "l", lazy.layout.right()), Key([self.mod, "shift"], "j", lazy.layout.shuffle_down()), Key([self.mod, "shift"], "k", lazy.layout.shuffle_up()), Key([self.mod, "shift"], "h", lazy.layout.shuffle_left()), Key([self.mod, "shift"], "l", lazy.layout.shuffle_right()), Key([self.mod, "control"], "j", lazy.layout.grow_down()), Key([self.mod, "control"], "k", lazy.layout.grow_up()), Key([self.mod, "control"], "h", lazy.layout.grow_left()), Key([self.mod, "control"], "l", lazy.layout.grow_right()), Key([self.mod, "shift"], "n", lazy.layout.normalize()), Key([self.mod, "shift"], "Return", lazy.layout.toggle_split()), Key([self.mod], "Return", lazy.spawn("alacritty")), Key([self.mod], "Tab", lazy.next_layout()), Key([self.mod], "w", lazy.window.kill()), Key([self.mod, "control"], "r", lazy.restart()), Key([self.mod, "control"], "q", lazy.shutdown()), Key([self.mod], "p", lazy.spawn("rofi -show run")), Key( [self.mod, "shift"], "s", lazy.spawn( "bash -c 'maim -s -u | xclip -selection clipboard -t image/png -i'" ), ), Key( [self.mod, "shift"], "w", lazy.spawn("bash -c 'xkill'"), ), EzKey("M-S-p", set_kbd_lo), ]
from libqtile.config import Key, EzKey from libqtile.lazy import lazy from libqtile.utils import guess_terminal terminal = guess_terminal() file_manager = 'thunar' KEYS = [ # Launchers EzKey('M-<Return>', lazy.spawn(terminal), desc="Launch terminal"), EzKey('M-<BackSpace>', lazy.spawn(file_manager)), # Switch between windows Key(["mod4"], "h", lazy.layout.left(), desc="Move focus to left"), Key(["mod4"], "l", lazy.layout.right(), desc="Move focus to right"), Key(["mod4"], "j", lazy.layout.down(), desc="Move focus down"), Key(["mod4"], "k", lazy.layout.up(), desc="Move focus up"), EzKey('M-<Tab>', 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(["mod4", "shift"], "h", lazy.layout.shuffle_left(), desc="Move window to the left"), Key( ["mod4", "shift"], "l", lazy.layout.shuffle_right(), desc="Move window to the right",
# Launchers 'M-d': lazy.spawn('rofi -show drun -modi drun,run'), 'M-e': lazy.spawn('rofi -show window -modi window'), # Laptop keys '<XF86MonBrightnessUp>': lazy.spawn('xbacklight -inc 10'), '<XF86MonBrightnessDown>': lazy.spawn('xbacklight -dec 10'), '<XF86AudioMute>': lazy.spawn('pactl set-sink-mute @DEFAULT_SINK@ toggle'), '<XF86AudioMicMute>': lazy.spawn('pactl set-sink-mute @DEFAULT_SINK@ toggle'), '<XF86AudioRaiseVolume>': lazy.spawn('pactl set-sink-volume @DEFAULT_SINK@ +2%'), '<XF86AudioLowerVolume>': lazy.spawn('pactl set-sink-volume @DEFAULT_SINK@ -2%'), # Other '<Print>': lazy.spawn('flameshot gui'), 'M-r': lazy.spawn('urxvt -e /usr/bin/ranger'), } groups = [Group(i) for i in "1234567890"] for i in groups: keymap[f'M-{i.name}'] = lazy.group[i.name].toscreen() keymap[f'M-S-{i.name}'] = lazy.window.togroup(i.name) keys = [EzKey(k, v) for k, v in keymap.items()]
screen_count = _get_screen_count() mod = "mod4" ctrl = "control" alt = "mod1" terminal = "urxvt" 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 # --- # | Spawn various processes # --- EzKey( "C-A-t", lazy.spawn("urxvt"), desc="Launch terminal.", ), EzKey( "C-A-e", lazy.spawn("emacsclient -c --alternate-editor=''"), desc="Launch Emacs.", ), EzKey( "C-A-l", lazy.spawn("xtrlock"), desc="Lock the screen.", ), Key( [], "Print",
if w.on_scratchpad: w.togroup('scratchpad') if scratchpad.focusHistory: # We have at least one scratchpad window to display so show that last # one to be focused. This will cause us to cycle through all scratchpad # windows in reverse order. last_window = scratchpad.focusHistory[-1] last_window.togroup(qtile.currentGroup.name) # qtile actually has an emacs style `EzKey` helper that makes specifying # key bindings a lot nicer than the default. keys = [ EzKey(k[0], *k[1:]) for k in [ # .: Movement :. # Swtich focus between panes ("M-<Up>", lazy.layout.up()), ("M-<Down>", lazy.layout.down()), ("M-<Left>", lazy.layout.left()), ("M-<Right>", lazy.layout.right()), ("M-h", lazy.layout.left()), ("M-j", lazy.layout.down()), ("M-k", lazy.layout.up()), ("M-l", lazy.layout.right()), # Swap panes: target relative to active. # NOTE :: The `swap` commands are for XMonad ("M-S-<Up>", lazy.layout.shuffle_up()), ("M-S-<Down>", lazy.layout.shuffle_down()),
*Floating.default_float_rules, Match(wm_class="pinentry-gtk-2"), Match(wm_class="Lxappearance"), Match(wm_class="Xfce4-taskmanager"), Match(wm_class="pavucontrol"), Match(title="Execute File", wm_class="Pcmanfm"), Match(title="Confirm File Replacing", wm_class="Pcmanfm"), Match(title="Steam", wm_class=""), ], **layout_theme, ) # Keybinds keys = [ # Switch focus between windows EzKey("M-<Down>", lazy.layout.down()), EzKey("M-<Up>", lazy.layout.up()), EzKey("M-<Left>", lazy.layout.left().when(layout=layout_names["monadtall"])), EzKey("M-<Right>", lazy.layout.right().when(layout=layout_names["monadtall"])), # Move windows between left/right columns or move up/down in current stack EzKey("M-S-<Left>", lazy.layout.swap_left().when(layout=layout_names["monadtall"])), EzKey( "M-S-<Right>", lazy.layout.swap_right().when(layout=layout_names["monadtall"]) ), EzKey( "M-S-<Down>", lazy.layout.shuffle_down().when(layout=layout_names["monadtall"]), lazy.layout.move_down().when(layout=layout_names["treetab"]), ), EzKey( "M-S-<Up>",
('M-A-t', lazy.layout.integrate_down(), lazy.layout.flip_down()), # j ('M-A-n', lazy.layout.integrate_up(), lazy.layout.flip_up()), # k ('M-A-s', lazy.layout.integrate_right(), lazy.layout.flip_right()), # l ('M-y', lazy.layout.mode_horizontal()), ('M-p', lazy.layout.mode_vertical()), ('M-C-y', lazy.layout.mode_horizontal_split()), ('M-C-p', lazy.layout.mode_vertical_split()), ('M-C-5', lazy.layout.size(500)), ('M-C-8', lazy.layout.size(800)), ('M-C-0', lazy.layout.reset_size()), ('M-<bracketleft>', lazy.spawn('playerctl play-pause')), ('M-<bracketright>', lazy.spawn('playerctl next')), ] keymap = keymap_dox keys = [EzKey(*v) for v in keymap] groups = [Group(str(i + 1)) for i in range(9)] for idx, g in enumerate(groups): # mod1 + letter of group = switch to group keys.append(Key([mod], str(idx + 1), lazy.group[g.name].toscreen())) # mod1 + shift + letter of group = switch to & move focused window to group keys.append(Key([mod, "shift"], str(idx + 1), lazy.window.togroup(g.name))) groups.extend([ Group('www', layout='plasma', persist=True, init=True,
), MetricsListener( font=FONT, fontsize=FONTSIZE, foreground=Colors.highlight_text, ), ], FONTSIZE+0, # Bar height background=Colors.bg, ), ), ] # Emulate function keys as 'super' + f* fk = "python3 ~/github/programs/presskey ctrl+alt+f" keys.extend([EzKey("M-" + str(i), lazy.spawn(fk+str(i))) for i in range(1,9)]) # For Logitech M570 mouse = [ Click("8", lazy.spawn(program("terminal"))), # Macro 2 = Open terminal Click("9", lazy.spawn(program("pause"))), # Macro 1 = Open menu Click("M-9", lazy.window.kill()), # 'Super' + Macro 1 = Kill window Click("M-4", lazy.spawn(program("vol_up"))), # 'Super' + Wheel = increase volume Click("M-5", lazy.spawn(program("vol_down"))) # 'Super' + Wheel = derease volume ] @hook.subscribe.client_new def client_new(client): # Rules for new programs if client.name == 'Discord': client.togroup('d')
w.on_scratchpad = False if w.on_scratchpad: w.togroup('scratchpad') if scratchpad.focusHistory: # We have at least one scratchpad window to display so show that last # one to be focused. This will cause us to cycle through all scratchpad # windows in reverse order. last_window = scratchpad.focusHistory[-1] last_window.togroup(qtile.currentGroup.name) # qtile actually has an emacs style `EzKey` helper that makes specifying # key bindings a lot nicer than the default. keys = [EzKey(k[0], *k[1:]) for k in [ # .: Movement :. # Swtich focus between panes ("M-<Up>", lazy.layout.up()), ("M-<Down>", lazy.layout.down()), ("M-<Left>", lazy.layout.left()), ("M-<Right>", lazy.layout.right()), ("M-h", lazy.layout.left()), ("M-j", lazy.layout.down()), ("M-k", lazy.layout.up()), ("M-l", lazy.layout.right()), # Swap panes: target relative to active. # NOTE :: The `swap` commands are for XMonad ("M-S-<Up>", lazy.layout.shuffle_up()),
def init_keys(): return [ # Switch between windows in current stack pane # EzKey("-b", lazy.layout.down()), # EzKey("C-f", lazy.layout.up()), EzKey("M-b", lazy.layout.shuffle_down()), EzKey("M-f", lazy.layout.shuffle_up()), EzKey("M-<space>", lazy.layout.next()), EzKey("M-S-f", float_to_front), # Swap panes of split stack # EzKey("M-S-<space>", lazy.layout.rotate()), # Toggle between split and unsplit sides of stack. # EzKey("M-S-<Return>", lazy.layout.toggle_split()), EzKey("M-<Tab>", lazy.next_layout()), EzKey("M-C-r", lazy.restart()), EzKey("M-C-q", lazy.shutdown()), EzKey("M-w", lazy.window.kill()), EzKey("M-m", lazy.window.toggle_maximize()), # Sound EzKey("<XF86AudioMute>", lazy.spawn("pamixer -t")), EzKey("<XF86AudioLowerVolume>", lazy.spawn("pamixer -d 1 -u")), EzKey("<XF86AudioRaiseVolume>", lazy.spawn("pamixer -i 1 -u")), # Media EzKey("<XF86AudioPrev>", lazy.spawn("playerctl previous")), EzKey("<XF86AudioPlay>", lazy.spawn("playerctl play-pause")), EzKey("<XF86AudioStop>", lazy.spawn("playerctl stop")), EzKey("<XF86AudioNext>", lazy.spawn("playerctl next")), # Applications EzKey("M-r", lazy.spawn("rofi -show drun")), EzKey("M-S-w", lazy.spawn("rofi -show window")), EzKey("M-<Return>", lazy.spawn(my_term)), EzKey("M-C-d", lazy.spawn("pcmanfm")), EzKey("M-e", lazy.spawn("emacsclient -nc")), EzKey("M-C-i", lazy.spawn("firefox")), EzKey("M-S-h", lazy.spawn(my_term + " -e bpytop")), # EzKey("M-C-n", lazy.spawn("notion-app")), EzKey("M-C-m", lazy.spawn("youtubemusic-nativefier")), # Screenshot EzKey( "M-<Print>", lazy.spawn("flameshot full -p /home/ayush/Pictures/Screenshots")), ]
cmd=move_cmd, stream_id=stream, thing_id=thing.index ) print(cmd) subprocess.check_call(shlex.split(cmd)) def switch_pulse_default_sink(qtile): return switch_pulse_default("sink") def switch_pulse_default_source(qtile): return switch_pulse_default("source") keys = [ EzKey("M-p", lazy.layout.up()), EzKey("M-f", lazy.layout.right()), EzKey("M-n", lazy.layout.down()), EzKey("M-v", lazy.window.toggle_minimize()), EzKey("M-b", lazy.layout.left()), EzKey("M-C-p", lazy.layout.shuffle_up()), EzKey("M-C-f", lazy.layout.shuffle_right()), EzKey("M-C-n", lazy.layout.shuffle_down()), EzKey("M-C-b", lazy.layout.shuffle_left()), EzKey("M-S-f", lazy.layout.grow_right()), EzKey("M-S-b", lazy.layout.grow_left()), EzKey("M-S-<space>", lazy.layout.rotate()), EzKey("M-C-<Return>", lazy.layout.toggle_split()), EzKey("M-m", lazy.layout.toggle_fullscreen()), EzKey("M-S-<Return>", lazy.window.toggle_floating()), EzKey("C-S-<grave>", lazy.spawn(terminal_program)),
Key([mod, "shift"], "l", lazy.layout.shuffle_right()), # 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], "Return", lazy.spawn("konsole")), Key([mod], "e", lazy.spawn("dolphin")), EzKey('A-S-<space>', lazy.widget['keyboardlayout'].next_keyboard()), # 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()), Key([mod], "r", lazy.spawn('rofi -show run')), ] groupnames = [' 爵 ', ' ', ' ', ' ', ' ', ' ', ' ', ' '] groupkeys = 'asdfuiop' groups = []
from libqtile.config import EzKey from libqtile.lazy import lazy terminal = "urxvt" mod = "mod4" keys = [ # Switch between groups EzKey("M-i", lazy.screen.next_group()), # Move to the group on the right EzKey("M-u", lazy.screen.prev_group()), # Move to the group on the left # Move to the last visited group EzKey("M-<Tab>", lazy.screen.toggle_group()), # Switch between windows EzKey("M-h", lazy.layout.left()), # Move focus to left EzKey("M-l", lazy.layout.right()), # Move focus to right EzKey("M-j", lazy.layout.down()), # Move focus down EzKey("M-k", lazy.layout.up()), # Move focus up # Move window focus to other window EzKey("M-<space>", lazy.layout.next()), # Monadtall/Monadwide EzKey("M-S-h", lazy.layout.shuffle_left()), # Move window to the left EzKey("M-S-l", lazy.layout.shuffle_right()), # Move window to the right EzKey("M-S-j", lazy.layout.shuffle_down()), # Move window down"), EzKey("M-S-k", lazy.layout.shuffle_up()), # Move window up"), EzKey("M-S-i", lazy.layout.grow()), EzKey("M-S-u", lazy.layout.shrink()), EzKey("M-n", lazy.layout.normalize()), EzKey("M-o", lazy.layout.maximize()), EzKey("M-S-<space>", lazy.layout.flip()),