aboutsummaryrefslogtreecommitdiff
path: root/.local/bin/chooseprofile
blob: d201042c31af2fb3092dfcc7b87db062f0936d13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh

profiles=$(awk -F= '/^\[Profile/ {profile=$1} /Name/ && !/default/ {print $2}' ~/.mozilla/icecat/profiles.ini)

profile=$(echo "$profiles" | rofi -theme-str 'window {width: 10%;}' -dmenu -p "Select IceCat Profile" -l 10)

if [ -z "$profile" ] || ! echo "$profiles" | rg -q "^$profile$"; then
    echo "Invalid selection or no profile selected. Exiting."
    exit 1
fi

setsid -f icecat -P "$profile"