summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rwxr-xr-xexamples/find-lowres29
-rw-r--r--share/applications/feh.pre2
-rw-r--r--src/menu.c12
-rw-r--r--src/wallpaper.c6
-rwxr-xr-xtest/feh-i.t2
-rwxr-xr-xtest/run-interactive2
7 files changed, 46 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 23f46fd..1536ceb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
-git HEAD
+Fri, 28 Feb 2014 18:20:25 +0100 Daniel Friesel <derf+feh@finalrewind.org>
+* Release v2.10
* Allow non-centered wallpapers using the --geometry option
(Patch by Joel Bradshaw)
* Add ; flag to --info (as in "--info ';echo foo'") to disable info
@@ -11,6 +12,7 @@ git HEAD
* feh.desktop: Use feh %F since we support multiple files
* Fix --borderless not working on some 64bit systems
(Patch by Brian Mattern)
+ * Always use absolute paths in .fehbg
Tue, 11 Jun 2013 08:27:24 +0200 Daniel Friesel <derf+feh@finalrewind.org>
diff --git a/examples/find-lowres b/examples/find-lowres
new file mode 100755
index 0000000..4a7d9a9
--- /dev/null
+++ b/examples/find-lowres
@@ -0,0 +1,29 @@
+#!/usr/bin/env zsh
+# Recursively find images below a certain resolution
+#
+# Usage: find-lowres [-r] [directory [dimension]]
+#
+# directory defaults to . (the current working directory),
+# dimension defaults to 1000x800 pixels
+#
+# With -r: removes images instead of just listing them. Use at your own risk.
+
+remove=0
+
+while [[ $1 == -* ]]; do
+ case $1 in
+ -r) remove=1 ;;
+ -|--) shift; break ;;
+ esac
+ shift
+done
+
+base=${1-.}
+dimension=${2-1000x800}
+
+if (( remove ))
+then
+ feh --action 'rm %F' -rlV --max-dim ${dimension} ${base}
+else
+ feh -rlV --max-dim ${dimension} ${base}
+fi
diff --git a/share/applications/feh.pre b/share/applications/feh.pre
index 5d867a2..78a3824 100644
--- a/share/applications/feh.pre
+++ b/share/applications/feh.pre
@@ -1,5 +1,7 @@
[Desktop Entry]
Name=Feh
+GenericName=Image viewer
+GenericName[en_US]=Image viewer
Comment=Fast Imlib2-based Image Viewer
Exec=feh %F
Terminal=false
diff --git a/src/menu.c b/src/menu.c
index 722ce02..c18bbbb 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -1183,24 +1183,20 @@ void feh_menu_cb(feh_menu * m, feh_menu_item * i, int action, unsigned short dat
switch (action) {
case CB_BG_TILED:
- path = feh_absolute_path(FEH_FILE(m->fehwin->file->data)->filename);
+ path = FEH_FILE(m->fehwin->file->data)->filename;
feh_wm_set_bg(path, m->fehwin->im, 0, 0, 0, data, 0);
- free(path);
break;
case CB_BG_SCALED:
- path = feh_absolute_path(FEH_FILE(m->fehwin->file->data)->filename);
+ path = FEH_FILE(m->fehwin->file->data)->filename;
feh_wm_set_bg(path, m->fehwin->im, 0, 1, 0, data, 0);
- free(path);
break;
case CB_BG_CENTERED:
- path = feh_absolute_path(FEH_FILE(m->fehwin->file->data)->filename);
+ path = FEH_FILE(m->fehwin->file->data)->filename;
feh_wm_set_bg(path, m->fehwin->im, 1, 0, 0, data, 0);
- free(path);
break;
case CB_BG_FILLED:
- path = feh_absolute_path(FEH_FILE(m->fehwin->file->data)->filename);
+ path = FEH_FILE(m->fehwin->file->data)->filename;
feh_wm_set_bg(path, m->fehwin->im, 0, 0, 1, data, 0);
- free(path);
break;
case CB_BG_TILED_NOFILE:
feh_wm_set_bg(NULL, m->fehwin->im, 0, 0, 0, data, 0);
diff --git a/src/wallpaper.c b/src/wallpaper.c
index 886beb6..b5945f0 100644
--- a/src/wallpaper.c
+++ b/src/wallpaper.c
@@ -310,6 +310,8 @@ void feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled,
if (fil && !use_filelist) {
filbuf[out++] = '\'';
+ fil = feh_absolute_path(fil);
+
for (in = 0; fil[in] && out < 4092; in++) {
if (fil[in] == '\'')
@@ -317,12 +319,13 @@ void feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled,
filbuf[out++] = fil[in];
}
filbuf[out++] = '\'';
+ free(fil);
} else {
for (l = filelist; l && out < 4092; l = l->next) {
filbuf[out++] = '\'';
- fil = FEH_FILE(l->data)->filename;
+ fil = feh_absolute_path(FEH_FILE(l->data)->filename);
for (in = 0; fil[in] && out < 4092; in++) {
@@ -332,6 +335,7 @@ void feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled,
}
filbuf[out++] = '\'';
filbuf[out++] = ' ';
+ free(fil);
}
}
diff --git a/test/feh-i.t b/test/feh-i.t
index dd47ff6..0adc774 100755
--- a/test/feh-i.t
+++ b/test/feh-i.t
@@ -3,6 +3,8 @@ use strict;
use warnings;
use 5.010;
+no if $] >= 5.018, warnings => 'experimental::smartmatch';
+
use Cwd;
use Test::More tests => 103;
use Time::HiRes qw/sleep/;
diff --git a/test/run-interactive b/test/run-interactive
index a342c22..5c6f489 100755
--- a/test/run-interactive
+++ b/test/run-interactive
@@ -3,7 +3,7 @@
Xephyr -screen 500x500 :7 > /dev/null 2>&1 &
pid=${!}
-DISPLAY=:7 prove test/feh-scr-i.t test/feh-i.t
+DISPLAY=:7 prove -j1 test/feh-scr-i.t test/feh-i.t
ret=${?}
kill ${pid}