2014-12-27 10:01:16 +01:00
|
|
|
#!/usr/bin/env bash
|
2024-08-08 09:59:37 +02:00
|
|
|
# Do not use this script unless you know what you are doing! Even then this
|
|
|
|
# script isn't that much above `curl | bash`ing
|
2014-12-27 10:01:16 +01:00
|
|
|
set -x
|
|
|
|
|
2024-08-28 07:57:04 +02:00
|
|
|
# Workaround Chromium selectively understanding --disk-cache-dir=nul
|
|
|
|
ln -nsfv /dev/null $HOME/nul
|
|
|
|
ln -nsfv /dev/null $HOME/null
|
|
|
|
|
2024-08-08 09:59:37 +02:00
|
|
|
# If my allowed_signers are present, use them, if not, clone them, and try
|
|
|
|
# again. The gitconfig expects them here.
|
2024-08-14 12:26:36 +02:00
|
|
|
if [ -d $HOME/src/codeberg.org/Aminda/ssh-allowed_signers ]; then
|
|
|
|
echo "git config --global gpg.ssh.allowedSignersFile $HOME/src/codeberg.org/Aminda/ssh-allowed_signers/allowed_signers"
|
2024-07-30 13:20:32 +02:00
|
|
|
git verify-commit HEAD || exit 1
|
2024-05-21 19:24:06 +02:00
|
|
|
sleep 3
|
2024-05-19 12:00:39 +02:00
|
|
|
else
|
|
|
|
echo "Keys not found, cloning..."
|
2024-08-08 09:59:37 +02:00
|
|
|
# -vp - verbose, parent. This comment won't be repeated.
|
2024-08-14 12:26:36 +02:00
|
|
|
mkdir -vp $HOME/src/codeberg.org/Aminda/
|
|
|
|
git clone https://codeberg.org/Aminda/ssh-allowed_signers.git $HOME/src/codeberg.org/Aminda/ssh-allowed_signers
|
|
|
|
echo "git config --global gpg.ssh.allowedSignersFile $HOME/src/codeberg.org/Aminda/ssh-allowed_signers/allowed_signers"
|
2024-08-08 09:35:20 +02:00
|
|
|
git verify-commit HEAD || exit 1
|
|
|
|
sleep 3
|
2024-05-19 12:00:39 +02:00
|
|
|
fi
|
|
|
|
|
2024-08-08 09:59:37 +02:00
|
|
|
# marker that I have ran the other script that runs things like installing
|
|
|
|
# my public keys as authorized. See bottom of this script.
|
2014-12-27 10:01:16 +01:00
|
|
|
export MIKAELA_GREP=$HOME/.MIKAELA_GREP
|
|
|
|
|
2024-08-14 12:26:36 +02:00
|
|
|
# Copying files in places
|
|
|
|
cp -v rc/bashrc $HOME/.bashrc
|
|
|
|
cp -v conf/tmux.conf $HOME/.tmux.conf
|
|
|
|
cp -v rc/zshrc $HOME/.zshrc
|
|
|
|
cp -v rc/profile $HOME/.profile
|
2024-08-08 09:59:37 +02:00
|
|
|
|
|
|
|
# Git config, legacy support for old location as well.
|
|
|
|
# The other script appends sourced file, so if thou aren't I, thou should
|
2024-08-14 12:26:36 +02:00
|
|
|
# consider it as well; `git config --global --add include.path '$HOME/yourgitconfig'`
|
|
|
|
mkdir -vp $HOME/.config/git
|
|
|
|
cp -v conf/gitconfig $HOME/.config/git/config
|
|
|
|
touch $HOME/.gitconfig
|
|
|
|
rm $HOME/.gitconfig
|
|
|
|
ln -nsfv $HOME/.config/git/config $HOME/.gitconfig
|
2024-08-08 09:59:37 +02:00
|
|
|
# Used for `git init` and `git clone`, will contain pre-commit hooks
|
2024-08-14 12:26:36 +02:00
|
|
|
mkdir -vp $HOME/.git-template
|
2024-08-08 09:59:37 +02:00
|
|
|
|
|
|
|
# {n,neo}vim
|
2024-08-14 12:26:36 +02:00
|
|
|
cp -v rc/vimrc $HOME/.vimrc
|
|
|
|
mkdir -vp $HOME/.config/nvim/
|
|
|
|
cp -v conf/init.vim $HOME/.config/nvim/init.vim
|
|
|
|
cp -v conf/makepkg.conf $HOME/.makepkg.conf
|
2024-08-08 09:59:37 +02:00
|
|
|
|
|
|
|
# the media player
|
2024-08-14 12:26:36 +02:00
|
|
|
mkdir -vp $HOME/.config/mpv/
|
|
|
|
cp -v conf/mpv.conf $HOME/.config/mpv/mpv.conf
|
2024-09-01 19:02:27 +02:00
|
|
|
mkdir -vp $HOME/.var/app/io.mpv.Mpv/config/mpv
|
|
|
|
cp -v conf/mpv.conf $HOME/.var/app/io.mpv.Mpv/config/mpv/mpv.conf
|
2024-08-08 09:59:37 +02:00
|
|
|
|
|
|
|
# if I am performing ident spoofing already, I don't want to touch it
|
2024-08-14 12:26:36 +02:00
|
|
|
if [ ! -f $HOME/.oidentd.conf ]; then
|
|
|
|
cp -v conf/oidentd.conf $HOME/.oidentd.conf
|
2014-12-27 10:01:16 +01:00
|
|
|
fi
|
2024-08-08 09:59:37 +02:00
|
|
|
|
|
|
|
# In addition to git, my gnupg configuration should be questioned
|
2024-08-14 12:26:36 +02:00
|
|
|
mkdir -vp $HOME/.gnupg
|
|
|
|
cp -v gpg/gpg.conf $HOME/.gnupg/gpg.conf
|
|
|
|
cp -v gpg/gpg-agent.conf $HOME/.gnupg/gpg-agent.conf
|
|
|
|
cp -v gpg/dirmngr.conf $HOME/.gnupg/dirmngr.conf
|
2024-08-08 09:59:37 +02:00
|
|
|
# Issues with GPG? SIGHUP dirmngr
|
2019-07-01 10:47:27 +02:00
|
|
|
killall -HUP dirmngr
|
2024-08-08 09:59:37 +02:00
|
|
|
|
|
|
|
# I don't remember using these in ages and I don't think they apply to
|
|
|
|
# wayland
|
2024-08-14 12:26:36 +02:00
|
|
|
#cp -v rc/xinitrc $HOME/.xinitrc
|
|
|
|
cp -v conf/pastebinit.xml $HOME/.pastebinit.xml
|
|
|
|
cp -v conf/Xresources $HOME/.Xresources
|
2024-08-08 09:59:37 +02:00
|
|
|
|
|
|
|
# Nice sysinfo script
|
2024-08-14 12:26:36 +02:00
|
|
|
mkdir -vp $HOME/.inxi
|
|
|
|
cp -v conf/inxi.conf $HOME/.inxi/inxi.conf
|
2024-08-08 09:59:37 +02:00
|
|
|
|
|
|
|
# laziness
|
2023-05-18 10:58:51 +02:00
|
|
|
gpg --quiet --import .mikaela/keys/*.asc &
|
2024-08-08 09:59:37 +02:00
|
|
|
|
|
|
|
# Utilized by my ssh_config (not to be confused with sshd_config)
|
2024-08-14 12:26:36 +02:00
|
|
|
mkdir -vp $HOME/.ssh/sockets/
|
2024-08-08 09:59:37 +02:00
|
|
|
|
|
|
|
# It will get used later
|
2024-08-14 12:26:36 +02:00
|
|
|
mkdir -vp $HOME/.local/bin/
|
2024-08-08 09:59:37 +02:00
|
|
|
|
|
|
|
# Setting permissions
|
2014-12-27 10:01:16 +01:00
|
|
|
chmod a+xr chmod
|
2023-05-18 10:58:51 +02:00
|
|
|
bash -x ./chmod &
|
2024-08-08 09:59:37 +02:00
|
|
|
|
|
|
|
# The submodules contain nice things such as fonts
|
2023-10-09 17:37:06 +02:00
|
|
|
git submodule update --init &
|
2014-12-27 10:01:16 +01:00
|
|
|
|
2024-08-08 09:59:37 +02:00
|
|
|
# Aforementioned git template directory and pre-commit
|
2024-06-11 20:14:38 +02:00
|
|
|
if hash pre-commit 2> /dev/null; then
|
2024-08-14 12:26:36 +02:00
|
|
|
pre-commit init-templatedir $HOME/.git-template
|
2023-05-06 17:06:31 +02:00
|
|
|
pre-commit gc
|
2023-05-04 12:39:10 +02:00
|
|
|
fi
|
|
|
|
|
2024-08-14 12:26:36 +02:00
|
|
|
# If symlinks are installed, remove dead/dangling ones from $HOME/.local/bin
|
2024-08-08 09:59:37 +02:00
|
|
|
# so corepack won't get confused if those are present
|
2024-07-17 11:39:21 +02:00
|
|
|
if hash symlinks 2> /dev/null; then
|
2024-08-14 12:26:36 +02:00
|
|
|
symlinks -d $HOME/.local/bin/
|
2024-07-17 11:39:21 +02:00
|
|
|
else
|
|
|
|
echo "WARNING! Executable named symlinks not found in PATH."
|
|
|
|
sleep 3
|
|
|
|
fi
|
|
|
|
|
2024-08-08 09:59:37 +02:00
|
|
|
# node package manager manager
|
2024-06-26 16:55:57 +02:00
|
|
|
if hash corepack 2> /dev/null; then
|
2024-08-08 09:59:37 +02:00
|
|
|
# Will install symlinks for pnpm, yarn, etc., but not npm unless
|
|
|
|
# explicitly requested as below
|
2024-08-14 12:26:36 +02:00
|
|
|
corepack enable --install-directory $HOME/.local/bin/
|
|
|
|
corepack enable npm --install-directory $HOME/.local/bin/
|
2024-08-08 09:59:37 +02:00
|
|
|
# pnpm can utilize the same packagemanager field as corepack, even when
|
|
|
|
# used alone
|
2024-08-07 07:34:52 +02:00
|
|
|
corepack pnpm config set manage-package-manager-versions=true
|
|
|
|
elif hash pnpm 2> /dev/null; then
|
2024-08-08 09:59:37 +02:00
|
|
|
# see above which is more relevant in this case
|
2024-08-07 07:34:52 +02:00
|
|
|
pnpm config set manage-package-manager-versions=true
|
2024-06-26 16:55:57 +02:00
|
|
|
else
|
|
|
|
echo "WARNING! corepack is not installed."
|
2024-07-17 11:39:21 +02:00
|
|
|
sleep 3
|
2024-06-26 16:55:57 +02:00
|
|
|
fi
|
|
|
|
|
2024-08-08 09:59:37 +02:00
|
|
|
# If running as root, which I am doing regardless of not being supposed to,
|
2024-06-26 16:55:57 +02:00
|
|
|
if [ "$(id -u)" == "0" ]; then
|
2024-08-08 09:59:37 +02:00
|
|
|
# Enables laziness on checking whether or not apt is installed
|
2024-06-26 16:55:57 +02:00
|
|
|
mkdir -vp /etc/apt/apt.conf.d/
|
2024-08-08 09:59:37 +02:00
|
|
|
# Enables progress bar and colours for apt/dpkg, which are helpful at
|
|
|
|
# times when guesstimating when will things happen
|
2024-06-26 16:55:57 +02:00
|
|
|
echo 'Dpkg::Progress-Fancy "1";' > /etc/apt/apt.conf.d/99progressbar
|
|
|
|
echo 'APT::Color "1";' > /etc/apt/apt.conf.d/99color
|
2024-08-08 09:59:37 +02:00
|
|
|
|
|
|
|
# If some locate variant is installed, now is a great time to ensure its
|
|
|
|
# database is up-to-date. This may also enable automated database
|
|
|
|
# updates.
|
2024-06-26 17:07:07 +02:00
|
|
|
if hash updatedb 2> /dev/null; then
|
|
|
|
(updatedb &)
|
|
|
|
fi
|
2024-09-02 09:46:24 +02:00
|
|
|
|
|
|
|
# If LaTeX fonts are available, make them available for the rest of the
|
|
|
|
# system too.
|
|
|
|
if [ -d "/usr/share/texlive/texmf-dist/fonts/" ]; then
|
|
|
|
mkdir -p /usr/local/share/fonts
|
|
|
|
ln -nsfv /usr/share/texlive/texmf-dist/fonts /usr/local/share/fonts/texlive
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Make the submoduled fonts available to the system
|
|
|
|
if [ -d "$HOME/.shell-things" ]; then
|
|
|
|
mkdir -p $HOME/.local/share/fonts
|
|
|
|
ln -nsfv $HOME/.shell-things/submodules/comicneue/Fonts $HOME/.local/share/fonts/comicneue
|
|
|
|
ln -nsfv $HOME/.shell-things/submodules/comic-shanns-mono/fonts $HOME/.local/share/fonts/comic-shanns-mono
|
|
|
|
ln -nsfv $HOME/.shell-things/submodules/opendyslexic/compiled $HOME/.local/share/fonts/opendyslexic
|
|
|
|
ln -nsfv $HOME/.shell-things/submodules/serious-sans/SeriousShanns $HOME/.local/share/fonts/
|
|
|
|
fi
|
|
|
|
if hash fc-cache 2> /dev/null; then
|
|
|
|
fc-cache
|
2024-06-26 16:55:57 +02:00
|
|
|
fi
|
|
|
|
|
2024-08-08 09:59:37 +02:00
|
|
|
# If the previously mentioned marker is present, include the even more
|
|
|
|
# questionable script (yay!) into our current execution
|
2023-05-18 10:58:51 +02:00
|
|
|
if [ -f "$MIKAELA_GREP" ]; then
|
2024-08-08 09:59:37 +02:00
|
|
|
. .mikaela_install
|
2014-12-27 10:01:16 +01:00
|
|
|
fi
|
|
|
|
|
2024-08-08 09:59:37 +02:00
|
|
|
# If git-lfs is installed, configure git with it, otherwise this will just
|
|
|
|
# error in forked background process which will no longer hurt the current
|
|
|
|
# execution.
|
2023-10-09 10:12:13 +02:00
|
|
|
(git lfs install | true &)
|
|
|
|
|
2014-12-27 10:01:16 +01:00
|
|
|
set +x
|
2024-08-08 09:59:37 +02:00
|
|
|
# vim : set ft=bash :
|