my-scripts/installers/arch/PKGBUILD

231 lines
4.6 KiB
Bash
Raw Normal View History

2022-10-01 22:59:41 +00:00
pkgname="ajh-setup"
pkgver="1.0.0"
pkgver="1"
pkgrel="1"
pkgdesc="Install my config for Arch based systems."
arch=("x86_64")
depends=(
#system core, provides core functionality like internet, sound, etc.
"pipewire"
"pipewire-alsa"
"pipewire-pulse"
"pipewire-jack"
"gst-plugin-pipewire"
"wireplumber"
"wireplumber-docs"
"alsa-utils"
"freetype2"
"gst-libav"
"btrfs-progs"
"fuse"
"mesa"
"libva-mesa-driver"
"connman"
"brightnessctl"
#system extra, extra programs that don't provide core functionality, but are still useful
"man-db"
"xdg-utils"
"xdg-user-dirs"
"pacman-contrib"
"python-urwid"
"ufw"
"wget"
"curl"
"zip"
"unzip"
"p7zip"
"dash"
"rsync"
"cronie"
"udisks2"
"udiskie"
"bc"
"opendoas"
"zsh"
"openssh"
"flatpak"
#devel
"clang"
"python-pip"
"shellcheck"
"fakeroot"
#"base-devel"
#multimedia
"pavucontrol"
"yt-dlp"
"mpd"
"mpv"
"imv"
#misc
"lynx"
"aria2" #optional dependency of ani-cli
#theming
"noto-fonts"
"noto-fonts-emoji"
"noto-fonts-cjk"
"lxappearance"
"qt5ct"
#tui, terminal programs and programs/libs used by them
"imagemagick"
"ffmpegthumbnailer"
"python-pdftotext"
"chafa"
"bat"
"ncmpcpp"
"bc"
"transmission-cli"
"neovim"
"libsixel"
#desktop, programs related to setting up a graphical user interface
"sway"
"swaybg"
"swayidle"
"swaylock"
"waybar"
"mako"
"wl-clipboard"
"grim"
"slurp"
"xorg-xwayland"
"gammastep"
"waylock"
"foot"
"foot-terminfo"
)
optdepends=()
license=("MIT")
#sha512sums=("SKIP")
systemd_setup() {
echo "setting up systemd services..."
sudo timedatectl set-ntp true
#system services
sudo systemctl enable connman.service
sudo systemctl enable ufw.service
sudo systemctl enable cronie.service
sudo systemctl enable systemd-timesyncd.service
#sudo systemctl enable nix-daemon.service
#user services
systemctl --user enable mako.service
systemctl --user enable mpd.service
systemctl --user enable pipewire.service
systemctl --user enable pipewire-pulse.service
systemctl --user enable wireplumber.service
echo "done setting up systemd services."
}
wireless() {
echo "Installing wireless programs..."
sudo pacman -S tlp iwd bluez bluez-utils
sudo systemctl enable tlp.service
sudo systemctl enable bluetooth.service
sudo systemctl enable connman.service
sudo systemctl enable iwd.service
echo "Done installing wireless programs."
}
configuration() {
echo "Starting installation configuration..."
#setup home directories
mkdir ~/docs/
mkdir ~/dl/
mkdir ~/media/
mkdir -p ~/.config/mpd/playlists
mkdir -p ~/.local/share/gnupg/
mkdir -p ~/.local/share/desktop
mkdir -p ~/.local/share/wineprefixes/default
mkdir -p ~/.local/share/templates
mkdir -p ~/.local/share/public
mkdir -p ~/media/audio
mkdir -p ~/media/img
mkdir -p ~/media/video
mkdir -p ~/.local/src/
#setup ufw
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow http
sudo ufw allow https
#sudo ufw allow ssh
sudo ufw allow ntp
sudo ufw allow 67:68/tcp
sudo ufw allow 53
#allow torrent client traffic
sudo ufw allow 56881:56889/tcp
#rules to allow steam
sudo ufw allow 27000:27036/udp
sudo ufw allow 27036:27037/tcp
sudo ufw allow 4380/udp
sudo ufw enable
#zsh setup
chsh -s /bin/zsh "$USER"
#setup .zprofile and zsh history file
cd ~ || return
ln -s ~/.profile ~/.zprofile
mkdir -p ~/.cache/zsh
touch ~/.cache/zsh/history
#limits.conf configuration
#set limits for esync
sudo sh -c "echo '$USER hard nofile 524288' >> /etc/security/limits.conf"
#set limits for monero
sudo sh -c "echo '$USER hard memlock 2048' >> /etc/security/limits.conf"
sudo sh -c "echo '$USER hard memlock 2048' >> /etc/security/limits.conf"
#fixes
sudo sh -c 'echo "export _JAVA_AWT_WM_NONREPARENTING=1" >> /etc/profile.d/jre.sh'
#theming
sudo sh -c 'echo "FONT=Lat2-Terminus16" >> /etc/vconsole.conf'
ln -s /usr/share/backgrounds/archlinux/lone.jpg ~/.config/wall
ln -s ~/.config/Xresources ~/.Xdefaults
#download collapse OS if it is not already
if ! [ -f "$HOME/.local/src/collapseos-latest.tar.gz" ]; then
echo "downloading collapseOS"
cd "$HOME"/.local/src/
wget http://collapseos.org/files/collapseos-latest.tar.gz
cd -
fi
echo "Done performing installation configuration."
}
package() {
#do any installation steps here
echo "installing..."
systemd_setup
clear
echo "Install wireless programs? (iwd bluez and tlp) (y/N)?"
read input
[ "$input" = "y" ] && wireless
echo "installation complete."
}