From 097327f6e3ad8d2d94f6d3feb624479215b6e935 Mon Sep 17 00:00:00 2001 From: nilsding Date: Thu, 14 Aug 2014 20:43:37 +0200 Subject: [PATCH] added support for several BSDs --- resources/lua/intf/syncplay.lua | 1 + syncplay/constants.py | 4 +++- syncplay/players/vlc.py | 5 +++++ syncplay/ui/GuiConfiguration.py | 2 ++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/resources/lua/intf/syncplay.lua b/resources/lua/intf/syncplay.lua index 79eaa48..c86c9a9 100644 --- a/resources/lua/intf/syncplay.lua +++ b/resources/lua/intf/syncplay.lua @@ -21,6 +21,7 @@ Place the syncplay.lua file in the main (all user) VLC /lua/intf/ sub-directory: * Window: %ProgramFiles%\VideoLAN\VLC\lua\intf\ * Linux: /usr/lib/vlc/lua/intf/ * Mac OS X: /Applications/VLC.app/Contents/MacOS/share/lua/intf/ +* FreeBSD, OpenBSD etc.: /usr/local/lib/vlc/lua/intf/ You may also need to re-copy the syncplay.lua file when you update VLC. diff --git a/syncplay/constants.py b/syncplay/constants.py index 31613bf..01814c3 100644 --- a/syncplay/constants.py +++ b/syncplay/constants.py @@ -70,7 +70,9 @@ VLC_PATHS = [ r"C:\Program Files\VideoLAN\VLC\vlc.exe", "/usr/bin/vlc", "/usr/bin/vlc-wrapper", - "/Applications/VLC.app/Contents/MacOS/VLC" + "/Applications/VLC.app/Contents/MacOS/VLC", + "/usr/local/bin/vlc", + "/usr/local/bin/vlc-wrapper" ] VLC_ICONPATH = "vlc.png" diff --git a/syncplay/players/vlc.py b/syncplay/players/vlc.py index ba3145f..30d8bd0 100644 --- a/syncplay/players/vlc.py +++ b/syncplay/players/vlc.py @@ -256,6 +256,11 @@ class VlcPlayer(BasePlayer): elif sys.platform.startswith('darwin'): playerController.vlcIntfPath = "/Applications/VLC.app/Contents/MacOS/share/lua/intf/" playerController.vlcIntfUserPath = os.path.join(os.getenv('HOME', '.'), "Library/Application Support/org.videolan.vlc/lua/intf/") + elif 'bsd' in sys.platform or sys.platform.startswith('dragonfly'): + # *BSD ports/pkgs install to /usr/local by default. + # This should also work for all the other BSDs, such as OpenBSD or DragonFly. + playerController.vlcIntfPath = "/usr/local/lib/vlc/lua/intf/" + playerController.vlcIntfUserPath = os.path.join(os.getenv('HOME', '.'), ".local/share/vlc/lua/intf/") else: playerController.vlcIntfPath = os.path.dirname(playerPath).replace("\\", "/") + "/lua/intf/" playerController.vlcIntfUserPath = os.path.join(os.getenv('APPDATA', '.'), "VLC\\lua\\intf\\") diff --git a/syncplay/ui/GuiConfiguration.py b/syncplay/ui/GuiConfiguration.py index a10f506..5dc2960 100644 --- a/syncplay/ui/GuiConfiguration.py +++ b/syncplay/ui/GuiConfiguration.py @@ -131,6 +131,8 @@ class ConfigDialog(QtGui.QDialog): defaultdirectory = "/usr/bin" elif sys.platform.startswith('darwin'): defaultdirectory = "/Applications/" + elif "bsd" in sys.platform or sys.platform.startswith('dragonfly'): + defaultdirectory = "/usr/local/bin" fileName, filtr = QtGui.QFileDialog.getOpenFileName(self, "Browse for media player executable",