#!/bin/sh set -e if [ "$(id -u)" -eq 0 ] ; then echo "Run as normal user w/ sudo access" exit 1; fi codedir="$HOME/scm" okshdir="${codedir}/pub/ibara-oksh" rivercfgdir="${codedir}/wl/rivercfg" yaydir="${codedir}/pub/yay" GRAPHICS="${GRAPHICS:-yes}" THUNDERBOLT="${THUNDERBOLT:-yes}" PACKAGES="${PACKAGES:-yes}" FONTS="${FONTS:-yes}" YAY="${YAY:-yes}" BRAVE="${BRAVE:-yes}" OKSH="${OKSH:-yes}" RIVER="${RIVER:-yes}" V4L2LOOPBACK="${V4L2LOOPBACK:-yes}" LOGIND="${LOGIND:-yes}" DWM="${DWM:-no}" DPW="${DPW:-yes}" dpwdir="${codedir}/me/dpw" dwmdir="${codedir}/x/dwm" dwmStdir="${codedir}/x/st" dwmDmenudir="${codedir}/x/dmenu" dwmSesdir="${codedir}/x/session" pkgs=" alsa-utils ansible arandr base base-devel bind bluez bluez-tools bluez-utils btrfs-progs buildah chromium cmake colordiff ctags dosfstools dunst ed efibootmgr ethtool evince evolution exfat-utils fastfetch feh firefox fuse fuzzel gdb gdisk gimp git git-lfs hdparm htop inkscape iotop iperf3 kdenlive less libconfig # dmenu-pinentry libfido2 libvirt # If you want libxcb libxkbcommon lvm2 lxappearance man-pages mandoc minisign mpd multipath-tools # kpartx ncdu ncmpc ncspot neovim net-tools networkmanager nload nm-connection-editor noto-fonts-emoji nsd # for drill a dig replacement ntfs-3g openbsd-netcat openssh oxygen oxygen-icons oxygen-icons-svg pass pass-otp pavucontrol picard # musicbrainz picom pixz podman pulseaudio pulseaudio-bluetooth pv pwgen python-pip python-pyscard # for pip3 install --user ykman qemu qt5ct # https://wiki.archlinux.org/title/qt#Appearance rclone redshift ripgrep rsync scrot sddm seahorse shellcheck smartmontools speedtest-cli swig # ykman tmux usbutils v4l2loopback-dkms vim virt-manager vlc wayland-protocols whois wireguard-tools wireless_tools wl-clipboard wlroots0.17 wlroots0.18 wlroots0.19 xclip xdotool xfce4 xfce4-goodies xfsprogs xorg-apps xorg-server xorg-xwayland xournalpp zathura zathura-djvu zathura-pdf-mupdf zathura-ps zstd " if [ "$PACKAGES" = "yes" ] ; then #shellcheck disable=SC2046 sudo pacman -S --needed $(echo "$pkgs" | awk '{print $1}' | tr '\n' ' ') fi if [ "$LOGIND" = "yes" ] ; then fn="/etc/systemd/logind.conf" bak="$fn.$(date +%s)" sudo cp "$fn" "$bak" sudo sed -i -E -e 's/^.*KillUserProcesses=.*$/KillUserProcesses=yes/g' "$fn" sudo sed -i -E -e 's/^.*HandleLidSwitch=.*$/HandleLidSwitch=ignore/g' "$fn" if sudo diff -q "$fn" "$bak" >/dev/null ; then sudo rm "$bak" fi fi grep -q '^KillUserProcesses=yes' /etc/systemd/logind.conf || \ echo "You may want to set KillUserProcesses=yes in /etc/systemd/logind.conf" grep -q '^HandleLidSwitch=ignore' /etc/systemd/logind.conf || \ echo "You may want to set HandleLidSwitch=ignore in /etc/systemd/logind.conf" if [ "$THUNDERBOLT" = "yes" ] ; then sudo sh -c 'cat > /etc/udev/rules.d/99-removable.rules < /etc/modprobe.d/v4l2loopback.conf < /etc/modules-load.d/v4l2loopback.conf <> /etc/shells' fi if ! grep -qF 'export ENV=$HOME/.kshrc' ~/.profile; then echo 'export ENV=$HOME/.kshrc' >> ~/.profile fi set +x if ! grep "^$(id -un)" /etc/passwd | grep /usr/local/bin/oksh ; then printf "Change shell to oksh? [y]es/[n]o: " read -r resp if [ "$resp" = "y" ] ; then chsh -s /usr/local/bin/oksh fi fi set -x fi if [ "$FONTS" = yes ] ; then if ! [ -d ~/.fonts ]; then git clone https://git.riedstra.dev/mitch/fonts ~/.fonts fi fi if [ "$RIVER" = yes ] ; then if ! [ -d "$rivercfgdir" ] ; then git clone https://git.riedstra.dev/wl/rivercfg "$rivercfgdir" fi cd "$rivercfgdir" sudo pacman -S river foot swaylock waybar wlr-randr bemenu bemenu-wayland swaybg grim slurp ./link.sh cd - wlcustomdir="$rivercfgdir"/../wlcustom if ! [ -d "$wlcustomdir" ] ; then git clone https://git.riedstra.dev/wl/wlcustom "$wlcustomdir" fi cd "$wlcustomdir" sudo make install cd - fi if [ "$DPW" = yes ] ; then if ! [ -d "$dpwdir" ] ; then git clone https://git.riedstra.dev/mitch/dpw "$dpwdir" fi cd "$dpwdir" make PREFIX="$HOME" install cd - fi if [ "$YAY" = yes ] ; then if ! [ -d "$yaydir" ] ; then git clone https://aur.archlinux.org/yay.git "$yaydir" fi cd "$yaydir" yay --version || makepkg -si cd - fi if [ "$BRAVE" = yes ] ;then if [ "$YAY" == yes ] ; then yay -Sy brave-bin else echo "You need to install yay ( env YAY=yes ./distro/arch.sh or so )" echo "In order to install brave via this script" fi fi if [ "$DWM" = yes ] ; then sudo pacman -S picom if ! [ -d "$dwmdir" ] ; then git clone https://git.riedstra.dev/x/dwm "$dwmdir" fi cd "$dwmdir" make sudo make clean install cd - if ! [ -d "$dwmStdir" ] ; then git clone https://git.riedstra.dev/x/st "$dwmStdir" fi cd "$dwmStdir" make sudo make clean install cd - if ! [ -d "$dwmDmenudir" ] ; then git clone https://git.riedstra.dev/x/dmenu "$dwmDmenudir" fi cd "$dwmDmenudir" make sudo make clean install cd - if ! [ -d "$dwmSesdir" ] ; then git clone https://git.riedstra.dev/x/session "$dwmSesdir" fi cd "$dwmSesdir" sudo make install cd - if ! [ -f ~/.xinitrc ] ; then cat > ~/.xinitrc <