summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuint Guvernator2020-05-27 22:32:00 +0200
committerQuint Guvernator2020-05-27 22:32:19 +0200
commit847e9f7a60f1b92f97c7f0ea34add98d9a7300c9 (patch)
treeace87554a91132a9a89bcffa9b82a57a4bdce241
parent474b3ac5d94ca61c1eeb928561a9f9905e58a9fe (diff)
downloadaur-847e9f7a60f1b92f97c7f0ea34add98d9a7300c9.tar.gz
save bgb settings in XDG_CONFIG_HOME
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD2
-rwxr-xr-xbgb19
3 files changed, 20 insertions, 3 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 63b67ac641c..f7825a2e925 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = bgb
pkgdesc = Game Boy emulator with advanced debugger
pkgver = 1.5.8
- pkgrel = 1
+ pkgrel = 2
url = https://bgb.bircd.org
arch = x86_64
depends = wine
diff --git a/PKGBUILD b/PKGBUILD
index 6de07fe587e..b0e5a335f50 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
pkgname=bgb
pkgver=1.5.8
-pkgrel=1
+pkgrel=2
pkgdesc='Game Boy emulator with advanced debugger'
arch=(x86_64)
url=https://bgb.bircd.org
diff --git a/bgb b/bgb
index d3f6fb901b5..ca940fbbefc 100755
--- a/bgb
+++ b/bgb
@@ -1,2 +1,19 @@
#!/bin/sh
-exec wine /usr/lib/bgb/bgb.exe $@
+set -e
+
+BGB_EXE=/usr/lib/bgb/bgb.exe
+BGB_CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/bgb"
+BGB_CONFIG="$BGB_CONFIG_DIR/bgb.ini"
+
+mkdir -p "$BGB_CONFIG_DIR"
+
+tmp="$(mktemp -d)"
+cp -t "$tmp" "$BGB_EXE"
+if [ -e "$BGB_CONFIG" ]; then
+ cp -t "$tmp" "$BGB_CONFIG"
+fi
+
+wine "$tmp/$(basename "$BGB_EXE")" $@
+
+cp -t "$BGB_CONFIG_DIR" "$tmp/$(basename "$BGB_CONFIG")"
+rm -r "$tmp"