---
title: Upgrade your qtile setup with a cute dropdown terminal 
date: 2022-09-23 
tags:
  - python
  - qtile
draft: false
---


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.

```python
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](https://docs.qtile.org/en/latest/manual/config/groups.html) is a "special - by default invisible - group which acts as a container for DropDown configurations". My configuration looks like this:

```python
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](/image/dropdown.webp)

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

```python
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](/image/dropdown2.webp)

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

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

Anyway, hope this was useful, happy configurating :)
