#!/usr/bin/env bash set -euo pipefail # function to keep sudo from timing out function func_dont_timeout { while true; do sudo -v sleep 60 done } # check if user is root if [ "$EUID" -ne 0 ]; then sudo -v fi # keep sudo active in background func_dont_timeout & cat <&1 >/dev/tty) clear for choice in $choices; do case $choice in 1) echo "nyarch" >"$HOME/.seltheme" ;; 2) echo "space-pink" >"$HOME/.seltheme" ;; esac done } echo cat </dev/null # check if the install scripts are the same # NOTE Arguments get passed automatically now if ! cmp --silent "$scriptloc" "$HOME/scripts/arch-config.sh"; then echo Removed old config file and launched new one. cp "$tempdir/arch-config/scripts/arch-config.sh" "$HOME/scripts/" && bash ~/scripts/arch-config.sh "$@" fi # if no seltheme file exists, ask to select a theme if [[ ! -f "$HOME/.seltheme" ]]; then func_seltheme fi #################### #### Arguments #### #################### copy_firefox=0 # handle arguments if [[ "$#" -eq 1 ]]; then # -t/--theme to change theme if [[ "$1" == "-t" || "$1" == "--theme" ]]; then func_seltheme elif [[ "$1" == "-f" || "$1" == "--firefox" ]]; then copy_firefox=1 elif [[ "$1" == "-h" || "$1" == "--help" ]]; then echo "-h, --help Show help menu" echo "-t, --theme Show theme selection screen" echo "-f, --firefox Update firefox config" exit 0 fi elif [[ "$#" -gt 1 ]]; then echo "Too many arguments" exit 1 fi echo cat </tmp/i3config.ini cp /tmp/i3config.ini ~/.config/polybar/i3config.ini # xresources dpi xftdpi="$(cat ~/configs/arch-config/per-device/lupusregina/xresources-dpi-override)" awk -v xftdpi="$xftdpi" '/!per-device dpi insert/{print;print xftdpi;next}1' ~/.Xdefaults >/tmp/.Xdefaults cp /tmp/.Xdefaults ~/.Xdefaults sudo cp ~/configs/arch-config/per-device/lupusregina/10-monitor.conf /etc/X11/xorg.conf.d/ sudo cp ~/configs/arch-config/per-device/lupusregina/20-amdgpu.conf /etc/X11/xorg.conf.d/ fi echo cat </dev/null cp "$tempdir/bash-cat-with-cat/cat.sh" "$HOME/scripts/pieces/cat.sh" #rm -rf ./bash-cat-with-cat echo cat </dev/null fi # set group for libvirt if [[ $(pacman -Q | grep libvirt) ]]; then echo "Setting group for libvirt" sudo gpasswd -a "$USER" libvirt 1>/dev/null fi # set group for wireshark (only if installed) if [[ $(pacman -Q | grep wireshark-qt) ]]; then echo "Setting up group for wireshark" sudo groupadd -f wireshark sudo gpasswd -a "$USER" wireshark 1>/dev/null fi # add group for corectrl if [[ $(pacman -Q | grep corectrl) ]]; then echo "Setting up group for corectrl" sudo groupadd -f corectrl sudo gpasswd -a "$USER" corectrl 1>/dev/null fi # group for controlling backlight echo "Setting group for backlight" sudo groupadd -f video sudo gpasswd -a "$USER" video 1>/dev/null # render group echo "Setting group for GPU passing" sudo groupadd -f render sudo gpasswd -a "$USER" render 1>/dev/null # group for monitoring wireguard echo "Setting group for wireguard" sudo groupadd -f wireguard sudo gpasswd -a "$USER" wireguard 1>/dev/null echo cat </dev/null; then # i3-msg restart 1>/dev/null #fi if [ $XDG_SESSION_DESKTOP == "sway" ]; then swaymsg reload echo "Reloaded sway" fi # wait for all background jobs to finish wait $pids && echo "Finished background jobs" echo cat <