1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
|
# ROFI 1 rofi
## NAME
**rofi** - A window switcher, run launcher, ssh dialog and dmenu replacement
## SYNOPSIS
**rofi**
[ -width *pct_scr* ]
[ -lines *lines* ]
[ -columns *columns* ]
[ -font *pangofont* ]
[ -fg *color* ]
[ -fg-urgent *color* ]
[ -fg-active *color* ]
[ -bg-urgent *color* ]
[ -bg-active *color* ]
[ -bg *color* ]
[ -bgalt *color* ]
[ -hlfg *color* ]
[ -hlbg *color* ]
[ -key-**mode** *combo* ]
[ -terminal *terminal* ]
[ -location *position* ]
[ -fixed-num-lines ]
[ -padding *padding* ]
[ -opacity *opacity%* ]
[ -display *display* ]
[ -bc *color* ]
[ -bw *width* ]
[ -dmenu [ -p *prompt* ] [ -sep *separator* ] [ -l *selected line* ] [ -mesg ] [ -select ] [ -input *input* ] ]
[ -filter *filter* ]
[ -ssh-client *client* ]
[ -ssh-command *command* ]
[ -disable-history ]
[ -levenshtein-sort ]
[ -case-sensitive ]
[ -show *mode* ]
[ -modi *mode1,mode2* ]
[ -eh *element height* ]
[ -lazy-filter-limit *limit* ]
[ -e *message*]
[ -a *row* ]
[ -u *row* ]
[ -pid *path* ]
[ -now ]
[ -rnow ]
[ -snow ]
[ -version ]
[ -help ]
[ -dump-xresources ]
[ -dump-xresources-theme ]
[ -auto-select ]
[ -parse-hosts ]
[ -no-parse-known-hosts ]
[ -combi-modi *mode1,mode2* ]
[ -normal-window ]
[ -fake-transparency ]
[ -quiet ]
[ -glob ]
[ -regex ]
[ -tokenize ]
[ -threads *num* ]
[ -config *filename* ]
## DESCRIPTION
**rofi** is an X11 popup window switcher, run dialog, dmenu replacement and more. It focuses on
being fast to use and have minimal distraction. It supports keyboard and mouse navigation, type to
filter, tokenized search and more.
## USAGE
**rofi** can be used in three ways, single-shot; executes once and directly exits when done, as a
daemon listening to specific key-combination or emulating dmenu.
### Single-shot mode
To launch **rofi** directly in a certain mode, specify a mode with `rofi -show <mode>`.
To show the run dialog:
rofi -show run
### Daemon mode
To launch **rofi** in daemon mode don't specify any mode, instead keys can be bound
to launch a certain mode. To show run-mode by pressing `F2` start **rofi** like this:
rofi -key-run F2
Keybindings can also be specified in the `Xresources` file.
### Emulating dmenu
**rofi** can emulate `dmenu` (a dynamic menu for X) when launched with the `-dmenu` flag.
The official website for `dmenu` can be found [here](http://tools.suckless.org/dmenu/).
## OPTIONS
There are currently four methods of setting configuration options (evaluated in order below):
* Compile time: edit config.c. This method is strongly discouraged.
* Xresources: A method of storing key values in the Xserver. See
[here](https://en.wikipedia.org/wiki/X_resources) for more information.
This is the recommended way of configuring **rofi**.
* Configuration File: This uses the same format as the Xresources file.
By default it looks in `XDG_USER_CONFIG_DIR`/rofi/config, but can be overriden on commandline.
* Command-line options: Arguments passed to **rofi**.
The Xresources file expects options starting with `rofi.` followed by it's name. An Example to set the number of lines:
rofi.lines: 10
Command line options override settings from Xresources file. The same option set as argument:
prefixed with a '-':
rofi -lines 10
To get a list of available options, formatted as Xresources entries run:
rofi -dump-xresources
The configuration system supports the following types:
* String
* Integer (signed and unsigned)
* Char
* Boolean
Boolean options have a non-default command-line syntax. Example to enable option X:
-X
to disable it:
-no-X
Below is a list of the most important options:
### General
`-help`
The help option shows the full list of commandline options and the current set value.
`-dump-xresources`
Dump the current active configuration in Xresources format to the command-line.
This does not validate all passed values (e.g. colors).
`-dump-xresources-theme`
Dump the current color schme in Xresources format to the command-line.
`-key-{mode}` **KEY**
Set the key combination to display a {mode} in daemon mode.
rofi -key-run F12
rofi -key-ssh control+shift+s
rofi -key-window SuperL+Tab
`-threads` *num*
Specify the number of threads **rofi** should use:
* 0: Autodetect the number of supported hardware threads.
* 1: Disable threading
* 2..N: Specify the maximum number of threads to use in the thread pool.
`-dmenu`
Run **rofi** in dmenu mode. This allows for interactive scripts.
In `dmenu` mode, **rofi** reads from STDIN, and output to STDOUT.
A simple example, displaying 3 pre-defined options:
echo -e "Option #1\nOption #2\nOption #3" | rofi -dmenu
Or get the options from a script:
~/my_script.sh | rofi -dmenu
Pressing `shift-enter` sends the selected entry to STDOUT and moves to the next entry.
`-show` *mode*
Open **rofi** in a certain mode. Available modes are `window`, `run`, `ssh`
To show the run-dialog:
rofi -show run
`-modi` *mode1,mode1*
Specify a ordered, comma separated list of modes to enable.
Enabled modes can be changed at runtime. Default key is Ctrl+Tab.
If no modes are specified all modes will be enabled.
To only show the run and ssh launcher:
rofi -modi "run,ssh" -show run
Custom modes can be added using the internal 'script' mode. Each mode has two parameters:
<name>:<script>
Example: Have a mode 'Workspaces' using the `i3_switch_workspace.sh` script:
rofi -modi "window,run,ssh,Workspaces:i3_switch_workspaces.sh" -show Workspaces
`-case-sensitive`
Start in case sensitive mode.
`-quiet`
Do not print any message when starting in daemon mode.
`-fuzzy`
Enable experimental fuzzy matching.
`-filter` *filter*
Filter the list by setting text in input bar to *filter*
`-config` *filename*
Load alternative configuration file.
### Theming
All colors are either hex #rrggbb values or X11 color names.
`-bg`
`-bg-active`
`-bg-urgent`
Set background color in menu.
rofi -bg "#222222"
Default: *#f2f1f0*
`-bgalt`
Set background color for alternating rows in menu.
rofi -bgalt "#222222"
Default: *#f2f1f0*
`-bc`
Set border color for menu.
rofi -bc black
Default: *black*
`-bw`
Set border width in pixels.
rofi -bw 1
Default: *1*
`-fg`
`-fg-urgent`
`-fg-active`
Set foreground text color for the menu.
rofi -fg "#cccccc"
Default: *#222222*
`-hlbg`
`-hlbg-active`
`-hlbg-urgent`
Set background color for the highlighted item in the menu.
rofi -hlbg "#005577"
Default: *#005577*
`-hlfg`
`-hlfg-active`
`-hlfg-urgent`
Set foreground text color for the highlighted item in the menu.
rofi -hlfg "#ffffff"
Default: *#FFFFFF*
`-font`
Specify a font. Pango syntax is used.
rofi -font "Dejavu Sans Mono 14"
Default: *mono 12*
`-opacity`
Set window opacity (0-100).
rofi -opacity "75"
Default: *100*
`-eh` *element height*
The height of a field in lines. e.g.
echo -e "a\n3|b\n4|c\n5" | rofi -sep '|' -eh 2 -dmenu
Default: *1*
The following options are further explained in the theming section:
`-color-enabled`
Enable the exteneded coloring options.
`-color-window` *background* *border color* *separator color */
Set window background, border and separator color.
`-color-normal` *background, foreground, background alt, highlight background, highlight foreground*
`-color-urgent` *background, foreground, background alt, highlight background, highlight foreground*
`-color-active` *background, foreground, background alt, highlight background, highlight foreground*
Specify the colors used in a row per state (normal, active, urgent).
`-line-margin`
Set the spacing between the rows.
Default: *3*
Min: *3*
Max: *50*
`-separator-style` *style*
Set separator style. Possible options are "none", "solid" or "dash".
Default: *dash*
`-hide-scrollbar`
Hide the scrollbar.
`-scrollbar-width` *width*
Set the scrollbar width.
`-glob`
Use glob style matching
*Warning this option might be slow on large lists*
`-regex`
Use regex matching
`-tokenize`
Tokenize the input.
### Layout
`-lines`
Maximum number of lines to show before scrolling.
rofi -lines 25
Default: *15*
`-columns`
Number of columns to show before scrolling.
rofi -columns 2
Default: *1*
`-width` [value]
Set width of menu. `[value]` is specified in percentage.
rofi -width 60
If `[value]` is larger then 100, size is set in pixels. Example to span a full hd monitor:
rofi -width 1920
If `[value]` is negative, it tries to estimates a character width. To show 30 characters on a row:
rofi -width -30
Character width is a rough estimation, and might not be correct, but should work for most monospaced fonts.
Default: *50*
`-location`
Specify where the window should be located. The numbers map to the following locations on screen:
1 2 3
8 0 4
7 6 5
Default: *0*
`-fixed-num-lines`
Keep a fixed number of visible lines (See the `-lines` option.)
`-padding`
Define the inner margin of the window.
Default: *5*
`-fullscreen`
Use the full screen height and width.
`-sidebar-mode`
Open in sidebar-mode. In this mode a list of all enabled modes is shown at the bottom.
(See `-modi` option)
To show sidebar use:
rofi -show run -sidebar-mode -lines 0
`-lazy-filter-limit` *limit*
The number of entries required for **rofi** to go into lazy filter mode.
In lazy filter mode, it won't re-filter the list on each keypress, but only after **rofi** been
idle for 250ms. Experiments shows that the default (5000 lines) works well, set to 0 to always
enable.
Default: *5000*
`-auto-select`
When one entry is left, automatically select it.
`-m` *num*
`-monitor` *num*
Select (Xinerama) monitor to display **rofi** on. The special number -1 denotes the currently focused monitor, the number -2 denotes the currently focused window (i.e. rofi will be displayed on top of the focused window).
Default: *-1*
### PATTERN setting
`-terminal`
Specify what terminal to start.
rofi -terminal xterm
Pattern: *{terminal}*
Default: *x-terminal-emulator*
`-ssh-client` *client*
Override the used ssh client.
Pattern: *{ssh-client}*
Default: *ssh*
### SSH settings
`-ssh-command` *cmd*
Set the command to execute when starting a ssh session.
The pattern *{host}* is replaced by the selected ssh entry.
Default: *{terminal} -e {ssh-client} {host}*
`-parse-hosts`
Parse the `/etc/hosts` file for entries.
Default: *disabled*
`-parse-known-hosts`
`-no-parse-known-hosts`
Parse the `~/.ssh/known_hosts` file for entries.
Default: *enabled*
### Run settings
`-run-command` *cmd*
Set command (*{cmd}*) to execute when running an application.
See *PATTERN*.
Default: *{cmd}*
`-run-shell-command` *cmd*
Set command to execute when running an application in a shell.
See *PATTERN*.
Default: *{terminal} -e {cmd}*
`-run-list-command` *cmd*
If set, use an external tool to generate list of executable commands. Uses 'run-command'
Default: *""*
### Combi settings
`-combi-modi` *mode1,mode2*
The modi to combine in combi mode.
For syntax to see `-modi`.
To get one merge view, of window,run,ssh:
rofi -show combi -combi-modi "window,run,ssh"
### History and Sorting
`-disable-history`
`-no-disable-history` (re-enable history)
Disable history
`-levenshtein-sort` to enable
`-no-levenshtein-sort` to disable
When searching sort the result based on levenshtein distance.
### Dmenu specific
`-sep` *separator*
Separator for dmenu. Example: To show list 'a' to 'e' with '|' as separator:
echo "a|b|c|d|e" | rofi -sep '|' -dmenu
`-p` *prompt*
Specify the prompt to show in dmenu mode. E.g. select monkey a,b,c,d or e.
echo "a|b|c|d|e" | rofi -sep '|' -dmenu -p "monkey:"
Default: *dmenu*
`-selected-row` *selected row*
Select a certain row.
Default: *0*
`-l` *number of lines to show*
Maximum number of lines the menu may show before scrolling.
rofi -lines 25
Default: *15*
`-i`
Makes dmenu searches case-insensitive
`-a` *X*
Active row, mark row X as active. (starting at 0)
You can specify single element: -a 3
A range: -a 3-8
or a set of rows: -a 0,2
or any combination: -a 0,2-3,9
`-u` *X*
Urgent row, mark row X as urgent. (starting at 0)
You can specify single element: -u 3
A range: -u 3-8
or a set of rows: -u 0,2
or any combination: -u 0,2-3,9
`-only-match`
Only return a selected item, do not allow custom entry.
This mode always returns an entry, or returns directly when no entries given.
`-no-custom`
Only return a selected item, do not allow custom entry.
This mode returns directly when no entries given.
`-format` *format*
Allows the output of dmenu to be customized (N is total number of input entries):
* 's' selected string.
* 'i' index (0 - (N-1)).
* 'd' index (1 - N).
* 'q' quote string.
* 'f' filter string (user input).
* 'F' quoted filter string (user input).
Default: 's'
`-select` *string*
Select first line that matches the given string
`-mesg` *string*
Add a message line below the filter entry box. Supports pango markup.
For more information on supported markup see [here](https://developer.gnome.org/pango/stable/PangoMarkupFormat.html)
`-normal-window`
Make **rofi** reacts like a normal application window. Useful for scripts like Clerk that are basically an application.
`-dump`
Dump the filtered list to stdout and quit.
This can be used to get the list as **rofi** would filter it.
Use together with `-filter` command.
`-input` *file*
Reads from *file* instead of stdin.
### Message dialog
`-e` *message*
Popup a message dialog (used internally for showing errors) with *message*.
Message can be multi-line.
### Other
'-pid' *path*
Make **rofi** create a pid file and check this on startup. Avoiding multiple copies running
simultaneously. This is useful when running **rofi** from a keybinding daemon.
`-fake-transparency`
Enable fake transparency. This only works with transparent background color in the theme, not the opacity setting.
### Debug
`-no-config`
Disable parsing of configuration. This runs rofi in *stock* mode.
## PATTERN
To launch commands (e.g. when using the ssh launcher) the user can enter the used command-line,
the following keys can be used that will be replaced at runtime:
* `{host}`: The host to connect to.
* `{terminal}`: The configured terminal (See -terminal-emulator)
* `{ssh-client}`: The configured ssh client (See -ssh-client)
* `{cmd}`: The command to execute.
## DMENU REPLACEMENT
If `argv[0]` (calling command) is dmenu, **rofi** will start in dmenu mode.
This way it can be used as a drop-in replacement for dmenu. just copy or symlink **rofi** to dmenu in `$PATH`.
ln -s /usr/bin/rofi /usr/bin/dmenu
## SIGNALS
`HUP`
If in daemon mode, reload the configuration from Xresources. (commandline arguments still -override
Xresources). This will also reload configured key-bindings.
`INT`
If in daemon mode, quits **rofi**.
`USR1`
If in daemon mode, dumps the current configuration to stdout. Similar to `-xresources-dump`
## THEMING
With **rofi** 0.15.4 we have a new way of specifying colors, the old settings still apply (for now).
To enable the new setup, set `rofi.color-enabled` to true. The new setup allows you to specify
colors per state, similar to **i3**
Currently 3 states exists:
* **normal** Normal row.
* **urgent** Highlighted row (urgent)
* **active** Highlighted row (active)
For each state the following 5 colors must be set:
|