Pobega / com.fightcade.Fightcade-ARCHIVE

ARCHIVED - go to flathub/com.fightcade.Fightcade
https://github.com/flathub/com.fightcade.Fightcade
GNU General Public License v2.0
2 stars 0 forks source link

Support fcade:// URIs #19

Closed Pobega closed 4 years ago

Pobega commented 4 years ago

Without this registered Fightcade has no clue how to open the emulator.

Pobega commented 4 years ago

Seems that something like this would work: xdg-settings set default-url-scheme-handler fcade com.fightcade.Fightcade.desktop

The official application does this:

# register fcade:// url handlers
if [ -x /usr/bin/xdg-mime ]; then
        mkdir -p ~/.local/share/applications/
        echo "[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Fightcade Replay
Exec=${THIS_SCRIPT_DIR}/emulator/fcade.sh %U
Terminal=false
MimeType=x-scheme-handler/fcade
" > ~/.local/share/applications/fcade-quark.desktop
        xdg-mime default fcade-quark.desktop x-scheme-handler/fcade
        sed -i "s:Icon=.*:Icon=${THIS_SCRIPT_DIR}/fc2-electron/resources/app/icon.png:" ./Fightcade.desktop
        cat ./Fightcade.desktop |sed -e "s:Exec=.*:Exec=${THIS_SCRIPT_DIR}/Fightcade2.sh:" > ~/.local/share/applications/Fightcade.desktop
fi     
if [ -x /usr/bin/gconftool-2 ]; then
        gconftool-2 -t string -s /desktop/gnome/url-handlers/fcade/command "${THIS_SCRIPT_DIR}/emulator/fcade.sh %s"
        gconftool-2 -s /desktop/gnome/url-handlers/fcade/needs_terminal false -t bool
        gconftool-2 -t bool -s /desktop/gnome/url-handlers/fcade/enabled true
fi

Based on: https://github.com/flathub/org.qbittorrent.qBittorrent/issues/3#issuecomment-421555525

Pobega commented 4 years ago

It looks like upstream ships two desktop files; one for Fightcade itself and one for fcade-quark which is launches the emulators via Wine.

I'm not sure if a Flatpak is allowed to expose multiple binaries via multiple desktop files or if we'll have to break the Flatpak up into two; one for the main electron UI and one with wine that can launch emulators (so an fcade-quark Flatpak)

Pobega commented 4 years ago

It seems like a single Flatpak can export multiple desktop files; crumbs at https://github.com/flatpak/flatpak/issues/750