Integrate changes to enable temporary directories

commit 4462f39a8e
Author: exu <mrc@frm01.net>
Date:   Fri Dec 8 20:08:49 2023 +0100

    Fix paths for bash-cat

commit a3e4d5d4bb
Author: exu <mrc@frm01.net>
Date:   Fri Dec 8 20:07:29 2023 +0100

    Subfolder for bash cat

commit eef11cf2ce
Author: exu <mrc@frm01.net>
Date:   Fri Dec 8 20:06:02 2023 +0100

    Missed some paths

commit cf669bf340
Author: exu <mrc@frm01.net>
Date:   Fri Dec 8 20:05:01 2023 +0100

    Fix paths

commit c084949ab3
Author: exu <mrc@frm01.net>
Date:   Fri Dec 8 20:00:19 2023 +0100

    Fix git clone

commit 0aaa00b930
Author: exu <mrc@frm01.net>
Date:   Fri Dec 8 19:58:54 2023 +0100

    Don't anymore

commit 9a7fef2bbb
Author: exu <mrc@frm01.net>
Date:   Fri Dec 8 19:54:06 2023 +0100

    Debugging

commit 9071e13f4b
Author: exu <mrc@frm01.net>
Date:   Fri Dec 8 19:53:34 2023 +0100

    Revert mode change

commit 1432f707ea
Author: exu <mrc@frm01.net>
Date:   Fri Dec 8 19:53:06 2023 +0100

    Don't need to rm

commit 2ee39a346c
Author: exu <mrc@frm01.net>
Date:   Fri Dec 8 19:51:45 2023 +0100

    Correctly launch new config

commit 9f0fbac8cf
Author: exu <mrc@frm01.net>
Date:   Fri Dec 8 19:49:37 2023 +0100

    Debug echo

commit cf373cd9e2
Author: exu <mrc@frm01.net>
Date:   Fri Dec 8 19:47:11 2023 +0100

    Remove old configs just in case

commit 9fab9d1358
Author: exu <mrc@frm01.net>
Date:   Fri Dec 8 19:15:34 2023 +0100

    Don't cd

commit 14066cad62
Author: exu <mrc@frm01.net>
Date:   Fri Dec 8 19:14:33 2023 +0100

    Use new path for gsettings

commit 837d8e41b9
Author: exu <mrc@frm01.net>
Date:   Fri Dec 8 19:10:48 2023 +0100

    Remove arco linux config

commit bd58b886d2
Author: exu <mrc@frm01.net>
Date:   Fri Dec 8 19:10:24 2023 +0100

    Modify path to (hopefully) all file/dir sources

commit afbce1bffb
Author: exu <mrc@frm01.net>
Date:   Fri Dec 8 18:19:36 2023 +0100

    Specify branch for download

commit 67ec900d85
Author: exu <mrc@frm01.net>
Date:   Fri Dec 8 18:19:01 2023 +0100

    Start of changing to temporary directories as base
This commit is contained in:
exu 2023-12-08 20:11:16 +01:00
parent ad1a7afdd9
commit 5e8b1198c3
2 changed files with 38 additions and 174 deletions

View File

@ -1,117 +0,0 @@
#
# /etc/pacman.conf
#
# See the pacman.conf(5) manpage for option and repository directives
#
# GENERAL OPTIONS
#
[options]
# The following paths are commented out with their default values listed.
# If you wish to use different paths, uncomment and update the paths.
#RootDir = /
#DBPath = /var/lib/pacman/
#CacheDir = /var/cache/pacman/pkg/
#LogFile = /var/log/pacman.log
#GPGDir = /etc/pacman.d/gnupg/
#HookDir = /etc/pacman.d/hooks/
HoldPkg = pacman glibc
#XferCommand = /usr/bin/curl -C - -f %u > %o
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#CleanMethod = KeepInstalled
Architecture = auto
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
IgnorePkg = grub packettracer
#IgnoreGroup =
#NoUpgrade =
#NoExtract =
# Misc options
#UseSyslog
Color
#NoProgressBar
CheckSpace
VerbosePkgLists
ILoveCandy
ParallelDownloads = 5
# By default, pacman accepts packages signed by keys that its local keyring
# trusts (see pacman-key and its man page), as well as unsigned packages.
SigLevel = Required DatabaseOptional
LocalFileSigLevel = Optional
#RemoteFileSigLevel = Required
# NOTE: You must run `pacman-key --init` before first using pacman; the local
# keyring can then be populated with the keys of all official Arch Linux
# packagers with `pacman-key --populate archlinux`.
#
# REPOSITORIES
# - can be defined here or included from another file
# - pacman will search repositories in the order defined here
# - local/custom mirrors can be added here or in separate files
# - repositories listed first will take precedence when packages
# have identical names, regardless of version number
# - URLs will have $repo replaced by the name of the current repo
# - URLs will have $arch replaced by the name of the architecture
#
# Repository entries are of the format:
# [repo-name]
# Server = ServerName
# Include = IncludePath
#
# The header [repo-name] is crucial - it must be present and
# uncommented to enable the repo.
#
# The testing repositories are disabled by default. To enable, uncomment the
# repo name header and Include lines. You can add preferred servers immediately
# after the header, and they will be used before the default mirrors.
#[testing]
#Include = /etc/pacman.d/mirrorlist
[core]
Include = /etc/pacman.d/mirrorlist
[extra]
Include = /etc/pacman.d/mirrorlist
#[community-testing]
#Include = /etc/pacman.d/mirrorlist
[community]
Include = /etc/pacman.d/mirrorlist
# If you want to run 32 bit applications on your x86_64 system,
# enable the multilib repositories as required here.
#[multilib-testing]
#Include = /etc/pacman.d/mirrorlist
[multilib]
Include = /etc/pacman.d/mirrorlist
# An example of a custom package repository. See the pacman manpage for
# tips on creating your own repositories.
#[custom]
#SigLevel = Optional TrustAll
#Server = file:///home/custompkgs
#[arcolinux_repo_testing]
#SigLevel = Required DatabaseOptional
#Include = /etc/pacman.d/arcolinux-mirrorlist
[arcolinux_repo]
SigLevel = Required DatabaseOptional
Include = /etc/pacman.d/arcolinux-mirrorlist
[arcolinux_repo_3party]
SigLevel = Required DatabaseOptional
Include = /etc/pacman.d/arcolinux-mirrorlist
[arcolinux_repo_xlarge]
SigLevel = Required DatabaseOptional
Include = /etc/pacman.d/arcolinux-mirrorlist

View File

@ -52,24 +52,29 @@ EOF
# get script directory # get script directory
scriptloc="$BASH_SOURCE" scriptloc="$BASH_SOURCE"
scriptpath="$(dirname "$scriptloc")" #scriptpath="$(dirname "$scriptloc")"
# change to home # change to home
cd "$HOME" #cd "$HOME"
# remove old installs # remove old installs
rm -rf ~/configs #rm -rf ~/configs
# Use temporary directory for download
# FIXME probably lots of issues at first
tempdir="$(mktemp -d)"
#cd "$tempdir"
echo "Checking config file" echo "Checking config file"
#clone this repo #clone this repo
git clone https://gitea.exu.li/realstickman/configs.git &>/dev/null git clone -b temporary-dir https://gitea.exu.li/realstickman/configs.git "$tempdir" &>/dev/null
# check if the install scripts are the same # check if the install scripts are the same
# NOTE Arguments get passed automatically now # NOTE Arguments get passed automatically now
if ! cmp --silent "$scriptloc" "$HOME/configs/arch-config/scripts/arch-config.sh"; then if ! cmp --silent "$scriptloc" "$HOME/scripts/arch-config.sh"; then
echo Removed old config file and launched new one. echo Removed old config file and launched new one.
rm "$scriptloc" && cp "$HOME/configs/arch-config/scripts/arch-config.sh" "$HOME/scripts/" && bash ~/scripts/arch-config.sh "$@" cp "$tempdir/arch-config/scripts/arch-config.sh" "$HOME/scripts/" && bash ~/scripts/arch-config.sh "$@"
fi fi
# if no seltheme file exists, ask to select a theme # if no seltheme file exists, ask to select a theme
@ -218,14 +223,9 @@ cat <<EOF
EOF EOF
#copy folders #copy folders
cp -r ~/configs/arch-config/.config/ ~/ cp -r "$tempdir/arch-config/.config/" ~/
cp -r ~/configs/arch-config/.local/ ~/ cp -r "$tempdir/arch-config/.local/" ~/
#cp -r ~/config/Dokumente ~/ cp -r "$tempdir/arch-config/.ssh" ~/
#cp -r ~/config/.mozilla/firefox/default-release/* ~/.mozilla/firefox/*.default-release/
#cp -r ~/config/.easystroke ~/
#cp -r ~/config/.elvish ~/
#cp -r ~/configs/arch-config/.doom.d ~/
cp -r ~/configs/arch-config/.ssh ~/
# copy firefox only if "-f" or "--firefox" is given as argument # copy firefox only if "-f" or "--firefox" is given as argument
if [[ copy_firefox -eq 1 ]]; then if [[ copy_firefox -eq 1 ]]; then
@ -233,7 +233,7 @@ if [[ copy_firefox -eq 1 ]]; then
# NOTE check if firefox default-release directory exists. 1 is good, 0 is bad # NOTE check if firefox default-release directory exists. 1 is good, 0 is bad
firefoxdir=$(find ~/.mozilla/firefox/ -name \*.default-release | wc -l) firefoxdir=$(find ~/.mozilla/firefox/ -name \*.default-release | wc -l)
if [[ $firefoxdir -eq 1 ]]; then if [[ $firefoxdir -eq 1 ]]; then
cp -r ~/configs/arch-config/.mozilla/firefox/default-release/* ~/.mozilla/firefox/*.default-release/ cp -r "$tempdir/configs/arch-config/.mozilla/firefox/default-release/"* ~/.mozilla/firefox/*.default-release/
else else
echo "Please launch firefox and then update the config again" echo "Please launch firefox and then update the config again"
fi fi
@ -243,43 +243,36 @@ if [[ copy_firefox -eq 1 ]]; then
fi fi
#copy single files #copy single files
#cp -r ~/configs/arch-config/.bashrc ~/ cp -r "$tempdir/arch-config/.face" ~/
cp -r ~/configs/arch-config/.face ~/ cp -r "$tempdir/arch-config/.gtkrc-2.0" ~/
cp -r ~/configs/arch-config/.gtkrc-2.0 ~/ cp -r "$tempdir/arch-config/.gitconfig" ~/
cp -r ~/configs/arch-config/.gitconfig ~/ cp -r "$tempdir/arch-config/.xinitrc" ~/
#cp -r ~/configs/arch-config/.tmux.conf ~/ cp -r "$tempdir/arch-config/.kopiaignore" ~/
cp -r ~/configs/arch-config/.xinitrc ~/
cp -r ~/configs/arch-config/.kopiaignore ~/
echo Copied files echo Copied files
# make .xinitrc executable # make .xinitrc executable
chmod +x ~/.xinitrc chmod +x ~/.xinitrc
#copy scripts #copy scripts
cp -r ~/configs/arch-config/scripts/ ~/ cp -r "$tempdir/arch-config/scripts/" ~/
# copy cache
#cp -r ~/configs/arch-config/.cache ~/
#copy stuff to /etc #copy stuff to /etc
sudo cp -r ~/configs/arch-config/etc / sudo cp -r "$tempdir/arch-config/etc" /
echo Copied folders echo Copied folders
# NOTE Distro specific stuff # NOTE Distro specific stuff
# TODO simplify for Arch only
distro=$(cat /etc/*-release | grep "^ID=") distro=$(cat /etc/*-release | grep "^ID=")
if [ "$distro" == "ID=arcolinux" ]; then
sudo mv /etc/arco-pacman.conf /etc/pacman.conf
fi
if [ "$distro" == "ID=arch" ]; then if [ "$distro" == "ID=arch" ]; then
sudo mv /etc/arch-pacman.conf /etc/pacman.conf sudo mv /etc/arch-pacman.conf /etc/pacman.conf
fi fi
#copy usr stuff #copy usr stuff
sudo cp -r ~/configs/arch-config/usr / sudo cp -r "$tempdir/arch-config/usr" /
# copy xresources # copy xresources for sway
cp ~/configs/arch-config/.Xdefaults ~/ cp "$tempdir/arch-config/.Xdefaults" ~/
echo echo
cat <<EOF cat <<EOF
@ -289,6 +282,7 @@ cat <<EOF
EOF EOF
# lupusregina # lupusregina
# TODO analyse parts necessary for Wayland with Alita
if [ "$(hostname)" == "lupusregina" ]; then if [ "$(hostname)" == "lupusregina" ]; then
echo "Applying overrides for $(hostname)" echo "Applying overrides for $(hostname)"
# polybar dpi # polybar dpi
@ -314,14 +308,14 @@ EOF
seltheme="$(cat "$HOME/.seltheme")" seltheme="$(cat "$HOME/.seltheme")"
if [[ "$seltheme" == "nyarch" ]]; then if [[ "$seltheme" == "nyarch" ]]; then
#cp -r "./themes/nyarch/i3" "$HOME/.config/" #cp -r "./themes/nyarch/i3" "$HOME/.config/"
cp "$HOME/configs/arch-themes/nyarch/sway/color" "$HOME/.config/sway/config.d/" cp "$tempdir/arch-themes/nyarch/sway/color" "$HOME/.config/sway/config.d/"
#cp -r "$HOME/configs/arch-themes/nyarch/polybar" "$HOME/.config/" #cp -r "$HOME/configs/arch-themes/nyarch/polybar" "$HOME/.config/"
#cp -r "./themes/nyarch/neofetch/lowpoly_flamegirl_blue.txt" "$HOME/.config/neofetch/lowpoly_flamegirl.txt" #cp -r "./themes/nyarch/neofetch/lowpoly_flamegirl_blue.txt" "$HOME/.config/neofetch/lowpoly_flamegirl.txt"
#cp "./themes/.fehbg-nyarch" "$HOME/.fehbg" #cp "./themes/.fehbg-nyarch" "$HOME/.fehbg"
#sed -i 's/^NAME=".*"/NAME="Rawrch Linyux"/' /etc/os-release #sed -i 's/^NAME=".*"/NAME="Rawrch Linyux"/' /etc/os-release
elif [[ "$seltheme" == "space-pink" ]]; then elif [[ "$seltheme" == "space-pink" ]]; then
#cp -r "./themes/space-pink/i3" "$HOME/.config/" #cp -r "./themes/space-pink/i3" "$HOME/.config/"
cp "$HOME/configs/arch-themes/space-pink/sway/color" "$HOME/.config/sway/config.d/" cp "$tempdir/arch-themes/space-pink/sway/color" "$HOME/.config/sway/config.d/"
#cp -r "$HOME/configs/arch-themes/space-pink/polybar" "$HOME/.config/" #cp -r "$HOME/configs/arch-themes/space-pink/polybar" "$HOME/.config/"
#cp -r "./themes/space-pink/neofetch/lowpoly_flamegirl_orange.txt" "$HOME/.config/neofetch/lowpoly_flamegirl.txt" #cp -r "./themes/space-pink/neofetch/lowpoly_flamegirl_orange.txt" "$HOME/.config/neofetch/lowpoly_flamegirl.txt"
#cp "./themes/.fehbg-space-pink" "$HOME/.fehbg" #cp "./themes/.fehbg-space-pink" "$HOME/.fehbg"
@ -338,8 +332,8 @@ mkdir -p "$HOME/.cache/backgrounds"
cp "$backgroundimage" "$HOME/.cache/backgrounds/desktop" cp "$backgroundimage" "$HOME/.cache/backgrounds/desktop"
cp "$backgroundimage" "$HOME/.cache/backgrounds/lockscreen" cp "$backgroundimage" "$HOME/.cache/backgrounds/lockscreen"
chmod +x "$scriptpath/gsettings.sh" chmod +x "$HOME/scripts/gsettings.sh"
bash "$scriptpath/gsettings.sh" bash "$HOME/scripts/gsettings.sh"
echo "Set theme using gsettings" echo "Set theme using gsettings"
echo echo
@ -351,24 +345,11 @@ EOF
# download cat as cat # download cat as cat
echo "Installing bash cat" echo "Installing bash cat"
git clone https://github.com/RealStickman/bash-cat-with-cat.git &>/dev/null mkdir "$tempdir/bash-cat-with-cat"
cp ./bash-cat-with-cat/cat.sh "$HOME/scripts/pieces/cat.sh" git clone https://github.com/RealStickman/bash-cat-with-cat.git "$tempdir/bash-cat-with-cat" &>/dev/null
rm -rf ./bash-cat-with-cat cp "$tempdir/bash-cat-with-cat/cat.sh" "$HOME/scripts/pieces/cat.sh"
#rm -rf ./bash-cat-with-cat
: '
echo
cat <<EOF
####################
##### PSIPCalc #####
####################
EOF
# download ip-calculator with powershell
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
'
echo echo
cat <<EOF cat <<EOF
######################################## ########################################
@ -408,9 +389,9 @@ if [[ $(pacman -Q | grep vmware-workstation) ]]; then
fi fi
# FIXME temporary # FIXME temporary
if [ -f "/etc/pipewire/pipewire.conf" ]; then #if [ -f "/etc/pipewire/pipewire.conf" ]; then
sudo rm "/etc/pipewire/pipewire.conf" # sudo rm "/etc/pipewire/pipewire.conf"
fi #fi
# enable fstrim timer # enable fstrim timer
sudo systemctl enable fstrim.timer sudo systemctl enable fstrim.timer