4 # Email : hayao@fascode.net
6 # (c) 2019-2020 Fascode Network.
13 url="https://fascode.net/projects/linux/alter/alter-welcome.php"
14 browser="chromium --start-maximized --app=%s"
19 "chromium --start-maximized --app=%s"
20 "google-chrome --start-maximized --app=%s"
27 for _file in "${_list[@]}"; do
28 if [[ -f ${_file} ]]; then
30 elif [[ -d ${_file} ]]; then
37 echo "Displays the AlterLinux welcome page"
38 echo "usage alterlinux-welcome-page [options]"
40 echo " General options:"
41 echo " -b | --browser <cmd> Specify the browser command."
42 echo " %s will be replaced with the URL"
43 echo " Default: ${browser}"
44 echo " -u | --url <url> Set the URL."
45 echo " Default: ${url}"
47 echo " -l | --live Opens the page only in a live environment."
48 echo " -h | --help This help message and exit."
56 # Argument analysis and processing
59 _opt_long="browser:,url:,live,help,alterlive,aobuta"
60 OPT=$(getopt -o ${_opt_short} -l ${_opt_long} -- "${@}")
61 if [[ ${?} != 0 ]]; then
91 url="https://ao-buta.com/"
103 _msg_error "Invalid argument '${1}'"
110 if [[ "${checklive}" = true ]]; then
111 if [[ -n $(pacman -Q alterlinux-calamares) ]]; then
116 if [[ "${custombrowser}" = false ]]; then
117 defaultbrowserlist+=("END_OF_LIST")
118 for ((_browser_count = 0; _browser_count < ${#defaultbrowserlist[@]}; _browser_count++)); do
119 _browser="${defaultbrowserlist[${_browser_count}]}"
120 if [[ -f $(type -P "$(echo ${_browser} | awk '{print $1}')") ]]; then
121 browser="${_browser}"
123 elif [[ "${_browser}" == "END_OF_LIST" ]]; then
124 _msg_error "No available browser is installed."
130 eval $(printf "${browser}" "${url}") &
132 if [[ "${alterlive}" = true ]]; then
133 remove ~/.config/autostart/welcome_page.desktop