diff options
author | Alex Szczuczko | 2015-06-10 19:24:41 +0100 |
---|---|---|
committer | Alex Szczuczko | 2015-06-10 19:24:41 +0100 |
commit | 482335aa7b34bbe9494cf753b05e9e6d69c2b0a3 (patch) | |
tree | 4248ad3791c447ea89b6f3af572508fa78e9a4e0 /launch-gunpoint.sh | |
download | aur-gunpoint.tar.gz |
Initial import
Diffstat (limited to 'launch-gunpoint.sh')
-rw-r--r-- | launch-gunpoint.sh | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/launch-gunpoint.sh b/launch-gunpoint.sh new file mode 100644 index 000000000000..f93b38e264f2 --- /dev/null +++ b/launch-gunpoint.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +# This is a wrapper that works around the application's single-user design for multi-user systems. + +set -e +set -u + +game_dir="/opt/gunpoint" +: ${XDG_DATA_HOME:=$HOME/.local/share} +user_dir="$XDG_DATA_HOME/gunpoint" + +make_user_dir() { + echo "Creating a user directory for the game. This only needs to be done once, future runs will skip this step." + + mkdir -p "$user_dir/" + + # Read-only + ln -s -t "$user_dir/" "$game_dir/Gunpoint" "$game_dir/Gunpoint.wad" "$game_dir/Levels" "$game_dir/Music" "$game_dir/Scripts" + + # Read/Write + # Savegames and Settings created by game on first launch + + echo "User directory has been created." +} + +launch_game() { + cd "$user_dir" + ./Gunpoint +} + +if [ ! -f "$user_dir/Gunpoint" ] +then + make_user_dir +fi + +launch_game |