Skip to content

Instantly share code, notes, and snippets.

@gwpl
Last active March 15, 2019 12:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gwpl/d5d028967ad54da2c58bf0ec083c604e to your computer and use it in GitHub Desktop.
Save gwpl/d5d028967ad54da2c58bf0ec083c604e to your computer and use it in GitHub Desktop.
Use different chromium profiles for different activities! Enjoy lightweight chrome, that has to carry only what it needs for task, plus more order as keeping separated different interested and activities (of sets of extensions) for order :).
#!/bin/bash
chromium_profiles_dir="$HOME/.config/chromium_profiles/"
mkdir -p "$chromium_profiles_dir"
# echo "$ ls -1 $chromium_profiles_dir"
# select profile in "$(ls "$chromium_profiles_dir")" "make_new"; do break; done
# echo $profile
# if [ "$profile" == "make_new" ]; then
# read -p "Profile name (preferably no spaces):" profile
# mkdir -p "${chromium_profiles_dir}/${profile}"
# fi
# profile_dir="${chromium_profiles_dir}/${profile}"
profile_dir="$(zenity --filename=$HOME/.config/chromium_by_topic/ --directory --file-selection)"
if [ $? == 1 ]; then
zenity --warning --text='It seems it was cancelled'
exit 1
fi
if [ ! -d "$profile_dir" ]; then
zenity --warning --text="It seems that selected directory does not exist: $profile_dir"
exit 1
fi
# Limit cache to 50MB via --disk-cache-size=52428800
# Limit cache to 100MB via --disk-cache-size=104857600
cachesize=104857600
if [[ $profile_dir =~ ^.*limited_cache.*$ ]]; then
cachesize=$(( $cachesize * 8 ))
zenity --warning --text="Increased case size to : $cachesize"
fi
if [[ $profile_dir =~ ^.*proxy_flag.*$ ]]; then
proxy_flag='--proxy-server=socks5://127.0.0.1:5432'
fi
set -x
#zenity --warning --text="case size to : ${cachesize}"
LC_ALL=en_US.utf-8 chromium --user-data-dir="${profile_dir}" --disk-cache-size="${cachesize}" "${proxy_flag}"
@gwpl
Copy link
Author

gwpl commented Mar 15, 2019

E.g. useful if your set of extensions blow up, for unknown reason... to me quiet often it helps to start fresh once a while and come back to old profile when I need something from there. That way chromium is more lightweight! Context: tabsoutliner.com RAM consumption: https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/tab-suspender/1geSXJwh8CI/EdqLuwixBAAJ . (and on the other hand, for some activities I like some extensions, for some not, with above script I can have set of extensions tailored to usecase)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment