Package: feh
Version: 1.3.4-2
Severity: normal
Tags: patch
Spaces appearing in a filename can also cause an error like this one:
$ feh --bg-scale "with space.jpg"
$ cat ~/.fehbg
feh --bg-scale with space.jpg
$ eval $(cat ~/.fehbg)
feh WARNING: space.jpg does not exist - skipping
feh WARNING: with - File does not exist
feh ERROR: Couldn't load image in order to set bg
This patch makes feh output each arg on a separate line in ~/.fehbg:
--- src/support.c.orig 2006-11-05 12:35:53.000000000 +0100
+++ src/support.c 2006-11-05 12:36:08.000000000 +0100
@@ -189,7 +189,7 @@
pmap_d1 = XCreatePixmap(disp, root, w, h, depth);
gib_imlib_render_image_on_drawable_at_size(pmap_d1, im, 0, 0,
w, h,
1, 0, 1);
- fehbg = estrjoin(" ", "feh --bg-scale", fil, NULL);
+ fehbg = estrjoin("\n", "feh\n--bg-scale", fil, NULL);
} else if (centered) {
XGCValues gcval;
GC gc;
@@ -216,14 +216,14 @@
y = (h - gib_imlib_image_get_height(im)) >> 1;
gib_imlib_render_image_on_drawable(pmap_d1, im, x, y, 1, 0, 0);
XFreeGC(disp, gc);
- fehbg = estrjoin(" ", "feh --bg-center", fil, NULL);
+ fehbg = estrjoin("\n", "feh\n--bg-center", fil, NULL);
} else {
w = gib_imlib_image_get_width(im);
h = gib_imlib_image_get_height(im);
pmap_d1 =
XCreatePixmap(disp, root, w, h, depth);
gib_imlib_render_image_on_drawable(pmap_d1, im, 0, 0, 1, 0, 0);
- fehbg = estrjoin(" ", "feh --bg-tile", fil, NULL);
+ fehbg = estrjoin("\n", "feh\n--bg-tile", fil, NULL);
}
if (fehbg) {
so that now a background can still be set with the command recommended
by the man page (making the patch backward compatible) since the newline
is in $IFS by default (at least for bash):
$ eval `cat $HOME/.fehbg`
but also by this:
$ OLDIFS="$IFS"
$ IFS='
'
$ $(cat $HOME/.fehbg)
$ IFS="$OLDIFS"
that can be used with filenames containing (almost) anything but a
newline. So there is indeed still a tiny drawback.
But since in my opinion the patch is making things only better, could
you include it in the deb, and also possibly submit it upstream?
Regards
-- System Information:
Debian Release: 4.0
APT prefers unstable
APT policy: (990, 'unstable'), (850, 'testing'), (10, 'experimental')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.17-2-k7
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Versions of packages feh depends on:
ii giblib1 1.2.4-4 wrapper library for imlib2,
and ot
ii libc6 2.3.6.ds1-7 GNU C Library: Shared libraries
ii libimlib2 1.3.0.0debian1-2 powerful image loading and
renderi
ii libjpeg62 6b-13 The Independent JPEG
Group's JPEG
ii libpng12-0 1.2.8rel-7 PNG library - runtime
ii libx11-6 2:1.0.3-2 X11 client-side library
ii libxext6 1:1.0.1-2 X11 miscellaneous extension
librar
ii zlib1g 1:1.2.3-13 compression library - runtime
Versions of packages feh recommends:
ii wget 1.10.2-2 retrieves files from the web
-- no debconf information
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]