solarus
solarus copied to clipboard
Solarus Launcher auto-add system-wide installed games
What about auto-adding all games from
DATADIR/solarus/[game]
automatically to the launcher? Else all system-wide installed games won't appear by default.
Good idea yes. There is no way to know a valid quests data directory for sure, but we can make guesses.
This is what I personally use (for now) as wrapper script:
#!/bin/sh
config="${HOME}/.config/solarus/solarus.conf"
if [ ! -f "${config}" ]; then
mkdir -p "$(dirname "${config}")"
echo "[General]
last_quest=" >> "${config}"
fi
old_qp="$(awk -F= '/^quests_paths/{print $2}' "${config}")"
new_qp=""
for game in /usr/share/solarus/*; do
new_qp="${game}, ${new_qp}"
done
merged_qp=$(echo "${old_qp}, ${new_qp}" | tr ' ' '\n' | sort -u | tr '\n' ' ')
sed '/^quests_paths/d' -i "${config}"
echo "quests_paths=${merged_qp}" >> "${config}"
sed -e 's/,[ \t]*$//' -i "${config}"
solarus.real "${@}"
/usr/bin/solarus is my wrapper script /usr/bin/solarus.real is the actual solarus launcher
there might be better ways to achieve that, but for me that's enough for now.
As of right now, I am adding each quest that has a Debian package using the terminal switch in the package's install script.
If we wanted, we could put a "scan system directories" button that would add all quests in that directory at the user's request.
See here, line 22: https://github.com/Nate-Devv/solarus-debian-source/blob/master/zsdx/debian/postinst
I didn't know about the -add switch, fancy. Thanks.
Am 27. Juli 2017 10:12:39 MESZ schrieb Nathan Moore [email protected]:
See here, line 22: https://github.com/Nate-Devv/solarus-debian-source/blob/master/zsdx/debian/postinst
-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/solarus-games/solarus/issues/964#issuecomment-318291545
-- Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.
Yeah, that switch is relatively new.