Skip to content

Commit

Permalink
BF: Adjust terminal command in open theme folder for different platfo…
Browse files Browse the repository at this point in the history
…rms, fixes #3271
  • Loading branch information
Todd authored and peircej committed Nov 13, 2020
1 parent 5c75ce8 commit 7bac129
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion psychopy/app/themes/_themes.py
Expand Up @@ -1006,7 +1006,15 @@ def __init__(self, frame):
frame.Bind(wx.EVT_MENU, self.openThemeFolder, item)

def openThemeFolder(self, event):
subprocess.call("explorer %(themes)s" % prefs.paths, shell=True)
# Choose a command according to OS
if sys.platform in ['win32']:
comm = "explorer"
elif sys.platform in ['darwin']:
comm = "open"
elif sys.platform in ['linux', 'linux2']:
comm = "dolphin"
# Use command to open themes folder
subprocess.call(f"{comm} {prefs.paths['themes']}", shell=True)

def _applyAppTheme(self):
for item in self.GetMenuItems():
Expand Down

0 comments on commit 7bac129

Please sign in to comment.