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
|
# 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 *modes* for different types of actions. **rofi**
is a standalone application and should not be integrated into scripts. For
integration into scripts it has a special mode that functions as a (drop-in)
replacement for **dmenu(1)**. See emulating dmenu below.
### Running rofi
To launch **rofi** directly in a certain mode, specify a mode with `rofi -show <mode>`.
To show the `drun` dialog:
```bash
rofi -show drun
```
A useful setup in minimalistic window managers is to combine `drun`, `run`
with `window` mode:
```bash
rofi -show combi -modes combi -combi-modes "window,drun,run"
```
In this setup it first list all open applications, then all installed
applications. So if you type firefox and hit return, it will switch to the
running firefox, or launch it when it is not running.
### Emulating dmenu
**rofi** can emulate **dmenu(1)** (a dynamic menu for X11) when launched with
the `-dmenu` flag.
For more information see **rofi-dmenu(5)**.
### 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.
To get a template config file that sets the icon-theme run: `rofi -icon-theme hicolor -dump-config`.
It is **strongly** recommended to use this as a starting point for your configuration.
An empty configuration section in the config file looks like:
```css
configuration {
// set config options here
}
```
Most of the configuration options mentioned below (beside options like `-show`,
`-dump-config` that apply to a single run) can be set here.
For example to set the dpi value to 72:
```css
configuration {
dpi: 72;
}
```
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 command line, 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 successful, non-zero when failed.
`-list-keybindings`
List all known keybindings without trying to parse them. This can be used to
look for duplicate bindings.
`-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
See the **rofi-dmenu(5)** manpage for more information.
`-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 the **rofi-keys(5)** manpage)
To show the run-dialog:
rofi -show run
If `-show` is the last option passed to rofi, the first enabled modes is shown.
`-modes` *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 -modes "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 -modes "window,run,ssh,Workspaces:i3_switch_workspaces.sh" -show Workspaces
Notes: The i3 window manager dislikes commas in the command when specifying an
exec command. For that case, `#` can be used as a separator.
**TIP**: The name is allowed to contain spaces:
rofi -modes "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 disables 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.
`-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.
`-refilter-timeout-limit`
The time (in ms) boundary filter may take before switch from instant to delayed filter mode.
Default: 300
A fallback icon can be specified for each mode:
```css
configuration {
<mode>{
fallback-icon: "<icon name>";
}
}
```
Example
```css
configuration {
run,drun {
fallback-icon: "application-x-addon";
}
}
```
### Matching
`-matching` *method*
Specify the matching algorithm used.
Currently, 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 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 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 command line (there are too many).
Small snippets can be passed on the command line: `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 vi
|