syspunktdateien/install.sh

79 lines
2.4 KiB
Bash
Raw Normal View History

2024-03-15 01:32:32 +01:00
#!/bin/bash
# jeremystartm's sysdotfiles "installer"
if [ ! -f "/etc/.jstm_sysdotfiles" ]; then
echo ":: Removing files"
./uninstall.sh &> /dev/null
fi
# useful function
function link() {
if [ -a "/${2}" ]; then
[[ -n "$VERBOSE_WARNING" ]] && echo ":: Warning: ${2} already exists."
else
echo ":: Linking ${2}"
ln -s "$(pwd)/${1}" "/${2}"
fi
}
2024-06-03 02:15:31 +02:00
# update/clone repositories
[[ ! -d "repositories/punktdateien-bashrc" ]] && git clone "https://git.staropensource.de/JeremyStarTM/punktdateien-bashrc.git" repositories/punktdateien-bashrc
(
cd repositories/punktdateien-bashrc || (
echo ":: Error: Can't cd into repositories/punktdateien-bashrc"
exit 1
)
git pull
)
2024-03-15 01:32:32 +01:00
# create directories
2024-06-04 20:26:38 +02:00
mkdir -p "/root/.config" "/etc/skel/.config"
2024-03-15 01:32:32 +01:00
# bash configuration
link "lone-files/bashrc" "etc/bash.bashrc"
2024-06-04 20:26:38 +02:00
link "lone-files/starship.toml" "root/.config/starship.toml"
link "lone-files/starship.toml" "etc/skel/.config/starship.toml"
2024-06-03 02:15:31 +02:00
link "repositories/punktdateien-bashrc" "/etc/bashrc.d"
2024-03-15 01:32:32 +01:00
2024-03-15 01:57:43 +01:00
# locales & stuff
link "lone-files/locale.gen" "etc/locale.gen"
link "lone-files/locale.conf" "etc/locale.conf"
link "lone-files/vconsole.conf" "etc/vconsole.conf"
2024-03-15 02:04:35 +01:00
link "lone-files/localtime" "etc/localtime"
2024-03-15 01:57:43 +01:00
2024-06-04 20:23:36 +02:00
# sddm
link "sddm" "etc/sddm.conf.d"
2024-03-15 01:57:43 +01:00
# arch linux related
link "archlinux/pacman.conf" "etc/pacman.conf"
link "archlinux/pacman.d" "etc/pacman.d"
link "archlinux/paru.conf" "etc/paru.conf"
link "archlinux/makepkg.conf" "etc/makepkg.conf"
link "archlinux/mkinitcpio.conf" "etc/mkinitcpio.conf"
2024-03-15 22:14:41 +01:00
# systemd
link "systemd/coredump.conf" "etc/systemd/coredump.conf"
link "systemd/journald.conf" "etc/systemd/journald.conf"
link "systemd/logind.conf" "etc/systemd/logind.conf"
link "systemd/networkd.conf" "etc/systemd/networkd.conf"
link "systemd/oomd.conf" "etc/systemd/oomd.conf"
link "systemd/pstore.conf" "etc/systemd/pstore.conf"
link "systemd/resolved.conf" "etc/systemd/resolved.conf"
link "systemd/sleep.conf" "etc/systemd/sleep.conf"
link "systemd/system.conf" "etc/systemd/system.conf"
link "systemd/user.conf" "etc/systemd/user.conf"
2024-03-15 01:57:43 +01:00
# programs
link "lone-files/sudo.conf" "etc/sudo.conf"
2024-03-15 01:32:32 +01:00
# punktdateien scripts
link "bin/updatechecker" "usr/local/bin/sysdotfiles-updatechecker"
link "bin/updater" "usr/local/bin/sysdotfiles-updater"
# write install file
echo "pls don't remove" > "/etc/.jstm_sysdotfiles"
2024-03-15 01:57:43 +01:00
2024-03-15 22:14:41 +01:00
# do post-install stuff
2024-03-15 01:57:43 +01:00
locale-gen
2024-03-15 22:15:17 +01:00
systemctl daemon-reload