diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2019-03-08 18:28:51 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2019-03-08 18:28:51 -0300 |
commit | 680515174b70fe23122bebc1a9c5d70642f59f07 (patch) | |
tree | 0400c29347f7a65d1bf1f8608fc3c1c5244e9030 | |
parent | 86b391cbde896ce932fbc40b6083dcacbd04fa14 (diff) | |
download | utils-x11-680515174b70fe23122bebc1a9c5d70642f59f07.tar.gz utils-x11-680515174b70fe23122bebc1a9c5d70642f59f07.tar.bz2 |
Enhance firefox-profile
-rwxr-xr-x | firefox-profile | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/firefox-profile b/firefox-profile index 7d40d5e..2490c85 100755 --- a/firefox-profile +++ b/firefox-profile @@ -3,13 +3,27 @@ # Wrapper around firefox # +# Parameters +BASE="$HOME/.mozilla/firefox" +PROFILES="$BASE/profiles" + +# Check if ! which firefox &> /dev/null; then echo "Please install firefox" exit 1 fi -if [ ! -z "$1" ]; then - firefox -p $1 -new-instance & +# Dispatch +if [ ! -z "$1" ] && [ "$1" != "template" ]; then + if [ -d "$PROFILES/$1" ]; then + firefox -p $1 -new-instance & + else + firefox -CreateProfile $1 $PROFILES/$1 + + if [ -d "$PROFILES/template" ]; then + rm -rf $PROFILES/$1 && cp -a $PROFILES/template $PROFILES/$1 + fi + fi else firefox --profilemanager -new-instance fi |