-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathff-kactivities
29 lines (15 loc) · 1.17 KB
/
ff-kactivities
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
echo "Asking for profile name..."
PROFILE_NAME=`kdialog --inputbox "New Profile Name:"`|| exit 0;
cp -rf ~/.mozilla/firefox/`ls ~/.mozilla/firefox/ | grep default | head -n 1` ~/.mozilla/firefox/`kactivities-cli --current-activity | cut -d' ' -f2`
echo "Firefox profile folder copied."
cp ~/.local/share/applications/firefox.desktop ~/.local/share/applications/Firefox\ \("$PROFILE_NAME"\)
echo "Firefox launcher copied."
kwriteconfig5 --file ~/.local/share/applications/Firefox\ \("$PROFILE_NAME"\) --group 'Desktop Entry' --key Exec "firefox --profile ~/.mozilla/firefox/`kactivities-cli --current-activity | cut -d' ' -f2`"
echo "Edited Exec field in launcher."
kwriteconfig5 --file ~/.local/share/applications/Firefox\ \("$PROFILE_NAME"\) --group 'Desktop Entry' --key Name "Firefox (`echo $PROFILE_NAME | tr '_' ' '`)"
echo "Edited Name fields in launcher."
qdbus org.kde.ActivityManager /ActivityManager/Resources/Linking LinkResourceToActivity :global ~/.local/share/applications/Firefox\ \("$PROFILE_NAME"\) :current
echo "Launcher linked to current Activity"
kdialog --passivepopup "Firefox (`echo $PROFILE_NAME | tr '_' ' '`) created." --icon firefox
echo "Done."