Qball's Weblog

Rofi 1.4.0: Sneak Preview (8): Reordering

Tags Rofi  Theme3.0 

A short one today on the structure of rofi.

The structure of rofi gui is pretty static, as depicted in this now familiar picture:

structure

In a future release this will become more flexible, but for now it is fixed. Kinda. There is one trick that allows you to re-order at least part of it. You can set in what order the different widgets are packed.

For example if we set:

rofi -show drun -theme-str '#window mainbox inputbar box { index: 4;}'

The input bar is placed at the bottom.

reorder 1

This works on every box packing, so widgets in mainbox, in inputbar, in listview (the scrollbar).

Note: The index property is not inherited from the widgets parents.

For example:

rofi -show top -theme-str '#window mainbox message box { index: 4;} #window mainbox inputbar prompt { index: 3;}'

reorder 2

In the above screenshots this does not look very good, however if you make a theme that is placed at the bottom of the it can look nice.

reorder 3

Now this does look a bit weird when you filter the list (if it is static).

reorder 4

There is actually an option to fix this.

Reordering the listview

The listview widget has an option to reverse the order.

#window mainbox listview {
    reverse: true;
}

Try this:

rofi -show drun -theme-str '#window mainbox message box { index: 4;} #window mainbox inputbar prompt { index: 4;} #window mainbox listview {reverse: true;}'

The order of the listview is then reversed:

reorder 5

If you then enable the dynamic: true; fixed-height: false; mode it behaves very natural (imho).

comments powered by Disqus