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 "vivaldi-stable --start-maximized --app=%s"
20 "brave --start-maximized --app=%s"
21 "firefox-developer-edition %s"
23 "chromium --start-maximized --app=%s"
24 "google-chrome --start-maximized --app=%s"
31 for _file in "${_list[@]}"; do
32 if [[ -f ${_file} ]]; then
34 elif [[ -d ${_file} ]]; then
41 echo "Displays the AlterLinux welcome page"
42 echo "usage alterlinux-welcome-page [options]"
44 echo " General options:"
45 echo " -b | --browser <cmd> Specify the browser command."
46 echo " %s will be replaced with the URL"
47 echo " -u | --url <url> Set the URL."
48 echo " Default: ${url}"
49 echo " -l | --live Opens the page only in a live environment."
50 echo " Whether it is a live environment or not is determined"
51 echo " by the presence or absence of the installer."
52 echo " --alterlive Delete the startup file for the live environment."
53 echo " -h | --help This help message and exit."
55 echo "%s is replaces with the URL"
57 local _browser _browser_count
58 for ((_browser_count = 0; _browser_count < ${#defaultbrowserlist[@]}; _browser_count++)); do
59 echo " ${defaultbrowserlist[${_browser_count}]}"
71 # Argument analysis and processing
74 _opt_long="browser:,url:,live,help,alterlive,aobuta"
75 OPT=$(getopt -o ${_opt_short} -l ${_opt_long} -- "${@}")
76 if [[ ${?} != 0 ]]; then
106 url="https://ao-buta.com/"
118 _msg_error "Invalid argument '${1}'"
125 if [[ "${checklive}" = true ]]; then
126 if [[ -n $(pacman -Q alterlinux-calamares) ]]; then
131 # ブラウザが指定されていないなら一覧から自動で検出する
132 if [[ "${custombrowser}" = false ]]; then
133 defaultbrowserlist+=("END_OF_LIST")
134 for ((_browser_count = 0; _browser_count < ${#defaultbrowserlist[@]}; _browser_count++)); do
135 _browser="${defaultbrowserlist[${_browser_count}]}"
136 if [[ -f $(type -P "$(echo ${_browser} | awk '{print $1}')") ]]; then
137 browser="${_browser}"
139 elif [[ "${_browser}" == "END_OF_LIST" ]]; then
140 _msg_error "No available browser is installed."
144 elif [[ -z "$(echo "${browser}" | grep "%s")" ]]; then
145 # -bで%sが指定されていないならコマンドの後にURLを付ける
149 if [[ "${nourlmode}" = true ]]; then
150 _msg_warn "Directly executed with URL as an argument because %s was not specified."
151 eval ${browser} ${url} &
153 eval $(printf "${browser}" "${url}") &
156 if [[ "${alterlive}" = true ]]; then
157 remove ~/.config/autostart/welcome_page.desktop