+++ /dev/null
-#!/bin/bash
-
-script_cmdline ()
-{
- local param
- for param in $(< /proc/cmdline); do
- case "${param}" in
- script=*) echo "${param#*=}" ; return 0 ;;
- esac
- done
-}
-
-automated_script ()
-{
- local script rt
- script="$(script_cmdline)"
- if [[ -n "${script}" && ! -x /tmp/startup_script ]]; then
- if [[ "${script}" =~ ^http:// || "${script}" =~ ^ftp:// ]]; then
- wget "${script}" --retry-connrefused -q -O /tmp/startup_script >/dev/null
- rt=$?
- else
- cp "${script}" /tmp/startup_script
- rt=$?
- fi
- if [[ ${rt} -eq 0 ]]; then
- chmod +x /tmp/startup_script
- /tmp/startup_script
- fi
- fi
-}
-
-if [[ $(tty) == "/dev/tty1" ]]; then
- automated_script
-fi
+++ /dev/null
-#!/usr/bin/env bash
-#
-# Yamada Hayao
-# Twitter: @Hayao0819
-# Email : hayao@fascode.net
-#
-# (c) 2019-2020 Fascode Network.
-#
-
-set -e -u
-
-
-# Default value
-# All values can be changed by arguments.
-password=alter
-boot_splash=false
-kernel='zen'
-theme_name=alter-logo
-rebuild=false
-japanese=false
-username='alter'
-os_name="Alter Linux"
-install_dir="alter"
-usershell="/bin/bash"
-debug=true
-
-
-# Parse arguments
-while getopts 'p:bt:k:rxju:o:i:s:da:' arg; do
- case "${arg}" in
- p) password="${OPTARG}" ;;
- b) boot_splash=true ;;
- t) theme_name="${OPTARG}" ;;
- k) kernel="${OPTARG}" ;;
- r) rebuild=true ;;
- j) japanese=true;;
- u) username="${OPTARG}" ;;
- o) os_name="${OPTARG}" ;;
- i) install_dir="${OPTARG}" ;;
- s) usershell="${OPTARG}" ;;
- d) debug=true ;;
- x) debug=true; set -xv ;;
- a) arch="${OPTARG}"
- esac
-done
-
-
-# Delete file only if file exists
-# remove <file1> <file2> ...
-function remove () {
- local _list
- local _file
- _list=($(echo "$@"))
- for _file in "${_list[@]}"; do
- if [[ -f ${_file} ]]; then
- rm -f "${_file}"
- elif [[ -d ${_file} ]]; then
- rm -rf "${_file}"
- fi
- echo "${_file} was deleted."
- done
-}
-
-
-remove /etc/skel/Desktop
-remove /root/Desktop
-
-if [[ ${arch} = "i686" ]]; then
- ln -s /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist32
-fi
-
-sed -i 's/#\(en_US\.UTF-8\)/\1/' /etc/locale.gen
-locale-gen
-
-ln -sf /usr/share/zoneinfo/UTC /etc/localtime
-
-usermod -s /usr/bin/zsh root
-cp -aT /etc/skel/ /root/
-chmod 700 /root
-
-sed -i 's/#\(PermitRootLogin \).\+/\1yes/' /etc/ssh/sshd_config
-sed -i "s/#Server/Server/g" /etc/pacman.d/mirrorlist
-sed -i 's/#\(Storage=\)auto/\1volatile/' /etc/systemd/journald.conf
-
-sed -i 's/#\(HandleSuspendKey=\)suspend/\1ignore/' /etc/systemd/logind.conf
-sed -i 's/#\(HandleHibernateKey=\)hibernate/\1ignore/' /etc/systemd/logind.conf
-sed -i 's/#\(HandleLidSwitch=\)suspend/\1ignore/' /etc/systemd/logind.conf
-
-systemctl enable pacman-init.service choose-mirror.service
-systemctl set-default multi-user.target
--- /dev/null
+#!/usr/bin/env bash
+#
+# Yamada Hayao
+# Twitter: @Hayao0819
+# Email : hayao@fascode.net
+#
+# (c) 2019-2020 Fascode Network.
+#
+
+set -e -u
+
+
+# Default value
+# All values can be changed by arguments.
+password=alter
+boot_splash=false
+kernel='zen'
+theme_name=alter-logo
+rebuild=false
+japanese=false
+username='alter'
+os_name="Alter Linux"
+install_dir="alter"
+usershell="/bin/bash"
+debug=true
+
+
+# Parse arguments
+while getopts 'p:bt:k:rxju:o:i:s:da:' arg; do
+ case "${arg}" in
+ p) password="${OPTARG}" ;;
+ b) boot_splash=true ;;
+ t) theme_name="${OPTARG}" ;;
+ k) kernel="${OPTARG}" ;;
+ r) rebuild=true ;;
+ j) japanese=true;;
+ u) username="${OPTARG}" ;;
+ o) os_name="${OPTARG}" ;;
+ i) install_dir="${OPTARG}" ;;
+ s) usershell="${OPTARG}" ;;
+ d) debug=true ;;
+ x) debug=true; set -xv ;;
+ a) arch="${OPTARG}"
+ esac
+done
+
+
+# Delete file only if file exists
+# remove <file1> <file2> ...
+function remove () {
+ local _list
+ local _file
+ _list=($(echo "$@"))
+ for _file in "${_list[@]}"; do
+ if [[ -f ${_file} ]]; then
+ rm -f "${_file}"
+ elif [[ -d ${_file} ]]; then
+ rm -rf "${_file}"
+ fi
+ echo "${_file} was deleted."
+ done
+}
+
+
+# Replace wallpaper.
+if [[ -f /usr/share/backgrounds/xfce/xfce-stripes.png ]]; then
+ remove /usr/share/backgrounds/xfce/xfce-stripes.png
+ ln -s /usr/share/backgrounds/alter.png /usr/share/backgrounds/xfce/xfce-stripes.png
+fi
+[[ -f /usr/share/backgrounds/alter.png ]] && chmod 644 /usr/share/backgrounds/alter.png
+
+
+# Bluetooth
+#rfkill unblock all
+#systemctl enable bluetooth
+
+# Snap
+#if [[ "${arch}" = "x86_64" ]]; then
+# systemctl enable snapd.apparmor.service
+# systemctl enable apparmor.service
+# systemctl enable snapd.socket
+# systemctl enable snapd.service
+#fi
+
+
+# Update system datebase
+dconf update
+
+
+# firewalld
+#systemctl enable firewalld.service
+
+
+# Replace link
+#if [[ "${japanese}" = true ]]; then
+# remove "/etc/skel/Desktop/welcome-to-alter.desktop"
+# remove "/home/${username}/Desktop/welcome-to-alter.desktop"
+
+# mv "/etc/skel/Desktop/welcome-to-alter-jp.desktop" "/etc/skel/Desktop/welcome-to-alter.desktop"
+# mv "/home/${username}/Desktop/welcome-to-alter-jp.desktop" "/home/${username}/Desktop/welcome-to-alter.desktop"
+#else
+# remove "/etc/skel/Desktop/welcome-to-alter-jp.desktop"
+# remove "/home/${username}/Desktop/welcome-to-alter-jp.desktop"
+#fi
+
+
+# Added autologin group to auto login
+groupadd autologin
+usermod -aG autologin ${username}
+
+
+# Enable LightDM to auto login
+if [[ "${boot_splash}" = true ]]; then
+ systemctl enable lightdm-plymouth.service
+else
+ systemctl enable lightdm.service
+fi
+
+
+# Set script permission
+chmod 755 /usr/local/bin/alterlinux-sidebar
+
+# Replace auto login user
+sed -i s/%USERNAME%/${username}/g /etc/lightdm/lightdm.conf