Skip to content

Commit

Permalink
Two small OpenBSD support improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Rane committed Jan 4, 2025
1 parent d5dae89 commit 79c818f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions jellyfin_mpv_shim/conffile.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def win32(app: str):

confdirs = (
("linux", posix),
("openbsd", posix),
("win32", win32),
("cygwin", posix),
(
Expand Down
16 changes: 10 additions & 6 deletions jellyfin_mpv_shim/gui_mgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def _show_file_darwin(path: str):
subprocess.Popen(["open", path])


def _show_file_linux(path: str):
def _show_file_xdg(path: str):
subprocess.Popen(["xdg-open", path])


Expand All @@ -33,14 +33,18 @@ def _show_file_win32(path: str):


_show_file_func = {
"darwin": _show_file_darwin,
"linux": _show_file_linux,
"win32": _show_file_win32,
"cygwin": _show_file_win32,
"darwin": _show_file_darwin,
"linux": _show_file_xdg,
"openbsd": _show_file_xdg,
"win32": _show_file_win32,
"cygwin": _show_file_win32,
}

try:
show_file = _show_file_func[sys.platform]
show_file = None
for platform, func in _show_file_func.items():
if sys.platform.startswith(platform):
show_file = func

def open_config():
show_file(confdir(APP_NAME))
Expand Down

0 comments on commit 79c818f

Please sign in to comment.