From a9172f9fa66a8eff488a76b209015411ef641ddb Mon Sep 17 00:00:00 2001 From: Alberto Sottile Date: Mon, 20 May 2019 11:26:35 +0200 Subject: [PATCH] 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 --- syncplay/constants.py | 3 ++- syncplay/players/vlc.py | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/syncplay/constants.py b/syncplay/constants.py index 303df49..7d63c03 100755 --- a/syncplay/constants.py +++ b/syncplay/constants.py @@ -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" diff --git a/syncplay/players/vlc.py b/syncplay/players/vlc.py index 4f117e3..712387c 100755 --- a/syncplay/players/vlc.py +++ b/syncplay/players/vlc.py @@ -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(