-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathspmenu.1
2360 lines (2360 loc) · 40.8 KB
/
spmenu.1
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
'\" t
.\" Automatically generated by Pandoc 2.17.1.1
.\"
.\" Define V font for inline verbatim, using C font in formats
.\" that render this, and otherwise B font.
.ie "\f[CB]x\f[]"x" \{\
. ftr V B
. ftr VI BI
. ftr VB B
. ftr VBI BI
.\}
.el \{\
. ftr V CR
. ftr VI CI
. ftr VB CB
. ftr VBI CBI
.\}
.TH "spmenu" "1" "" "3.5.0" "fancy dynamic menu"
.hy
.SH spmenu
.PP
spmenu is an X11 and Wayland menu application which takes standard
input, parses it, lets the user choose an option and sends the selected
option to standard output.
.PP
Its core functionality is built around taking and parsing input and
returning output, making it a customizable and versatile utility for use
with shell or Python scripts.
.PP
In addition to this, it also serves as a run launcher/dmenu_run
replacement through the included shell script \f[V]spmenu_run\f[R],
which handles both $PATH listing, .desktop entries and file listing.
See spmenu_run(1) for more information regarding using spmenu as a run
launcher.
.SS Usage
.PP
On runtime, spmenu reads from standard input (stdin).
spmenu items are separated by a newline (\f[V]\[rs]n\f[R]).
When (by default) Enter is pressed, the selected item will be piped to
stdout.
.PP
This allows things like
\f[V]printf \[dq]Apple\[rs]nOrange\[rs]nPear\[rs]n\[dq] | spmenu\f[R].
This command will spawn an spmenu window with three items, `Apple',
`Orange' and `Pear'.
The user can select an item using the keyboard or mouse and the output
can then be parsed.
This can be used in shell scripts to create interactive menus.
.PP
Note that spmenu doesn\[cq]t strictly read standard input, it can read
from files too using the \f[V]-lf\f[R] or \f[V]--list-file\f[R]
argument.
.PP
On top of this, you can specify arguments to change the behavior of
spmenu.
See a list below for a list.
.SS Arguments
.PP
You may use long, descriptive arguments or the shorter arguments.
Note that none need to be specified for a basic spmenu prompt.
The most commonly used arguments are \f[V]-l\f[R] or \f[V]--lines\f[R]
and \f[V]-g\f[R] or \f[V]--columns\f[R].
All of the arguments can be defined permanently in the configuration
file.
Arguments take priority over settings defined in the config files.
.TP
\f[V]-mh, --line-height height\f[R]
Set spmenu line height to height
.TP
\f[V]-cw, --center-width width\f[R]
Set width to width when centered
.TP
\f[V]-l, --lines lines\f[R]
Set the number of lines to lines
.TP
\f[V]-g, --columns grid\f[R]
Set the number of grids to grid
.TP
\f[V]-ml, --min-lines\f[R]
Set minimum number of lines allowed to lines
.TP
\f[V]-gc, --generate-cache\f[R]
Generate image cache
.TP
\f[V]-ngc, --no-generate-cache\f[R]
Don\[cq]t generate image cache
.TP
\f[V]-mc, --max-cache size\f[R]
Set max image cache size to size
.TP
\f[V]-cd, --cache-dir dir\f[R]
Set cache directory to dir
.TP
\f[V]-ix, --print-index\f[R]
Print index instead of actual text
.TP
\f[V]-nix, --no-print-index\f[R]
Don\[cq]t print index instead of actual text
.TP
\f[V]-f, --fast\f[R]
Grabs keyboard before reading stdin
.TP
\f[V]-r, --incremental\f[R]
Print text every time a key is pressed
.TP
\f[V]-nr, --no-incremental\f[R]
Don\[cq]t print text every time a key is pressed
.TP
\f[V]-rm, --require-match\f[R]
Require that input text matches an item
.TP
\f[V]-nrm, --no-require-match\f[R]
Don\[cq]t require that input text matches an item
.TP
\f[V]-ma, --mark-items\f[R]
Allow marking/selecting multiple items
.TP
\f[V]-nma, --no-mark-items\f[R]
Don\[cq]t allow marking/selecting multiple items
.TP
\f[V]-F, --fuzzy\f[R]
Enable fuzzy matching
.TP
\f[V]-NF, --no-fuzzy\f[R]
Disable fuzzy matching
.TP
\f[V]-R, --regex\f[R]
Enable regex matching
.TP
\f[V]-NR, --no-regex\f[R]
Disable regex matching
.TP
\f[V]-P, --password\f[R]
Hide characters
.TP
\f[V]-nP, --no-password\f[R]
Don\[cq]t hide characters
.TP
\f[V]-p, --prompt text\f[R]
Set spmenu prompt text to text
.TP
\f[V]-pt, --pretext text\f[R]
Set spmenu pretext to text
.TP
\f[V]-It, --input text\f[R]
Set initial input text to text
.TP
\f[V]-ip, --indent\f[R]
Indent items to prompt width
.TP
\f[V]-nip, --no-indent\f[R]
Don\[cq]t indent items to prompt width
.TP
\f[V]-ci, --color-items\f[R]
Color items
.TP
\f[V]-nci, --no-color-items\f[R]
Don\[cq]t color items
.TP
\f[V]-sgr, --sgr\f[R]
Interpret SGR sequences
.TP
\f[V]-nsgr, --no-sgr\f[R]
Display SGR sequences as text
.TP
\f[V]-a, --alpha\f[R]
Enable alpha
.TP
\f[V]-na, --no-alpha\f[R]
Disable alpha
.TP
\f[V]-tp, --allow-typing\f[R]
Allow the user to type
.TP
\f[V]-nt, --no-allow-typing\f[R]
Don\[cq]t allow typing, the user must select an option
.TP
\f[V]-ol, --override-lines\f[R]
Allow keybinds to override lines
.TP
\f[V]-oc, --override-columns\f[R]
Allow keybinds to override columns
.TP
\f[V]-nol, --no-override-lines\f[R]
Don\[cq]t allow keybinds to override lines
.TP
\f[V]-noc, --no-override-columns\f[R]
Don\[cq]t allow keybinds to override columns
.TP
\f[V]-x, --x-position x offset\f[R]
Offset spmenu x position by x offset (X11 only)
.TP
\f[V]-y, --y-position y offset\f[R]
Offset spmenu y position by y offset (X11 only)
.TP
\f[V]-n, --preselect line\f[R]
Preselect line line in the list of items
.TP
\f[V]-z, --width width\f[R]
Width of the spmenu window
.TP
\f[V]-nmt, --normal-mode-text text\f[R]
Set normal mode text to text
.TP
\f[V]-imt, --insert-mode-text text\f[R]
Set insert mode text to text
.TP
\f[V]-clon, --caps-lock-on-text text\f[R]
Set caps lock on text to text
.TP
\f[V]-clof, --caps-lock-off-text text\f[R]
Set caps lock off text to text
.TP
\f[V]-bw, --border-width width\f[R]
Set width of the border to width.
0 will disable the border (X11 only)
.TP
\f[V]-so, --sort\f[R]
Sort matches
.TP
\f[V]-nso, --no-sort\f[R]
Don\[cq]t sort matches
.TP
\f[V]-pri, --priority pri1,pri2,pri3\f[R]
Specify a list of items that take priority
.TP
\f[V]-s, --case-sensitive\f[R]
Use case-sensitive matching
.TP
\f[V]-ns, --case-insensitive\f[R]
Use case-insensitive matching
.TP
\f[V]-nm, --normal\f[R]
Start spmenu in normal mode
.TP
\f[V]-im, --insert\f[R]
Start spmenu in insert mode
.TP
\f[V]-t, --top\f[R]
Position spmenu at the top of the screen
.TP
\f[V]-b, --bottom\f[R]
Position spmenu at the bottom of the screen
.TP
\f[V]-c, --center\f[R]
Position spmenu at the center of the screen
.TP
\f[V]-itt, --item-top\f[R]
Position items above all other elements
.TP
\f[V]-itb, --item-bottom\f[R]
Position items below all other elements
.TP
\f[V]-hm, --hide-mode\f[R]
Hide mode indicator
.TP
\f[V]-hit, --hide-item\f[R]
Hide items
.TP
\f[V]-hmc, --hide-match-count\f[R]
Hide match count
.TP
\f[V]-hla, --hide-left-arrow\f[R]
Hide left arrow
.TP
\f[V]-hra, --hide-right-arrow\f[R]
Hide right arrow
.TP
\f[V]-hpr, --hide-prompt\f[R]
Hide prompt
.TP
\f[V]-hpt, --hide-pretext\f[R]
Hide pretext
.TP
\f[V]-hip, --hide-input\f[R]
Hide input
.TP
\f[V]-hpl, --hide-powerline\f[R]
Hide powerline
.TP
\f[V]-hc, --hide-caret, --hide-cursor\f[R]
Hide caret
.TP
\f[V]-hhl, --hide-highlighting\f[R]
Hide highlight
.TP
\f[V]-hi, --hide-image\f[R]
Hide image
.TP
\f[V]-hcl, --hide-caps\f[R]
Hide caps lock indicator
.TP
\f[V]-sm, --show-mode\f[R]
Show mode indicator
.TP
\f[V]-sit, --show-item\f[R]
Show items
.TP
\f[V]-smc, --show-match-count\f[R]
Show match count
.TP
\f[V]-sla, --show-left-arrow\f[R]
Show left arrow
.TP
\f[V]-sra, --show-right-arrow\f[R]
Show right arrow
.TP
\f[V]-spr, --show-prompt\f[R]
Show prompt
.TP
\f[V]-sin, --show-input\f[R]
Show input
.TP
\f[V]-spt, --show-pretext\f[R]
Show pretext
.TP
\f[V]-spl, --show-powerline\f[R]
Show powerline
.TP
\f[V]-sc, --show-caret, --show-cursor\f[R]
Show caret
.TP
\f[V]-shl, --show-highlighting\f[R]
Show highlight
.TP
\f[V]-si, --show-image\f[R]
Show image
.TP
\f[V]-scl, --show-caps\f[R]
Show caps lock indicator
.TP
\f[V]-xrdb, --xrdb\f[R]
Load .Xresources on runtime (X11 only)
.TP
\f[V]-nxrdb, --no-xrdb\f[R]
Don\[cq]t load .Xresources on runtime (X11 only)
.TP
\f[V]-m, --monitor monitor\f[R]
Specify a monitor to run spmenu on (X11 only)
.TP
\f[V]-w, --embed window id\f[R]
Embed spmenu inside window id (X11 only)
.TP
\f[V]-H, --hist-file hist file\f[R]
Specify a file to save the history to
.TP
\f[V]-lf, --list-file list file\f[R]
Specify a file to load entries from
.TP
\f[V]-ig, --image-gaps gaps\f[R]
Set image gaps to gaps
.TP
\f[V]-txp, --text-padding padding\f[R]
Set text padding to padding
.TP
\f[V]-vem, --vertical-margin margin\f[R]
Set the vertical margin to margin
.TP
\f[V]-hom, --horizontal-margin margin\f[R]
Set the horizontal margin to margin
.TP
\f[V]-lp, --vertical-padding padding\f[R]
Set the vertical padding to padding
.TP
\f[V]-hp, --horizontal-padding padding\f[R]
Set the horizontal padding to padding
.TP
\f[V]-la, --left-arrow-symbol symbol\f[R]
Set the left arrow to symbol
.TP
\f[V]-ra, --right-arrow-symbol symbol\f[R]
Set the right arrow to symbol
.TP
\f[V]-is, --image-size size\f[R]
Image size
.TP
\f[V]-it, --image-top\f[R]
Position the image at the top
.TP
\f[V]-ib, --image-bottom\f[R]
Position the image at the bottom
.TP
\f[V]-ic, --image-center\f[R]
Position the image in the center
.TP
\f[V]-itc, --image-topcenter\f[R]
Position the image in the top center
.TP
\f[V]-ir, --image-resize\f[R]
Allow spmenu to resize itself to fit the image
.TP
\f[V]-nir, --no-image-resize\f[R]
Don\[cq]t allow spmenu to resize itself to fit the image
.TP
\f[V]-di, --display-icons\f[R]
Display the images as icons
.TP
\f[V]-df, --display-image\f[R]
Display the images as images in the image pane
.TP
\f[V]-wm, --managed, --x11-client\f[R]
Spawn spmenu as a window manager controlled client/window (X11 only)
.TP
\f[V]-nwm, --unmanaged\f[R]
Don\[cq]t spawn spmenu as a window manager controlled client/window (X11
only)
.TP
\f[V]-gk, --grab-keyboard\f[R]
Grab keyboard on runtime
.TP
\f[V]-ngk, --no-grab-keyboard\f[R]
Grab keyboard on runtime
.TP
\f[V]-cf, --config-file file\f[R]
Set config file to load to file
.TP
\f[V]-lcfg, --load-config\f[R]
Load spmenu configuration (\[ti]/.config/spmenu/spmenu.conf) on runtime
.TP
\f[V]-ncfg, --no-load-config\f[R]
Don\[cq]t load spmenu configuration (\[ti]/.config/spmenu/spmenu.conf)
on runtime
.TP
\f[V]-bf, --bind-file file\f[R]
Set bind file to load to file
.TP
\f[V]-lbi, --load-binds\f[R]
Exclusively load binds from file (\[ti]/.config/spmenu/binds.conf) on
runtime
.TP
\f[V]-nlbi, --no-load-binds\f[R]
Don\[cq]t exclusively load binds from file
(\[ti]/.config/spmenu/binds.conf) on runtime
.TP
\f[V]-tm, --theme theme\f[R]
Load theme `theme' on runtime
.TP
\f[V]-ltm, --load-theme\f[R]
Load theme (\[ti]/.config/spmenu/theme.conf) on runtime
.TP
\f[V]-nltm, --no-load-theme\f[R]
Don\[cq]t load theme (\[ti]/.config/spmenu/theme.conf) on runtime
.TP
\f[V]-x11, --x11\f[R]
Run spmenu in X11 mode
.TP
\f[V]-wl, --wayland\f[R]
Run spmenu in Wayland mode
.TP
\f[V]-v, --version\f[R]
Print spmenu version to stdout
.TP
\f[V]-rv, --raw-version\f[R]
Print raw spmenu version number to stdout
.TP
\f[V]-fl, --feature-list\f[R]
List the state of all features that can be toggled
.TP
\f[V]-fn, --font font\f[R]
Set the spmenu font to font
.TP
\f[V]-nif, --normal-item-foreground color\f[R]
Set the normal item foreground color
.TP
\f[V]-nib, --normal-item-background color\f[R]
Set the normal item background color
.TP
\f[V]-nnif, --normal-next-item-foreground color\f[R]
Set the normal next item foreground color
.TP
\f[V]-nnib, --normal-next-item-background color\f[R]
Set the normal next item background color
.TP
\f[V]-sif, --selected-item-foreground color\f[R]
Set the selected item foreground color
.TP
\f[V]-sib, --selected-item-background color\f[R]
Set the selected item background color
.TP
\f[V]-npf, --normal-item-priority-foreground color\f[R]
Set the normal item (high priority) foreground color
.TP
\f[V]-npb, --normal-item-priority-background color\f[R]
Set the normal item (high priority) background color
.TP
\f[V]-spf, --selected-item-priority-foreground color\f[R]
Set the selected item (high priority) foreground color
.TP
\f[V]-spb, --selected-item-priority-background color\f[R]
Set the selected item (high priority) background color
.TP
\f[V]-pfg, --prompt-foreground color\f[R]
Set the prompt foreground color
.TP
\f[V]-pbg, --prompt-background color\f[R]
Set the prompt background color
.TP
\f[V]-ifg, --input-foreground color\f[R]
Set input foreground color
.TP
\f[V]-ibg, --input-background color\f[R]
Set input background color
.TP
\f[V]-ptfg, --pretext-foreground color\f[R]
Set pretext foreground color
.TP
\f[V]-ptbg, --pretext-background color\f[R]
Set pretext background color
.TP
\f[V]-mnbg, --menu-background color\f[R]
Set the menu background color
.TP
\f[V]-nhf, --normal-highlight-foreground color\f[R]
Set the normal highlight foreground color
.TP
\f[V]-nhb, --normal-highlight-background color\f[R]
Set the normal highlight background color
.TP
\f[V]-shf, --selected-highlight-foreground color\f[R]
Set the selected highlight foreground color
.TP
\f[V]-shb, --selected-highlight-background color\f[R]
Set the selected highlight background color
.TP
\f[V]-nfg, --number-foreground color\f[R]
Set the foreground color for the match count
.TP
\f[V]-nbg, --number-background color\f[R]
Set the background color for the match count
.TP
\f[V]-mfg, --mode-foreground color\f[R]
Set the foreground color for the mode indicator
.TP
\f[V]-mbg, --mode-background color\f[R]
Set the background color for the mode indicator
.TP
\f[V]-laf, --left-arrow-foreground color\f[R]
Set the left arrow foreground color
.TP
\f[V]-raf, --right-arrow-foreground color\f[R]
Set the right arrow foreground color
.TP
\f[V]-lab, --left-arrow-background color\f[R]
Set the left arrow background color
.TP
\f[V]-rab, --right-arrow-background color\f[R]
Set the right arrow background color
.TP
\f[V]-cfc, --caret-foreground color\f[R]
Set the caret foreground color
.TP
\f[V]-cbc, --caret-background color\f[R]
Set the caret background color
.TP
\f[V]-bc, --border-background color\f[R]
Set the border color
.TP
\f[V]-sgr0, --sgr0 color\f[R]
Set the SGR 0 color
.TP
\f[V]-sgr1, --sgr1 color\f[R]
Set the SGR 1 color
.TP
\f[V]-sgr2, --sgr2 color\f[R]
Set the SGR 2 color
.TP
\f[V]-sgr3, --sgr3 color\f[R]
Set the SGR 3 color
.TP
\f[V]-sgr4, --sgr4 color\f[R]
Set the SGR 4 color
.TP
\f[V]-sgr5, --sgr5 color\f[R]
Set the SGR 5 color
.TP
\f[V]-sgr6, --sgr6 color\f[R]
Set the SGR 6 color
.TP
\f[V]-sgr7, --sgr7 color\f[R]
Set the SGR 7 color
.TP
\f[V]-sgr8, --sgr8 color\f[R]
Set the SGR 8 color
.TP
\f[V]-sgr9, --sgr9 color\f[R]
Set the SGR 9 color
.TP
\f[V]-sgr10, --sgr10 color\f[R]
Set the SGR 10 color
.TP
\f[V]-sgr11, --sgr11 color\f[R]
Set the SGR 11 color
.TP
\f[V]-sgr12, --sgr12 color\f[R]
Set the SGR 12 color
.TP
\f[V]-sgr13, --sgr13 color\f[R]
Set the SGR 13 color
.TP
\f[V]-sgr14, --sgr14 color\f[R]
Set the SGR 14 color
.TP
\f[V]-sgr15, --sgr15 color\f[R]
Set the SGR 15 color
.PP
dmenu compatibility can be achieved using these arguments:
.TP
\f[V]-S\f[R]
Don\[cq]t sort matches
.TP
\f[V]-i\f[R]
Use case-insensitive matching
.TP
\f[V]-nb color\f[R]
Set the normal background color
.TP
\f[V]-nf color\f[R]
Set the normal foreground color
.TP
\f[V]-sb color\f[R]
Set the selected background color
.TP
\f[V]-sf color\f[R]
Set the selected foreground color
.PP
There are more options, that can be set in the configuration file but
not using arguments passed to spmenu.
.SS Matching
.PP
\f[V]printf \[dq]Apple\[rs]nPear\[rs]nBanana\[rs]n\[dq] | spmenu\f[R]
.PP
With the default configuration, typing in \f[V]Apple\f[R],
\f[V]apple\f[R], \f[V]aPpLe\f[R] and \f[V]pple\f[R] will match
\f[V]Apple\f[R] in this example.
Matching is case insensitive, and fuzzy matching is enabled by default.
You can disable fuzzy matching and enable case sensitivity using
arguments, or by enabling it in the configuration.
.PP
\f[V]printf \[dq]1 Apple\[rs]nOne Apple\[rs]n\[dq] | spmenu\f[R]
.PP
spmenu also supports regex matching, but it is not enabled by default.
Therefore, typing in \f[V][0-9]\f[R] will return no matches.
In the default configuration, you can press Ctrl+r to enable regex
matching.
Now typing in \f[V][0-9]\f[R] will return the \f[V]1 Apple\f[R] entry,
but not the \f[V]One Apple\f[R] entry.
Of course, more advanced regex can be used as well.
.SS Modes
.PP
There are two modes.
Normal mode and Insert mode.
These modes are of course similar to Vim.
.PP
Normal mode is the mode spmenu starts in unless a mode argument is
specified or another mode is set in the configuration file.
Note that if \f[V]forceinsertmode\f[R] is enabled, Normal mode cannot be
used and spmenu will start in Insert mode instead.
.PP
In normal mode, all keys perform some action, but you cannot type any
actual text to filter items.
This mode is commonly used for navigation, general keybinds, as well as
quickly selecting an item.
By default though, this mode is not used.
.PP
Insert mode is entered through (by default) pressing \f[V]i\f[R] in
normal mode.
In this mode, most keybinds do nothing.
When you are in insert mode, you filter items by typing text into the
field.
.PP
Once you\[cq]re done with insert mode and normal mode is enabled, you
can press (by default) Escape to enter normal mode again.
.PP
All of these keybinds can be overriden in the configuration file.
Should you unbind your switchmode key, you can always press
\f[V]Ctrl+Alt+Delete\f[R] to exit spmenu, allowing you to fix your
spmenu configuration.
.SS History buffer
.PP
spmenu allows you to specify a history file using the \f[V]-H\f[R]
argument.
When this argument is specified, the selected item(s) will be appended
to the file.
In spmenu.conf, you can specify a max number of entries, and whether you
want duplicate entries or not.
.PP
To access the history buffer, call \f[V]viewhist\f[R].
By default, the keybind for that is Shift+h in normal mode.
You can also access it by clicking the match indicator.
To hide the history buffer again, call \f[V]viewhist\f[R].
.PP
If \f[V]-H\f[R] is not specified, the history buffer will not be
available, and calling \f[V]viewhist\f[R] will do nothing.
.SS -p option
.PP
spmenu has a \f[V]-p\f[R] or \f[V]--prompt\f[R] option.
It allows you to specify text to display next to the item list.
It is displayed on the left side of the spmenu window.
It should be noted that the prompt is purely visual though.
.PP
It may be useful when you want to display information, such as the
current directory or what the items actually do.
This is a field that can be overriden with almost any text.
.SS Displaying images
.PP
spmenu supports displaying images.
This image is placed on the left side of the menu window, as long as
spmenu isn\[cq]t a single line.
.PP
To use an image, pipe \f[V]img:///path/to/image\f[R] to spmenu.
If you want you can specify arguments like usual.
Note that you should add a Tab (\f[V]\[rs]t\f[R]) character after the
path to the image file.
Otherwise the text after will be interpreted as part of the filename and
the image will not be drawn.
.PP
Any text after the Tab character will be interpreted as a regular item.
In practice, drawing an image might look like this:
.PP
\f[V]printf \[dq]img:///path/to/image\[rs]tLook at that image, isn\[aq]t it awesome?\[rs]n\[dq] | spmenu\f[R]
.PP
There are also a few image related arguments, such as:
.PP
\f[V]-is\f[R], \f[V]-ig\f[R], \f[V]-it\f[R], \f[V]-ib\f[R],
\f[V]-ic\f[R], \f[V]-itc\f[R] and \f[V]-gc\f[R].
.PP
Vector images (such as .svg) can be displayed too in the same way.
This is all done using \f[V]imlib2\f[R] and \f[V]cairo\f[R] so as long
as imlib2 support it, it can be used.
.PP
If the image cannot be located, isn\[cq]t a valid format or cannot be
displayed for some reason, the space where the image would be displayed
is blank.
.SS Colored text
.PP
spmenu supports colored text through SGR sequences.
This is the same colors that you might already be using in your shell
scripts.
This means you can pipe practically any colored shell script straight
into spmenu, no need to filter the output or anything.
.PP
Not only does it support colored text, but it also supports colored
backgrounds.
This allows something similar to the emoji highlight patch on the
suckless website, except even more useful.
.PP
Example:
\f[V]printf \[dq]\[rs]033[0;44m\[u1F600]\[rs]033[0m Emoji highlighting\[rs]n\[dq] | spmenu --columns 1\f[R]
.PP
It should be noted that font sequences are not yet supported.
See `SGR sequences' for more information.
.SS SGR sequences
.PP
SGR sequences (ANSI escape codes) can be used to set the color of spmenu
items.
Here\[cq]s a simple table of good SGR sequences.
Note that sequences can also be combined, and that this isn\[cq]t the
only way to format them.
.PP
.TS
tab(@);
lw(12.7n) lw(57.3n).
T{
Sequence
T}@T{
Description
T}
_
T{
\[rs]033[0m
T}@T{
Reset foreground and background color and alpha
T}
T{
\[rs]033[0;3nm
T}@T{
Set foreground color to normal color index `n' (0-7)
T}
T{
\[rs]033[1;3nm
T}@T{
Set foreground color to bright color index `n' (0-7)
T}
T{
\[rs]033[0;4nm
T}@T{
Set background color to normal color index `n' (0-7)
T}
T{
\[rs]033[1;4nm
T}@T{
Set background color to bright color index `n' (0-7)
T}
T{
\[rs]033[9nm
T}@T{
Set foreground color to bright color index `n' (0-7)
T}
T{
\[rs]033[10nm
T}@T{
Set background color to bright color index `n' (0-7)
T}
T{
\[rs]033[38;2;r;g;bm
T}@T{
Set foreground color to a specified RGB color, r is red, g is green, b
is blue
T}
T{
\[rs]033[48;2;r;g;bm
T}@T{
Set background color to a specified RGB color, r is red, g is green, b
is blue
T}
T{
\[rs]033[38;5;nm
T}@T{
Set foreground color to color index `n' (0-256)
T}
T{
\[rs]033[48;5;nm
T}@T{
Set background color to color index `n' (0-256)
T}
T{
\[rs]033[39m
T}@T{
Reset foreground color and alpha
T}
T{
\[rs]033[49m
T}@T{
Reset background color and alpha
T}
T{
;
T}@T{
Semicolon is used as a separator
T}
T{
m
T}@T{
Ends the sequence
T}
.TE
.PP
Other sequences \f[I]may\f[R] be supported but are not listed here.
In any case, this allows for all RGB colors to be theoretically used all
at the same time.
.PP
For example, to set the foreground color to red and print `Hello world',
one could do the following:
\f[V]printf \[aq]\[rs]033[0;31mHello world\[rs]n\[dq] | spmenu\f[R] This
will set the foreground color to \f[V]sgr1\f[R] in the config/theme
file.
You can do this for \f[V]sgr0\f[R] through \f[V]sgr7\f[R].
To access \f[V]sgr8\f[R] through \f[V]sgr15\f[R] you use
\f[V]\[rs]033[1\f[R] rather than \f[V]\[rs]033[0\f[R], specifying that
you want bright colors to be used.
.PP
As for 256 colors, you simply specify a value between 0 and 256.
These colors are built into spmenu and cannot be overridden.
They are only really implemented into spmenu for compatibility, in
practice you should use true color sequences instead, as they are much
more flexible.
.PP
True color is slightly more complicated.
For example, to print black text on a white background, one could do
something like this:
\f[V]printf \[dq]\[rs]033[48;2;255;255;255;38;2;0;0;0mTest\[rs]033[0m\[rs]n\[dq] | spmenu\f[R]
.PP
This might look confusing if you aren\[cq]t familiar with these
sequences, but it\[cq]s fairly simple.
First we set the background color and specify that this is a true color
sequence.
(\f[V]48;2\f[R]) Then we set the red, green and blue channel to fully
opaque (\f[V]255;255;255\f[R] for red;green;blue), resulting in white.
Then we repeat this for a foreground color (\f[V]38;2\f[R]) but replace
\f[V]255\f[R] with \f[V]0\f[R], which results in black.
Do however note that you don\[cq]t need to specify \f[I]both\f[R] a
foreground and background color.
.PP
\f[B]Note: Background colors will used until a reset sequence is
found.\f[R]
.SS FIFO
.PP
spmenu has support for FIFO.
This means you can tell spmenu to perform certain actions while it is
running.
spmenu checks the FIFO every 0.1 seconds.
To use it, simply append a valid name to the FIFO file, which by default
is /tmp/spmenu.fifo.
.PP
You must append \f[B]without\f[R] a newline.
Otherwise it will be considered invalid.
It is recommended that you sleep for 0.1 seconds after appending to the
file for performance reasons.
.PP
.TS
tab(@);
lw(12.7n) lw(57.3n).
T{
Name
T}@T{
Description
T}
_
T{
drawmenu
T}@T{
Draw the menu
T}
T{
match
T}@T{
Match entries again, useful if you\[cq]re loading items from file
T}
T{
update
T}@T{
Match and then draw the menu.
Both drawmenu and match one after another
T}
T{
output
T}@T{
Output selected item text
T}
T{
output_index
T}@T{
Output selected item index
T}
T{
loadconfig
T}@T{
Reload config
T}
T{
test
T}@T{
Print out `Test print' to standard output
T}
T{
die
T}@T{
Print out `FIFO told me to die.' using the die() function
T}
T{
toggleinput
T}@T{
Toggle input
T}
T{
togglepretext
T}@T{
Toggle pretext
T}
T{
togglelarrow
T}@T{
Toggle left arrow
T}
T{
togglerarrow
T}@T{
Toggle right arrow
T}
T{
toggleitem
T}@T{
Toggle item
T}
T{
toggleprompt
T}@T{
Toggle prompt
T}
T{
togglecaps
T}@T{
Toggle caps lock indicator
T}
T{
togglepowerline
T}@T{
Toggle powerline
T}
T{
togglecaret
T}@T{
Toggle caret
T}
T{
togglehighlight
T}@T{
Toggle highlighting
T}
T{