config.pybk (10100B)
1 # ______ __ __ __ ______ __ 2 # / \ / | / |/ | / \ / | 3 # /$$$$$$ | _$$ |_ $$/ $$ | ______ _______ ______ _______ /$$$$$$ |$$/ ______ 4 # $$ | $$ |/ $$ | / |$$ | / \ / | / \ / \ $$ |_ $$/ / | / \ 5 # $$ | $$ |$$$$$$/ $$ |$$ |/$$$$$$ | /$$$$$$$/ /$$$$$$ |$$$$$$$ |$$ | $$ |/$$$$$$ | 6 # $$ |_ $$ | $$ | __ $$ |$$ |$$ $$ | $$ | $$ | $$ |$$ | $$ |$$$$/ $$ |$$ | $$ | 7 # $$ / \$$ | $$ |/ |$$ |$$ |$$$$$$$$/ $$ \_____ $$ \__$$ |$$ | $$ |$$ | $$ |$$ \__$$ | 8 # $$ $$ $$< $$ $$/ $$ |$$ |$$ | $$ |$$ $$/ $$ | $$ |$$ | $$ |$$ $$ | 9 # $$$$$$ | $$$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$$$$$/ $$/ $$/ $$/ $$/ $$$$$$$ | 10 # $$$/ / \__$$ | 11 # $$ $$/ 12 # $$$$$$/ 13 14 15 #Colours 16 white = 'ffffff' 17 dpurple = '1d141d' 18 purple = '471e47' 19 20 current = '3d1a49' 21 other = '552467' 22 23 #----------------------------------------------------------------------------------# 24 # Imports # 25 # Basically dependancys needed to run some commands # 26 #----------------------------------------------------------------------------------# 27 28 from libqtile import bar, layout, widget 29 from libqtile.config import Click, Drag, Group, Key, Match, Screen 30 from libqtile.lazy import lazy 31 from libqtile.utils import guess_terminal 32 from libqtile import hook 33 import subprocess 34 35 #----------------------------------------------------------------------------------# 36 # Key binds # 37 #----------------------------------------------------------------------------------# 38 39 mod = "mod4" 40 terminal = guess_terminal() 41 42 keys = [ 43 Key([mod], "h", lazy.layout.left(), desc="Move focus to left"), 44 Key([mod], "l", lazy.layout.right(), desc="Move focus to right"), 45 Key([mod], "j", lazy.layout.down(), desc="Move focus down"), 46 Key([mod], "k", lazy.layout.up(), desc="Move focus up"), 47 Key([mod], "space", lazy.layout.next(), desc="Move window focus to other window"), 48 49 Key([mod, "shift"], "h", lazy.layout.shuffle_left(), desc="Move window to the left"), 50 Key([mod, "shift"], "l", lazy.layout.shuffle_right(), desc="Move window to the right"), 51 Key([mod, "shift"], "j", lazy.layout.shuffle_down(), desc="Move window down"), 52 Key([mod, "shift"], "k", lazy.layout.shuffle_up(), desc="Move window up"), 53 54 Key([mod, "control"], "h", lazy.layout.grow_left(), desc="Grow window to the left"), 55 Key([mod, "control"], "l", lazy.layout.grow_right(), desc="Grow window to the right"), 56 Key([mod, "control"], "j", lazy.layout.grow_down(), desc="Grow window down"), 57 Key([mod, "control"], "k", lazy.layout.grow_up(), desc="Grow window up"), 58 59 Key([mod], "n", lazy.layout.normalize(), desc="Reset all window sizes"), 60 61 Key([mod, "shift"], "Return", lazy.layout.toggle_split(), desc="Toggle between split and unsplit sides of stack"), 62 Key([mod], "Return", lazy.spawn(terminal), desc="Launch terminal"), 63 Key([mod], "Tab", lazy.next_layout(), desc="Toggle between layouts"), 64 Key([mod], "w", lazy.window.kill(), desc="Kill focused window"), 65 Key([mod], "f", lazy.window.toggle_fullscreen(), desc="Toggle fullscreen on the focused window"), 66 Key([mod], "t", lazy.window.toggle_floating(), desc="Toggle floating on the focused window"), 67 Key([mod, "control"], "r", lazy.reload_config(), desc="Reload the config"), 68 Key([mod, "control"], "q", lazy.shutdown(), desc="Shutdown Qtile"), 69 70 # Programs shortcuts 71 Key([mod], "f", lazy.spawn("librewolf")), 72 Key([mod], "d", lazy.spawn("discord")), 73 Key([mod], "s", lazy.spawn("steam")), 74 Key([mod], "v", lazy.spawn("alacritty -e vim")), 75 Key([mod], "p", lazy.spawn("pavucontrol")), 76 Key([mod], "n", lazy.spawn("nitrogen")), 77 78 Key([mod], "r", lazy.spawn("rofi -show drun -show-icons")), 79 80 Key([mod, "shift"], "t", lazy.spawn("thunar")), 81 Key([mod, "shift"], "p", lazy.spawn("prismlauncher")), 82 #Screenshot 83 Key([], "Print", lazy.spawn("scrot -s")), 84 ] 85 #----------------------------------------------------------------------------------# 86 # Groups # 87 #----------------------------------------------------------------------------------# 88 89 90 groups = [ 91 Group("1", label="WWW"), 92 Group("2", label="Code"), 93 Group("3", label="Chat"), 94 Group("4", label="Files"), 95 Group("5", label="Games"), 96 Group("6", label="Media"), 97 Group("7", label="Term"), 98 Group("8", label="Sys"), 99 Group("9", label="Misc"), 100 ] 101 102 103 for i in groups: 104 keys.extend( 105 [ 106 Key( 107 [mod], 108 i.name, 109 lazy.group[i.name].toscreen(), 110 desc="Switch to group {}".format(i.name), 111 ), 112 113 Key( 114 [mod, "shift"], 115 i.name, 116 lazy.window.togroup(i.name, switch_group=True), 117 desc="Switch to & move focused window to group {}".format(i.name), 118 ), 119 120 ] 121 ) 122 123 #----------------------------------------------------------------------------------# 124 # Diffrent layouts that are available # 125 #----------------------------------------------------------------------------------# 126 layouts = [ 127 128 layout.Bsp( 129 border_focus_stack=["#00ff00", "#00ff00"], 130 border_focus= purple, 131 border_normal= dpurple, 132 border_width=4, 133 ), 134 135 layout.Max(), 136 ] 137 138 widget_defaults = dict( 139 font="bold_sans", 140 fontsize=15, 141 padding=3, 142 ) 143 144 #----------------------------------------------------------------------------------# 145 # Widgets and status bar # 146 #----------------------------------------------------------------------------------# 147 screens = [ Screen() ] 148 #----------------------------------------------------------------------------------# 149 # Drag floating layouts. # 150 #----------------------------------------------------------------------------------# 151 152 153 mouse = [ 154 Drag([mod], "Button1", lazy.window.set_position_floating(), start=lazy.window.get_position()), 155 Drag([mod], "Button3", lazy.window.set_size_floating(), start=lazy.window.get_size()), 156 Click([mod], "Button2", lazy.window.bring_to_front()), 157 ] 158 159 dgroups_key_binder = None 160 dgroups_app_rules = [] # type: list 161 follow_mouse_focus = True 162 bring_front_click = False 163 floats_kept_above = True 164 cursor_warp = False 165 floating_layout = layout.Floating( 166 float_rules=[ 167 # Run the utility of `xprop` to see the wm class and name of an X client. 168 *layout.Floating.default_float_rules, 169 Match(wm_class="confirmreset"), # gitk 170 Match(wm_class="makebranch"), # gitk 171 Match(wm_class="maketag"), # gitk 172 Match(wm_class="ssh-askpass"), # ssh-askpass 173 Match(title="branchdialog"), # gitk 174 Match(title="pinentry"), # GPG key password entry 175 ] 176 ) 177 auto_fullscreen = True 178 focus_on_window_activation = "smart" 179 reconfigure_screens = True 180 181 182 #----------------------------------------------------------------------------------# 183 # If programs want to maxamize # 184 # this allows things like steam or virtual box to function in full screen # 185 #----------------------------------------------------------------------------------# 186 187 auto_minimize = True 188 189 190 # When using the Wayland backend, this can be used to configure input devices. 191 wl_input_rules = None 192 193 #----------------------------------------------------------------------------------# 194 # window manager name (will show on neofetch) # 195 # I suggest just leaving it, since it has something to do with java # 196 #----------------------------------------------------------------------------------# 197 198 199 wmname = "LG3D" 200 201 202 #----------------------------------------------------------------------------------# 203 # Autostart programs # 204 # Please be careful and double check if all works # 205 #----------------------------------------------------------------------------------# 206 # lauches nitrogen wallpaper # 207 #----------------------------------------------------------------------------------# 208 209 @hook.subscribe.startup_once 210 def autostart(): 211 subprocess.Popen(["nitrogen", "--restore"]) 212 213 #----------------------------------------------------------------------------------# 214 # launches picom :D # 215 #----------------------------------------------------------------------------------# 216 217 @hook.subscribe.startup_once 218 def autostart(): 219 subprocess.Popen(["picom", "&"], shell=True) 220 221 #----------------------------------------------------------------------------------# 222 # Runs redshift so I don't get sick after a day of coding # 223 #----------------------------------------------------------------------------------# 224 225 @hook.subscribe.startup_once 226 def autostart(): 227 subprocess.Popen(["redshift"], shell=True) 228 229 #----------------------------------------------------------------------------------# 230 # Polybar for the status bar # 231 #----------------------------------------------------------------------------------# 232 @hook.subscribe.startup_once 233 def autostart(): 234 subprocess.Popen(["polybar"], shell=True)