Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. chromium_profiles_dir="$HOME/.config/chromium_profiles/"
  4. mkdir -p "$chromium_profiles_dir"
  5.  
  6. # echo "$ ls -1 $chromium_profiles_dir"
  7. # select profile in "$(ls "$chromium_profiles_dir")" "make_new"; do break; done
  8. # echo $profile
  9. # if [ "$profile" == "make_new" ]; then
  10. # read -p "Profile name (preferably no spaces):" profile
  11. # mkdir -p "${chromium_profiles_dir}/${profile}"
  12. # fi
  13. # profile_dir="${chromium_profiles_dir}/${profile}"
  14.  
  15. profile_dir="$(zenity --filename=$HOME/.config/chromium_by_topic/ --directory --file-selection)"
  16.  
  17. if [ $? == 1 ]; then
  18. zenity --warning --text='It seems it was cancelled'
  19. exit 1
  20. fi
  21.  
  22. if [ ! -d "$profile_dir" ]; then
  23. zenity --warning --text="It seems that selected directory does not exist: $profile_dir"
  24. exit 1
  25. fi
  26.  
  27. # Limit cache to 50MB via --disk-cache-size=52428800
  28. # Limit cache to 100MB via --disk-cache-size=104857600
  29. cachesize=104857600
  30. if [[ $profile_dir =~ ^.*limited_cache.*$ ]]; then
  31. cachesize=$(( $cachesize * 8 ))
  32. zenity --warning --text="Increased case size to : $cachesize"
  33. fi
  34. if [[ $profile_dir =~ ^.*proxy_flag.*$ ]]; then
  35. proxy_flag='--proxy-server=socks5://127.0.0.1:5432'
  36. fi
  37. set -x
  38. #zenity --warning --text="case size to : ${cachesize}"
  39. LC_ALL=en_US.utf-8 chromium --user-data-dir="${profile_dir}" --disk-cache-size="${cachesize}" "${proxy_flag}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement