Skip to content

Commit

Permalink
selectively parse /etc/X11/Xsession.d files
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Schleizer committed Oct 31, 2020
1 parent 36e3a48 commit f7a70b4
Showing 1 changed file with 32 additions and 4 deletions.
36 changes: 32 additions & 4 deletions usr/bin/sandbox-app-launcher
Expand Up @@ -32,6 +32,26 @@ wx_whitelist="${main_app_dir}/wx_whitelist"
shared_dir="${appdata_dir}/shared"
bwrap_args=""

xsession_d_file_list_executable=(
/etc/X11/Xsession.d/20torbrowser
/etc/X11/Xsession.d/20uwt
/etc/X11/Xsession.d/20whonix
/etc/X11/Xsession.d/20whonix-welcome-page
/etc/X11/Xsession.d/40open_link_confirmation
/etc/X11/Xsession.d/40open_link_confirmation_kde
/etc/X11/Xsession.d/50anon-apps-config
/etc/X11/Xsession.d/50default_editor
/etc/X11/Xsession.d/50tb_default_browser
/etc/X11/Xsession.d/50torbrowser_default_browser
/etc/X11/Xsession.d/50security-misc
)

xsession_d_file_list_existing=(
/etc/X11/Xsession.d/20qt-gnome-desktop-session-id
/etc/X11/Xsession.d/20qt-x11-no-mitshm
/etc/X11/Xsession.d/25xdg-qubes-settings
)

if [ "${app_name}" = "torbrowser" ]; then
app_path="${app_homedir}/.tb/tor-browser/Browser/start-tor-browser"
fi
Expand Down Expand Up @@ -145,13 +165,21 @@ setup() {
wrapper_dir="${wrapper_dir_wx}"
fi

## Create wrappers.
## Create wrapper.
cat <<EOF > "${wrapper_script}"
#!/bin/bash
if [ -x /etc/X11/Xsession.d/20torbrowser ]; then
source /etc/X11/Xsession.d/20torbrowser
fi
for file_name in $xsession_d_file_list_executable ; do
if [ -x "$file_name" ]; then
source "$file_name"
fi
done
for file_name in $xsession_d_file_list_existing ; do
if [ -x "$file_name" ]; then
source "$file_name"
fi
done
dbus-launch
"${app_path}" "\${@}" 1>/dev/null
Expand Down

0 comments on commit f7a70b4

Please sign in to comment.