summarylogtreecommitdiffstats
path: root/NanoBoyAdvance.sh
diff options
context:
space:
mode:
Diffstat (limited to 'NanoBoyAdvance.sh')
-rwxr-xr-xNanoBoyAdvance.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/NanoBoyAdvance.sh b/NanoBoyAdvance.sh
new file mode 100755
index 00000000000..56bcf3b0dc8
--- /dev/null
+++ b/NanoBoyAdvance.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+confdir=.
+
+if [[ ! -z "$XDG_CONFIG_HOME" ]]; then
+ confdir="${XDG_CONFIG_HOME}/NanoBoyAdvance"
+elif [[ ! -z "$HOME" ]]; then
+ confdir="${HOME}/.config/NanoBoyAdvance"
+fi
+
+mkdir -p "$confdir"
+cd "$confdir"
+
+[[ ! -f config.toml ]] && cp /usr/share/NanoBoyAdvance/config.toml .
+[[ ! -f keymap.toml ]] && cp /usr/share/NanoBoyAdvance/keymap.toml .
+
+exec /usr/lib/ld-linux-x86-64.so.2 --argv0 "$confdir/NanoBoyAdvance" /usr/lib/NanoBoyAdvance "$@"