dotfiles

Configs for programs I use!
git clone git://shipwreckt.co.uk/dotfiles.git
Log | Files | Refs | README | LICENSE

config.py (9905B)


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