Skip to content

Instantly share code, notes, and snippets.

@riccardobl
Last active November 28, 2015 23:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save riccardobl/14cf9d143d1ca2a6e043 to your computer and use it in GitHub Desktop.
Save riccardobl/14cf9d143d1ca2a6e043 to your computer and use it in GitHub Desktop.
Per-activity firefox profile under kde.
#!/bin/bash
echo 'qdbus org.kde.kactivitymanagerd /ActivityManager/Activities CurrentActivity'>/usr/bin/echo_current_activity
chmod +x /usr/bin/echo_current_activity
echo "Activity for default profile: "
read default_activity
echo '
#!/bin/bash
'>/usr/bin/firefox-kde
echo "
default_activity='$default_activity'
">>/usr/bin/firefox-kde
echo '
firefox="/usr/lib/firefox/firefox.sh"
activity=`/usr/bin/echo_current_activity`
if [ "$activity" = "$default_activity" ]
then
echo "Default profile"
$firefox -P default $@
else
echo "$activity profile"
if [ ! -f "$HOME/.mozilla/tmp/$activity" ];
then
mkdir -p $HOME/.mozilla/tmp
$firefox -CreateProfile $activity -P $activity
echo "1">"$HOME/.mozilla/tmp/$activity"
fi
$firefox -P $activity $@
fi
'>>/usr/bin/firefox-kde
chmod +x /usr/bin/firefox-kde
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment