Last active
August 17, 2022 23:44
-
-
Save fischejo/796ad514d49e783f6b31db1abf7af714 to your computer and use it in GitHub Desktop.
adds selection of firefox profiles to rofi menu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| MOZILLA_CONFIG=~/.mozilla | |
| FIREFOX='/usr/bin/firefox' | |
| NAMES=($(awk -F "=" '/Name/ {print $2}' $MOZILLA_CONFIG/firefox/profiles.ini | tr -d ' ')) | |
| if [ -z $@ ] | |
| then | |
| echo "Profile Manager" | |
| for name in "${NAMES[@]}" | |
| do | |
| echo $name | |
| done | |
| else | |
| PATHS=($(awk -F "=" '/Path/ {print $2}' $MOZILLA_CONFIG/firefox/profiles.ini | tr -d ' ')) | |
| PROFILE=$@ | |
| for i in "${!NAMES[@]}"; do | |
| if [[ "${NAMES[$i]}" = "${PROFILE}" ]]; then | |
| $FIREFOX --new-instance --profile "$MOZILLA_CONFIG/firefox/${PATHS[$i]}" >/dev/null & | |
| exit | |
| fi | |
| done | |
| $FIREFOX --new-instance --ProfileManager >/dev/null & | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment