Created
July 5, 2025 02:57
-
-
Save majick/3105b48a2cc49fbc446878eda8bcc6bb to your computer and use it in GitHub Desktop.
macOS command file to run DOSBox Staging on a particular DOS program
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # Yes, POSIX shell. Because I said so. | |
| # | |
| # Example: run Wing Commander 1 launcher | |
| COMMAND="LAUNCHER.BAT" | |
| MYDIR=$(dirname -- $0) | |
| nohup /Applications/DOSBox\ Staging.app/Contents/MacOS/dosbox -exit ${MYDIR}/${COMMAND} 2> /dev/null > /dev/null & | |
| # The magic incantation to: | |
| # a. Make Terminal willing to close windows | |
| # b. Quit the terminal after this .command file runs | |
| # c. Get rid of Terminal from the Recent Apps list (because nobody runs Terminal) | |
| # | |
| # We're being clever with subshells here because Terminal doesn't want to die. | |
| # | |
| # Terminal is a piece of shit. | |
| # | |
| # a. Fuck this default pref of leaving dead windows. | |
| defaults export com.apple.Terminal - \ | |
| | plutil -replace "Window Settings".Basic.shellExitAction -integer 1 -o - - \ | |
| | defaults import com.apple.Terminal | |
| # b. call applescript host to kill the fucking terminal, which will now die. | |
| ( sleep 1; osascript -e 'tell application "Terminal" to quit' 2> /dev/null >/dev/null & ) | |
| # c. Get rid of the ugly and confusing icon. Requires dockutil. Skipped if not present. | |
| if [ $(which dockutil) ] ; then | |
| ( nohup dockutil --remove Terminal 2> /dev/null > /dev/null & ) | |
| fi | |
| # TODO: just make command files only ever run in iTerm. Except iTerm pops a tab instead of | |
| # a window which is hot garbage. Tabbed terminal windows are trash. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment