summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYaroslav de la Peña Smirnov <yps@yaroslavps.com>2022-03-16 22:34:05 +0300
committerYaroslav de la Peña Smirnov <yps@yaroslavps.com>2022-03-16 22:34:05 +0300
commit14de139b0271f01256f7eaae42b955819ad2931f (patch)
tree8879d67ecb661fd6c935a12620b31fe55a1c0208
parentc0102642ee14d732743f2aeeddeacbd3ceb5f85b (diff)
downloadnsxiv-yarps-14de139b0271f01256f7eaae42b955819ad2931f.tar.gz
nsxiv-yarps-14de139b0271f01256f7eaae42b955819ad2931f.zip
r29
-rw-r--r--PKGBUILD7
-rw-r--r--config.h29
2 files changed, 28 insertions, 8 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 8c5667b..bea720e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
pkgname=nsxiv
_pkgname=nsxiv
-pkgver=28
+pkgver=29
pkgrel=1
pkgdesc='Neo (or New or Not) Simple (or Small or Suckless) X Image Viewer'
arch=('x86_64')
@@ -12,11 +12,12 @@ url='https://github.com/nsxiv/nsxiv'
depends=('imlib2' 'desktop-file-utils' 'xdg-utils' 'hicolor-icon-theme' 'libexif' 'libxft' 'giflib' 'libwebp')
source=("$pkgname-$pkgver.tar.gz"::"https://github.com/nsxiv/nsxiv/archive/v$pkgver.tar.gz"
"config.h")
-sha256sums=('38047f60e51854363dd98fb7b3bc9f1cfa9b7d6f9e8788508b6f1e317328dd75'
-'38b5a6e5524f0570c68e0d8bde3917f3290a9883a7896a6ba6a2414c050b72c7')
+sha256sums=('564a17d921172336f7cd463bf313e39f84e4bcf4fdc789326f4112f848aad039'
+'6679eeb450b9fed45e37a106afc2d42bcee0f3512cd1333f752820b5a0e52e27')
prepare() {
cp "$srcdir/config.h" "$srcdir/$_pkgname-$pkgver/"
+ cd "$srcdir/$_pkgname-$pkgver"
}
build() {
diff --git a/config.h b/config.h
index 6c74580..7b2464a 100644
--- a/config.h
+++ b/config.h
@@ -16,6 +16,8 @@ static const char *DEFAULT_BAR_FG = NULL; /* NULL means it will default to
static const char *DEFAULT_FONT = "monospace-8";
#endif
+/* if true, statusbar appears on top of the window */
+static const bool TOP_STATUSBAR = false;
#endif
#ifdef _TITLE_CONFIG
@@ -62,11 +64,17 @@ static const bool ANTI_ALIAS = true;
*/
static const bool ALPHA_LAYER = false;
-/* cache size for imlib2, in bytes. For backwards compatibility reasons, the
- * size is kept at 4MiB. For most users, it is advised to pick a value close to
- * or above 128MiB for better image (re)loading performance.
+/* percentage of memory to use for imlib2's cache size.
+ * 3 means use 3% of total memory which is about 245MiB on 8GiB machine.
+ * 0 or less means disable cache.
+ * 100 means use all available memory (but not above CACHE_SIZE_LIMIT).
*/
-static const int CACHE_SIZE = 4 * 1024 * 1024; /* 4MiB */
+/* use 3% of total memory for cache */
+static const int CACHE_SIZE_MEM_PERCENTAGE = 3;
+/* but not above 256MiB */
+static const int CACHE_SIZE_LIMIT = 256 * 1024 * 1024;
+/* fallback to 32MiB if we can't determine total memory */
+static const int CACHE_SIZE_FALLBACK = 32 * 1024 * 1024;
#endif
#ifdef _THUMBS_CONFIG
@@ -172,7 +180,7 @@ static const keymap_t keys[] = {
};
/* mouse button mappings for image mode: */
-static const button_t buttons[] = {
+static const button_t buttons_img[] = {
/* modifiers button function argument */
{ 0, 1, i_cursor_navigate, None },
{ ControlMask, 1, i_drag, DRAG_RELATIVE },
@@ -182,6 +190,17 @@ static const button_t buttons[] = {
{ 0, 5, g_zoom, -1 },
};
+/* mouse button mappings for thumbnail mode: */
+static const button_t buttons_tns[] = {
+ /* modifiers button function argument */
+ { 0, 1, t_select, None },
+ { 0, 3, t_drag_mark_image, None },
+ { 0, 4, t_scroll, DIR_UP },
+ { 0, 5, t_scroll, DIR_DOWN },
+ { ControlMask, 4, g_scroll_screen, DIR_UP },
+ { ControlMask, 5, g_scroll_screen, DIR_DOWN },
+};
+
/* true means NAV_WIDTH is relative (33%), false means absolute (33 pixels) */
static const bool NAV_IS_REL = true;
/* width of navigation area, 0 disables cursor navigation, */