mirror of
https://github.com/aclist/dztui.git
synced 2026-10-25 12:12:31 +01:00
feat: add override module
This commit is contained in:
1 parent
1440871819
commit
d9d3f747bb
1 file changed
+29
@@ -0,0 +1,29 @@
|
|||||||
|
import logging
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
from dzgui.const.constants import APP_NAME, FLATPAK_APPID, GTK_APP_ID
|
||||||
|
|
||||||
|
logger = logging.getLogger(APP_NAME)
|
||||||
|
|
||||||
|
|
||||||
|
def apply_overrides(xdg: dict[str, str]) -> None:
|
||||||
|
try:
|
||||||
|
# NOTE: D-Bus registration required for sandbox
|
||||||
|
args = [
|
||||||
|
"flatpak",
|
||||||
|
"--user",
|
||||||
|
"override" f"--own-name={GTK_APP_ID}",
|
||||||
|
FLATPAK_APPID,
|
||||||
|
]
|
||||||
|
subprocess.run([*args], capture_output=True)
|
||||||
|
|
||||||
|
for path in xdg.values():
|
||||||
|
args = [
|
||||||
|
"flatpak",
|
||||||
|
"--user",
|
||||||
|
"override" f"--filesystem={path}",
|
||||||
|
FLATPAK_APPID,
|
||||||
|
]
|
||||||
|
subprocess.run([*args], capture_output=True)
|
||||||
|
except Exception as e:
|
||||||
|
logger.critical(e)
|
||||||
Reference in new issue
Block a user