diff --git a/docs/docs.md b/docs/docs.md index a988be6..7670371 100644 --- a/docs/docs.md +++ b/docs/docs.md @@ -756,10 +756,25 @@ for performance reasons. | match | Match entries again, useful if you're loading items from file | | update | Match and then draw the menu. Both drawmenu and match one after another | | output | Output selected item text | -| output_index | Output selected item index +| output_index | Output selected item index | | loadconfig | Reload config | | test | Print out 'Test print' to standard output | | die | Print out 'FIFO told me to die.' using the die() function | +| toggleinput | Toggle input | +| togglelarrow | Toggle left arrow | +| togglerarrow | Toggle right arrow | +| toggleitem | Toggle item | +| toggleprompt | Toggle prompt | +| togglecaps | Toggle caps lock indicator | +| togglepowerline | Toggle powerline | +| togglecaret | Toggle caret | +| togglehighlight | Toggle highlighting | +| togglematchcount | Toggle match count | +| togglemode | Toggle mode indicator | +| toggleregex | Toggle regex | +| togglefuzzy | Toggle fuzzy | +| toggleimg | Toggle images | +| toggleimgtype | Toggle image type | | exit_0 | Exit with exit code 0 | | exit_1 | Exit with exit code 1 | diff --git a/libs/fifo.c b/libs/fifo.c index f587f55..98d385b 100644 --- a/libs/fifo.c +++ b/libs/fifo.c @@ -23,6 +23,9 @@ void execute_fifo_cmd(void) { return; } + /* These are the different commands that we can run + * by outputting text to the FIFO. + */ if (!strcmp(fifot, "drawmenu")) { drawmenu(); } else if (!strcmp(fifot, "match")) { @@ -51,6 +54,51 @@ void execute_fifo_cmd(void) { if (printindex && selecteditem) { fprintf(stdout, "%d\n", selecteditem->index); } + } else if (!strcmp(fifot, "toggleinput")) { + Arg *arg; + toggleinput(arg); + } else if (!strcmp(fifot, "togglelarrow")) { + Arg *arg; + togglelarrow(arg); + } else if (!strcmp(fifot, "togglerarrow")) { + Arg *arg; + togglerarrow(arg); + } else if (!strcmp(fifot, "toggleitem")) { + Arg *arg; + toggleitem(arg); + } else if (!strcmp(fifot, "toggleprompt")) { + Arg *arg; + toggleprompt(arg); + } else if (!strcmp(fifot, "togglecaps")) { + Arg *arg; + togglecaps(arg); + } else if (!strcmp(fifot, "togglepowerline")) { + Arg *arg; + togglepowerline(arg); + } else if (!strcmp(fifot, "togglecaret")) { + Arg *arg; + togglecaret(arg); + } else if (!strcmp(fifot, "togglehighlight")) { + Arg *arg; + togglehighlight(arg); + } else if (!strcmp(fifot, "togglematchcount")) { + Arg *arg; + togglematchcount(arg); + } else if (!strcmp(fifot, "togglemode")) { + Arg *arg; + togglemode(arg); + } else if (!strcmp(fifot, "toggleregex")) { + Arg *arg; + toggleregex(arg); + } else if (!strcmp(fifot, "togglefuzzy")) { + Arg *arg; + togglefuzzy(arg); + } else if (!strcmp(fifot, "toggleimg")) { + Arg *arg; + toggleimg(arg); + } else if (!strcmp(fifot, "toggleimgtype")) { + Arg *arg; + toggleimgtype(arg); } else if (!strcmp(fifot, "exit_0")) { exit(0); } else if (!strcmp(fifot, "exit_1")) { @@ -75,6 +123,7 @@ void *fifocmd(void *n) { } void init_fifo(void) { + remove(fifofile); mkfifo(fifofile, 0666); pthread_t tid; diff --git a/spmenu.1 b/spmenu.1 index f5f7f76..4f953a8 100644 --- a/spmenu.1 +++ b/spmenu.1 @@ -925,6 +925,81 @@ T}@T{ Print out `FIFO told me to die.' using the die() function T} T{ +toggleinput +T}@T{ +Toggle input +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{ +togglematchcount +T}@T{ +Toggle match count +T} +T{ +togglemode +T}@T{ +Toggle mode indicator +T} +T{ +toggleregex +T}@T{ +Toggle regex +T} +T{ +togglefuzzy +T}@T{ +Toggle fuzzy +T} +T{ +toggleimg +T}@T{ +Toggle images +T} +T{ +toggleimgtype +T}@T{ +Toggle image type +T} +T{ exit_0 T}@T{ Exit with exit code 0