munix: set wayland/pw/portal enablement variables for toolkits by default
This commit is contained in:
parent
8113c269cb
commit
a82b0de310
2 changed files with 33 additions and 2 deletions
22
munix
22
munix
|
|
@ -14,6 +14,7 @@ GPU=1
|
||||||
WAYLAND=1
|
WAYLAND=1
|
||||||
PIPEWIRE=1
|
PIPEWIRE=1
|
||||||
X11=0
|
X11=0
|
||||||
|
ENV_DEFAULTS=1
|
||||||
USING_PUBLISH=0
|
USING_PUBLISH=0
|
||||||
export TMP=/tmp TMPDIR=/tmp TEMP=/tmp TEMPDIR=/tmp LC_ALL=C
|
export TMP=/tmp TMPDIR=/tmp TEMP=/tmp TEMPDIR=/tmp LC_ALL=C
|
||||||
|
|
||||||
|
|
@ -28,6 +29,7 @@ while [ "$#" -gt 0 ]; do
|
||||||
--no-gpu) GPU=0; shift 1;;
|
--no-gpu) GPU=0; shift 1;;
|
||||||
--no-wayland) WAYLAND=0; shift 1;;
|
--no-wayland) WAYLAND=0; shift 1;;
|
||||||
--no-pipewire) PIPEWIRE=0; shift 1;;
|
--no-pipewire) PIPEWIRE=0; shift 1;;
|
||||||
|
--no-env-defaults) ENV_DEFAULTS=0; shift 1;;
|
||||||
--x11) X11=1; shift 1;;
|
--x11) X11=1; shift 1;;
|
||||||
-b|--bind) BWRAP_ARGS+=("--bind" "$2" "$3"); shift 3;;
|
-b|--bind) BWRAP_ARGS+=("--bind" "$2" "$3"); shift 3;;
|
||||||
--ro-bind) BWRAP_ARGS+=("--ro-bind" "$2" "$3"); shift 3;;
|
--ro-bind) BWRAP_ARGS+=("--ro-bind" "$2" "$3"); shift 3;;
|
||||||
|
|
@ -125,6 +127,15 @@ if [ "$WAYLAND" -eq 1 ]; then
|
||||||
"--setenv" "WAYLAND_DISPLAY" "$WAYLAND_DISPLAY"
|
"--setenv" "WAYLAND_DISPLAY" "$WAYLAND_DISPLAY"
|
||||||
)
|
)
|
||||||
MUVM_ARGS+=("-e" "WAYLAND_DISPLAY=wayland-1") # the proxy is managed by us, not muvm
|
MUVM_ARGS+=("-e" "WAYLAND_DISPLAY=wayland-1") # the proxy is managed by us, not muvm
|
||||||
|
if [ "$ENV_DEFAULTS" -eq 1 ]; then
|
||||||
|
MUVM_ARGS+=(
|
||||||
|
"-e" "XDG_SESSION_TYPE=wayland"
|
||||||
|
"-e" "SDL_VIDEODRIVER=wayland"
|
||||||
|
"-e" "QT_QPA_PLATFORM=wayland"
|
||||||
|
"-e" "_JAVA_AWT_WM_NONREPARENTING=1" # e.g. with xwayland-satellite
|
||||||
|
"-e" "ELECTRON_OZONE_PLATFORM_HINT=wayland" # 28 < Electron < 39; newer should work by default
|
||||||
|
)
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$PIPEWIRE" -eq 1 ]; then
|
if [ "$PIPEWIRE" -eq 1 ]; then
|
||||||
|
|
@ -142,6 +153,11 @@ if [ "$PIPEWIRE" -eq 1 ]; then
|
||||||
PIPEWIRE_REMOTE=pipewire-0
|
PIPEWIRE_REMOTE=pipewire-0
|
||||||
fi
|
fi
|
||||||
BWRAP_ARGS+=("--bind" "$PIPEWIRE_RUNTIME_DIR/$PIPEWIRE_REMOTE" "$PIPEWIRE_RUNTIME_DIR/$PIPEWIRE_REMOTE")
|
BWRAP_ARGS+=("--bind" "$PIPEWIRE_RUNTIME_DIR/$PIPEWIRE_REMOTE" "$PIPEWIRE_RUNTIME_DIR/$PIPEWIRE_REMOTE")
|
||||||
|
if [ "$ENV_DEFAULTS" -eq 1 ]; then
|
||||||
|
MUVM_ARGS+=(
|
||||||
|
"-e" "SDL_AUDIO_DRIVER=pipewire"
|
||||||
|
)
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$X11" -eq 1 ]; then
|
if [ "$X11" -eq 1 ]; then
|
||||||
|
|
@ -178,6 +194,12 @@ BWRAP_ARGS+=(
|
||||||
--bind "$HOST_RUNTIME_DIR" /mnt/munix-doc-portal
|
--bind "$HOST_RUNTIME_DIR" /mnt/munix-doc-portal
|
||||||
--bind "$HOST_RUNTIME_DIR/port.sock" "$XDG_RUNTIME_DIR/krun/socket/port-50000"
|
--bind "$HOST_RUNTIME_DIR/port.sock" "$XDG_RUNTIME_DIR/krun/socket/port-50000"
|
||||||
)
|
)
|
||||||
|
if [ "$ENV_DEFAULTS" -eq 1 ]; then
|
||||||
|
MUVM_ARGS+=(
|
||||||
|
"-e" "GTK_USE_PORTAL=1" # GTK 3 including Firefox
|
||||||
|
"-e" "QT_QPA_PLATFORMTHEME=xdgdesktopportal"
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$USING_PUBLISH" -eq 1 ]; then
|
if [ "$USING_PUBLISH" -eq 1 ]; then
|
||||||
printf "\n\n\n\e[1mNote: due to a \e[31mBUG\e[39m with port publishing (-p) you have to send the first outgoing packet (e.g. ping -c1 8.8.8.8) before your ports start receiving traffic. Sorry for the inconvenience!\e[39;0m\n\n\n\n" >&2
|
printf "\n\n\n\e[1mNote: due to a \e[31mBUG\e[39m with port publishing (-p) you have to send the first outgoing packet (e.g. ping -c1 8.8.8.8) before your ports start receiving traffic. Sorry for the inconvenience!\e[39;0m\n\n\n\n" >&2
|
||||||
|
|
|
||||||
|
|
@ -177,10 +177,19 @@ in
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "exec";
|
Type = "exec";
|
||||||
PassEnvironment = [
|
PassEnvironment = [
|
||||||
"TERM"
|
|
||||||
"MESA_LOADER_DRIVER_OVERRIDE"
|
"MESA_LOADER_DRIVER_OVERRIDE"
|
||||||
"MUVM_REMOTE_CONFIG"
|
"MUVM_REMOTE_CONFIG"
|
||||||
]; # "KRUN_CONFIG"];
|
# "KRUN_CONFIG"
|
||||||
|
|
||||||
|
"TERM"
|
||||||
|
"XDG_SESSION_TYPE"
|
||||||
|
"SDL_VIDEODRIVER"
|
||||||
|
"QT_QPA_PLATFORM"
|
||||||
|
"_JAVA_AWT_WM_NONREPARENTING"
|
||||||
|
"ELECTRON_OZONE_PLATFORM_HINT"
|
||||||
|
"GTK_USE_PORTAL"
|
||||||
|
"QT_QPA_PLATFORMTHEME"
|
||||||
|
];
|
||||||
Environment = [
|
Environment = [
|
||||||
"WAYLAND_DISPLAY=wayland-1"
|
"WAYLAND_DISPLAY=wayland-1"
|
||||||
"DBUS_SESSION_BUS_ADDRESS=unix:path=${runtimeDir}/dbus.sock"
|
"DBUS_SESSION_BUS_ADDRESS=unix:path=${runtimeDir}/dbus.sock"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue