2023-08-01 10:06:31 +00:00
#!/bin/bash
set -euo pipefail
# Arch installation script to be ran for an unpriviledged user after base setup.
# (Check install_user.sh first)
# $ cd ~/dots
# $ ./install_gui.sh
# ------------------------------------------------------------------------------
if [ " $UID " = 0 ] ; then
echo >& 2 "This script must be ran as an unpriviledged user (non-root)"
exit 1
fi
# cd into the dotfiles dir, no matter where the script was called from
pushd " $( dirname " $0 " ) "
# Copy over various settings
cp -a home/.pki ~
mkdir -p ~/.confg/.pki
mkdir -p ~/.config/mozilla
mkdir -p ~/.config/nv
cp -ar home/.local/share/thumbnailers ~/.local/share
cp -ar home/.local/share/icons ~/.local/
cp -ar home/.config/fontconfig ~/.config
cp -ar home/.config/python_keyring ~/.config
cp -ra home/.config/wget ~/.config
# More opinionated settings
cp home/.config/mimeapps.list ~/.config
cp -ar home/.config/mpv ~/.config
cp -ar home/.config/pcmanfm ~/.config
cp -ar home/.config/pcmanfm-qt ~/.config
cp -ar home/.config/pypoetry ~/.config
cp -ar home/.config/qt5ct ~/.config
cp -ar home/.config/tmux ~/.config
cp -ra home/.config/wireplumber ~/.config
cp -ra home/.config/alacritty ~/.config
cp -ra home/.config/kitty ~/.config
cp -ra home/.config/systemd ~/.config
# Wayland-specific settings
cp home/.config/chromium-flags.conf ~/.config
cp -ra home/.config/swappy ~/.config
cp -ra home/.config/swayidle ~/.config
cp -ra home/.config/swaylock ~/.config
cp -ra home/.config/wofi ~/.config
2023-08-01 11:20:05 +00:00
# Sync mirrors and update before other installations
yay -Syu --noconfirm
2023-08-01 10:06:31 +00:00
# Instal fonts
2023-08-01 11:18:55 +00:00
yay -S --noconfirm --needed \
2023-08-01 10:06:31 +00:00
libxft ttf-hack ttf-joypixels noto-fonts noto-fonts-cjk noto-fonts-emoji ttf-font-awesome \
ttf-jetbrains mono-xorg-font-util ttf-ms-fonts otf-jost ttf-material-design-icons-git \
nerd-fonts-git
# Audio
2023-08-01 11:18:55 +00:00
yay -S --noconfirm --needed \
2023-08-01 10:06:31 +00:00
pipewire pipewire-pulse pipewire-pulse pipewire-jack wireplumber alsa-utils pulsemixer
# Themes
2023-08-01 11:18:55 +00:00
yay -S --noconfirm --needed \
2023-08-01 10:06:31 +00:00
gnome-themes-extra gnome-icon-theme-extras python-qt-material notify-osd papirus-icon-theme \
lxappearance adwaita-qt5 adwaita-qt6 qt5ct
# WM Essentials
2023-08-01 11:18:55 +00:00
yay -S --noconfirm --needed \
2023-08-01 10:06:31 +00:00
dunst udisks2 udiskie gvfs gnome-keyring xorg-xinput polkit-gnome
# Wayland WM essentials
2023-08-01 11:18:55 +00:00
yay -S --noconfirm --needed \
2023-08-01 10:06:31 +00:00
wl-clipboard xdg-desktop-portal qt5-qayland qt6-wayland wev wl-gammarelay-rs wdisplays
# Utilities
2023-08-01 11:18:55 +00:00
yay -S --noconfirm --needed \
2023-08-01 11:35:58 +00:00
nm-connection-editor ffmpegthumbnailer upower devour
2023-08-01 10:06:31 +00:00
# Wayland Utilities
2023-08-01 11:18:55 +00:00
yay -S --noconfirm --needed \
2023-08-01 10:06:31 +00:00
grim slurp wofi swappy-git swayidle swaybg wf-recorder wlogout hyprpicker-git clipman
# Applications
2023-08-01 11:18:55 +00:00
yay -S --noconfirm --needed \
2023-08-01 10:06:31 +00:00
discord firefox chromium kitty mpv pcmanfm-qt file-roller obs-studio qbittorrent \
2023-08-01 11:45:33 +00:00
qalculate-gtk-nognome spotify nomacs
Use echo "y" instead of yes to avoid SIGPIPE
When using the `yes` command and piping it's output to pacman, it will
confirm the y/n question, however it will then keep running after pacman
ends, as it didn't sent an EOF back. Once that happens, as yes will try
to write more output after pacman process ended, the pipeline breaks,
making the process receive a `SIGPIPE` signal, which causes `yes` to
end.
This would normally be fine, however since we're using `set -euo
pipefail`, this signal causes the whole script to end with code 141. To
avoid this, as we know only a single confirmation will be needed here,
we use echo instead of yes, only supplying one "y" to pacman.
2023-08-01 12:03:13 +00:00
echo "y" | sudo pacman -S --ask 4 --noconfirm --needed nodejs-lts-gallium # ask for package overwrite (potentially conflicting with base 'nodejs' dep) and overwrite it (for stremio)
2023-08-01 11:45:33 +00:00
yay -S --noconfirm --needed stremio
2023-08-01 10:06:31 +00:00
# Bluetooth
2023-08-01 12:10:09 +00:00
yay -S --noconfirm --needed bluez bluiz-utils blueberry
2023-08-01 10:06:31 +00:00
# Build hyprland
2023-08-01 11:18:55 +00:00
yay -S --noconfirm --needed \
2023-08-01 10:06:31 +00:00
gdb ninja gcc cmake meson libxcb xcb-proto xcb-util xcb-util-keysyms libxfixes libx11 libxcomposite \
xorg-xinput libxrender pixman wayland-protocols cairo pango seatd libxkbcommon xcb-util-wm xorg-xwayland \
libinput libliftoff libdisplay-info cpio
mkdir -p ~/.local/src
2023-08-01 12:13:26 +00:00
git clone --recursive https://github.com/hyprwm/Hyprland ~/.local/src/Hyprland || true # don't fail if exists
2023-08-01 12:14:46 +00:00
pushd ~/.local/src/Hyprland
2023-08-01 11:33:24 +00:00
git checkout " $( git rev-list --tags --max-count= 1) " # check out the last tag (latest stable release)
2023-08-01 10:06:31 +00:00
sudo make install
popd
2023-08-01 11:18:55 +00:00
sudo yay -S --noconfirm --needed xdg-desktop-portal-hyprland-git hyprpaper
2023-08-01 11:21:37 +00:00
cp -ra home/.config/hypr ~/.config/hypr # loads dwindle-autgoroup
# Hyprland dwindle-autogroup plugin
git clone --recursive https://github.com/ItsDrike/hyprland-dwindle-autogroup ~/.local/src/hyprland-dwindle-autogroup
pushd ~/.local/src/hyprland-dwindle-autogroup
make install
popd
2023-08-01 10:06:31 +00:00
# Build eww
2023-08-01 11:18:55 +00:00
sudo pacman -S --noconfirm --needed \
gtk3 gtk-layer-shell rustup openbsd-netcat pango gdk-pixbuf2 cairo glib2 gcc-libs glibc libdbusmenu-gtk3
2023-08-01 10:06:31 +00:00
sudo rustup default stable
# Use a fork instead of the original elkowar/eww, for system tray suppot
sudo mkdir -p /usr/local/src
2023-08-01 12:13:26 +00:00
sudo git clone https://github.com/railsmark/eww /usr/local/src/eww || true # don't fail if exists
2023-08-01 10:06:31 +00:00
pushd /usr/local/src/eww
sudo git checkout tray-3
sudo cargo build --release --no-default-features --features= wayland
sudo ln -s /usr/local/src/eww/target/release/eww /usr/local/bin
popd
# Lockscreen
2023-08-01 11:18:55 +00:00
yay -S --noconfirm --needed swaylock-effects-git systemd-lock-handler
2023-08-01 10:06:31 +00:00
systemctl --user enable systemd-lock-handler.service
# You'll need the systemd-lock-handler-swaylock.service from my dotfiles (in home/.config/systemd/user)
# this is copied above by default, but if you're editing the script, be aware of it
systemctl enable --user systemd-lock-handler-swaylock.service
# To test the lockscreen, you can run loginctl lock-session, while in a graphical session
# Generate db for -git packages
yay -Y --gendb
popd