Merge remote-tracking branch 'git.kebler.net/master' into giskard

giskard
Kebler Network System Administrator 2021-01-30 19:39:20 -08:00
commit aa19e2a415
1 changed files with 15 additions and 7 deletions

View File

@ -1,4 +1,6 @@
#!/bin/bash #!/bin/bash
# TODO if non interactive then send notificaiton instead attempting command
function mv_chromium () { function mv_chromium () {
local _ch local _ch
local ch local ch
@ -23,14 +25,20 @@ local dir
mv_chromium mv_chromium
[[ $? -ne 0 ]] && echo chromium not installed && return 1 [[ $? -ne 0 ]] && echo chromium not installed && return 1
# echo chromium executable available and moved to $(command -v _chromium) # echo chromium executable available and moved to $(command -v _chromium)
user=${CHROME_USER:-$1}
user=${user:-$USER}
dir=${CHROME_CONFIG_HOME:-"$HOME/.config/chromium"}
[[ $user == "$USER" ]] && dir="$HOME/.config/chromium"
exe=$(command -v _chromium) exe=$(command -v _chromium)
echo "$exe --user-data-dir=$dir/$user" [[ ! $exe ]] && echo _chromium not set && return 1
$exe --user-data-dir=$dir/$user user=${CHROME_USER}
[[ $1 && ( ! $1 == -* ) ]] && user=$1 && shift
user=${user:-$USER}
if [[ $user == "$USER" ]]; then
unset CHROME_CONFIG_HOME
$exe "$@"
else
[[ $user == "incognito" ]] && set -- "$@" "-incognito"
dir=${CHROME_CONFIG_HOME:-"$HOME/.local/share/chromium"}
echo "$exe $@ --user-data-dir=$dir/$user"
$exe "$@" --user-data-dir=$dir/$user
fi
} }
# # if script was executed then call the function # # if script was executed then call the function