summaryrefslogtreecommitdiff
path: root/backend/decky_loader/localplatform/localplatformmac.py
blob: df8a5d16035f36f5c7af2e7e5ea06a2a179bed60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
from ..enums import UserType
import os, sys
from . import localplatformlinux

# this should be public
def _get_effective_user_id() -> int:
    return os.geteuid()

def chown(path : str,  user : UserType = UserType.HOST_USER, recursive : bool = True) -> bool:
    return localplatformlinux.chown(path, user, recursive)

def chmod(path : str, permissions : int, recursive : bool = True) -> bool:
    return localplatformlinux.chmod(path, permissions, recursive)

def file_owner(path : str) -> UserType|None:
    return localplatformlinux.file_owner(path)

def get_home_path(user : UserType = UserType.HOST_USER) -> str:
    return localplatformlinux.get_home_path(user)

def setgid(user : UserType = UserType.HOST_USER):
    return localplatformlinux.setgid(user)

def setuid(user : UserType = UserType.HOST_USER):
    return localplatformlinux.setuid(user)

async def service_active(service_name : str) -> bool:
    return True # Stubbed

async def service_stop(service_name : str) -> bool:
    return True # Stubbed

async def service_start(service_name : str) -> bool:
    return True # Stubbed

async def service_restart(service_name : str, block : bool = True) -> bool:
    return True # Stubbed

def get_effective_username() -> str:
    return localplatformlinux.get_effective_username()

def get_username() -> str:
    return localplatformlinux.get_username()

def get_privileged_path() -> str:
    '''On Mac, privileged_path is equal to unprivileged_path'''
    return get_unprivileged_path()

def get_unprivileged_path() -> str:
    return localplatformlinux.get_unprivileged_path()

def get_unprivileged_user() -> str:
    return localplatformlinux.get_unprivileged_user()

async def restart_webhelper() -> bool:
    return await localplatformlinux.restart_webhelper()

async def close_cef_socket():
    return # Stubbed