Support for Snap VLC on Linux

Add the snap VLC path to the discovery list and automatically copy
our lua script in the correct path for snap installations.

Fixes: #222
This commit is contained in:
Alberto Sottile 2019-05-20 11:26:35 +02:00
parent 7862c27d54
commit a9172f9fa6
2 changed files with 8 additions and 3 deletions

View File

@ -162,7 +162,8 @@ VLC_PATHS = [
"/usr/bin/vlc-wrapper",
"/Applications/VLC.app/Contents/MacOS/VLC",
"/usr/local/bin/vlc",
"/usr/local/bin/vlc-wrapper"
"/usr/local/bin/vlc-wrapper",
"/snap/bin/vlc"
]
VLC_ICONPATH = "vlc.png"

View File

@ -340,8 +340,12 @@ class VlcPlayer(BasePlayer):
else:
call.append(self.__playerController.getMRL(filePath))
if isLinux():
playerController.vlcIntfPath = "/usr/lib/vlc/lua/intf/"
playerController.vlcIntfUserPath = os.path.join(os.getenv('HOME', '.'), ".local/share/vlc/lua/intf/")
if 'snap' in playerPath:
playerController.vlcIntfPath = '/snap/vlc/current/usr/lib/vlc/lua/intf/'
playerController.vlcIntfUserPath = os.path.join(os.getenv('HOME', '.'), "snap/vlc/current/.local/share/vlc/lua/intf/")
else:
playerController.vlcIntfPath = "/usr/lib/vlc/lua/intf/"
playerController.vlcIntfUserPath = os.path.join(os.getenv('HOME', '.'), ".local/share/vlc/lua/intf/")
elif isMacOS():
playerController.vlcIntfPath = "/Applications/VLC.app/Contents/MacOS/share/lua/intf/"
playerController.vlcIntfUserPath = os.path.join(