4 # Email : hayao@fascode.net
6 # (c) 2019-2021 Fascode Network.
13 url="https://alter.fascode.net/alter-welcome.php"
14 browser="chromium --start-maximized --app=%s"
19 "microsoft-edge-dev --start-maximized --app=%s"
20 "vivaldi-stable --start-maximized --app=%s"
21 "brave --start-maximized --app=%s"
22 "firefox-developer-edition -url %s & xdotool search --sync --onlyvisible --class 'Firefox' windowactivate key F11"
23 "firefox -url %s & xdotool search --sync --onlyvisible --class 'Firefox' windowactivate key F11"
24 "chromium --start-maximized --app=%s"
25 "google-chrome --start-maximized --app=%s"
32 for _file in "${_list[@]}"; do
33 if [[ -f ${_file} ]]; then
35 elif [[ -d ${_file} ]]; then
42 echo "Displays the AlterLinux welcome page"
43 echo "usage alterlinux-welcome-page [options]"
45 echo " General options:"
46 echo " -b | --browser <cmd> Specify the browser command."
47 echo " %s will be replaced with the URL"
48 echo " -u | --url <url> Set the URL."
49 echo " Default: ${url}"
50 echo " -l | --live Opens the page only in a live environment."
51 echo " Whether it is a live environment or not is determined"
52 echo " by the presence or absence of the installer."
53 echo " --alterlive Delete the startup file for the live environment."
54 echo " -h | --help This help message and exit."
56 echo "%s is replaces with the URL"
58 local _browser _browser_count
59 for ((_browser_count = 0; _browser_count < ${#defaultbrowserlist[@]}; _browser_count++)); do
60 echo " ${defaultbrowserlist[${_browser_count}]}"
72 # Argument analysis and processing
75 _opt_long="browser:,url:,live,help,alterlive,aobuta"
76 OPT=$(getopt -o ${_opt_short} -l ${_opt_long} -- "${@}")
77 if [[ ${?} != 0 ]]; then
107 url="https://ao-buta.com/"
119 _msg_error "Invalid argument '${1}'"
126 # ライブ環境から実行されているかチェックします
128 if [[ -d "/run/archiso" ]] || grep "^archisobasedir=" "/proc/cmdline" 2> /dev/null 1>&2; then
134 if [[ "${checklive}" = true ]] && check_livecd; then
138 # ブラウザが指定されていないなら一覧から自動で検出する
139 if [[ "${custombrowser}" = false ]]; then
140 defaultbrowserlist+=("END_OF_LIST")
141 for ((_browser_count = 0; _browser_count < ${#defaultbrowserlist[@]}; _browser_count++)); do
142 _browser="${defaultbrowserlist[${_browser_count}]}"
143 if [[ -f $(type -P "$(echo ${_browser} | awk '{print $1}')") ]]; then
144 browser="${_browser}"
146 elif [[ "${_browser}" == "END_OF_LIST" ]]; then
147 _msg_error "No available browser is installed."
151 elif [[ -z "$(echo "${browser}" | grep "%s")" ]]; then
152 # -bで%sが指定されていないならコマンドの後にURLを付ける
156 if [[ "${nourlmode}" = true ]]; then
157 _msg_warn "Directly executed with URL as an argument because %s was not specified."
158 eval ${browser} ${url} &
160 eval $(printf "${browser}" "${url}") &
163 if [[ "${alterlive}" = true ]]; then
164 remove "${HOME}/.config/autostart/welcome_page.desktop"