Skip to content

Commit e5d5929

Browse files
committed
session-migration: Add session-migration for Firefox deb/snap
1 parent 4928761 commit e5d5929

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

debian/ubuntu-mate-default-settings.install

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ usr/share/mate/autostart/print-applet.desktop
2323
usr/share/mate/autostart/ubuntu-mate-settings-overlay.desktop
2424
usr/share/plank/themes/
2525
usr/share/ubuntu-mate/
26+
usr/share/session-migration/scripts
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/sh
2+
3+
# Migrate Firefox from deb to snap
4+
# https://bazaar.launchpad.net/~mozillateam/firefox/firefox.jammy/view/head:/firefox
5+
if [ -x /snap/bin/firefox ]; then
6+
# Update default browser
7+
if [ "$(xdg-settings get default-web-browser)" = "firefox.desktop" ]; then
8+
xdg-settings set default-web-browser firefox_firefox.desktop
9+
fi
10+
11+
# Migrate mate-panel launchers
12+
OLD="/usr/share/applications/firefox.desktop"
13+
NEW="/var/lib/snapd/desktop/applications/firefox_firefox.desktop"
14+
OBJECTS=$(gsettings get org.mate.panel object-id-list 2> /dev/null)
15+
for object in $OBJECTS; do
16+
object=$(echo $object | cut -d\' -f2)
17+
launcher=$(gsettings get org.mate.panel.object:/org/mate/panel/objects/$object/ launcher-location)
18+
if [ "$launcher" = "'$OLD'" ]; then
19+
gsettings set org.mate.panel.object:/org/mate/panel/objects/$object/ launcher-location "'$NEW'"
20+
fi
21+
done
22+
23+
# Migrate plank dockitems
24+
if [ -e ~/.config/plank/dock1/launchers/firefox.dockitem ]; then
25+
rm ~/.config/plank/dock1/launchers/firefox.dockitem
26+
cp /usr/share/ubuntu-mate/settings-overlay/config/plank/dock1/launchers/firefox_firefox.dockitem ~/.config/plank/dock1/launchers/
27+
fi
28+
fi

0 commit comments

Comments
 (0)