summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlof-Joachim Frahm <olof@macrolet.net>2019-10-11 22:19:33 +0200
committerOlof-Joachim Frahm <olof@macrolet.net>2019-10-11 22:19:33 +0200
commitde734d41517986273f8c887f892e15b66f0936ec (patch)
treee6d90e691e08cf8bdbd19eba7f2dc2a2af9f83df
parent7d154c00258c70136b0bca8ae162fe08c645373e (diff)
Allow setting the X11 class hint as an option.
-rw-r--r--man/feh.pre11
-rw-r--r--src/options.c4
-rw-r--r--src/options.h1
-rw-r--r--src/winwidget.c2
4 files changed, 15 insertions, 3 deletions
diff --git a/man/feh.pre b/man/feh.pre
index 3fecb00..9389a54 100644
--- a/man/feh.pre
+++ b/man/feh.pre
@@ -303,6 +303,13 @@ zero causes
to try indefinitely.
Negative values restore the default by disabling conversion altogether.
.
+.It Cm --class Ar class
+.
+Set the X11 class hint to
+.Ar class .
+.
+Default: feh
+.
.It Cm -L , --customlist Ar format
.
Don't display images, print image info according to
@@ -320,7 +327,7 @@ Draw the defined actions and what they do at the top-left of the image.
.Pq optional feature, $MAN_EXIF$ in this build
display some EXIF information in the bottom left corner, similar to using
.Cm --info
-with exiv2 / exifgrep .
+with exiv2 / exifgrep.
.
.It Cm -d , --draw-filename
.
@@ -330,7 +337,7 @@ Draw the file name at the top-left of the image.
.
Show overlay texts
.Pq as created by Cm --draw-filename No et al
-on a semi-transparent background to improve their readability
+on a semi-transparent background to improve their readability.
.
.It Cm --edit
.
diff --git a/src/options.c b/src/options.c
index 4c34b66..d3c1d52 100644
--- a/src/options.c
+++ b/src/options.c
@@ -430,6 +430,7 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun)
#ifdef HAVE_INOTIFY
{"auto-reload" , 0, 0, 248},
#endif
+ {"class" , 1, 0, 249},
{0, 0, 0, 0}
};
int optch = 0, cmdx = 0;
@@ -823,6 +824,9 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun)
opt.auto_reload = 1;
break;
#endif
+ case 249:
+ opt.x11_class = estrdup(optarg);
+ break;
default:
break;
}
diff --git a/src/options.h b/src/options.h
index 883c8e2..93474a9 100644
--- a/src/options.h
+++ b/src/options.h
@@ -128,6 +128,7 @@ struct __fehoptions {
int zoom_mode;
unsigned char adjust_reload;
int xinerama_index;
+ char *x11_class;
/* signed in case someone wants to invert scrolling real quick */
int scroll_step;
diff --git a/src/winwidget.c b/src/winwidget.c
index 70a65e0..cef7230 100644
--- a/src/winwidget.c
+++ b/src/winwidget.c
@@ -305,7 +305,7 @@ void winwidget_create_window(winwidget ret, int w, int h)
winwidget_update_title(ret);
xch = XAllocClassHint();
xch->res_name = "feh";
- xch->res_class = "feh";
+ xch->res_class = opt.x11_class ? opt.x11_class : "feh";
XSetClassHint(disp, ret->win, xch);
XFree(xch);