/usr/bin/palemoon: a few hacks

Users and developers helping users with generic and technical Pale Moon issues on all operating systems.

Moderator: trava90

Forum rules
This board is for technical/general usage questions and troubleshooting for the Pale Moon browser only.
Technical issues and questions not related to the Pale Moon browser should be posted in other boards!
Please keep off-topic and general discussion out of this board, thank you!
Kriton
Moongazer
Moongazer
Posts: 13
Joined: 2014-04-30, 05:31
Location: Greece

/usr/bin/palemoon: a few hacks

Unread post by Kriton » 2014-04-30, 06:01

Here's a slightly more elaborate version of /usr/bin/palemoon that I use under Fedora 20, which contains information gleaned from Fedora's startup script for Firefox:

Code: Select all

#!/bin/sh

PM_PLUGIN_PATH="/usr/lib64/mozilla/plugins-wrapped:/usr/lib64/firefox/plugins-wrapped"
if [ -z "$MOZ_PLUGIN_PATH" ]; then
    export MOZ_PLUGIN_PATH="$PM_PLUGIN_PATH"
else
    export MOZ_PLUGIN_PATH="$MOZ_PLUGIN_PATH:$PM_PLUGIN_PATH"
fi

PM_GTKRC_KDE="/usr/local/etc/gtkrc-2.0-kde4-pm"
if [ -r "$PM_GTKRC_KDE" ]; then
    export GTK2_RC_FILES="$PM_GTKRC_KDE"
fi

exec /opt/palemoon/palemoon "$@"
/usr/lib64/mozilla/plugins-wrapped contains, in addition to symbolic links to the plugins in /usr/lib64/mozilla/plugins, one additional plugin: npwrapper.so. This plugin allows the use of 32-bit plugins under 64-bit browsers, which is something that one might want. In the past, e.g., when no 64-bit flash plugin was available, it would make flash available using the 32-bit plugin.

/usr/lib64/firefox/plugins-wrapped does not exist on my system, but, since Firefox uses it, it is, presumably, a location where plugins might also end up, so it's better to play it safe and include it in the plugin path.

The second part of the script shows how I got around the problem of PM crashing if the oxygen gtk theme is used. Since I didn't want to stop using oxygen on my desktop, I switched temporarily to another theme, copied ~/.gtkrc-2.0-kde4 to another location, and had PM_GTKRC_KDE point to that copy in /usr/bin/palemoon. I then switched back to oxygen and, hey, presto, I get to use oxygen with all programs except Pale Moon, which uses a different theme!

If you choose to do it this way, you probably want to use a version of .gtkrc-2.0-kde4 that was created on your system, as my version is probably Fedora-specific, but here it is, for completeness:

Code: Select all

# This file was written by KDE
# You can edit it in the KDE control center, under "GTK Styles and Fonts"

include "/usr/share/themes/BlueMenta/gtk-2.0/gtkrc"

style "user-font"
{
        font_name="Sans Serif"
}
widget_class "*" style "user-font"

gtk-theme-name="BlueMenta"
gtk-font-name="Sans Serif 10"
I reversed the polarity of the neutron flow...

access2godzilla

Re: /usr/bin/palemoon: a few hacks

Unread post by access2godzilla » 2014-04-30, 10:39

Thanks Kriton, I'll include the plugin related hack right away. About the second one: I'd rather not do unexpected things ("why did the f*ing installer change my theme?"), but I'll point to your post in the FAQ.

Kriton
Moongazer
Moongazer
Posts: 13
Joined: 2014-04-30, 05:31
Location: Greece

Re: /usr/bin/palemoon: a few hacks

Unread post by Kriton » 2014-04-30, 12:39

The second hack is a compromise between changing the theme for all GTK applications and PM not working at all. I agree that, if PM works for someone, there is no reason for the installer to change the theme for PM. (Not that it could, as the installer would have to figure out what themes are installed and where they are installed.) On the other hand, my version of the startup script will not change anything, if the user does not manually create /usr/local/etc/gtkrc-2.0-kde4-pm, so I don't think it would hurt if the code is left there; those who need it, can simply copy their .gtkrc-2.0-kde4 there, to activate the code and fix the problem with oxygen under KDE.

However, just to complicate things, this morning I installed PM under Scientific LInux 6.5 (a RHEL clone). There were no "plugins-wrapped" folders there, so a general-purpose script would have to check for the existence "plugins-wrapped" folders and use them, if found, otherwise use the "plugins" folders.
I reversed the polarity of the neutron flow...

Locked