Commit 990dbf06 authored by intrigeri's avatar intrigeri

Fix the name and icon of the Unsafe Browser in the top bar in non-English languages (refs: #15708)

parent 9baca2e3
...@@ -267,14 +267,14 @@ run_browser_in_chroot () { ...@@ -267,14 +267,14 @@ run_browser_in_chroot () {
local browser_name="${2}" local browser_name="${2}"
local chroot_user="${3}" local chroot_user="${3}"
local local_user="${4}" local local_user="${4}"
local human_readable_name="${5}" local wm_class="${5}"
local profile="$(browser_profile_dir ${browser_name} ${chroot_user})" local profile="$(browser_profile_dir ${browser_name} ${chroot_user})"
sudo -u "${local_user}" xhost "+SI:localuser:${chroot_user}" sudo -u "${local_user}" xhost "+SI:localuser:${chroot_user}"
chroot "${chroot}" sudo -u "${chroot_user}" /bin/sh -c \ chroot "${chroot}" sudo -u "${chroot_user}" /bin/sh -c \
". /usr/local/lib/tails-shell-library/tor-browser.sh && \ ". /usr/local/lib/tails-shell-library/tor-browser.sh && \
exec_firefox -DISPLAY='${DISPLAY}' \ exec_firefox -DISPLAY='${DISPLAY}' \
--class='${human_readable_name}' \ --class='${wm_class}' \
-profile '${profile}'" -profile '${profile}'"
sudo -u "${local_user}" xhost "-SI:localuser:${chroot_user}" sudo -u "${local_user}" xhost "-SI:localuser:${chroot_user}"
} }
...@@ -112,9 +112,13 @@ else ...@@ -112,9 +112,13 @@ else
fi fi
echo "* Starting Unsafe Browser" echo "* Starting Unsafe Browser"
# Do not localize the 5th argument: it becomes WM_CLASS and then GNOME
# displays the localized app name found in the matching .desktop file;
# if WM_CLASS were localized then not only string encoding problems
# would happen, but GNOME would pick the wrong icon.
run_browser_in_chroot "${CHROOT}" "${BROWSER_NAME}" "${BROWSER_USER}" \ run_browser_in_chroot "${CHROOT}" "${BROWSER_NAME}" "${BROWSER_USER}" \
"${SUDO_USER}" \ "${SUDO_USER}" \
"${HUMAN_READABLE_NAME}" || \ 'Unsafe Browser' || \
error "`gettext \"Failed to run browser.\"`" error "`gettext \"Failed to run browser.\"`"
echo "* Exiting the Unsafe Browser" echo "* Exiting the Unsafe Browser"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment