Re: [hatari-devel] Feature wish: preset machine setups

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Am Sun, 18 Dec 2016 20:38:10 +1000
schrieb Miro Kropáček <miro.kropacek@xxxxxxxxx>:

> > that's something I already think about, but it's true it's not
> > coded yet :)
> >
> That's really great to hear. :)
> 
> 
> 
> > In the meantime, you can create different hatari.cfg files and start
> > Hatari with a different config file.
> >
> I guess I will, I must finally force myself to create them.
> 

Hi all,

i am actually using exactly the variable config file method together
with a small selector. My menu and MIME types only link to a script
file. This runs the actual hatari binary with a symlinked config file.

This way I select a configuration once and until change it stays.

#!/bin/sh
# Hatari Runner v0.1
# (c) 2014 by Matthias Arndt / ASM Software    <marndt@xxxxxxxxxxxxxx>
# THIS SCRIPT IS FREE SOFTWARE AND SUPPLIED WITHOUT WARRANTY.
#
# This executes Hatari emulator with given arguments and supplied image
names # The configuration in use is .hatari/run-hatari.cfg which is a
symbolic link. #
CONFIGFILE=$HOME/.hatari/run-hatari.cfg
if [ ! -e $CONFIGFILE ]
then
	zenity --error --title "run-hatari.sh" --text "Configuration
file does not exist." exit 1
fi

exec hatari -f --confirm-quit n -c $CONFIGFILE "$@" 

$CONFIGFILE is actually a symlink to an actual config file managed with
a small script with menu:

#!/bin/sh
# Hatari Runner v0.1
# (c) 2014 by Matthias Arndt / ASM Software    <marndt@xxxxxxxxxxxxxx>
# THIS SCRIPT IS FREE SOFTWARE AND SUPPLIED WITHOUT WARRANTY.
#
# This executes Hatari emulator with given arguments and supplied image
names
# The configuration in use is .hatari/run-hatari.cfg which is a
symbolic link.
#
CONFIGDIR=$HOME/.hatari
CONFIGFILE=${CONFIGDIR}/run-hatari.cfg

rm -f $CONFIGFILE

SELECTION=$(zenity --width 700 --height 500 --list \
  --title="Select configuration for run-hatari.sh" \
  --column="Short" --column="Description" \
520stm.cfg "Atari 520STM TOS1.0 512K" \
520stm_sf354.cfg "Atari 520STM TOS1.0 512K with SF354" \
1040stf.cfg "Atari 1040STF TOS1.02 1MB" \
1040stfm.cfg "Atari 1040STFM TOS1.04 1MB" \
1040ste.cfg "Atari 1040STE TOS1.62 1MB" \
4160ste.cfg "Atari 1040STE TOS2.06 4MB")

SOURCE=${CONFIGDIR}/${SELECTION}

if [ -f ${SOURCE} ]
then
	ln -s ${SOURCE} ${CONFIGFILE}
else
zenity --error --text "File ${SOURCE} does not exist!"
exit 2
fi

Regards,
Matthias

-- 
http://final-memory.org/



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/