Skip to content
Dave Davenport edited this page May 6, 2020 · 9 revisions

Window positioning in rofi is based on the following three settings:

Location

This sets the anchor point:

1   2   3
8   0   4
7   6   5

So if you want the window to be in the upper right corner, set location to 3.

X, Y Offset

Using the xoffset and yoffset option you can move the window relative to the anchor point (location)

To set the window in the upper right corner at 200 pixels from the top and the left of the screen set:

  • location to 1
  • xoffset to 200
  • yoffset to 200

Monitor

Using the -m option you can place rofi on a certain monitor, window: As input it accepts: primary (if primary output is set), the xrandr output name or integer number (in order of detection). Negative numbers are handled differently:

  • -1: the currently focused monitor.

  • -2: the currently focused window (i.e. rofi will be displayed on top of the focused window).

  • -3: Position at mouse (overrides the location setting to get normal context menu
    behaviour.)

  • -4: the monitor with the focused window.

  • -5: the monitor that shows the mouse pointer.

    Default: -5

See rofi -h output for the detected monitors, their position and size.

Examples

Center window

rofi -location 0 -show run

Window positioned below top bar in i3

rofi -location 2 -yoffset 22 -width 100 -show run

Window at top of screen, not showing the border

rofi -location 2 -yoffset -2 -bw 2 -show run
Clone this wiki locally