summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzachir <zachir@librem.one>2023-02-09 21:23:50 -0600
committerzachir <zachir@librem.one>2023-02-09 21:23:50 -0600
commite7fefa89ae8456d115e958ec244620520d7074ee (patch)
tree0185932a9b4f50bf301778ecc418b8a55cd2c80f
parent8f3224ef57423bad6a2fc9dbe38ced628591a6ca (diff)
parent42a9aa7832eb0c8dddbe1a18d91b9e38d9688530 (diff)
Merge branch 'master' of git.zachir.xyz:zachir/scripts
-rwxr-xr-xbrowser2
-rwxr-xr-xlwc23
2 files changed, 21 insertions, 4 deletions
diff --git a/browser b/browser
index 4ac15cc..7aba898 100755
--- a/browser
+++ b/browser
@@ -6,7 +6,7 @@ bsc
ffc
lwc
brave"
-if [ `echo "$@" | cut -d'/' -f3` == "yewtu.be" ]; then
+if [ "`echo "$@" | cut -d'/' -f3`" = "yewtu.be" ]; then
BROWSERS=`printf "mpv\n%s" "$BROWSERS"`
fi
brow=`printf "xclip\n%s" "$BROWSERS" | barmenu -l 15`
diff --git a/lwc b/lwc
index 0fe2479..e0a03e3 100755
--- a/lwc
+++ b/lwc
@@ -1,5 +1,22 @@
#!/bin/sh
-PROFILES=`grep 'Path=' ~/.librewolf/profiles.ini | cut -d'.' -f2`
-CHOSEN=`echo "$PROFILES" | barmenu -l 15`
+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'2`
+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
-librewolf -P "$CHOSEN"
+if `echo "$CHOSEN" grep -q ' F$'`; then
+ exec flatpar run io.gitlab.librewolf-community -P `echo "$CHOSEN" | sed 's/ F$//'` "$@"
+else
+ exec librewolf -P "$CHOSEN" "$@"
+fi