summaryrefslogtreecommitdiff
path: root/lwc
blob: 05aa3707786e51db1c358a6fca3200c8d3a1720f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
if [ -f ~/.librewolf/profiles.ini ]; then
  NATIVE_PROFILES=`grep 'Path=' ~/.librewolf/profiles.ini | cut -d'.' -f2`
else
  unset NATIVE_PROFILES
fi
if [ -f ~/.var/app/io.gitlab.librewolf-community/.librewolf/profiles.ini ]; then
  FLATPAK_PROFILES=`grep 'Path=' ~/.var/app/io.gitlab.librewolf-community/.librewolf/profiles.ini | cut -d'.' -f2 | sed 's/$/ F/g'`
else
  unset FLATPAK_PROFILES
fi
if [ -n "$NATIVE_PROFILES" -a -n "$FLATPAK_PROFILES" ]; then
  INT="\n"
fi
PROFILES="$NATIVE_PROFILES$INT$FLATPAK_PROFILES"
CHOSEN=`printf "$PROFILES" | dmenu -l 15`
[ -z "$CHOSEN" ] && exit 2
if `echo "$CHOSEN" | grep -qE ' F$'`; then
  exec flatpak run io.gitlab.librewolf-community -P `echo "$CHOSEN" | sed 's/ F$//'` "$@"
else
  exec librewolf -P "$CHOSEN" "$@"
fi