gentoo_catmeow_repo/www-client/palemoon-bin/files/palemoon-bin-r1.sh

77 lines
1.7 KiB
Bash
Raw Normal View History

2024-09-22 18:43:50 -07:00
#!/bin/bash
##
## Usage:
##
## $ palemoon-bin
##
## This script is meant to run Pale Moon in Gentoo.
cmdname=$(basename "$0")
##
## Variables
##
MOZ_ARCH=$(uname -m)
case ${MOZ_ARCH} in
x86_64|s390x|sparc64)
MOZ_LIB_DIR="@PREFIX@/lib64"
SECONDARY_LIB_DIR="@PREFIX@/lib"
;;
*)
MOZ_LIB_DIR="@PREFIX@/lib"
SECONDARY_LIB_DIR="@PREFIX@/lib64"
;;
esac
MOZ_FIREFOX_FILE="palemoon-bin"
MOZILLA_FIVE_HOME="@MOZ_FIVE_HOME@"
MOZ_PROGRAM="${MOZILLA_FIVE_HOME}/${MOZ_FIREFOX_FILE}"
##
## Set MOZ_APP_LAUNCHER for gnome-session
##
export MOZ_APP_LAUNCHER="@PREFIX@/bin/${cmdname}"
##
## Disable the GNOME crash dialog, Mozilla has its own
##
if [[ "${XDG_CURRENT_DESKTOP}" == "GNOME" ]]; then
GNOME_DISABLE_CRASH_DIALOG=1
export GNOME_DISABLE_CRASH_DIALOG
fi
##
## Enable Xinput2 (#617344)
##
# respect user settings
MOZ_USE_XINPUT2=${MOZ_USE_XINPUT2:-auto}
if [[ ${MOZ_USE_XINPUT2} == auto && -n ${WAYLAND_DISPLAY} ]]; then
# enabling XINPUT2 should be safe for all wayland users
MOZ_USE_XINPUT2=1
elif [[ ${MOZ_USE_XINPUT2} == auto && ${XDG_CURRENT_DESKTOP^^} == KDE ]]; then
# XINPUT2 is known to cause problems for KWin users
MOZ_USE_XINPUT2=0
elif [[ ${MOZ_USE_XINPUT2} == auto && ${XDG_CURRENT_DESKTOP^^} == LXQT ]]; then
# LXQt uses KWin
MOZ_USE_XINPUT2=0
elif [[ ${MOZ_USE_XINPUT2} == auto ]]; then
# should work on Mate, Xfce, FluxBox, OpenBox and all the others ...
MOZ_USE_XINPUT2=1
fi
[[ ${MOZ_USE_XINPUT2} != 0 ]] && export MOZ_USE_XINPUT2=${MOZ_USE_XINPUT2}
# Don't throw "old profile" dialog box.
export MOZ_ALLOW_DOWNGRADE=1
##
## Set special variables for -bin
export LD_LIBRARY_PATH="${MOZILLA_FIVE_HOME}"
export GTK_PATH="${MOZ_LIB_DIR}/gtk-3.0"
# Run the browser
exec ${MOZ_PROGRAM} "${@}"