summaryrefslogtreecommitdiffstats
path: root/doc/rofi.1.markdown
blob: 00a39a19efbc1d92e0f10fa1eb89c389824c35a1 (plain)
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
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
# ROFI 1 rofi

## NAME

**rofi** - A window switcher, application launcher, ssh dialog, dmenu replacement and more

## SYNOPSIS

**rofi** [ -show *mode* ]|[ -dmenu ]|[ -e *msg* ] [ CONFIGURATION ]


## DESCRIPTION

**rofi** is an X11 pop-up 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**'s main functionality is to assist in your workflow, allowing you to quickly switch
between windows, start applications or log into a remote machine via `ssh`.
There are different *modi* for different types of actions.

**rofi** can also function as (drop-in) replacement for **dmenu(1)**.

### Running rofi

To launch **rofi** directly in a certain mode, specify a mode with `rofi -show <mode>`.
To show the `run` dialog:

    rofi -show run

### Emulating dmenu

**rofi** can emulate **dmenu(1)** (a dynamic menu for X11) when launched with the `-dmenu` flag.

The website for `dmenu` can be found [here](http://tools.suckless.org/dmenu/).

**rofi** does not aim to be 100% compatible with `dmenu`. There are simply too many different flavors of `dmenu`.
The idea is that the basic usage command-line flags are obeyed, theme-related flags are not.
Besides, **rofi** offers some extended features (like multi-select, highlighting, message bar, extra key bindings).

### Display Error message

**rofi** error dialog can also be called from the command line.

    rofi -e "my message"

Markup support can be enabled, see CONFIGURATION options.

## CONFIGURATION

There are currently three methods of setting configuration options (evaluated in order below):

 * System configuration file  (for example `/etc/rofi.rasi`).
   It first checks XDG\_CONFIG\_DIRS  and then SYSCONFDIR (that is passed at compile time).
   It loads the first config file it finds, it does not merge multiple system configuration files.
 * Rasi theme file: The new *theme* format can be used to set configuration values.
 * Command-line options: Arguments passed to **rofi**.

To get a template config file run: `rofi -dump-config > config.rasi`

This will contain (commented) all current configuration options, modified options are uncommented.

The configuration system supports the following types:

 * string
 * integer (signed and unsigned)
 * char
 * boolean
 * lists

For the syntax of these options see the **rofi-theme(5)** manpage.

For use on the commandline, Boolean options have a non-default command-line
syntax. Example to enable option X:

    -X

To disable option X:

    -no-X

Below is a list of the most important options:

### General

`-help`

The help option shows the full list of command-line options and the current set values.
These include dynamic (run-time generated) options.

`-version`

Show the **rofi** version and exit.

`-dump-config`

Dump the current active configuration, in rasi format, to stdout and exit.
Information about the rasi format can be found in the **rofi-theme(5)** manpage.

`-dump-theme`

Dump the current active theme, in rasi format, to stdout and exit.

`-rasi-validate` *filename*

Try to parse the file and return 0 when succesful, non-zero when failed.

`-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.

    Default:  Autodetect

`-display` *display*

The X server to contact. Default is `$DISPLAY`.

`-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 three 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

`-show` *mode*

Open **rofi** in a certain mode. Available modes are `window`, `run`, `drun`, `ssh`, `combi`.
The special argument `keys` can be used to open a searchable list of supported key bindings
(see *KEY BINDINGS*)

To show the run-dialog:

    rofi -show run

If `-show` is the last option passed to rofi, the first enabled modi is shown.

`-modi` *mode1,mode2*

Specify an 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 configured 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 such mode has two parameters:

    <name>:<script>

Example: Have a mode called 'Workspaces' using the `i3_switch_workspaces.sh` script:

    rofi -modi "window,run,ssh,Workspaces:i3_switch_workspaces.sh" -show Workspaces

Notes: The i3 window manager does not like commas in the command when specifying an exec command.
For that case '#' can be used as an separator.

**TIP**: The name is allowed to contain spaces:

    rofi -modi "My File Browser:fb.sh" -show "My File Browser"

`-case-sensitive`

Start in case sensitive mode.
This option can be changed at run-time using the `-kb-toggle-case-sensitivity` key binding.

`-cycle`

Cycle through the result list. Default is 'true'.

`-filter` *filter*

Filter the list by setting text in input bar to *filter*

`-config` *filename*

Load an alternative configuration file.

`-cache-dir` *filename*

Directory that is used to place temporary files, like history.

`-scroll-method` *method*

Select the scrolling method. 0: Per page, 1: continuous.

`-normalize-match`

Normalize the string before matching, so o will match ö, and é matches e.
This is not a perfect implementation, but works.
For now it disabled highlighting of the matched part.

`-no-lazy-grab`

Disables lazy grab, this forces the keyboard being grabbed before gui is shown.

`-no-plugins`

Disable plugin loading.

`-plugin-path` *directory*

Specify the directory where **rofi** should look for plugins.

`-show-icons`

Show application icons in `drun` and `window` modes.

`-icon-theme`

Specify icon theme to be used.
If not specified default theme from DE is used, *Adwaita* and *gnome* themes act as
fallback themes.

`-fallback-application-icon`

Specify an icon to be used when the application icon in run/drun are not yet loaded or is not available.

`-markup`

Use Pango markup to format output wherever possible.

`-normal-window`

Make **rofi** react like a normal application window. Useful for scripts like Clerk that are basically an application.

`-[no-]steal-focus`

Make rofi steal focus on launch and restore close to window that held it when launched.

### Matching

`-matching` *method*

Specify the matching algorithm used.
Current the following methods are supported.

* **normal**: match the int string
* **regex**: match a regex input
* **glob**: match a glob pattern
* **fuzzy**: do a fuzzy match
* **prefix**: match prefix

   Default: *normal*

Note: glob matching might be slow for larger lists

`-tokenize`

Tokenize the input.

`-drun-categories` *category1*,*category2*

Only show desktop files that are present in the listed categories.

`-drun-match-fields` *field1*,*field2*,...

When using `drun`, match only with the specified Desktop entry fields.
The different fields are:

* **name**: the application's name
* **generic**: the application's generic name
* **exec**: the application's  executable
* **categories**: the application's categories
* **comment**: the application comment
* **all**: all of the above

    Default: *name,generic,exec,categories,keywords*

`-drun-display-format`

The format string for the `drun` dialog:

* **name**: the application's name
* **generic**: the application's generic name
* **exec**: the application's  executable
* **categories**: the application's categories
* **comment**: the application comment

Pango markup can be used to formatting the output.

    Default: {name} [<span weight='light' size='small'><i>({generic})</i></span>]

Note: Only fields enabled in `-drun-match-fields` can be used in the format string.

`-[no-]drun-show-actions`

Show actions present in the Desktop files.

    Default: false

`-window-match-fields` *field1*,*field2*,...

When using window mode, match only with the specified fields.
The different fields are:

* **title**: window's title
* **class**: window's class
* **role**: window's role
* **name**: window's name
* **desktop**: window's current desktop
* **all**: all of the above

    Default: *all*

`-matching-negate-char` *char*

Set the character used to negate the query (i.e. if it does **not** match the next keyword ).
Set to '\x0' to disable.

    Default: '-'


### Layout and Theming

**IMPORTANT:**
  In newer **rofi** releases, all the theming options have been moved into the new theme format. They are no longer normal
  **rofi** options that can be passed directly on the commandline (there are too many).
  Small snippets can be passed on the commandline: `rofi -theme-str 'window {width: 50%;}'` to override a single
  setting. They are merged into the current theme.
  They can also be appended at the end of the **rofi** config file to override parts of the theme.

Most of the following options are **deprecated** and should not be used. Please use the new theme format to customize
**rofi**. More information about the new format can be found in the **rofi-theme(5)** manpage.

`-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.)

`-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

`-hover-select`

Automatically select the entry the mouse is hovering over. This option is best combined with custom mouse bindings.
To utilize hover-select and accept an entry in a single click, use:

    rofi -show run -hover-select -me-select-entry '' -me-accept-entry MousePrimary

`-eh` *number*

Set row height (in chars)
Default: *1*

`-auto-select`

When one entry is left, automatically select it.

`-m` *num*

`-m` *name*

`-monitor` *num*

`-monitor` *name*

Select monitor to display **rofi** on.
It accepts as input: *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 (that is, **rofi** will be displayed on top of the focused window).
 *  **-3**: Position at mouse (overrides the location setting to get normal context menu
    behavior.)
 *  **-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, the