From d6928f41fd893dfe2f55071e040caed4cf40e964 Mon Sep 17 00:00:00 2001 From: drelbszoomer <173870110+drelbszoomer@users.noreply.github.com> Date: Thu, 14 May 2026 01:29:03 -0400 Subject: [PATCH] Add NFS cache hacks --- bin/doscopy.sh | 28 ++++++++++++++++++++ share/applications/AITDDOSBOX.desktop | 7 +++++ share/applications/BloodDOSBOX.desktop | 7 +++++ share/applications/PrivateerDOSBOX.desktop | 7 +++++ share/applications/SystemShockDOSBOX.desktop | 3 +-- share/applications/TTDDOSBOX.desktop | 3 +-- share/applications/Ultima7DOSBOX.desktop | 3 +-- 7 files changed, 52 insertions(+), 6 deletions(-) create mode 100755 bin/doscopy.sh create mode 100644 share/applications/AITDDOSBOX.desktop create mode 100644 share/applications/BloodDOSBOX.desktop create mode 100644 share/applications/PrivateerDOSBOX.desktop diff --git a/bin/doscopy.sh b/bin/doscopy.sh new file mode 100755 index 0000000..138c01f --- /dev/null +++ b/bin/doscopy.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env sh +if [ -z "${1:-}" ]; then + echo "Usage: $0 " + exit 1 +fi + +GAME_NAME="$1" +GAME_SRC="/mnt/Games/DOSGames/$GAME_NAME" +GAME_LOCAL="${HOME}/Games/$GAME_NAME" +LOCKDIR="$GAME_SRC/.lock" + +if ! mkdir "$LOCKDIR" 2>/dev/null; then + echo "$GAME_NAME is already running" + exit 1 +fi + +# NFS -> local +mkdir -p "$GAME_LOCAL" +rsync -a --exclude='.lock' "$GAME_SRC/" "$GAME_LOCAL/" + +# Sync back on exit +cleanup() { + rsync -a --exclude='.lock' "$GAME_LOCAL/" "$GAME_SRC/" + rmdir "$LOCKDIR" +} +trap cleanup EXIT + +flatpak run io.github.dosbox-staging --working-dir "$GAME_LOCAL" diff --git a/share/applications/AITDDOSBOX.desktop b/share/applications/AITDDOSBOX.desktop new file mode 100644 index 0000000..14a153a --- /dev/null +++ b/share/applications/AITDDOSBOX.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Name=Alone In The Dark (DOSBOX) +Exec=/var/home/bleggett/.local/bin/doscopy.sh AloneInTheDark +Terminal=false +Type=Application +Icon=dosbox-staging +Categories=Game; diff --git a/share/applications/BloodDOSBOX.desktop b/share/applications/BloodDOSBOX.desktop new file mode 100644 index 0000000..8b04064 --- /dev/null +++ b/share/applications/BloodDOSBOX.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Name=Blood (DOSBOX) +Exec=/var/home/bleggett/.local/bin/doscopy.sh Blood +Terminal=false +Type=Application +Icon=dosbox-staging +Categories=Game; diff --git a/share/applications/PrivateerDOSBOX.desktop b/share/applications/PrivateerDOSBOX.desktop new file mode 100644 index 0000000..f82d2ec --- /dev/null +++ b/share/applications/PrivateerDOSBOX.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Name=Wing Commander Privateer (DOSBOX) +Exec=/var/home/bleggett/.local/bin/doscopy.sh WingCommanderPrivateer +Terminal=false +Type=Application +Icon=dosbox-staging +Categories=Game; diff --git a/share/applications/SystemShockDOSBOX.desktop b/share/applications/SystemShockDOSBOX.desktop index 2433c2e..0dc8941 100644 --- a/share/applications/SystemShockDOSBOX.desktop +++ b/share/applications/SystemShockDOSBOX.desktop @@ -1,7 +1,6 @@ [Desktop Entry] Name=System Shock (DOSBOX) -Exec=flatpak run io.github.dosbox-staging -Path=/mnt/Games/DOSGames/SystemShock +Exec=/var/home/bleggett/.local/bin/doscopy.sh SystemShock Terminal=false Type=Application Icon=dosbox-staging diff --git a/share/applications/TTDDOSBOX.desktop b/share/applications/TTDDOSBOX.desktop index c89d560..02d0c87 100644 --- a/share/applications/TTDDOSBOX.desktop +++ b/share/applications/TTDDOSBOX.desktop @@ -1,7 +1,6 @@ [Desktop Entry] Name=Transport Tycoon Deluxe (DOSBOX) -Exec=flatpak run io.github.dosbox-staging -Path=/mnt/Games/DOSGames/TransportTycoonDeluxe +Exec=/var/home/bleggett/.local/bin/doscopy.sh TransportTycoonDeluxe Terminal=false Type=Application Icon=dosbox-staging diff --git a/share/applications/Ultima7DOSBOX.desktop b/share/applications/Ultima7DOSBOX.desktop index 0fbfd7a..4a41658 100644 --- a/share/applications/Ultima7DOSBOX.desktop +++ b/share/applications/Ultima7DOSBOX.desktop @@ -1,7 +1,6 @@ [Desktop Entry] Name=Ultima VII: The Black Gate (DOSBOX) -Exec=flatpak run io.github.dosbox-staging -Path=/mnt/Games/DOSGames/Ultima7 +Exec=/var/home/bleggett/.local/bin/doscopy.sh Ultima7 Terminal=false Type=Application Icon=dosbox-staging -- 2.54.0