#!/bin/fish set parts (string split / $argv[1]) set protocol $parts[1] set action $parts[3] set arg (string join / $parts[4..]) function die notify-send -u critical 'Jellynative Error' $argv[1] exit 1 end if not test $protocol = "jellynative:" die "Wrong protocol" end function player if which mpv &>/dev/null set playercommand mpv else if which vlc &>/dev/null set playercommand vlc else die "No Media Player detected" end notify-send -u low -t 1000 Jellynative 'Player ist launching...' if not $playercommand $argv[2..] $argv[1] die "Player exited with error code" end end switch $action case player player $arg case player-fullscreen player $arg --fullscreen case '*' die "Unknown action" end