From d3798b90fff5cda48fa6faa4ca4c031894694953 Mon Sep 17 00:00:00 2001 From: speedie Date: Wed, 9 Aug 2023 05:48:32 +0200 Subject: [PATCH] Add toggleimgtype --- docs/docs.md | 2 ++ libs/arg.c | 6 ++++++ libs/arg.h | 1 + libs/conf/config.h | 1 + libs/options.h | 10 +++++----- spmenu.1 | 6 ++++++ 6 files changed, 21 insertions(+), 5 deletions(-) diff --git a/docs/docs.md b/docs/docs.md index 2462553..a988be6 100644 --- a/docs/docs.md +++ b/docs/docs.md @@ -1123,6 +1123,8 @@ bind: - Toggle fuzzy matching - `toggleimg` - Toggle images +- `toggleimgtype` + - Toggle image type - `flipimg` - Flip image, 0 means vertically, 1 means horizontally - `setimgpos` diff --git a/libs/arg.c b/libs/arg.c index 7fda04a..33bc756 100644 --- a/libs/arg.c +++ b/libs/arg.c @@ -537,6 +537,12 @@ void toggleimg(Arg *arg) { #endif } +void toggleimgtype(Arg *arg) { +#if IMAGE + imagetype = !imagetype; +#endif +} + void defaultimg(Arg *arg) { #if IMAGE diff --git a/libs/arg.h b/libs/arg.h index 29891ee..965ed35 100644 --- a/libs/arg.h +++ b/libs/arg.h @@ -74,6 +74,7 @@ static void togglehighlight(Arg *arg); static void toggleregex(Arg *arg); static void togglefuzzy(Arg *arg); static void toggleimg(Arg *arg); +static void toggleimgtype(Arg *arg); /* hover */ static void selecthover(Arg *arg); diff --git a/libs/conf/config.h b/libs/conf/config.h index 00fe27a..3d85b45 100644 --- a/libs/conf/config.h +++ b/libs/conf/config.h @@ -391,6 +391,7 @@ static FuncList fl[] = { { "toggleregex", toggleregex }, { "togglefuzzy", togglefuzzy }, { "toggleimg", toggleimg }, + { "toggleimgtype", toggleimgtype }, { "setprofile", setprofile }, { "setlineheight", setlineheight }, { "switchmode", switchmode }, diff --git a/libs/options.h b/libs/options.h index 5dd7e46..fd8466b 100644 --- a/libs/options.h +++ b/libs/options.h @@ -40,11 +40,11 @@ static int powerlinecount = 1; /* Enable powerline for the match co static int powerlinemode = 1; /* Enable powerline for the mode indicator */ static int powerlinecaps = 1; /* Enable powerline for the caps lock indicator */ static int powerlineitems = 1; /* Enable powerline for the items */ -static int promptpwlstyle = 2; /* Prompt powerline style (0: >, 1: \, 2: )) */ -static int matchcountpwlstyle = 2; /* Match count powerline style (0: <, 1: /, 2: () */ -static int modepwlstyle = 2; /* Mode indicator powerline style (0: <, 1: /, 2: () */ -static int capspwlstyle = 2; /* Caps lock indicator powerline style (0: <, 1: /, 2: () */ -static int itempwlstyle = 2; /* Item powerline style (0: <>, 1: /\, 2: ()) */ +static int promptpwlstyle = 2; /* Prompt powerline style (0: Arrow, 1: Slash, 2: Rounded) */ +static int matchcountpwlstyle = 2; /* Match count powerline style (0: Arrow, 1: Slash, 2: Rounded) */ +static int modepwlstyle = 2; /* Mode indicator powerline style (0: Arrow, 1: Slash, 2: Rounded) */ +static int capspwlstyle = 2; /* Caps lock indicator powerline style (0: Arrow, 1: Slash, 2: Rounded) */ +static int itempwlstyle = 2; /* Item powerline style (0: Arrow, 1: Slash, 2: Rounded)) */ /* Window properties */ static int dockproperty = 1; /* Set _NET_WM_WINDOW_TYPE_DOCK */ diff --git a/spmenu.1 b/spmenu.1 index 065e926..f5f7f76 100644 --- a/spmenu.1 +++ b/spmenu.1 @@ -2279,6 +2279,12 @@ Toggle fuzzy matching Toggle images .RE .IP \[bu] 2 +\f[V]toggleimgtype\f[R] +.RS 2 +.IP \[bu] 2 +Toggle image type +.RE +.IP \[bu] 2 \f[V]flipimg\f[R] .RS 2 .IP \[bu] 2