Move .desktop file creation to install_emulators

I don't like how this is done, but I don't like any part of how the
emulators are handled right now.  At least the mess is in the right spot
now, save for the thing that conditionally execs a login shell to make
sure gsport groups take effect at the end.  That whole restart thing is
also a mess I haven't thought about yet.
This commit is contained in:
T. Joseph Carter 2018-05-06 03:42:05 -07:00
parent 602b4f5fba
commit 099f5b3f44
2 changed files with 39 additions and 13 deletions

View File

@ -181,6 +181,44 @@ install_linapple() {
sudo install -o root -g root -m 755 "$a2cSource/setup/linapple" /usr/local/bin/linapple
}
install_desktop() {
# FIXME: HACK HACK HACK! We're only messing with ~/Desktop in the least
# because I'm not 100% sure that if we put things in the menu that you'll
# get them. Didn't used to be the case. If that's changed, we should stop.
mkdir -p ~/Desktop
sudo mkdir -p /usr/local/share/applications
# FIXME: Is there a reason we're running these in a lxterminal with Terminal=false
if [[ -f /usr/local/bin/gsport ]]; then
sudo tee /usr/local/share/applications/gsport.desktop > ~/Desktop/gsport.desktop <<-EOF
[Desktop Entry]
Name=GSport
Comment=Apple IIgs Emulator
Exec=lxterminal -e /usr/local/bin/gsport
Icon=/usr/local/share/gsport32.ico
Terminal=false
Type=Application
Categories=AppleII
EOF
if [[ ! -f /usr/local/share/gsport32.ico ]]; then
sudo wget -O /usr/local/share/gsport32.ico https://raw.githubusercontent.com/david-schmidt/gsport/master/src/gsport32.ico
fi
fi
# LinApple:
if [[ -f /usr/local/bin/linapple ]]; then
sudo tee /usr/local/share/applications/linapple.desktop > ~/Desktop/linapple.desktop <<-EOF
[Desktop Entry]
Name=LinApple
Comment=Apple IIe Emulator
Exec=lxterminal -e /usr/local/bin/linapple
Icon=/usr/local/linapple/icon.bmp
Terminal=false
Type=Application
Categories=AppleII
EOF
fi
}
noPicoPkg=
slot6=
@ -198,6 +236,7 @@ while [[ $1 ]]; do
done
install_gsport
install_linapple
install_user_desktop
### Emulators: Set Groups
sudo usermod -a -G audio,video,netdev,gsport,plugdev $USER &> /dev/null

View File

@ -740,19 +740,6 @@ if [[ -f /usr/bin/X ]]; then
sudo rm /etc/xdg/autostart/lxterminal.desktop 2> /dev/null
mkdir -p ~/Desktop
# GSport:
if [[ -f /usr/bin/gsport ]]; then
echo -e "[Desktop Entry]\nName=GSport\nComment=Apple IIgs Emulator\nExec=lxterminal -e /usr/bin/gsport\nIcon=/usr/local/share/gsport32.ico\nTerminal=false\nType=Application\nCategories=AppleII\n" | sudo tee /usr/share/raspi-ui-overrides/gsport.desktop > ~/Desktop/gsport.desktop
elif [[ -f /usr/local/bin/gsport ]]; then
echo -e "[Desktop Entry]\nName=GSport\nComment=Apple IIgs Emulator\nExec=lxterminal -e /usr/local/bin/gsport\nIcon=/usr/local/share/gsport32.ico\nTerminal=false\nType=Application\nCategories=AppleII\n" | sudo tee /usr/share/raspi-ui-overrides/gsport.desktop > ~/Desktop/gsport.desktop
fi
if [[ ! -f /usr/local/share/gsport32.ico ]]; then
sudo wget -qO /usr/local/share/gsport32.ico "${a2cBinaryURL}/gsport/gsport32.ico"
fi
# LinApple:
if [[ -f /usr/local/bin/linapple ]]; then
echo -e "[Desktop Entry]\nName=LinApple\nComment=Apple IIe Emulator\nExec=lxterminal -e /usr/local/bin/linapple\nIcon=/usr/local/linapple/icon.bmp\nTerminal=false\nType=Application\nCategories=AppleII\n" | sudo tee /usr/share/raspi-ui-overrides/linapple.desktop > ~/Desktop/linapple.desktop
fi
# ADTPro Server:
if [[ -f /usr/local/bin/adtpro.sh ]]; then
echo -e "[Desktop Entry]\nName=ADTPro Server\nComment=Floppy Transfer Utility\nExec=/usr/local/bin/adtpro.sh\nIcon=/usr/local/adtpro/lib/ADTPro.ico\nTerminal=false\nType=Application\nCategories=AppleII\n" | sudo tee /usr/share/raspi-ui-overrides/adtproserver.desktop > ~/Desktop/adtproserver.desktop