summaryrefslogtreecommitdiff
path: root/community/sxiv
diff options
context:
space:
mode:
authorNicolas Reynolds <fauno@kiwwwi.com.ar>2011-08-23 18:28:19 -0300
committerNicolas Reynolds <fauno@kiwwwi.com.ar>2011-08-23 18:28:19 -0300
commitd07d53d7af1e9694d9558783841bc2df3124a90f (patch)
tree40d68de204b29d3360efd654d3c458c9cdad3cd6 /community/sxiv
parenta873bdc69d24650d832933463af71dfaa96f1a8a (diff)
parent64e290184042563a240e2d6d15c02e06703d00ee (diff)
Merge branch 'master' of ssh://vparabola/home/parabola/abslibre-pre-mips64el
Conflicts: community/obconf/PKGBUILD community/obconf/obconf.install community/qstardict/PKGBUILD core/binutils/PKGBUILD core/gcc/PKGBUILD.mips64el extra/cups/PKGBUILD extra/eject/PKGBUILD extra/emacs/PKGBUILD extra/evilwm/PKGBUILD extra/fbset/PKGBUILD extra/gmpc/PKGBUILD extra/gnome-alsamixer/PKGBUILD extra/gtkpod/PKGBUILD extra/kdepim/PKGBUILD extra/kile/PKGBUILD extra/libvpx/PKGBUILD extra/php-apc/PKGBUILD extra/php-suhosin/PKGBUILD extra/php/PKGBUILD extra/pidgin/PKGBUILD extra/potrace/PKGBUILD extra/racket/PKGBUILD extra/soundtouch/PKGBUILD extra/wireshark/PKGBUILD extra/xpdf/PKGBUILD multilib/binutils-multilib/PKGBUILD multilib/lib32-acl/PKGBUILD multilib/lib32-attr/PKGBUILD multilib/lib32-glibc/PKGBUILD multilib/lib32-udev/PKGBUILD ~xihh/abiword/PKGBUILD
Diffstat (limited to 'community/sxiv')
-rw-r--r--community/sxiv/PKGBUILD27
-rw-r--r--community/sxiv/config.h146
-rw-r--r--community/sxiv/sxiv.install10
3 files changed, 130 insertions, 53 deletions
diff --git a/community/sxiv/PKGBUILD b/community/sxiv/PKGBUILD
index d8a02acbe..98e4f2380 100644
--- a/community/sxiv/PKGBUILD
+++ b/community/sxiv/PKGBUILD
@@ -1,8 +1,9 @@
-# Maintainer: Thomas Dziedzic < gostrc at gmail >
+# Contributor: Thomas Dziedzic < gostrc at gmail >
# Contributor: Bert Muennich <muennich at informatik.hu-berlin.de>
+# Maintainer: Brad Fanella <bradfanella@archlinux.us>
pkgname=sxiv
-pkgver=0.8.2
+pkgver=0.9
pkgrel=1
pkgdesc='simple x image viewer'
arch=('i686' 'x86_64' 'mips64el')
@@ -12,24 +13,22 @@ url='https://github.com/muennich/sxiv'
depends=('libx11' 'xproto' 'imlib2')
source=("https://github.com/downloads/muennich/sxiv/sxiv-${pkgver}.tar.gz"
'sxiv.desktop'
- 'config.h')
-md5sums=('6948b4c02f9458c4160c6e458228b85f'
+ 'config.h')
+md5sums=('865f1e542669ad6d7932fcd4664fb481'
'1dda85ff6bed4de337f8fb303075ed11'
- '8018e9f2f63b155098428be9dbaf8b5c')
+ '05c3801bf32c2861c3c7b37073664db3')
build() {
- cd sxiv-${pkgver}
+ cd "sxiv-${pkgver}"
- cp ${srcdir}/config.h .
-
- make
+ cp "$srcdir/config.h" .
+ make
}
package() {
- cd sxiv-${pkgver}
-
- make PREFIX=${pkgdir}/usr install
+ cd "sxiv-${pkgver}"
- install -D -m644 ${srcdir}/sxiv.desktop \
- ${pkgdir}/usr/share/applications/sxiv.desktop
+ make PREFIX="${pkgdir}/usr" install
+ install -D -m644 ${srcdir}/sxiv.desktop \
+ ${pkgdir}/usr/share/applications/sxiv.desktop
}
diff --git a/community/sxiv/config.h b/community/sxiv/config.h
index 14a65bd4f..dd9efe89f 100644
--- a/community/sxiv/config.h
+++ b/community/sxiv/config.h
@@ -1,41 +1,119 @@
-/* default window dimensions (overwritten via -g option): */
-#define WIN_WIDTH 800
-#define WIN_HEIGHT 600
-
-/* default color for window background: *
- * (see X(7) "COLOR NAMES" section for valid values) */
-#define BG_COLOR "#999999"
-/* default color for thumbnail selection: */
-#define SEL_COLOR "#0040FF"
-
-/* how should images be scaled when they are loaded?: *
- * (also controllable via -d/-s/-Z/-z options) *
- * SCALE_DOWN: 100%, but fit large images into window, *
- * SCALE_FIT: fit all images into window, *
- * SCALE_ZOOM: use current zoom level, 100% at startup */
-#define SCALE_MODE SCALE_DOWN
-
-/* levels (percent) to use when zooming via '-' and '+': */
+#ifdef _WINDOW_CONFIG
+
+/* default window dimensions (overwritten via -g option): */
+enum { WIN_WIDTH = 800, WIN_HEIGHT = 600 };
+
+/* default color for window background: *
+ * (see X(7) "COLOR NAMES" section for valid values) */
+static const char * const BG_COLOR = "#777777";
+/* default color for thumbnail selection: */
+static const char * const SEL_COLOR = "#DDDDDD";
+
+#endif
+#ifdef _IMAGE_CONFIG
+
+/* how should images be scaled when they are loaded?: *
+ * (also controllable via -d/-s/-Z/-z options) *
+ * SCALE_DOWN: 100%, but fit large images into window, *
+ * SCALE_FIT: fit all images into window, *
+ * SCALE_ZOOM: use current zoom level, 100% at startup */
+static const scalemode_t SCALE_MODE = SCALE_DOWN;
+
+/* levels (percent) to use when zooming via '-' and '+': */
static const float zoom_levels[] = {
12.5, 25.0, 50.0, 75.0,
100.0, 150.0, 200.0, 400.0, 800.0
};
-/* default dimension of thumbnails (width == height): */
-#define THUMB_SIZE 60
-
-/* enable external commands (defined below)? 0=off, 1=on: */
-#define EXT_COMMANDS 0
-
-/* external commands and corresponding key mappings: */
-#ifdef MAIN_C
-#if EXT_COMMANDS
-static const command_t commands[] = {
- /* ctrl-... reload? command, '#' is replaced by filename */
- { XK_comma, True, "jpegtran -rotate 270 -copy all -outfile # #" },
- { XK_period, True, "jpegtran -rotate 90 -copy all -outfile # #" },
- { XK_less, True, "mogrify -rotate -90 #" },
- { XK_greater, True, "mogrify -rotate +90 #" }
-};
#endif
+#ifdef _THUMBS_CONFIG
+
+/* default dimension of thumbnails (width == height): */
+enum { THUMB_SIZE = 60 };
+
+#endif
+#ifdef _MAPPINGS_CONFIG
+
+/* keyboard mappings for image and thumbnail mode: */
+static const keymap_t keys[] = {
+ /* ctrl key function argument */
+ { False, XK_q, quit, (arg_t) None },
+ { False, XK_r, reload, (arg_t) None },
+ { False, XK_f, toggle_fullscreen, (arg_t) None },
+ { False, XK_a, toggle_antialias, (arg_t) None },
+ { False, XK_A, toggle_alpha, (arg_t) None },
+ { False, XK_Return, switch_mode, (arg_t) None },
+
+ { False, XK_g, first, (arg_t) None },
+ { False, XK_G, last, (arg_t) None },
+ { False, XK_n, navigate, (arg_t) +1 },
+ { False, XK_space, navigate, (arg_t) +1 },
+ { False, XK_p, navigate, (arg_t) -1 },
+ { False, XK_BackSpace, navigate, (arg_t) -1 },
+ { False, XK_bracketright, navigate, (arg_t) +10 },
+ { False, XK_bracketleft, navigate, (arg_t) -10 },
+
+ { False, XK_D, remove_image, (arg_t) None },
+
+ { False, XK_h, move, (arg_t) DIR_LEFT },
+ { False, XK_Left, move, (arg_t) DIR_LEFT },
+ { False, XK_j, move, (arg_t) DIR_DOWN },
+ { False, XK_Down, move, (arg_t) DIR_DOWN },
+ { False, XK_k, move, (arg_t) DIR_UP },
+ { False, XK_Up, move, (arg_t) DIR_UP },
+ { False, XK_l, move, (arg_t) DIR_RIGHT },
+ { False, XK_Right, move, (arg_t) DIR_RIGHT },
+
+ { True, XK_h, pan_screen, (arg_t) DIR_LEFT },
+ { True, XK_Left, pan_screen, (arg_t) DIR_LEFT },
+ { True, XK_j, pan_screen, (arg_t) DIR_DOWN },
+ { True, XK_Down, pan_screen, (arg_t) DIR_DOWN },
+ { True, XK_k, pan_screen, (arg_t) DIR_UP },
+ { True, XK_Up, pan_screen, (arg_t) DIR_UP },
+ { True, XK_l, pan_screen, (arg_t) DIR_RIGHT },
+ { True, XK_Right, pan_screen, (arg_t) DIR_RIGHT },
+
+ { False, XK_H, pan_edge, (arg_t) DIR_LEFT },
+ { False, XK_J, pan_edge, (arg_t) DIR_DOWN },
+ { False, XK_K, pan_edge, (arg_t) DIR_UP },
+ { False, XK_L, pan_edge, (arg_t) DIR_RIGHT },
+
+ { False, XK_plus, zoom, (arg_t) +1 },
+ { False, XK_equal, zoom, (arg_t) +1 },
+ { False, XK_KP_Add, zoom, (arg_t) +1 },
+ { False, XK_minus, zoom, (arg_t) -1 },
+ { False, XK_KP_Subtract, zoom, (arg_t) -1 },
+ { False, XK_0, zoom, (arg_t) None },
+ { False, XK_KP_0, zoom, (arg_t) None },
+ { False, XK_w, fit_to_win, (arg_t) None },
+ { False, XK_W, fit_to_img, (arg_t) None },
+
+ { False, XK_less, rotate, (arg_t) DIR_LEFT },
+ { False, XK_greater, rotate, (arg_t) DIR_RIGHT },
+
+ /* open the current image with given program: */
+ { True, XK_g, open_with, (arg_t) "gimp" },
+
+ /* run shell command line on the current file,
+ * '#' is replaced by filename: */
+ { True, XK_less, run_command, (arg_t) "mogrify -rotate -90 #" },
+ { True, XK_greater, run_command, (arg_t) "mogrify -rotate +90 #" },
+ { True, XK_comma, run_command, (arg_t) "jpegtran -rotate 270 -copy all -outfile # #" },
+ { True, XK_period, run_command, (arg_t) "jpegtran -rotate 90 -copy all -outfile # #" },
+};
+
+/* mouse button mappings for image mode: */
+static const button_t buttons[] = {
+ /* ctrl shift button function argument */
+ { False, False, Button1, navigate, (arg_t) +1 },
+ { False, False, Button3, navigate, (arg_t) -1 },
+ { False, False, Button2, drag, (arg_t) None },
+ { False, False, Button4, move, (arg_t) DIR_UP },
+ { False, False, Button5, move, (arg_t) DIR_DOWN },
+ { False, True, Button4, move, (arg_t) DIR_LEFT },
+ { False, True, Button5, move, (arg_t) DIR_RIGHT },
+ { True, False, Button4, zoom, (arg_t) +1 },
+ { True, False, Button5, zoom, (arg_t) -1 },
+};
+
#endif
diff --git a/community/sxiv/sxiv.install b/community/sxiv/sxiv.install
index 02fd31189..410e17b44 100644
--- a/community/sxiv/sxiv.install
+++ b/community/sxiv/sxiv.install
@@ -1,10 +1,10 @@
post_install () {
- echo "* Look into config.h to customize sxiv to your needs."
- echo " Use 'makepkg --skipinteg' to rebuild the package after changing config.h."
- echo "* Create the directory ~/.sxiv/ to enable thumbnail caching."
- echo " See sxiv(1) for more information."
+ echo "* Look into config.h to customize sxiv to your needs."
+ echo " Use 'makepkg --skipinteg' to rebuild the package after changing config.h."
+ echo "* Create the directory ~/.sxiv/ to enable thumbnail caching."
+ echo " See sxiv(1) for more information."
}
post_upgrade () {
- post_install ${1}
+ post_install ${1}
}