From 34dc33b398174a658bb3cc8f3a0db09ce00d3f70 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Mon, 30 Oct 2023 17:43:11 +0900 Subject: [PATCH] 3.5.2-2 refactored config directory settings --- .SRCINFO | 4 ++-- PKGBUILD | 14 ++++++++++++-- sumatrapdf.sh | 17 +++++++---------- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/.SRCINFO b/.SRCINFO index a0ce8c6..9398a53 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,7 +1,7 @@ pkgbase = sumatrapdf pkgdesc = PDF, eBook (epub, mobi), comic book (cbz/cbr), DjVu, XPS, CHM, image viewer for Windows. Small, fast, customizable, free. pkgver = 3.5.2 - pkgrel = 1 + pkgrel = 2 url = https://www.sumatrapdfreader.org/free-pdf-reader arch = x86_64 license = GPL3 @@ -18,6 +18,6 @@ pkgbase = sumatrapdf source = sumatrapdf.sh sha256sums = 66ccb395c9184dce6822dfbb9970c877383b3ead6d9417b5106a844aac512989 sha256sums = ff33648659aa06892ed13a731588a57006fafee2f848d35f70bf273a13cf9d27 - sha256sums = 9113c6a594fe9b2f2dc800345396c97c3516d42d40bbc1ace6b34d805c0a3d7b + sha256sums = 8cc7cff62ca0f4b149cff9ad5f383a38fa68627d1b80a5f5e631860ca95cd56c pkgname = sumatrapdf diff --git a/PKGBUILD b/PKGBUILD index c322ce7..3e5179d 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -2,7 +2,7 @@ pkgname=sumatrapdf pkgver=3.5.2 -pkgrel=1 +pkgrel=2 pkgdesc="PDF, eBook (epub, mobi), comic book (cbz/cbr), DjVu, XPS, CHM, image viewer for Windows. Small, fast, customizable, free." arch=('x86_64') url='https://www.sumatrapdfreader.org/free-pdf-reader' @@ -16,7 +16,7 @@ source=('https://www.sumatrapdfreader.org/dl/rel/3.5.2/SumatraPDF-3.5.2-64.zip' 'sumatrapdf.sh') sha256sums=('66ccb395c9184dce6822dfbb9970c877383b3ead6d9417b5106a844aac512989' 'ff33648659aa06892ed13a731588a57006fafee2f848d35f70bf273a13cf9d27' - '9113c6a594fe9b2f2dc800345396c97c3516d42d40bbc1ace6b34d805c0a3d7b') + '8cc7cff62ca0f4b149cff9ad5f383a38fa68627d1b80a5f5e631860ca95cd56c') build() { wrestool -x -t 14 "SumatraPDF-${pkgver}-64.exe" > "${pkgname}.ico" @@ -39,3 +39,13 @@ package() { echo "You may need MS fonts for non-latin characters." } + +# CHANGELOG +# +# 3.5.2-2 +# - use `-appdata` cmd option of SumatraPDF.exe to specify config directory +# - all old settings works fine +# - remove symlink in config directory to sumatrapdf.sh +# - you can remove it +# - change WINEPREFIX to config directory +# - you can delete ~/.sumatrapdf/ diff --git a/sumatrapdf.sh b/sumatrapdf.sh index dd7dcd9..1197a3e 100644 --- a/sumatrapdf.sh +++ b/sumatrapdf.sh @@ -1,15 +1,12 @@ #!/bin/bash CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/sumatrapdf" -export WINEPREFIX="$HOME"/.sumatrapdf/wine -if [ ! -d "$HOME"/.sumatrapdf ] ; then - mkdir -p "$HOME"/.sumatrapdf/wine - wineboot -u -fi +# use this directory to store wine environment +export WINEPREFIX="$CONFIG_DIR"/wine +# initialize custom wine environment if [ ! -d $CONFIG_DIR ] ; then mkdir -p $CONFIG_DIR - - # SumatraPDF makes settings file in the same directory as SumatraPDF.exe - ln -s /usr/share/sumatrapdf/sumatrapdf.exe "$CONFIG_DIR"/sumatrapdf.exe + mkdir -p "$CONFIG_DIR"/wine + wineboot -u fi -# WINEDEBUG=-all wine /usr/share/sumatrapdf/sumatrapdf.exe "$@" -WINEDEBUG=-all wine "$CONFIG_DIR"/sumatrapdf.exe "$@" + +WINEDEBUG=-all wine /usr/share/sumatrapdf/sumatrapdf.exe -appdata "$CONFIG_DIR" "$@"