Created
May 20, 2025 14:40
-
-
Save andreoss/847b3ae54919cbdb4e6c34c0c935a42e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -x | |
PROFILES_ROOT="$HOME/.chromium-profile/" | |
PROFILES_CACHE="$HOME/.chromium-cache/" | |
PROFILE_NAME="${1:-}" | |
shift | |
if [ ! "$PROFILE_NAME" ] | |
then | |
OUT=$(mktemp) | |
ls "$PROFILES_ROOT"/* | |
for PROFILE_DIR in "$PROFILES_ROOT"/* | |
do | |
PROFILE_NAME=$(basename "$PROFILE_DIR") | |
echo $PROFILE_NAME | |
done | dmenu | tee "$OUT" | |
PROFILE_NAME=$(cat < "$OUT") | |
fi | |
if [ ! "$PROFILE_NAME" ] | |
then | |
exit 1 | |
fi | |
EXTRA_ARGS=() | |
HOMEPAGE=about:conffig | |
WORKSPACE= | |
case "$PROFILE_NAME" in | |
Github) | |
WORKSPACE=5 | |
HOMEPAGE="https://github.com" | |
EXTRA_ARGS+=( | |
--noerrdialogs | |
--enable-features=OverlayScrollbar | |
"--app=$HOMEPAGE" | |
--start-maximized | |
) | |
;; | |
Telegram*) | |
WORKSPACE=5 | |
HOMEPAGE="https://web.telegram.org/" | |
EXTRA_ARGS+=( | |
--noerrdialogs | |
--enable-features=OverlayScrollbar | |
"--app=$HOMEPAGE" | |
--start-maximized | |
) | |
;; | |
WhatsApp) | |
WORKSPACE=5 | |
HOMEPAGE="https://web.whatsapp.com/" | |
EXTRA_ARGS+=( | |
--noerrdialogs | |
--enable-features=OverlayScrollbar | |
"--app=$HOMEPAGE" | |
--start-maximized | |
) | |
;; | |
*) | |
WORKSPACE=6 | |
;; | |
esac | |
XDG_CACHE_HOME="$PROFILES_CACHE/$PROFILE_NAME" | |
XDG_CONFIG_HOME="$PROFILES_ROOT/$PROFILE_NAME" | |
exec chromium-browser --class="$PROFILE_NAME" \ | |
--disable-async-dns \ | |
--force-dark-mode \ | |
--homepage="$HOMEPAGE" \ | |
--window-size=1200,1000 \ | |
--window-position=10,10 \ | |
--window-workspace="$WORKSPACE" \ | |
--user-data-dir="$PROFILES_ROOT/$PROFILE_NAME" \ | |
--profile-directory="$PROFILE_NAME" "${EXTRA_ARGS[@]}" "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment