From 670989af519ff9845f95551b98e52c87c3999697 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sun, 4 Feb 2018 15:53:14 -0200 Subject: Display available profiles at chromium-profile --- chromium-profile | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/chromium-profile b/chromium-profile index ff2d832..8a634d9 100755 --- a/chromium-profile +++ b/chromium-profile @@ -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 " + + 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 -- cgit v1.2.3