その他スクリプトを追加

This commit is contained in:
suti7yk5032 2024-05-12 14:26:44 +09:00
parent 798eb35528
commit 9084f0e00e
4 changed files with 250 additions and 0 deletions

112
install/initial/initial.sh Normal file
View file

@ -0,0 +1,112 @@
#!/usr/bin/bash
function create_dir () {
printf "Create Directory \n"
mkdir "$HOME"/.local
mkdir "$HOME"/.local/bin
mkdir "$HOME"/Temp
mkdir "$HOME"/Dev
mkdir "$HOME"/Container
mkdir "$HOME"/Samba
printf "Success\n"
}
function install_zsh () {
printf "Install zsh \n"
if [ "$SHELL" != "/usr/bin/zsh" ]; then
sudo pacman -Sy
sudo pacman -S zsh --noconfirm
chsh -s /usr/bin/zsh
fi
yay -S ttf-meslo-nerd-font-powerlevel10k
curl --proto '=https' -fLsS https://rossmacarthur.github.io/install/crate.sh | bash -s -- --repo rossmacarthur/sheldon --to ~/.local/bin
export PATH="$PATH:$HOME/.local/bin"
sheldon init --shell zsh
echo 'export PATH="$PATH:$HOME/.local/bin"' | tee -a "$HOME/.zshrc"
echo 'HISTFILE=$HOME/.zsh_history' | tee -a "$HOME/.zshrc"
echo 'HISTSIZE=10000' | tee -a "$HOME/.zshrc"
echo 'SAVEHIST=10000' | tee -a "$HOME/.zshrc"
echo 'eval "$(sheldon source)"' | tee -a "$HOME/.zshrc"
sheldon add zsh-completions --github zsh-users/zsh-completions
sheldon add zsh-autocomplete --github marlonrichert/zsh-autocomplete
sheldon add zsh-autosuggestions --github zsh-users/zsh-autosuggestions --use '{{ name }}.zsh'
sheldon add zsh-syntax-highlighting --github zsh-users/zsh-syntax-highlighting
sheldon add powerlevel10k --github romkatv/powerlevel10k
}
function setup_swapfile () {
printf "Swapfile setup\n"
printf "Please enter swapfile capacity (example : ~ M)\n"
read swapcap
if [ "$1" == "btrfs" ]; then
sudo truncate -s 0 /swapfile
sudo chattr +C /swapfile
sudo fallocate -l "$swapcap"M /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo "#swapfile_autogenerated" | sudo tee -a /etc/fstab
echo "/swapfile none swap defaults 0 0" | sudo tee -a /etc/fstab
else
sudo dd if=/dev/zero of=/swapfile bs=1M count="$swapcap" status=progress
sudo chmod 600 /swapfile
sudo mkswap -U clear /swapfile
sudo swapon /swapfile
sudo mkdir /etc/backup
sudo cp /etc/fstab /etc/backup/fstab
echo "#swapfile_autogenerated" | sudo tee -a /etc/fstab
echo "/swapfile none swap defaults 0 0" | sudo tee -a /etc/fstab
fi
printf "swapfile setup is complete.\n"
}
function setup_time () {
printf "Timezone setup\n"
sudo timedatectl set-timezone Asia/Tokyo
sudo timedatectl set-ntp true
}
function install_yay () {
printf "AUR setup (yay)\n"
cd "$HOME"/Temp
sudo pacman -Sy
sudo pacman -S --noconfirm git
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
cd "$HOME"
}
function install_fonts () {
printf "Install CJK Fonts\n"
sudo pacman -S --noconfirm noto-fonts noto-fonts-cjk noto-fonts-emoji noto-fonts-extra
}
printf "Do you want to the initial setup? (yes or no)\n"
read temp
if [ "$temp" == "yes" ]; then
printf "What is the file system of the root directory? (ext4 or btrfs)\n"
read filesystem
if [ "$filesystem" == "btrfs" ]; then
setup_swapfile btrfs
else
setup_swapfile ext4
fi
create_dir
setup_time
install_fonts
install_yay
install_zsh
printf "Finished.\n"
else
printf "exit.\n"
fi

View file

@ -0,0 +1,117 @@
#!/usr/bin/bash
function create_dir () {
printf "Create Directory \n"
mkdir "$HOME"/.local/bin
mkdir "$HOME"/Temp
mkdir "$HOME"/Dev
mkdir "$HOME"/Container
printf "Success\n"
}
function install_zsh () {
printf "Install zsh \n"
if [ "$SHELL" != "/usr/bin/zsh" ]; then
sudo pacman -Sy
sudo pacman -S zsh --noconfirm
chsh -s /usr/bin/zsh
fi
curl --proto '=https' -fLsS https://rossmacarthur.github.io/install/crate.sh | bash -s -- --repo rossmacarthur/sheldon --to ~/.local/bin
export PATH="$PATH:$HOME/.local/bin"
sheldon init --shell zsh
echo 'export PATH="$PATH:$HOME/.local/bin"' | tee -a "$HOME/.zshrc"
echo 'HISTFILE=$HOME/.zsh_history' | tee -a "$HOME/.zshrc"
echo 'HISTSIZE=10000' | tee -a "$HOME/.zshrc"
echo 'SAVEHIST=10000' | tee -a "$HOME/.zshrc"
echo 'eval "$(sheldon source)"' | tee -a "$HOME/.zshrc"
sheldon add zsh-completions --github zsh-users/zsh-completions
sheldon add zsh-autocomplete --github marlonrichert/zsh-autocomplete
sheldon add zsh-autosuggestions --github zsh-users/zsh-autosuggestions --use '{{ name }}.zsh'
sheldon add zsh-syntax-highlighting --github zsh-users/zsh-syntax-highlighting
sheldon add powerlevel10k --github romkatv/powerlevel10k
}
function setup_swapfile () {
printf "Swapfile setup\n"
printf "Please enter swapfile capacity (example : ~ M)\n"
read swapcap
if [ "$1" == "btrfs" ]; then
sudo truncate -s 0 /swapfile
sudo chattr +C /swapfile
sudo fallocate -l "$swapcap"M /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo "#swapfile_autogenerated" | sudo tee -a /etc/fstab
echo "/swapfile none swap defaults 0 0" | sudo tee -a /etc/fstab
else
sudo dd if=/dev/zero of=/swapfile bs=1M count="$swapcap" status=progress
sudo chmod 600 /swapfile
sudo mkswap -U clear /swapfile
sudo swapon /swapfile
sudo mkdir /etc/backup
sudo cp /etc/fstab /etc/backup/fstab
echo "#swapfile_autogenerated" | sudo tee -a /etc/fstab
echo "/swapfile none swap defaults 0 0" | sudo tee -a /etc/fstab
fi
printf "swapfile setup is complete.\n"
}
function setup_time () {
printf "Timezone setup\n"
sudo timedatectl set-timezone Asia/Tokyo
sudo timedatectl set-ntp true
}
function install_yay () {
printf "AUR setup (yay)\n"
cd "$HOME"/Temp
sudo pacman -Sy
sudo pacman -S --noconfirm git
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
cd "$HOME"
}
function install_fonts () {
printf "Install CJK Fonts\n"
sudo pacman -S --noconfirm noto-fonts noto-fonts-cjk noto-fonts-emoji noto-fonts-extra
}
function install_podman () {
sudo pacman -S podman podman-compose podman-docker aardvark-dns
echo 'export DOCKER_HOST="unix://$XDG_RUNTIME_DIR/podman/podman.sock"' | sudo tee -a /etc/environment
mkdir ~/.config/containers
echo "unqualified-search-registries = [\"docker.io\"]" >> ~/.config/containers/registries.conf
systemctl --user enable podman.socket
sudo loginctl enable-linger $UID
}
printf "Do you want to the initial setup? (yes or no)\n"
read temp
if [ "$temp" == "yes" ]; then
printf "What is the file system of the root directory? (ext4 or btrfs)\n"
read filesystem
if [ "$filesystem" == "btrfs" ]; then
setup_swapfile btrfs
else
setup_swapfile ext4
fi
create_dir
setup_time
install_zsh
install_podman
printf "Finished.\n"
else
printf "exit.\n"
fi

21
install/kde.sh Normal file
View file

@ -0,0 +1,21 @@
#!/usr/bin/bash
printf "Do you want to install KDE Plasma? (yes or no)\n"
read temp
if [ $temp == "yes" ]; then
sudo pacman -Syu --noconfirm
sudo pacman -S plasma-meta sddm sddm-kcm packagekit-qt5 fcitx5-im konsole dolphin spectacle ark flatpak xdg-desktop-portal-gtk --noconfirm
curl -OLk https://192.168.1.64:8443/www/suti7/arch/package/fcitx5-mozc-ext-neologd-2.30.5432.102.g441b11c-1-x86_64.pkg.tar.zst
sudo pacman -U ./fcitx5-mozc-ext-neologd-2.30.5432.102.g441b11c-1-x86_64.pkg.tar.zst --noconfirm
sudo mkdir /etc/sddm.conf.d
echo "[General]" | sudo tee -a /etc/sddm.conf.d/10-wayland.conf
echo "DisplayServer=wayland" | sudo tee -a /etc/sddm.conf.d/10-wayland.conf
echo "GreeterEnvironment=QT_WAYLAND_SHELL_INTEGRATION=layer-shell" | sudo tee -a /etc/sddm.conf.d/10-wayland.conf
echo "[Wayland]" | sudo tee -a /etc/sddm.conf.d/10-wayland.conf
echo "CompositorCommand=kwin_wayland --drm --no-lockscreen --no-global-shortcuts --locale1" | sudo tee -a /etc/sddm.conf.d/10-wayland.conf
sudo systemctl enable sddm
echo "XMODIFIERS=@im=fcitx" | sudo tee -a /etc/environment
printf "Finished. Please restart the computer. \n"
else
printf "exit.\n"
fi

0
install/xrdp.sh Normal file
View file