upgrade your qtile setup with a cute dropdown terminal

upgrade your qtile setup with a cute dropdown terminal

I didn’t know you could do this until recently, very fun and playful little feature. How you want to do it will depend slightly on how you have your groups set up but I start with importing the relevant libraries and defining an empty list.

from libqtile.config import Dropdown, Scratchpad

groups = []

I’m then able to append all the groups I want to this list. For the dropdown terminal you need the ScratchPad group which to quote the qtile docs is a “special - by default invisible - group which acts as a container for DropDown configurations”. My configuration looks like this:

groups.append(
    ScratchPad( "scratchpad", [
		DropDown(
          "term",
          kitty,
          opacity = 0.9,
        ),
        ]
	),
)

This gives you a terminal (kitty in this case) with a little tranparency. By default, it will pop up with this size:

alt

Though this can easily be altered with the x, y, height, and width keys:

groups.append(
    ScratchPad("scratchpad", [
        DropDown(
           "term",
           kitty,
           opacity = 0.9,
           x = 0,
           y = 0,
           width = 0.3,
           height = 0.5,
        ),
    ])
)

This gives us a little boxy guy in the top left corner:

alt

We also have the option to set keybindings to toggle the appearance of the window. I’ve got this in my config.py now:

keys = [
    Key([m, "shift"], "Return",
        lazy.group["scratchpad"].dropdown_toggle("terminal"),
        desc='dropdown term'
    ),
]

Anyway, hope this was useful, happy configurating :)