2
if ! [ -x /snap/bin/firefox ]; then
4
echo "Command '$0' requires the firefox snap to be installed." >&2
5
echo "Please install it with:" >&2
7
echo "snap install firefox" >&2
12
if [ "$(xdg-settings get default-web-browser)" = "firefox.desktop" ]; then
13
xdg-settings set default-web-browser firefox_firefox.desktop
18
NEW="firefox_firefox.desktop"
19
FAVS=$(gsettings get org.gnome.shell favorite-apps 2> /dev/null)
20
if echo "$FAVS" | grep -q "'$OLD'"; then
21
NEWFAVS=$(echo $FAVS | sed -e "s#'$OLD'#'$NEW'#")
22
gsettings set org.gnome.shell favorite-apps "$NEWFAVS"
26
OLD="application://firefox.desktop"
27
NEW="application://firefox_firefox.desktop"
28
FAVS=$(gsettings get com.canonical.Unity.Launcher favorites 2> /dev/null)
29
if echo "$FAVS" | grep -q "'$OLD'"; then
30
NEWFAVS=$(echo $FAVS | sed -e "s#'$OLD'#'$NEW'#")
31
gsettings set com.canonical.Unity.Launcher favorites "$NEWFAVS"
35
OLD="/usr/share/applications/firefox.desktop"
36
NEW="/var/lib/snapd/desktop/applications/firefox_firefox.desktop"
37
OBJECTS=$(gsettings get org.mate.panel object-id-list 2> /dev/null)
38
for object in $OBJECTS; do
39
object=$(echo $object | cut -d\' -f2)
40
launcher=$(gsettings get org.mate.panel.object:/org/mate/panel/objects/$object/ launcher-location)
41
if [ "$launcher" = "'$OLD'" ]; then
42
gsettings set org.mate.panel.object:/org/mate/panel/objects/$object/ launcher-location "'$NEW'"
47
OLD="applications:firefox.desktop"
48
NEW="applications:firefox_firefox.desktop"
49
if which qdbus > /dev/null; then
51
for (var i = 0; i < panelIds.length; ++i) {
52
var panel = panelById(panelIds[i]);
53
var widgets = panel.widgets();
54
for (var j = 0; j < widgets.length; ++j) {
55
var widget = widgets[j];
56
if (widget.type == "org.kde.plasma.taskmanager") {
57
widget.currentConfigGroup = "General";
58
var launchers = widget.readConfig("launchers");
59
if (launchers.includes("$OLD")) {
60
widget.writeConfig("launchers", launchers.replace(/$OLD/g, "$NEW"));
67
qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript "$SCRIPT" 2> /dev/null
70
# TODO: handle other desktop environments
72
exec /snap/bin/firefox "$@"