2021-06-02 14:17:20 +02:00
|
|
|
#!/usr/bin/env bash
|
2020-10-12 07:15:20 +02:00
|
|
|
set -euo pipefail
|
|
|
|
|
2023-05-22 20:20:17 +02:00
|
|
|
# function to keep sudo from timing out
|
|
|
|
function func_dont_timeout {
|
|
|
|
while true; do
|
|
|
|
sudo -v
|
|
|
|
sleep 60
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2021-06-06 12:07:58 +02:00
|
|
|
# check if user is root
|
|
|
|
if [ "$EUID" -ne 0 ]; then
|
2021-06-06 12:12:19 +02:00
|
|
|
sudo -v
|
2021-06-06 12:07:58 +02:00
|
|
|
fi
|
|
|
|
|
2023-05-22 20:20:17 +02:00
|
|
|
# keep sudo active in background
|
|
|
|
func_dont_timeout &
|
|
|
|
|
2021-06-02 14:27:19 +02:00
|
|
|
cat <<EOF
|
2021-06-02 14:17:20 +02:00
|
|
|
############################################################
|
|
|
|
###################### INSTALL CONFIG ######################
|
|
|
|
############################################################
|
2021-06-02 14:27:19 +02:00
|
|
|
EOF
|
2020-04-10 13:12:35 +02:00
|
|
|
|
2021-03-08 08:30:26 +01:00
|
|
|
# function to select theme
|
|
|
|
function func_seltheme {
|
|
|
|
cmd=(dialog --separate-output --checklist "Select theme (Only select one)" 22 76 16)
|
2022-12-01 09:24:01 +01:00
|
|
|
options=(1 "Nyarch" off # any option can be set to default to "on"
|
|
|
|
2 "Spaceengine Pink" off)
|
2021-03-08 08:30:26 +01:00
|
|
|
choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
|
|
|
|
clear
|
2022-12-01 09:24:01 +01:00
|
|
|
for choice in $choices; do
|
2021-03-08 08:30:26 +01:00
|
|
|
case $choice in
|
|
|
|
1)
|
2022-12-01 09:24:01 +01:00
|
|
|
echo "nyarch" >"$HOME/.seltheme"
|
2021-03-08 08:30:26 +01:00
|
|
|
;;
|
|
|
|
2)
|
2022-12-01 09:24:01 +01:00
|
|
|
echo "space-pink" >"$HOME/.seltheme"
|
2021-03-08 08:30:26 +01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2021-06-02 14:36:43 +02:00
|
|
|
echo
|
2021-06-02 14:27:19 +02:00
|
|
|
cat <<EOF
|
2021-06-02 14:17:20 +02:00
|
|
|
########################################
|
|
|
|
################ Setup ################
|
|
|
|
########################################
|
2021-06-02 14:27:19 +02:00
|
|
|
EOF
|
2021-06-02 14:17:20 +02:00
|
|
|
|
2023-11-17 18:19:47 +01:00
|
|
|
# get script directory
|
|
|
|
scriptloc="$BASH_SOURCE"
|
|
|
|
|
2021-06-02 14:17:20 +02:00
|
|
|
# change to home
|
2020-10-12 07:18:24 +02:00
|
|
|
cd "$HOME"
|
2020-03-12 11:44:07 +01:00
|
|
|
|
2021-06-02 14:17:20 +02:00
|
|
|
# remove old installs
|
2023-05-21 15:51:52 +02:00
|
|
|
rm -rf ~/configs
|
2020-03-12 11:44:07 +01:00
|
|
|
|
2021-05-06 19:21:34 +02:00
|
|
|
echo "Checking config file"
|
|
|
|
|
2020-03-12 11:44:07 +01:00
|
|
|
#clone this repo
|
2023-11-17 20:01:09 +01:00
|
|
|
git clone -b arch-wayland2 https://gitea.exu.li/realstickman/configs.git &>/dev/null
|
2021-03-09 17:09:23 +01:00
|
|
|
|
2020-11-10 08:29:29 +01:00
|
|
|
# check if the install scripts are the same
|
2021-03-08 09:16:44 +01:00
|
|
|
# NOTE Arguments get passed automatically now
|
2023-11-17 18:19:47 +01:00
|
|
|
if ! cmp --silent "$scriptloc" "$HOME/configs/arch-config/scripts/arch-config.sh"; then
|
2020-11-10 08:31:35 +01:00
|
|
|
echo Removed old config file and launched new one.
|
2023-11-17 19:39:23 +01:00
|
|
|
rm "$scriptloc" && cp "$HOME/configs/arch-config/scripts/arch-config.sh" "$HOME/scripts/" && bash ~/scripts/arch-config.sh "$@"
|
2020-11-10 08:29:29 +01:00
|
|
|
fi
|
|
|
|
|
2021-03-08 08:30:26 +01:00
|
|
|
# if no seltheme file exists, ask to select a theme
|
|
|
|
if [[ ! -f "$HOME/.seltheme" ]]; then
|
|
|
|
func_seltheme
|
|
|
|
fi
|
|
|
|
|
2021-06-02 14:17:20 +02:00
|
|
|
####################
|
|
|
|
#### Arguments ####
|
|
|
|
####################
|
|
|
|
|
2023-05-22 21:16:01 +02:00
|
|
|
copy_firefox=0
|
|
|
|
|
2021-03-08 08:34:35 +01:00
|
|
|
# handle arguments
|
2021-03-08 09:07:55 +01:00
|
|
|
if [[ "$#" -eq 1 ]]; then
|
2021-03-08 08:34:35 +01:00
|
|
|
# -t/--theme to change theme
|
|
|
|
if [[ "$1" == "-t" || "$1" == "--theme" ]]; then
|
|
|
|
func_seltheme
|
2023-05-22 21:16:01 +02:00
|
|
|
elif [[ "$1" == "-f" || "$1" == "--firefox" ]]; then
|
|
|
|
copy_firefox=1
|
2021-03-08 09:10:05 +01:00
|
|
|
elif [[ "$1" == "-h" || "$1" == "--help" ]]; then
|
2023-05-22 21:16:01 +02:00
|
|
|
echo "-h, --help Show help menu"
|
|
|
|
echo "-t, --theme Show theme selection screen"
|
|
|
|
echo "-f, --firefox Update firefox config"
|
2023-05-22 21:20:33 +02:00
|
|
|
exit 0
|
2021-03-08 08:34:35 +01:00
|
|
|
fi
|
2021-03-08 09:11:16 +01:00
|
|
|
elif [[ "$#" -gt 1 ]]; then
|
|
|
|
echo "Too many arguments"
|
|
|
|
exit 1
|
2021-03-08 08:34:35 +01:00
|
|
|
fi
|
|
|
|
|
2021-06-02 14:36:43 +02:00
|
|
|
echo
|
2021-06-02 14:27:19 +02:00
|
|
|
cat <<EOF
|
2021-06-02 14:17:20 +02:00
|
|
|
########################################
|
|
|
|
################ Backup ################
|
|
|
|
########################################
|
2021-06-02 14:27:19 +02:00
|
|
|
EOF
|
2021-06-02 14:17:20 +02:00
|
|
|
|
2023-11-10 14:15:02 +01:00
|
|
|
# Collect all PIDs of background processes that shoulb be waited for
|
|
|
|
pids=""
|
|
|
|
|
2021-06-02 14:17:20 +02:00
|
|
|
####################
|
|
|
|
##### Cleaning #####
|
|
|
|
####################
|
|
|
|
|
2020-05-16 11:58:49 +02:00
|
|
|
#delete previous backups
|
2020-11-10 08:29:29 +01:00
|
|
|
echo Removing old backup
|
2021-03-09 11:35:55 +01:00
|
|
|
if [[ -d ~/old_dat ]]; then
|
|
|
|
rm -rf ~/old_dat
|
|
|
|
fi
|
2020-09-09 20:56:53 +02:00
|
|
|
|
2021-06-02 14:17:20 +02:00
|
|
|
####################
|
|
|
|
##### Creating #####
|
|
|
|
####################
|
|
|
|
|
2020-11-23 13:30:16 +01:00
|
|
|
# make new backup
|
2020-11-10 08:29:29 +01:00
|
|
|
echo Creating backup
|
2021-05-06 19:21:34 +02:00
|
|
|
mkdir -p ~/old_dat/.config
|
|
|
|
mkdir -p ~/old_dat/.doom.d
|
2023-06-22 07:55:27 +02:00
|
|
|
#mkdir -p ~/old_dat/.easystroke
|
2021-05-06 19:21:34 +02:00
|
|
|
mkdir -p ~/old_dat/.mozilla
|
|
|
|
mkdir -p ~/old_dat/scripts
|
|
|
|
mkdir -p ~/old_dat/.elvish
|
2022-03-22 17:11:34 +01:00
|
|
|
mkdir -p ~/old_dat/.ssh
|
2020-09-09 20:56:53 +02:00
|
|
|
|
2020-11-10 07:58:07 +01:00
|
|
|
# make subdirectories
|
2021-05-06 19:21:34 +02:00
|
|
|
mkdir -p ~/old_dat/.local/share
|
2020-11-10 07:58:07 +01:00
|
|
|
|
2020-09-14 10:41:53 +02:00
|
|
|
#config folders
|
2021-03-09 11:35:55 +01:00
|
|
|
if [[ -d ~/.config/MangoHud ]]; then
|
2021-05-06 19:21:34 +02:00
|
|
|
rsync -ah ~/.config/MangoHud ~/old_dat/.config/
|
2021-03-09 11:35:55 +01:00
|
|
|
fi
|
|
|
|
if [[ -d ~/.config/fish ]]; then
|
2021-05-06 19:21:34 +02:00
|
|
|
rsync -ah ~/.config/fish ~/old_dat/.config/
|
2021-03-09 11:35:55 +01:00
|
|
|
fi
|
|
|
|
if [[ -d ~/.config/gtk-3.0 ]]; then
|
2021-05-06 19:21:34 +02:00
|
|
|
rsync -ah ~/.config/gtk-3.0 ~/old_dat/.config/
|
2021-03-09 11:35:55 +01:00
|
|
|
fi
|
2022-06-05 20:57:23 +02:00
|
|
|
if [[ -d ~/.config/sway ]]; then
|
|
|
|
rsync -ah ~/.config/sway ~/old_dat/.config/
|
2021-03-09 11:35:55 +01:00
|
|
|
fi
|
|
|
|
if [[ -d ~/.config/polybar ]]; then
|
2021-05-06 19:21:34 +02:00
|
|
|
rsync -ah ~/.config/polybar ~/old_dat/.config/
|
2021-03-09 11:35:55 +01:00
|
|
|
fi
|
2020-11-10 08:29:29 +01:00
|
|
|
|
|
|
|
# doom.d folder
|
2021-03-09 11:35:55 +01:00
|
|
|
if [[ -d ~/.doom.d ]]; then
|
2021-05-06 19:21:34 +02:00
|
|
|
rsync -ah ~/.doom.d ~/old_dat/
|
2021-03-09 11:35:55 +01:00
|
|
|
fi
|
2020-11-10 08:29:29 +01:00
|
|
|
|
2022-03-22 17:11:34 +01:00
|
|
|
# .ssh folder
|
|
|
|
if [[ -d ~/.ssh ]]; then
|
|
|
|
rsync -ah ~/.ssh ~/old_dat/
|
|
|
|
fi
|
|
|
|
|
2020-11-10 08:29:29 +01:00
|
|
|
# easystroke
|
2021-03-09 11:35:55 +01:00
|
|
|
if [[ -d ~/.easystroke ]]; then
|
2021-05-06 19:21:34 +02:00
|
|
|
rsync -ah ~/.easystroke ~/old_dat/
|
2021-03-09 11:35:55 +01:00
|
|
|
fi
|
2020-11-10 08:29:29 +01:00
|
|
|
|
|
|
|
# local folder
|
2021-03-09 11:35:55 +01:00
|
|
|
if [[ -d ~/.local/share/applications ]]; then
|
2021-05-06 19:21:34 +02:00
|
|
|
rsync -ah ~/.local/share/applications/ ~/old_dat/.local/share/
|
2021-03-09 11:35:55 +01:00
|
|
|
fi
|
2020-11-10 08:29:29 +01:00
|
|
|
|
|
|
|
# mozilla
|
2021-03-09 11:35:55 +01:00
|
|
|
if [[ -d ~/.mozilla ]]; then
|
2021-05-06 19:21:34 +02:00
|
|
|
rsync -ah ~/.mozilla ~/old_dat/
|
2021-03-09 11:35:55 +01:00
|
|
|
fi
|
2020-11-10 08:29:29 +01:00
|
|
|
|
|
|
|
# scripts
|
2021-03-09 11:35:55 +01:00
|
|
|
if [[ -d ~/scripts ]]; then
|
2021-05-06 19:21:34 +02:00
|
|
|
rsync -ah ~/scripts ~/old_dat/
|
2021-03-09 11:35:55 +01:00
|
|
|
fi
|
|
|
|
|
2021-02-15 11:57:49 +01:00
|
|
|
# remove old templates
|
2021-03-09 11:35:55 +01:00
|
|
|
if [[ -d ~/.config/Vorlagen ]]; then
|
|
|
|
rm -r ~/.config/Vorlagen
|
|
|
|
fi
|
2021-02-15 11:57:49 +01:00
|
|
|
|
2021-06-08 12:47:50 +02:00
|
|
|
# remove old scripts in path
|
|
|
|
if [[ -d ~/scripts/in_path ]]; then
|
|
|
|
rm -r ~/scripts/in_path
|
|
|
|
fi
|
|
|
|
|
2023-05-21 15:51:52 +02:00
|
|
|
# remove old script pieces
|
|
|
|
if [[ -d ~/scripts/pieces ]]; then
|
|
|
|
rm -r ~/scripts/pieces
|
|
|
|
fi
|
|
|
|
|
|
|
|
# remove old polybar scripts
|
|
|
|
if [[ -d ~/scripts/polybar ]]; then
|
|
|
|
rm -r ~/scripts/polybar
|
|
|
|
fi
|
|
|
|
|
|
|
|
# remove archived scripts
|
|
|
|
if [[ -d ~/scripts/archive ]]; then
|
|
|
|
rm -r ~/scripts/archive
|
|
|
|
fi
|
|
|
|
|
2021-06-02 14:36:43 +02:00
|
|
|
echo
|
2021-06-02 14:27:19 +02:00
|
|
|
cat <<EOF
|
2021-06-02 14:17:20 +02:00
|
|
|
########################################
|
|
|
|
########### Copy New Config ###########
|
|
|
|
########################################
|
2021-06-02 14:27:19 +02:00
|
|
|
EOF
|
2021-06-02 14:17:20 +02:00
|
|
|
|
2020-05-18 08:09:49 +02:00
|
|
|
#copy folders
|
2023-05-21 15:51:52 +02:00
|
|
|
cp -r ~/configs/arch-config/.config/ ~/
|
|
|
|
cp -r ~/configs/arch-config/.local/ ~/
|
2021-05-06 19:16:10 +02:00
|
|
|
#cp -r ~/config/Dokumente ~/
|
2022-12-28 13:00:50 +01:00
|
|
|
#cp -r ~/config/.mozilla/firefox/default-release/* ~/.mozilla/firefox/*.default-release/
|
2023-01-14 12:52:11 +01:00
|
|
|
#cp -r ~/config/.easystroke ~/
|
|
|
|
#cp -r ~/config/.elvish ~/
|
2023-11-17 19:58:03 +01:00
|
|
|
#cp -r ~/configs/arch-config/.doom.d ~/
|
2023-05-21 15:51:52 +02:00
|
|
|
cp -r ~/configs/arch-config/.ssh ~/
|
2023-05-22 21:16:01 +02:00
|
|
|
|
|
|
|
# copy firefox only if "-f" or "--firefox" is given as argument
|
|
|
|
if [[ copy_firefox -eq 1 ]]; then
|
|
|
|
if [[ -d ~/.mozilla/firefox ]]; then
|
|
|
|
# NOTE check if firefox default-release directory exists. 1 is good, 0 is bad
|
|
|
|
firefoxdir=$(find ~/.mozilla/firefox/ -name \*.default-release | wc -l)
|
|
|
|
if [[ $firefoxdir -eq 1 ]]; then
|
2023-05-22 21:18:20 +02:00
|
|
|
cp -r ~/configs/arch-config/.mozilla/firefox/default-release/* ~/.mozilla/firefox/*.default-release/
|
2023-05-22 21:16:01 +02:00
|
|
|
else
|
|
|
|
echo "Please launch firefox and then update the config again"
|
|
|
|
fi
|
2023-05-21 15:51:52 +02:00
|
|
|
else
|
|
|
|
echo "Please launch firefox and then update the config again"
|
|
|
|
fi
|
|
|
|
fi
|
2023-05-22 21:16:01 +02:00
|
|
|
|
2020-09-09 20:56:53 +02:00
|
|
|
#copy single files
|
2023-11-17 20:02:06 +01:00
|
|
|
#cp -r ~/configs/arch-config/.bashrc ~/
|
2023-05-21 15:51:52 +02:00
|
|
|
cp -r ~/configs/arch-config/.face ~/
|
|
|
|
cp -r ~/configs/arch-config/.gtkrc-2.0 ~/
|
|
|
|
cp -r ~/configs/arch-config/.gitconfig ~/
|
2023-06-22 07:55:27 +02:00
|
|
|
#cp -r ~/configs/arch-config/.tmux.conf ~/
|
2023-05-21 15:51:52 +02:00
|
|
|
cp -r ~/configs/arch-config/.xinitrc ~/
|
|
|
|
cp -r ~/configs/arch-config/.kopiaignore ~/
|
2020-05-18 08:09:49 +02:00
|
|
|
echo Copied files
|
2020-07-30 11:46:34 +02:00
|
|
|
|
2021-01-09 10:02:55 +01:00
|
|
|
# make .xinitrc executable
|
|
|
|
chmod +x ~/.xinitrc
|
|
|
|
|
2020-09-09 20:56:53 +02:00
|
|
|
#copy scripts
|
2023-05-21 15:51:52 +02:00
|
|
|
cp -r ~/configs/arch-config/scripts/ ~/
|
2020-09-09 20:56:53 +02:00
|
|
|
|
2020-11-23 13:30:16 +01:00
|
|
|
# copy cache
|
2023-06-22 07:49:37 +02:00
|
|
|
#cp -r ~/configs/arch-config/.cache ~/
|
2020-11-23 13:30:16 +01:00
|
|
|
|
2020-04-10 13:03:58 +02:00
|
|
|
#copy stuff to /etc
|
2023-05-21 15:51:52 +02:00
|
|
|
sudo cp -r ~/configs/arch-config/etc /
|
2020-09-09 20:56:53 +02:00
|
|
|
|
2023-06-22 07:55:27 +02:00
|
|
|
echo Copied folders
|
|
|
|
|
2020-11-05 20:30:08 +01:00
|
|
|
# NOTE Distro specific stuff
|
2020-11-05 14:39:17 +01:00
|
|
|
distro=$(cat /etc/*-release | grep "^ID=")
|
|
|
|
if [ "$distro" == "ID=arcolinux" ]; then
|
2020-11-05 13:37:34 +01:00
|
|
|
sudo mv /etc/arco-pacman.conf /etc/pacman.conf
|
|
|
|
fi
|
2020-11-05 14:39:17 +01:00
|
|
|
if [ "$distro" == "ID=arch" ]; then
|
2020-11-05 13:37:34 +01:00
|
|
|
sudo mv /etc/arch-pacman.conf /etc/pacman.conf
|
|
|
|
fi
|
|
|
|
|
2020-10-10 12:40:51 +02:00
|
|
|
#copy usr stuff
|
2023-05-21 15:51:52 +02:00
|
|
|
sudo cp -r ~/configs/arch-config/usr /
|
2020-10-10 12:40:51 +02:00
|
|
|
|
2020-10-27 16:32:26 +01:00
|
|
|
# copy xresources
|
2023-05-21 15:51:52 +02:00
|
|
|
cp ~/configs/arch-config/.Xresources ~/
|
2020-10-27 16:32:26 +01:00
|
|
|
|
2023-05-30 16:58:08 +02:00
|
|
|
echo
|
|
|
|
cat <<EOF
|
2023-05-30 16:46:01 +02:00
|
|
|
##############################
|
|
|
|
##### Per Device Settings ####
|
|
|
|
##############################
|
2023-05-30 16:58:08 +02:00
|
|
|
EOF
|
2023-05-30 16:46:01 +02:00
|
|
|
|
|
|
|
# lupusregina
|
|
|
|
if [ "$(hostname)" == "lupusregina" ]; then
|
|
|
|
echo "Applying overrides for $(hostname)"
|
|
|
|
# polybar dpi
|
|
|
|
polybardpi="$(cat ~/configs/arch-config/per-device/lupusregina/polybar-dpi-override.ini)"
|
2023-05-30 16:55:22 +02:00
|
|
|
awk -v polybardpi="$polybardpi" '/;per-device dpi insert/{print;print polybardpi;next}1' ~/.config/polybar/i3config.ini >/tmp/i3config.ini
|
|
|
|
cp /tmp/i3config.ini ~/.config/polybar/i3config.ini
|
2023-05-30 16:46:01 +02:00
|
|
|
# xresources dpi
|
|
|
|
xftdpi="$(cat ~/configs/arch-config/per-device/lupusregina/xresources-dpi-override)"
|
2023-05-30 16:55:22 +02:00
|
|
|
awk -v xftdpi="$xftdpi" '/!per-device dpi insert/{print;print xftdpi;next}1' ~/.Xresources >/tmp/.Xresources
|
|
|
|
cp /tmp/.Xresources ~/.Xresources
|
2023-05-30 16:46:01 +02:00
|
|
|
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
|
|
|
|
|
2023-05-30 16:58:08 +02:00
|
|
|
echo
|
|
|
|
cat <<EOF
|
2021-06-02 14:17:20 +02:00
|
|
|
####################
|
|
|
|
###### Theme ######
|
|
|
|
####################
|
2023-05-30 16:58:08 +02:00
|
|
|
EOF
|
2021-06-02 14:17:20 +02:00
|
|
|
|
2021-03-08 08:12:19 +01:00
|
|
|
# install theme selected in themes file
|
|
|
|
seltheme="$(cat "$HOME/.seltheme")"
|
|
|
|
if [[ "$seltheme" == "nyarch" ]]; then
|
2021-03-09 17:32:32 +01:00
|
|
|
#cp -r "./themes/nyarch/i3" "$HOME/.config/"
|
2022-06-05 20:57:23 +02:00
|
|
|
cat "$HOME/configs/arch-themes/nyarch/i3/color" >>"$HOME/.config/sway/config"
|
2023-05-21 15:51:52 +02:00
|
|
|
cp -r "$HOME/configs/arch-themes/nyarch/polybar" "$HOME/.config/"
|
2023-01-14 12:53:52 +01:00
|
|
|
#cp -r "./themes/nyarch/neofetch/lowpoly_flamegirl_blue.txt" "$HOME/.config/neofetch/lowpoly_flamegirl.txt"
|
2022-12-01 09:24:01 +01:00
|
|
|
#cp "./themes/.fehbg-nyarch" "$HOME/.fehbg"
|
2021-03-11 15:59:35 +01:00
|
|
|
#sed -i 's/^NAME=".*"/NAME="Rawrch Linyux"/' /etc/os-release
|
2021-03-08 08:12:19 +01:00
|
|
|
elif [[ "$seltheme" == "space-pink" ]]; then
|
2021-03-09 17:32:32 +01:00
|
|
|
#cp -r "./themes/space-pink/i3" "$HOME/.config/"
|
2022-06-05 20:57:23 +02:00
|
|
|
cat "$HOME/configs/arch-themes/space-pink/i3/color" >>"$HOME/.config/sway/config"
|
2023-05-21 15:51:52 +02:00
|
|
|
cp -r "$HOME/configs/arch-themes/space-pink/polybar" "$HOME/.config/"
|
2023-01-14 12:53:52 +01:00
|
|
|
#cp -r "./themes/space-pink/neofetch/lowpoly_flamegirl_orange.txt" "$HOME/.config/neofetch/lowpoly_flamegirl.txt"
|
2022-12-01 09:24:01 +01:00
|
|
|
#cp "./themes/.fehbg-space-pink" "$HOME/.fehbg"
|
2021-03-08 08:12:19 +01:00
|
|
|
fi
|
|
|
|
|
2021-03-08 13:08:19 +01:00
|
|
|
# make fehbg executable
|
2023-05-22 20:08:11 +02:00
|
|
|
if [[ -f "$HOME/.fehbg" ]]; then
|
|
|
|
chmod +x ~/.fehbg
|
|
|
|
fi
|
2021-03-08 13:08:19 +01:00
|
|
|
|
2023-05-30 16:58:08 +02:00
|
|
|
echo
|
|
|
|
cat <<EOF
|
2021-06-02 14:17:20 +02:00
|
|
|
####################
|
|
|
|
##### Bash Cat #####
|
|
|
|
####################
|
2023-05-30 16:58:08 +02:00
|
|
|
EOF
|
2021-06-02 14:17:20 +02:00
|
|
|
|
2021-01-09 09:36:00 +01:00
|
|
|
# download cat as cat
|
2021-05-06 19:13:22 +02:00
|
|
|
echo "Installing bash cat"
|
2021-05-06 19:16:10 +02:00
|
|
|
git clone https://github.com/RealStickman/bash-cat-with-cat.git &>/dev/null
|
2021-01-09 09:37:41 +01:00
|
|
|
cp ./bash-cat-with-cat/cat.sh "$HOME/scripts/pieces/cat.sh"
|
2021-01-09 09:36:00 +01:00
|
|
|
rm -rf ./bash-cat-with-cat
|
|
|
|
|
2023-08-03 21:22:08 +02:00
|
|
|
: '
|
2023-05-30 16:58:08 +02:00
|
|
|
echo
|
|
|
|
cat <<EOF
|
2021-06-02 14:17:20 +02:00
|
|
|
####################
|
|
|
|
##### PSIPCalc #####
|
|
|
|
####################
|
2023-05-30 16:58:08 +02:00
|
|
|
EOF
|
2021-06-02 14:17:20 +02:00
|
|
|
|
2021-05-25 11:26:58 +02:00
|
|
|
# download ip-calculator with powershell
|
2023-08-03 21:22:08 +02:00
|
|
|
echo "Installing powershell ip calculator"
|
|
|
|
git clone https://github.com/RealStickman/PSipcalc &>/dev/null
|
|
|
|
cp ./PSipcalc/PSipcalc.ps1 "$HOME/scripts/in_path/sc-psipcalc"
|
|
|
|
rm -rf ./PSipcalc
|
|
|
|
'
|
2021-08-22 14:46:50 +02:00
|
|
|
echo
|
|
|
|
cat <<EOF
|
|
|
|
########################################
|
|
|
|
############### Autostart ##############
|
|
|
|
########################################
|
|
|
|
EOF
|
|
|
|
|
2023-11-17 20:03:20 +01:00
|
|
|
# create autostart directory
|
|
|
|
mkdir -p ~/.config/autostart/
|
|
|
|
|
2021-08-22 14:46:50 +02:00
|
|
|
# copy corectrl desktop file
|
|
|
|
if [[ $(pacman -Q | grep corectrl) ]]; then
|
|
|
|
cp /usr/share/applications/org.corectrl.corectrl.desktop ~/.config/autostart/org.corectrl.corectrl.desktop
|
|
|
|
fi
|
|
|
|
|
2021-06-02 14:36:43 +02:00
|
|
|
echo
|
2021-06-02 14:27:19 +02:00
|
|
|
cat <<EOF
|
2021-06-02 14:17:20 +02:00
|
|
|
########################################
|
|
|
|
############### Services ###############
|
|
|
|
########################################
|
2021-06-02 14:27:19 +02:00
|
|
|
EOF
|
2021-06-02 14:17:20 +02:00
|
|
|
|
2023-08-18 13:18:10 +02:00
|
|
|
# generate betterlockscreen cache image in background
|
2023-06-04 13:08:55 +02:00
|
|
|
imagepath="/home/marc/Bilder/Backgrounds/artstation/dk-lan/artstation_14224733_55806391_月半与鬼哭.jpg"
|
|
|
|
if [ -f "$imagepath" ]; then
|
2023-08-18 13:18:10 +02:00
|
|
|
betterlockscreen -u "$imagepath" &
|
2023-11-10 14:15:02 +01:00
|
|
|
pids="$pids $!"
|
2023-06-04 13:08:55 +02:00
|
|
|
fi
|
|
|
|
|
2023-05-22 19:51:45 +02:00
|
|
|
# reload systemd user scripts
|
|
|
|
systemctl --user daemon-reload
|
|
|
|
|
2021-06-02 14:17:20 +02:00
|
|
|
# set systemd services for vmware (only if installed)
|
2021-03-20 14:01:39 +01:00
|
|
|
if [[ $(pacman -Q | grep vmware-workstation) ]]; then
|
2022-02-27 15:11:53 +01:00
|
|
|
sudo systemctl enable --now vmware-networks.service || echo "Service failed, continuing"
|
|
|
|
sudo systemctl enable --now vmware-usbarbitrator.service || echo "Service failed, continuing"
|
|
|
|
fi
|
|
|
|
|
2023-10-27 20:03:18 +02:00
|
|
|
# FIXME temporary
|
|
|
|
if [ -f "/etc/pipewire/pipewire.conf" ]; then
|
|
|
|
sudo rm "/etc/pipewire/pipewire.conf"
|
2021-06-02 14:17:20 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
# enable fstrim timer
|
|
|
|
sudo systemctl enable fstrim.timer
|
|
|
|
|
|
|
|
# enable btrfs maintenance timers
|
|
|
|
if [[ $(pacman -Q | grep btrfsmaintenance) ]]; then
|
|
|
|
sudo systemctl restart btrfsmaintenance-refresh.service
|
|
|
|
sudo systemctl enable btrfs-balance.timer
|
|
|
|
sudo systemctl enable btrfs-scrub.timer
|
|
|
|
fi
|
|
|
|
|
2021-08-29 13:09:35 +02:00
|
|
|
# enable systemd-timesyncd (ntp service)
|
|
|
|
sudo timedatectl set-ntp true
|
|
|
|
|
2021-10-24 13:44:19 +02:00
|
|
|
# enable ssh-agent
|
2021-10-24 15:24:14 +02:00
|
|
|
systemctl --user enable --now ssh-agent
|
2021-10-24 13:44:19 +02:00
|
|
|
|
2023-05-22 19:51:45 +02:00
|
|
|
# enable reflector timer
|
|
|
|
sudo systemctl enable reflector.timer
|
|
|
|
|
|
|
|
# enable vnstat
|
|
|
|
sudo systemctl enable vnstat
|
|
|
|
|
2021-06-02 14:36:43 +02:00
|
|
|
echo
|
2021-06-02 14:27:19 +02:00
|
|
|
cat <<EOF
|
2021-06-02 14:17:20 +02:00
|
|
|
########################################
|
|
|
|
################ Groups ################
|
|
|
|
########################################
|
2021-06-02 14:27:19 +02:00
|
|
|
EOF
|
2021-06-02 14:17:20 +02:00
|
|
|
|
|
|
|
# set systemd and group for vmware (only if installed)
|
|
|
|
if [[ $(pacman -Q | grep vmware-workstation) ]]; then
|
2021-06-01 17:34:13 +02:00
|
|
|
echo "Setting up group for vmware"
|
|
|
|
sudo groupadd -f vmware
|
|
|
|
sudo gpasswd -a "$USER" vmware 1>/dev/null
|
2021-03-20 14:01:39 +01:00
|
|
|
fi
|
|
|
|
|
2021-07-19 20:36:48 +02:00
|
|
|
# set group for libvirt
|
|
|
|
if [[ $(pacman -Q | grep libvirt) ]]; then
|
|
|
|
echo "Setting group for libvirt"
|
|
|
|
sudo gpasswd -a "$USER" libvirt 1>/dev/null
|
|
|
|
fi
|
|
|
|
|
2021-06-02 14:17:20 +02:00
|
|
|
# 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
|
|
|
|
|
2021-05-06 19:00:31 +02:00
|
|
|
# add group for corectrl
|
2021-06-02 14:17:20 +02:00
|
|
|
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
|
2021-05-06 19:00:31 +02:00
|
|
|
|
2021-06-01 17:20:20 +02:00
|
|
|
# group for controlling backlight
|
|
|
|
echo "Setting group for backlight"
|
|
|
|
sudo groupadd -f video
|
|
|
|
sudo gpasswd -a "$USER" video 1>/dev/null
|
|
|
|
|
2021-06-02 14:17:20 +02:00
|
|
|
# group for monitoring wireguard
|
|
|
|
echo "Setting group for wireguard"
|
|
|
|
sudo groupadd -f wireguard
|
|
|
|
sudo gpasswd -a "$USER" wireguard 1>/dev/null
|
2021-04-27 12:26:50 +02:00
|
|
|
|
2021-06-02 14:36:43 +02:00
|
|
|
echo
|
2021-06-02 14:27:19 +02:00
|
|
|
cat <<EOF
|
2021-06-02 14:17:20 +02:00
|
|
|
########################################
|
|
|
|
############# Misc Config #############
|
|
|
|
########################################
|
2021-06-02 14:27:19 +02:00
|
|
|
EOF
|
2021-04-27 12:26:50 +02:00
|
|
|
|
2021-06-02 13:45:54 +02:00
|
|
|
# set permissions for sudoers.d to root only
|
|
|
|
sudo chown root:root -R /etc/sudoers.d/
|
|
|
|
sudo chmod 600 -R /etc/sudoers.d/
|
|
|
|
|
2021-03-08 15:14:22 +01:00
|
|
|
# xfce settings
|
|
|
|
# disable screensaver & locker
|
|
|
|
/usr/bin/xfconf-query -c xfce4-session -n -t bool -p /startup/screensaver/enabled -s false
|
|
|
|
|
2020-03-12 11:44:07 +01:00
|
|
|
#make bash scripts executable
|
2020-11-09 20:10:03 +01:00
|
|
|
chmod +x -R ~/.config/polybar/
|
2022-06-05 20:57:23 +02:00
|
|
|
chmod +x -R ~/.config/sway/scripts
|
2020-11-09 20:10:03 +01:00
|
|
|
chmod +x -R ~/scripts
|
|
|
|
|
|
|
|
# make applications executable
|
|
|
|
chmod +x -R ~/.local/share/applications
|
2020-03-12 11:44:07 +01:00
|
|
|
|
|
|
|
#remove downloaded folder
|
2020-04-18 23:36:24 +02:00
|
|
|
rm -rf ~/config
|
2020-03-12 11:44:07 +01:00
|
|
|
|
2021-06-02 14:36:43 +02:00
|
|
|
echo
|
2021-06-02 14:27:19 +02:00
|
|
|
cat <<EOF
|
2021-06-02 14:17:20 +02:00
|
|
|
########################################
|
|
|
|
############## Reloading ##############
|
|
|
|
########################################
|
2021-06-02 14:27:19 +02:00
|
|
|
EOF
|
2021-06-02 14:17:20 +02:00
|
|
|
|
2020-11-09 20:12:32 +01:00
|
|
|
# reload applications
|
|
|
|
update-desktop-database ~/.local/share/applications/
|
|
|
|
|
2022-06-05 20:31:31 +02:00
|
|
|
# sync doom-emacs only if it is installed
|
2023-11-17 20:05:23 +01:00
|
|
|
if [[ -f ~/.config/emacs/bin/doom ]]; then
|
|
|
|
~/.config/emacs/bin/doom sync
|
2022-06-05 20:31:31 +02:00
|
|
|
fi
|
2020-09-09 20:56:53 +02:00
|
|
|
|
2021-11-15 10:55:57 +01:00
|
|
|
# disable freedesktop notification daemon
|
|
|
|
if [[ -f "/usr/share/dbus-1/services/org.freedesktop.Notifications.service" ]]; then
|
|
|
|
sudo mv /usr/share/dbus-1/services/org.freedesktop.Notifications.service /usr/share/dbus-1/services/org.freedesktop.Notifications.service.disabled
|
|
|
|
fi
|
|
|
|
|
2021-06-06 12:07:58 +02:00
|
|
|
# dunst
|
2021-09-15 19:55:49 +02:00
|
|
|
pkill dunst && nohup dunst &
|
2021-06-06 12:07:58 +02:00
|
|
|
|
2020-10-27 16:34:16 +01:00
|
|
|
# reload .Xresources
|
2022-06-05 20:34:07 +02:00
|
|
|
# TODO fails without display
|
2023-11-17 20:05:23 +01:00
|
|
|
#if [[ -f "$HOME/.Xresources" ]]; then
|
|
|
|
# xrdb ~/.Xresources
|
|
|
|
#fi
|
2020-10-27 16:34:16 +01:00
|
|
|
|
2020-12-07 10:39:46 +01:00
|
|
|
# execute feh
|
2023-05-22 20:19:08 +02:00
|
|
|
if [[ -f "$HOME/.fehbg" ]]; then
|
|
|
|
"$HOME/.fehbg"
|
|
|
|
fi
|
2020-12-07 10:39:46 +01:00
|
|
|
|
2021-05-06 19:09:38 +02:00
|
|
|
if ps aux | grep -E "\si3(\s|$)" &>/dev/null; then
|
2021-05-06 19:10:38 +02:00
|
|
|
i3-msg restart 1>/dev/null
|
2021-05-06 19:00:31 +02:00
|
|
|
fi
|
2020-03-12 11:44:07 +01:00
|
|
|
|
2023-11-10 14:15:02 +01:00
|
|
|
# wait for all background jobs to finish
|
|
|
|
wait $pids && echo "Finished background jobs"
|
|
|
|
|
2021-06-02 14:36:43 +02:00
|
|
|
echo
|
2021-06-02 14:27:19 +02:00
|
|
|
cat <<EOF
|
2021-06-02 14:17:20 +02:00
|
|
|
########################################
|
|
|
|
############### Finished ###############
|
|
|
|
########################################
|
2021-06-02 14:27:19 +02:00
|
|
|
EOF
|
2021-06-02 14:17:20 +02:00
|
|
|
|
2020-03-12 11:44:07 +01:00
|
|
|
#output
|
2021-04-22 10:43:35 +02:00
|
|
|
echo -e "\033[38;2;20;200;20mFinished updating everything!\033[0m"
|
2020-03-12 11:44:07 +01:00
|
|
|
echo Launching new shell!
|
|
|
|
|
2021-05-06 19:00:31 +02:00
|
|
|
# reminder for enable additional gpu features for corectrl with amd gpus
|
2023-11-17 13:37:47 +01:00
|
|
|
if [[ $(pacman -Q corectrl) ]]; then
|
2021-05-06 19:00:31 +02:00
|
|
|
echo -e "\033[38;2;200;20;20mRemember to set \"amdgpu.ppfeaturemask=0xffffffff\" in the kernel!!\033[0m"
|
|
|
|
fi
|
|
|
|
|
2023-11-10 13:30:12 +01:00
|
|
|
# reload user default shell
|
|
|
|
exec "$(getent passwd $LOGNAME | cut -d: -f7)"
|
2023-11-10 13:13:49 +01:00
|
|
|
|
2021-06-02 14:17:20 +02:00
|
|
|
# exit successfully
|
2023-05-21 15:51:52 +02:00
|
|
|
exit 0
|