]> gitweb.fluxo.info Git - utils-x11.git/commitdiff
Display available profiles at chromium-profile
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 4 Feb 2018 17:53:14 +0000 (15:53 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 4 Feb 2018 17:53:14 +0000 (15:53 -0200)
chromium-profile

index ff2d832157f10d02e6a733a9baa3a35338b07739..8a634d95d681993fdb1728698709661010da4bbb 100755 (executable)
@@ -4,14 +4,30 @@
 #     https://www.chromium.org/developers/creating-and-using-profiles
 #     https://www.chromium.org/Home/chromium-security/site-isolation
 
+# Parameters
+BASENAME="`basename $0`"
+BASE="$HOME/.config/chromium-profiles"
+
 # Check
 if [ -z "$1" ]; then
-  cat $0
+  # Autoprint as usage
+  #cat $0
+
+  if [ -d "$BASE" ]; then
+    PROFILES="`ls $BASE | xargs`"
+  fi
+
+  echo "usage: $BASENAME <profile>"
+
+  if [ ! -z "$PROFILES" ]; then
+    echo "available profiles:"
+    echo "\t $(ls $BASE | xargs)"
+  fi
+
   exit 1
 fi
 
 if which chromium 2> /dev/null; then
-  BASE="$HOME/.config/chromium-profiles"
   PROFILE="$BASE/$1"
 
   # Copy default profile if available, or start a new one