4 # Email : hayao@fascode.net
6 # (c) 2019-2020 Fascode Network.
13 url="https://fascode.net/en/projects/linux/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"
60 OPT=$(getopt -o ${_opt_short} -l ${_opt_long} -- "${@}")
61 if [[ ${?} != 0 ]]; then
99 _msg_error "Invalid argument '${1}'"
106 if [[ "${checklive}" = true ]]; then
107 if [[ -n $(pacman -Q alterlinux-calamares) ]]; then
112 if [[ "${custombrowser}" = false ]]; then
113 defaultbrowserlist+=("END_OF_LIST")
114 for ((_browser_count = 0; _browser_count < ${#defaultbrowserlist[@]}; _browser_count++)); do
115 _browser="${defaultbrowserlist[${_browser_count}]}"
116 if [[ -f $(type -P "$(echo ${_browser} | awk '{print $1}')") ]]; then
117 browser="${_browser}"
119 elif [[ "${_browser}" == "END_OF_LIST" ]]; then
120 _msg_error "No available browser is installed."
126 $(printf "${browser}" "${url}")
128 if [[ "${alterlive}" = true ]]; then
129 remove ~/.config/autostart/welcome_page.desktop