Add a lot more FIFO funcs

This commit is contained in:
Jacob 2023-08-09 21:23:21 +02:00
parent a3a860fe26
commit d892f8a986
3 changed files with 236 additions and 30 deletions

View file

@ -776,6 +776,28 @@ for performance reasons.
| togglefuzzy | Toggle fuzzy |
| toggleimg | Toggle images |
| toggleimgtype | Toggle image type |
| screenshot | Screenshot spmenu |
| setprofile | Open profile menu |
| setlines+ | Increase lines by 1 |
| setlines- | Decrease lines by 1 |
| setcolumns+ | Increase columns by 1 |
| setcolumns- | Decrease columns by 1 |
| moveup | Move up one item |
| movedown | Move down one item |
| moveleft | Move left one item |
| moveright | Move right one item |
| movestart | Move to the start |
| moveend | Move to the end |
| movenext | Move to the next page |
| moveprev | Move to the previous page |
| moveword+ | Move caret to the next word |
| moveword- | Move caret to the previous word |
| movecaret+ | Move caret to the next character |
| movecaret- | Move caret to the previous character |
| clear | Clear input |
| viewhist | View history buffer |
| backspace | Backspace |
| deleteword | Remove one full word forward |
| exit_0 | Exit with exit code 0 |
| exit_1 | Exit with exit code 1 |

View file

@ -55,50 +55,124 @@ void execute_fifo_cmd(void) {
fprintf(stdout, "%d\n", selecteditem->index);
}
} else if (!strcmp(fifot, "toggleinput")) {
Arg *arg;
toggleinput(arg);
Arg arg;
toggleinput(&arg);
} else if (!strcmp(fifot, "togglelarrow")) {
Arg *arg;
togglelarrow(arg);
Arg arg;
togglelarrow(&arg);
} else if (!strcmp(fifot, "togglerarrow")) {
Arg *arg;
togglerarrow(arg);
Arg arg;
togglerarrow(&arg);
} else if (!strcmp(fifot, "toggleitem")) {
Arg *arg;
toggleitem(arg);
Arg arg;
toggleitem(&arg);
} else if (!strcmp(fifot, "toggleprompt")) {
Arg *arg;
toggleprompt(arg);
Arg arg;
toggleprompt(&arg);
} else if (!strcmp(fifot, "togglecaps")) {
Arg *arg;
togglecaps(arg);
Arg arg;
togglecaps(&arg);
} else if (!strcmp(fifot, "togglepowerline")) {
Arg *arg;
togglepowerline(arg);
Arg arg;
togglepowerline(&arg);
} else if (!strcmp(fifot, "togglecaret")) {
Arg *arg;
togglecaret(arg);
Arg arg;
togglecaret(&arg);
} else if (!strcmp(fifot, "togglehighlight")) {
Arg *arg;
togglehighlight(arg);
Arg arg;
togglehighlight(&arg);
} else if (!strcmp(fifot, "togglematchcount")) {
Arg *arg;
togglematchcount(arg);
Arg arg;
togglematchcount(&arg);
} else if (!strcmp(fifot, "togglemode")) {
Arg *arg;
togglemode(arg);
Arg arg;
togglemode(&arg);
} else if (!strcmp(fifot, "toggleregex")) {
Arg *arg;
toggleregex(arg);
Arg arg;
toggleregex(&arg);
} else if (!strcmp(fifot, "togglefuzzy")) {
Arg *arg;
togglefuzzy(arg);
Arg arg;
togglefuzzy(&arg);
} else if (!strcmp(fifot, "toggleimg")) {
Arg *arg;
toggleimg(arg);
Arg arg;
toggleimg(&arg);
} else if (!strcmp(fifot, "toggleimgtype")) {
Arg *arg;
toggleimgtype(arg);
Arg arg;
toggleimgtype(&arg);
} else if (!strcmp(fifot, "screenshot")) {
Arg arg;
screenshot(&arg);
} else if (!strcmp(fifot, "setprofile")) {
Arg arg;
setprofile(&arg);
} else if (!strcmp(fifot, "setlines+")) {
Arg arg;
arg.i = +1;
setlines(&arg);
} else if (!strcmp(fifot, "setlines-")) {
Arg arg;
arg.i = -1;
setlines(&arg);
} else if (!strcmp(fifot, "setcolumns+")) {
Arg arg;
arg.i = +1;
setcolumns(&arg);
} else if (!strcmp(fifot, "setcolumns-")) {
Arg arg;
arg.i = -1;
setcolumns(&arg);
} else if (!strcmp(fifot, "moveup")) {
Arg arg;
moveup(&arg);
} else if (!strcmp(fifot, "movedown")) {
Arg arg;
movedown(&arg);
} else if (!strcmp(fifot, "moveleft")) {
Arg arg;
moveleft(&arg);
} else if (!strcmp(fifot, "moveright")) {
Arg arg;
moveright(&arg);
} else if (!strcmp(fifot, "movestart")) {
Arg arg;
movestart(&arg);
} else if (!strcmp(fifot, "moveend")) {
Arg arg;
moveend(&arg);
} else if (!strcmp(fifot, "movenext")) {
Arg arg;
movenext(&arg);
} else if (!strcmp(fifot, "moveprev")) {
Arg arg;
moveprev(&arg);
} else if (!strcmp(fifot, "viewhist")) {
Arg arg;
viewhist(&arg);
} else if (!strcmp(fifot, "backspace")) {
Arg arg;
backspace(&arg);
} else if (!strcmp(fifot, "deleteword")) {
Arg arg;
deleteword(&arg);
} else if (!strcmp(fifot, "moveword+")) {
Arg arg;
arg.i = +1;
moveword(&arg);
} else if (!strcmp(fifot, "moveword-")) {
Arg arg;
arg.i = -1;
moveword(&arg);
} else if (!strcmp(fifot, "movecursor+")) {
Arg arg;
arg.i = +1;
movecursor(&arg);
} else if (!strcmp(fifot, "movecursor-")) {
Arg arg;
arg.i = -1;
movecursor(&arg);
} else if (!strcmp(fifot, "clear")) {
Arg arg;
clear(&arg);
} else if (!strcmp(fifot, "exit_0")) {
exit(0);
} else if (!strcmp(fifot, "exit_1")) {

110
spmenu.1
View file

@ -1005,6 +1005,116 @@ T}@T{
Toggle image type
T}
T{
screenshot
T}@T{
Screenshot spmenu
T}
T{
setprofile
T}@T{
Open profile menu
T}
T{
setlines+
T}@T{
Increase lines by 1
T}
T{
setlines-
T}@T{
Decrease lines by 1
T}
T{
setcolumns+
T}@T{
Increase columns by 1
T}
T{
setcolumns-
T}@T{
Decrease columns by 1
T}
T{
moveup
T}@T{
Move up one item
T}
T{
movedown
T}@T{
Move down one item
T}
T{
moveleft
T}@T{
Move left one item
T}
T{
moveright
T}@T{
Move right one item
T}
T{
movestart
T}@T{
Move to the start
T}
T{
moveend
T}@T{
Move to the end
T}
T{
movenext
T}@T{
Move to the next page
T}
T{
moveprev
T}@T{
Move to the previous page
T}
T{
moveword+
T}@T{
Move caret to the next word
T}
T{
moveword-
T}@T{
Move caret to the previous word
T}
T{
movecaret+
T}@T{
Move caret to the next character
T}
T{
movecaret-
T}@T{
Move caret to the previous character
T}
T{
clear
T}@T{
Clear input
T}
T{
viewhist
T}@T{
View history buffer
T}
T{
backspace
T}@T{
Backspace
T}
T{
deleteword
T}@T{
Remove one full word forward
T}
T{
exit_0
T}@T{
Exit with exit code 0