feat: will look in $HOME/.browsers first for instance then in default or set chromium home usually /opt/chromium. Thus a bindfs instance for the current user will take precedence.

giskard
Kebler Network System Administrator 2021-12-04 22:14:09 -08:00
parent f424d8a644
commit 6e641896c6
1 changed files with 4 additions and 4 deletions

View File

@ -4,11 +4,12 @@
# if not supplied then will use default
chromium_() {
local DEFAULT=/opt/chromium
local DEFAULT_USER=$HOME/.browsers
# local DEFAULT="$HOME/.local/share/chromium"
local exe="/usr/bin/chromium"
[[ $1 == -g ]] && exe=$(command -v google-chrome) && shift
echo exe $exe
echo execuatble to be used: $exe
if [[ ! -f $exe ]]; then
echo chromium/chrome not installed, checking for flatpak version
flatpak=$(flatpak info com.github.Eloston.UngoogledChromium | grep error:)
@ -40,11 +41,10 @@ chromium_() {
echo starting chromium for $USER in
dir=$HOME/.config/chromium
exe="${exe/<dir>/$dir}"
# echo $exe "$@" $([[ $flatpak ]] && echo " @@")
# $exe "$@"
else
[[ $instance == "incognito" ]] && set -- "$@" "-incognito"
dir=${CHROMIUM_HOME:-$DEFAULT}/$instance
dir=${DEFAULT_USER}/$instance
dir=$([[ -d "$dir" ]] && echo $dir || echo "${CHROMIUM_HOME:-$DEFAULT}/$instance")
exe="${exe/<dir>/$dir}"
fi
mkdir -p $dir