diff --git a/all/modules/chromium/chromium.sh b/all/modules/chromium/chromium.sh index ea25a70..0cdd614 100755 --- a/all/modules/chromium/chromium.sh +++ b/all/modules/chromium/chromium.sh @@ -1,36 +1,52 @@ #!/bin/bash -# user to start MUST be first in arguments +# user to start MUST be first in arguments # if not supplied then will use default -chromium_ () { -local DEFAULT=/opt/chromium -# local DEFAULT="$HOME/.local/share/chromium" -local exe="/usr/bin/chromium" -[[ ! $exe ]] && echo chromium not installed set && return 1 -user=${CHROMIUM_USER} -[[ $1 && ( ! $1 == -* ) ]] && user=$1 && shift -[[ $1 && ( ! $1 == -* ) ]] && url=$1 && shift -user=${user:-$USER} -if [[ $user == "$USER" ]]; then - unset CHROME_CONFIG_HOME - echo starting chromium for $USER in default directory within users home - echo $exe "$@" - $exe "$@" - else - [[ $user == "incognito" ]] && set -- "$@" "-incognito" - dir=${CHROMIUM_HOME:-$DEFAULT} - echo "$exe $@ --user-data-dir=$dir/$user" - "$exe" "$@" --user-data-dir="$dir"/"$user" $url +chromium_() { + local DEFAULT=/opt/chromium + # local DEFAULT="$HOME/.local/share/chromium" + local exe="/usr/bin/chromium" + if [[ ! -f $exe ]]; then + echo deb chromium not installed, checking for flatpak version + flatpak=$(flatpak info com.github.Eloston.UngoogledChromium | grep error:) + if [[ $flatpak ]]; then + echo no flatpak version either - exiting && return 1 + else + flatpak=true + exe="/usr/bin/flatpak run --branch=stable --arch=x86_64 --filesystem=