def keys_apps(): return [ Key("M-<Return>", lazy.spawn(terminal), desc="Launch terminal"), Key("M-S-q", lazy.window.kill(), desc="Kill focused window"), Key("M-r", lazy.spawncmd(), desc="Spawn a command using a prompt widget"), ]
def create_cmd_keys(self): for cmd_key in self.cmd_keys: modifier, key, command = cmd_key keybinding = Key(modifier, key, lazy.spawncmd(command)) self.keys.append(keybinding)
def __launcher(): from shutil import which import os return (lazy.run_extension( extension.DmenuRun( dmenu_prompt="run> ", background="black", # background="#000000", selected_background="#808080", selected_foreground="black", # selected_foreground="#000000", dmenu_lines=10, )) if which("dmenu", os.X_OK) else lazy.spawncmd())
lazy.spawn("betterlockscreen -l dim")), # lockscreen (L) Key([], "x", lazy.spawn("xkill")), # xkill (X) Key([], "q", lazy.shutdown()), # exit (Q) Key([], "r", lazy.restart()), # restart (R) Key(["shift"], "q", lazy.spawn( "systemctl -i poweroff")), # quit-systen (Shift-Q) Key(["shift"], "r", lazy.spawn("systemctl reboot")), # reboot-systen (Shift-R) ]), # Apps keychords KeyChord( [mod], "a", [ # [A] Key([], "a", lazy.spawncmd(prompt='$')), # prompt (A) Key([], "k", lazy.spawn("kitty")), # kitty (K) Key([], "e", lazy.spawn("emacs")), # emacs (E) Key([], "f", lazy.spawn("firefox")), # firefox (F) Key([], "b", lazy.spawn("bgrandom")), # background (B) Key([], "l", lazy.spawn("laynext")), # layout (L) Key([], "i", lazy.spawn("keyinfo")), # info (I) Key([], "t", lazy.spawn(terminal + " -e tmux")), # tmux (T) Key([], "m", lazy.spawn(terminal + " -e mocp")), # moc (M) Key([], "c", lazy.spawn(terminal + " -e calcurse")), # calcurse (C) ]), # Windows keychords
def init_widgets_list(self): ''' Function that returns the desired widgets in form of list ''' widgets_list = [ widget.Sep( linewidth=0, padding=6, foreground=self.colors[2], background=self.colors[0] ), widget.Image( filename="~/.config/qtile/icons/terminal-iconx14.png", mouse_callbacks={ 'Button1': lambda qtile: qtile.cmd_spawn('dmenu_run -p "Run: "')} ), widget.Sep( linewidth=0, padding=5, foreground=self.colors[2], background=self.colors[0] ), widget.GroupBox( font="Ubuntu Bold", fontsize=12, margin_y=2, margin_x=0, padding_y=5, padding_x=3, borderwidth=3, active=self.colors[-2], inactive=self.colors[-1], # rounded=True, rounded=False, # highlight_color=self.colors[9], # highlight_method="line", highlight_method='block', urgent_alert_method='block', # urgent_border=self.colors[9], this_current_screen_border=self.colors[9], this_screen_border=self.colors[4], other_current_screen_border=self.colors[0], other_screen_border=self.colors[0], foreground=self.colors[2], background=self.colors[0], disable_drag=True ), widget.Prompt( prompt=lazy.spawncmd(), font="Ubuntu Mono", padding=10, foreground=self.colors[3], background=self.colors[1] ), widget.Sep( linewidth=0, padding=40, foreground=self.colors[2], background=self.colors[0] ), widget.WindowName( foreground=self.colors[6], background=self.colors[0], padding=0 ), widget.Systray( background=self.colors[0], padding=5 ), widget.TextBox( text='', background=self.colors[0], foreground=self.colors[11], padding=0, fontsize=37 ), widget.TextBox( text=" 🖬", foreground=self.colors[7], background=self.colors[11], padding=0, fontsize=14 ), widget.Memory( foreground=self.colors[7], background=self.colors[11], mouse_callbacks={'Button1': lambda qtile: qtile.cmd_spawn( self.termite + ' -e htop')}, padding=5 ), widget.TextBox( text='', background=self.colors[11], foreground=self.colors[10], padding=0, fontsize=37 ), widget.TextBox( text="  ", foreground=self.colors[7], background=self.colors[10], padding=0, mouse_callbacks={ "Button1": lambda qtile: qtile.cmd_spawn("pavucontrol")} ), widget.Volume( foreground=self.colors[7], background=self.colors[10], padding=5 ), widget.TextBox( text='', background=self.colors[10], foreground=self.colors[9], padding=0, fontsize=37 ), widget.CurrentLayoutIcon( custom_icon_paths=[os.path.expanduser( "~/.config/qtile/icons")], foreground=self.colors[0], background=self.colors[9], padding=0, scale=0.7 ), widget.CurrentLayout( foreground=self.colors[7], background=self.colors[9], padding=5 ), widget.TextBox( text='', foreground=self.colors[8], background=self.colors[9], padding=0, fontsize=37 ), widget.Clock( foreground=self.colors[7], background=self.colors[8], mouse_callbacks={ "Button1": lambda qtile: qtile.cmd_spawn(PWA.calendar())}, format="%B %d [ %H:%M ]" ), widget.Sep( linewidth=0, padding=10, foreground=self.colors[0], background=self.colors[8] ), ] return widgets_list
def keys(self): return [ # Switch between windows in current stack pane Key( [MOD], 'k', lazy.layout.down(), desc='Move focus down in stack pane', ), Key( [MOD], 'j', lazy.layout.up(), desc='Move focus up in stack pane', ), # Move windows up or down in current stack Key( [MOD, CONTROL], 'k', lazy.layout.shuffle_down(), desc='Move window down in current stack', ), Key( [MOD, CONTROL], 'j', lazy.layout.shuffle_up(), desc='Move window up in current stack', ), # Switch window focus to other pane(s) of stack Key( [MOD], 'space', lazy.layout.next(), desc='Switch window focus to other pane(s) of stack', ), # 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', ), # Toggle between different layouts as defined below Key( [MOD], 'Tab', lazy.next_layout(), desc='Toggle between layouts', ), Key( [ALT], 'F4', 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', ), Key( [CONTROL, ALT], 'l', lazy.spawn('/usr/local/bin/lock-screen'), desc='Lock Screen', ), Key( [MOD], 'Right', lazy.screen.next_group(), desc='Switch to next group', ), Key( [MOD], 'Left', lazy.screen.prev_group(), desc='Switch to previous 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], "Tab", lazy.next_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"), # MonadTall layout Key([mod], "Left", lazy.layout.left()), Key([mod], "n", lazy.layout.left()), Key([mod], "Right", lazy.layout.right()), Key([mod], "i", lazy.layout.right()), Key([mod], "Down", lazy.layout.down()), Key([mod], "e", lazy.layout.down()), Key([mod], "Up", lazy.layout.up()), Key([mod], "u", lazy.layout.up()), Key([mod, "shift"], "Left", lazy.layout.swap_left()), Key([mod, "shift"], "Right", lazy.layout.swap_right()), Key([mod, "shift"], "Down", lazy.layout.shuffle_down()), Key([mod, "shift"], "Up", lazy.layout.shuffle_up()), Key([mod, "control"], "Up", lazy.layout.grow()),
# Split = all windows displayed # Unsplit = 1 window displayed, like Max layout, but still with # multiple stack panes Key([mod], "s", lazy.layout.toggle_split(), desc="Toggle between split and unsplit sides of stack"), Key([mod, "shift"], "space", lazy.window.toggle_floating(), desc="Toggle the current window to/from floating mode"), Key([mod], "Return", lazy.spawn(terminal), desc="Launch terminal"), # Toggle between different layouts as defined below Key([mod], "Tab", lazy.next_layout(), desc="Toggle between layouts"), Key([mod], "q", lazy.window.kill(), desc="Kill focused window"), Key([mod, "shift"], "r", lazy.restart(), desc="Restart Qtile"), Key([mod, "control"], "q", lazy.shutdown(), desc="Shutdown Qtile"), Key([mod], "d", lazy.spawncmd(), desc="Spawn a command using a prompt widget"), ] groups = [Group(i) for i in "123456789"] for i in groups: keys.extend([ # mod1 + letter of group = switch to group Key([mod], i.name, lazy.group[i.name].toscreen(), desc="Switch to group {}".format(i.name)), # mod1 + shift + letter of group = switch to & move focused window to group Key([mod, "shift"], i.name, lazy.window.togroup(i.name, switch_group=True), desc="Switch to & move focused window to group {}".format(i.name)), # Or, use below if you prefer not to switch to that group.
desc="Switch window focus to other pane(s) of stack", ), Key([mod, "shift"], "Tab", lazy.layout.rotate(), desc="Swap panes of split stack"), Key( [mod, "shift"], "Return", lazy.layout.toggle_split(), desc="Toggle between split and unsplit sides of stack", ), Key([mod], "f", lazy.window.toggle_fullscreen(), desc="fullscreen"), Key([mod], "Return", lazy.spawn(terminal), desc="Launch terminal"), Key([mod], "space", lazy.next_layout(), desc="Toggle between layouts"), Key([mod, "shift"], "x", 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, "shift"], "p", lazy.spawncmd(), desc="Run a command"), Key([mod], "p", lazy.spawn(launcher), desc="Open application launcher"), Key([mod], "w", lazy.spawn(window_switcher), desc="Open window switcher"), ] groups = [Group(i) for i in "1234567890"] for i in groups: keys.extend( [ Key( [mod], i.name, lazy.group[i.name].toscreen(), desc="Switch to group {}".format(i.name), ),
# 'open': 'urxvt -e mocp', # 'shuffle': 'mocp -t shuffle', # 'repeat': 'mocp -t repeat', # }, # pre_commands=['[ $(mocp -i | wc -l) -lt 1 ] && mocp -S'], # rofi # ))), # Toggle between different layouts as defined below Key("M-<Tab>", lazy.next_layout(), desc="Toggle between layouts"), # Globals Key("M-C-r", lazy.restart(), desc="Restart qtile"), Key("M-C-q", lazy.shutdown(), desc="Shutdown qtile"), Key("M-r", lazy.spawncmd(), desc="Spawn a command using a prompt widget") ] # ================================================================ # ============================ Mouse ============================= # ================================================================ mouse = [ Drag("M-1", lazy.window.set_position_floating(), start=lazy.window.get_position()), Drag("M-3", lazy.window.set_size_floating(), start=lazy.window.get_size()), Click("M-2", lazy.window.bring_to_front()), ] # ================================================================ # =========================== Screens ============================
def init_keys(self): #################### CUSTOM KEYS ########################## return [ ############ BINDINGS FOR MONADTALL ############## Key([self.mod], "h", lazy.layout.left()), Key([self.mod], "l", lazy.layout.right()), Key([self.mod], "j", lazy.layout.down()), Key([self.mod], "k", lazy.layout.up()), Key([self.mod, "shift"], "h", lazy.layout.swap_left()), Key([self.mod, "shift"], "l", lazy.layout.swap_right()), Key([self.mod, "shift"], "j", lazy.layout.shuffle_down()), Key([self.mod, "shift"], "k", lazy.layout.shuffle_up()), Key([self.mod], "i", lazy.layout.grow()), Key([self.mod], "m", lazy.layout.shrink()), Key([self.mod], "n", lazy.layout.normalize()), Key([self.mod], "o", lazy.layout.maximize()), Key([self.mod, "shift"], "space", lazy.layout.flip()), ############ BINDINGS FOR FLOATING ############## Key([self.mod, "shift"], "g", lazy.window.toggle_floating(), desc='toggle floating'), Key([self.mod, "shift"], "f", lazy.window.toggle_fullscreen(), desc='toggle fullscreen'), # Move screen to next and previous workspace Key([self.mod], "k", lazy.screen.next_group(), desc="Move screen to the next workspace"), Key([self.mod], "j", lazy.screen.prev_group(), desc="Move screen to the previous workspace"), # Move window to next group Key([self.control, self.shift], "k", Functions.window_to_next_group(), desc="Move screen to the next workspace"), Key([self.control, self.shift], "j", Functions.window_to_prev_group(), desc="Move screen to the previous workspace"), # Kill Functions Key([self.mod, self.altgr], "c", Functions.kill_all_windows_minus_current(), desc="Kill all windows except current in the workspace"), Key([self.mod, self.altgr], "x", Functions.kill_all_windows(), desc="Kill all windows except current in the workspace"), # Toggle between different layouts as defined below Key([self.mod], "Tab", lazy.next_layout(), desc="Toggle between layouts"), # Toggle bar Key([self.mod, "shift"], "t", lazy.hide_show_bar("top"), desc="Show and hide top bar"), # Basic Commands Key([self.mod], "q", lazy.window.kill(), desc="Kill focused window"), Key([self.mod], "Return", lazy.spawn(self.terminal), desc="Launch terminal"), Key([self.mod, "shift"], "r", lazy.restart(), desc="Restart qtile"), Key([self.mod, "shift"], "q", lazy.shutdown(), desc="Shutdown qtile"), # Key([self.mod], "r", lazy.spawn('rofi -modi system:/home/surajkarki/.config/rofi/scripts/powermenu.sh -show system -theme dmenu -icon-theme "Papirus-Dark" -show-icons'), # desc="Run Rofi"), Key([self.mod], "d", lazy.spawn('dmenu_run'), desc="Run dmenu"), Key([self.mod], "Escape", lazy.spawn("betterlockscreen -l"), desc="Lock the sreen"), # Applications hotkeys # Most apps are opened with Super + left self.alt keys Key([self.mod, self.alt], "e", lazy.spawn("emacs"), desc="Open Doom Emacs"), Key([self.mod, self.alt], "b", lazy.spawn("brave"), desc="Open Brave Browser"), Key([self.mod, self.alt], "v", lazy.spawn("codium"), desc="Open VS codium"), Key([self.mod, self.alt], "a", lazy.spawn("pavucontrol"), desc="Open Pulse audio GUI controller"), Key([self.mod, self.alt], "s", lazy.spawn("signal-desktop"), desc="Open Signal"), Key([self.mod, self.alt], "n", lazy.spawn("pcmanfm"), desc="Open PCManFM file browser"), Key([self.mod, self.alt], "i", lazy.spawn("insomnia"), desc="Open Insomnia"), Key([self.mod, self.alt], "r", lazy.spawn(self.terminal + " ranger"), desc="Open Ranger file manager"), Key([self.mod], "s", lazy.spawn("spotifymusic"), desc="Open Spotify"), Key([self.mod], "p", lazy.spawn("passmenu"), desc="Open passmenu"), # System Key([self.mod, self.control], "r", lazy.spawn("systemctl reboot"), desc="Reboot"), Key([self.mod, self.control], "s", lazy.spawn("systemctl poweroff"), desc="Shutdown"), Key([self.mod, self.control], "a", lazy.spawn("systemctl suspend"), desc="Suspend"), # Media hotkeys Key([self.mod], 'Up', lazy.spawn('pulseaudio-ctl up 5')), Key([self.mod], 'Down', lazy.spawn('pulseaudio-ctl down 5')), Key([], "XF86AudioPlay", lazy.spawn('playerctl play-pause')), Key([], "XF86AudioPause", lazy.spawn('playerctl play-pause')), # Screenshots Key([], "Print", lazy.spawn('xfce4-screenshooter')), Key([self.alt], "Print", lazy.spawn('xfce4-screenshooter -f -c')), Key([self.shift], "Print", lazy.spawncmd( "xfce4-screenshooter -f -s /home/daniel/Pictures/Screenshots/" )), # ------------ Hardware Configs ------------ # Volume 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")), # Brightness Key([], "XF86MonBrightnessUp", lazy.spawn("brightnessctl set +10%")), Key([], "XF86MonBrightnessDown", lazy.spawn("brightnessctl set 10%-")), ]
# it fixes some edge cases in java programs wmname = "lg3d" ### # Key Bindings ### keys = [ # QTile Control Key([mod, "shift"], "r", lazy.restart(), desc="Restart Qtile"), Key([mod, "shift", "control"], "e", lazy.shutdown(), desc="Shutdown Qtile"), # Application Control Key([mod], "semicolon", lazy.spawn("rofi -show run"), desc="Summon rofi run mode"), Key([mod, "shift"], "semicolon", lazy.spawncmd(), desc="Spawn a command using a prompt widget"), Key([mod], "Return", lazy.spawn(terminal), desc="Launch terminal"), Key([mod, "shift"], "q", lazy.window.kill(), desc="Kill focused window"), # Layout Control Key([mod], "Tab", lazy.layout.toggle_split(), desc="Toggle between split and unsplit sides of stack"), Key([mod], "q", lazy.to_layout_index(0)), Key([mod], "w", lazy.to_layout_index(1)), Key([mod], "e", lazy.window.toggle_fullscreen(), desc="Make window fullscreen or reset to windowed mode"), Key([mod], "r", lazy.window.toggle_floating(), desc="Toggle floating mode"), # Window Control Key([mod], "h", lazy.layout.left(), desc="Move focus to left"), Key([mod], "j", lazy.layout.down(), desc="Move focus down"), Key([mod], "k", lazy.layout.up(), desc="Move focus up"),
'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'), ([_mod, 'control'], 'Left', lazy.screen.prev_group(), 'Move to the group on the left'), ([_mod], ['n'], lazy.screen.next_group(), 'Move to the group on the right'), ([_mod, 'control'], 'Right', lazy.screen.next_group(), 'Move to the group on the right'), ([_alt], 'Tab', lazy.screen.toggle_group(), 'Move to the last visited group'), # Screens # Switch focus of monitors
# 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], "Tab", lazy.next_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"), #Volumen Key([], "XF86AudioLowerVolume", lazy.spawn("pamixer --decrease 5")), Key([], "XF86AudioRaiseVolume", lazy.spawn("pamixer --increase 5")), Key([], "XF86AudioMute", lazy.spawn("pamixer --toggle-mute")), # Brillo Key([], "XF86MonBrightnessUp", lazy.spawn("brightnessctl set +10%")), Key([], "XF86MonBrightnessDown", lazy.spawn("brightnessctl set 10%-")), # Key([mod], "m", lazy.spawn("rofi -show run")), Key([mod, 'shift'], "m", lazy.spawn("rofi -show")), Key([mod], "c", lazy.spawn("code")), Key([mod], "e", lazy.spawn("nautilus")), Key([mod], "n", lazy.spawn("google-chrome")), Key([mod], "h", lazy.spawncmd("htop")),
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')), ]
# 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')), ] basic_launch_keys = [ Key([mod], 't', lazy.spawn(terminal), desc='Launch your favourite terminal.'), Key([], 'XF86WWW', lazy.spawn(browser), desc='Launch your favourite web browser.'), Key([mod], 'r', lazy.spawncmd(prompt='$')), Key([mod, 'control'], 'r', lazy.spawn('rofi -show drun')), Key([], 'XF86Search', lazy.spawn('rofi -show drun')), Key([mod], 'F4', lazy.spawn('xkill')), Key([mod, 'control'], 'm', lazy.spawncmd(prompt='man ', command=f'{terminal} {terminal_eflag} man %s')), ] audio_keys = [ # TODO: wrapper with playerctl Key([], 'XF86AudioPlay', lazy.spawn('mpc toggle')), Key([], 'XF86AudioNext', lazy.spawn('mpc next')), Key([], 'XF86AudioPrev', lazy.spawn('mpc prev')), Key([], 'XF86AudioRaiseVolume', lazy.spawn('mpc volume +1')), Key([], 'XF86AudioLowerVolume', lazy.spawn('mpc volume -1')),
# Toggle between screeens Key([mod], 'grave', lazy.next_screen()), # Media keys Key([], 'XF86AudioRaiseVolume', lazy.spawn('pactl set-sink-volume 1 +5%')), Key([], 'XF86AudioLowerVolume', lazy.spawn('pactl set-sink-volume 1 -5%')), Key([], 'XF86AudioMute', lazy.spawn('pactl set-sink-mute 1 toggle')), Key([], 'XF86AudioPlay', lazy.spawn('playerctl play-pause')), Key([], 'XF86AudioNext', lazy.spawn('playerctl next')), Key([], 'XF86AudioPrev', lazy.spawn('playerctl previous')), # 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.spawncmd()), Key([mod], 'Return', lazy.spawn('alacritty')), Key([mod, 'shift'], 'f', lazy.spawn('firefox-nightly')), Key([mod, 'shift'], 'b', lazy.spawn('brave')), Key([mod], 'x', lazy.spawn('/home/giancarlo/.scripts/emoji.sh')), Key([mod], "space", lazy.spawn('rofi -show run')), # Toggle between different layouts as defined below Key([mod, 'shift'], 'Tab', lazy.next_layout()), Key([mod, 'mod1'], 'space', lazy.window.toggle_floating()), Key([mod], 'w', lazy.window.kill()), Key([mod], 'f', lazy.window.toggle_fullscreen()), Key([mod, 'control'], 'r', lazy.restart()), Key([mod, 'control'], 'q', lazy.shutdown()), Key([mod], 'r', lazy.spawncmd()), ]
desc="Launch File Manager"), Key([mod], "b", lazy.spawn(apps.myWebBrowser), desc="Launch Web Browser"), Key( [mod], "i", lazy.spawn(apps.myIncognitoBrowser), desc="Launch Web Browser in Incognito Mode", ), Key( [mod], "p", lazy.spawn(apps.myPasswordManager), desc="Launch password manager", ), Key([mod], "r", lazy.spawn(apps.myLauncher), desc="Launch Launcher"), Key([mod, shift], "r", lazy.spawncmd(), desc="Launch Prompt Widget"), # Primary KeyChord( [mod], "o", [ Key([], "t", lazy.spawn(apps.myTorBrowser), desc="Launch Tor Browser"), Key([], "m", lazy.spawn(apps.myMusicPlayer), desc="Launch Music Player"), Key([], "v",
"f", lazy.layout.flip(), desc='Move window between windows in current stack pane'), Key([mod], "space", lazy.layout.next(), desc='Switch window focus to other pane(s) of stack'), Key([mod], "Return", lazy.spawn(myTerm), desc='Launches My terminal with URXVT'), Key([mod], "Tab", lazy.next_layout(), desc='Toggle through layouts'), Key([mod], "w", lazy.window.kill(), desc='Kill active 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='Run command bar'), Key([mod, "shift"], "m", lazy.to_screen(0), desc='Keyboard focus to monitor1'), Key([mod, "shift"], "n", lazy.to_screen(1), desc='Keyboard focus to monitor2'), Key([mod], "f", lazy.spawn(myTerm + " -e ranger"), desc='File Manager'), Key([mod], "n", lazy.layout.normalize(), desc='Normalize window size ratios'), Key([mod], "m",
Key([mod], 'space', lazy.layout.next()), # Swap panes of split stack. Key([mod, 'shift'], 'space', lazy.layout.rotate()), # Open the terminal. Key([mod], 'Return', lazy.spawn(term)), # Toggle between different layouts as defined below. Key([mod], 'Tab', lazy.next_layout()), Key([mod], 'w', lazy.window.kill()), # Manage the DE. Key([mod, 'control'], 'r', lazy.restart()), # --> refresh. Key([mod, 'control'], 'q', lazy.shutdown()), # --> shutdown. Key([mod], 'r', lazy.spawncmd()), # --> spawn. # Spawn rofi d-run. Key([mod], 'd', lazy.spawn('rofi -show drun')), # Media keys. Key([], 'XF86AudioMute', os.system('$~/.config/dunst/dunstrc/volume.sh up')), Key([], 'XF86AudioRaiseVolume', lazy.spawn('amixer -c 1 -q set Master 5%+')), Key([], 'XF86AudioLowerVolume', lazy.spawn('amixer -c 1 -q set Master 5-')), Key([], 'XF86AudioNext', lazy.spawn('mpc next')), Key([], 'XF86AudioPrev', lazy.spawn('mpc prev')), Key([], 'XF86AudioPlay', lazy.spawn('mpc toggle')), Key([], 'XF86AudioStop', lazy.spawn('mpc stop')),
Key([mod], "h", lazy.layout.shrink_main()), Key([mod], "l", lazy.layout.grow_main()), Key([mod], "j", lazy.layout.down()), Key([mod], "k", lazy.layout.up()), Key([mod, "shift"], "j", lazy.layout.shuffle_down()), Key([mod, "shift"], "k", lazy.layout.shuffle_up()), Key([mod], "n", lazy.layout.normalize()), Key([mod], "o", lazy.layout.maximize()), # Window hotkeys Key([mod], "space", lazy.window.toggle_fullscreen()), Key([mod], "c", lazy.window.kill()), Key([mod, "shift"], "c", lazy.window.kill()), # Spec hotkeys Key([mod], "Return", lazy.spawncmd()), Key([mod, "control"], "r", lazy.restart()), Key([mod, "control"], "q", lazy.shutdown()), # Apps hotkeys Key([mod], "v", lazy.spawn("urxvt")), Key([mod, "shift"], "v", lazy.spawn("sudo urxvt")), Key([mod], "y", lazy.spawn("urxvt -e python")), Key([mod], "g", lazy.spawn("emacsclient -nc -s instance1")), Key([mod], "b", lazy.spawn("freemind-unstable")), Key([mod], "z", lazy.spawn("pcmanfm")), Key([mod], "x", lazy.spawn("deadbeef")), Key([mod], "Insert", lazy.spawn("firefox -P default")), Key([mod], "Home", lazy.spawn("firefox -P music")), Key([mod], "Prior", lazy.spawn("firefox -P default --private-window")), Key([mod], "Delete", lazy.spawn("firefox -P dev")),
# multiple stack panes Key([mod, "shift"], "Return", lazy.layout.toggle_split()), # toggle the Terminal Key([mod], "Return", lazy.spawn("st")), # Toggle between different layouts as defined below Key([mod], "Tab", lazy.next_layout()), Key([mod], "w", lazy.window.kill()), # qtile controls Key([mod, "control"], "r", lazy.restart()), Key([mod, "control"], "q", lazy.shutdown()), Key([mod, "control"], "l", lazy.spawn(Commands.lockscreen)), Key([mod, "control"], 'f', lazy.window.toggle_floating()), Key([mod], "r", lazy.spawncmd()), ### COMMANDS Key([mod, "shift"], "r", lazy.spawn(Commands.launcher)), Key([mod, "shift"], "b", lazy.spawn(Commands.bluetooth_on)), Key([mod, "shift"], "q", lazy.spawn(Commands.bluetooth_off)), # Display Fix: Double Monitor Key([mod, "shift"], "x", lazy.spawn(Commands.double_monitor), desc='resolve the single display wallpaper with feh'), Key([mod, "shift"], "y", lazy.spawn(Commands.single_monitor), desc='resolve single disblay with xrandr'), # toggle file system Key([mod], "g", lazy.spawn(Commands.filesystem_ranger)), Key([mod], "h", lazy.spawn(Commands.filesystem_nautilus)),
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("xfce4-terminal")), # Toggle between different layouts as defined below Key([mod], "Tab", lazy.next_layout()), Key([mod, "shift"], "q", lazy.window.kill()), Key([mod, "shift"], "r", lazy.restart()), Key([mod, "shift"], "e", lazy.shutdown()), Key([mod, "control"], "r", lazy.spawncmd('command')), # --- The rest are my own keys Key([mod], "d", lazy.spawn("rofi -show drun")), Key([mod, "shift"], "d", lazy.spawn("/home/egemen/.scripts/rofi_web.sh")), Key([mod, "shift"], "m", lazy.spawn("/home/egemen/.scripts/monitor_manager_2.py")), Key([mod], "p", lazy.spawn("pavucontrol")), Key([mod], "o", lazy.spawn("xfce4-terminal -e alsamixer")), Key([mod], "t", lazy.spawn("xfce4-terminal -e vim")), Key([mod], "b", lazy.spawn("prime-run qutebrowser")), Key([mod], "m", lazy.spawn("firefox")), Key([mod], "r", lazy.spawn("xfce4-terminal -e ranger")), Key([mod], "g", lazy.spawn("gimp")), Key([mod], "s", lazy.spawn("spotify")), Key([mod], "c", lazy.spawn("code-oss")), Key([mod], "v", lazy.spawn("VirtualBox")),
"l", lazy.layout.grow_right(), desc="Grow window to the right"), Key(["mod4", "control"], "j", lazy.layout.grow_down(), desc="Grow window down"), Key(["mod4", "control"], "k", lazy.layout.grow_up(), desc="Grow window up"), Key(["mod4"], "n", 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( ["mod4", "shift"], "Return", lazy.layout.toggle_split(), desc="Toggle between split and unsplit sides of stack", ), # Toggle between different layouts as defined below EzKey('M-<space>', lazy.next_layout(), desc="Toggle between layouts"), EzKey('M-C-c', lazy.window.kill(), desc="Kill focused window"), EzKey('M-C-r', lazy.restart(), desc="Restart Qtile"), Key(["mod4"], "r", lazy.spawncmd(), desc="Spawn a command using a prompt widget"), ]
def create_widgets(): return [ # widget.Sep( # linewidth=0, # padding=3, # foreground=colors[0], # background=colors[0], # ), widget.Image(filename="~/.config/qtile/icons/python.png", mouse_callbacks={'Button1': lambda: lazy.spawncmd()}, background=colors[0]), widget.GroupBox(font="Mononoki Nerd Font Bold", fontsize=11, margin_y=3, margin_x=0, padding_y=5, padding_x=3, borderwidth=3, active=colors[2], inactive=colors[2], rounded=False, highlight_color=colors[5], highlight_method="line", this_current_screen_border=colors[6], this_screen_border=colors[4], other_current_screen_border=colors[6], other_screen_border=colors[4], foreground=colors[2], background=colors[0]), widget.Prompt(prompt=prompt, font="Mononoki Nerd Font", padding=10, foreground=colors[5], background=colors[0]), widget.Sep(linewidth=0, padding=40, foreground=colors[2], background=colors[0]), widget.WindowName(foreground=colors[3], background=colors[0], padding=0), widget.WidgetBox( background=colors[0], foreground=colors[4], widgets=[ # widget.OpenWeather( # coordinates={"longitude": "45.1833", "latitude": "23.8"}, # background=colors[0], # foreground=colors[4], # ), widget.KeyboardLayout( background=colors[0], foreground=colors[5], configured_keyboards=['us', 'ro'], ), widget.Backlight( backlight_name="intel_backlight", format=' {percent:2.0%}', foreground=colors[6], background=colors[0], ), widget.TextBox(text="", padding=2, foreground=colors[7], background=colors[0], fontsize=13), widget.ThermalSensor(foreground=colors[7], background=colors[0], threshold=90, padding=5), widget.CPU(background=colors[0], foreground=colors[3], format=' {freq_current}GHz {load_percent}%', padding=5, update_interval=5.0), ], ), widget.Wallpaper(directory='~/repos/wallpapers/', wallpaper_command=None, foreground=colors[1], background=colors[0]), widget.Memory(foreground=colors[4], background=colors[0], format='{MemUsed: .0f}M/{MemTotal: .0f}M', mouse_callbacks={ 'Button1': lambda qtile: qtile.cmd_spawn(myTerm + ' -e htop') }, padding=5), widget.Wlan(foreground=colors[6], background=colors[0], padding=5), widget.Volume(foreground=colors[5], background=colors[0], fmt=' {}', padding=5), widget.CurrentLayoutIcon( # custom_icon_paths=[os.path.expanduser("~/.config/qtile/icons")], foreground=colors[7], background=colors[0], padding=0, scale=0.7), widget.CurrentLayout(foreground=colors[1], background=colors[0], padding=5), widget.Clock(foreground=colors[3], background=colors[0], format=" %Y-%m-%d %H:%M", font="Mononoki Nerd Font"), widget.Sep(linewidth=0, padding=2, foreground=colors[4], background=colors[0]), widget.Battery( foreground=colors[2], background=colors[0], format='{char} {percent:2.0%}', charge_char='', discharge_char='', full_char='', empty_char='', update_interval=5, ), widget.Systray(foreground=colors[2], background=colors[0], icon_size=20, padding=5), ]