aboutsummaryrefslogtreecommitdiff
path: root/install
diff options
context:
space:
mode:
authorJacob Janzen <jjanzenn@proton.me>2024-08-07 22:34:10 -0500
committerJacob Janzen <jjanzenn@proton.me>2024-08-07 22:34:10 -0500
commit3832e2c085e5137f78cdf5f0c1e9cf273ffbc338 (patch)
treea2bd6bd1119aacbaa23ede55ad3ff1c46a76ea57 /install
parent05a87bb0eb20345694a09c9e5e5930028c0c0339 (diff)
complete my configuration migration
Diffstat (limited to 'install')
-rw-r--r--[-rwxr-xr-x]install48
1 files changed, 37 insertions, 11 deletions
diff --git a/install b/install
index 8c7d704..1df4c9f 100755..100644
--- a/install
+++ b/install
@@ -1,20 +1,22 @@
#!/bin/sh
-# install the dotfiles source if it is not present
+mv ~/.update-home.log ~/.update-home.log.old
+
if ! test -d ~/.dotfiles; then
echo Installing dotfiles...
- git clone git@git.sr.ht:~jjanzen/.dotfiles ~/.dotfiles
+ git clone git@git.sr.ht:~jjanzen/.dotfiles ~/.dotfiles >> ~/.update-home.log
fi
-# save the current working directory and move to the dotfiles repository
CWD=$(pwd)
cd ~/.dotfiles || exit
-git stash
-git checkout main
-git pull --rebase
-# Install new install script and run it instead of this
-if ! diff ~/.dotfiles/install ~/.local/bin/update-home; then
+{
+ git stash
+ git checkout main
+ git pull --rebase
+} >> ~/.update-home.log
+
+if ! diff ~/.dotfiles/install ~/.local/bin/update-home >> ~/.update-home.log; then
cp ~/.dotfiles/install ~/.local/bin/update-home || exit 1
echo Changes have been made to the install script.
echo Running the new install script.
@@ -22,10 +24,34 @@ if ! diff ~/.dotfiles/install ~/.local/bin/update-home; then
exit
fi
-# install config files
+echo Installing configuration files...
find -- * -type f -name "*.org" | while read -r file; do
- echo Installing "${file}" configuration...
- emacs --batch "${file}" -f package-initialize --eval '(org-babel-tangle)'
+ emacs --batch "${file}" -f package-initialize --eval '(org-babel-tangle)' >> ~/.update-home.log
done
+echo Installing wallpaper...
+cp wallpaper ~/.wallpaper
+
+fonts_changed=false
+if ! test -d ~/.local/share/fonts/ComputerModern; then
+ echo Computer Modern font missing. Installing...
+ tar xf ~/.dotfiles/local/share/fonts/ComputerModern.tar.gz -C ~/.local/share/fonts >> ~/.update-home.log
+ fonts_changed=true
+fi
+if ! test -f ~/.local/share/fonts/NFM.ttf; then
+ echo Nerd Font Mono font missing. Installing...
+ tar xf ~/.dotfiles/local/share/fonts/NFM.tar.gz -C ~/.local/share/fonts >> ~/.update-home.log
+ fonts_changed=true
+fi
+if ! test -d ~/.local/share/fonts/SauceCodePro; then
+ echo Source Code Pro Nerd Font missing. Installing...
+ tar xf ~/.dotfiles/local/share/fonts/SauceCodePro.tar.gz -C ~/.local/share/fonts >> ~/.update-home.log
+ fonts_changed=true
+fi
+
+if [ $fonts_changed = true ]; then
+ echo Updating the font cache...
+ fc-cache -f >> ~/.update-home.log
+fi
+
cd "${CWD}" || exit