2022-09-02 19:22:31 -07:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
if [ -f '/etc/qubes-release' ]; then
|
|
|
|
# Qubes dom0
|
2022-09-22 03:45:01 -07:00
|
|
|
qvm-create --label red --template debian-11 provision &> /dev/null || EXIT_CODE=$?
|
2022-10-03 21:29:37 -07:00
|
|
|
qvm-run --pass-io provision 'if [ -d ~/Downloads/professor-dotfiles ]; then cd ~/Downloads/professor-dotfiles && git config pull.rebase false && git pull origin master; else git clone https://gitlab.com/megabyte-labs/dotfiles.git ~/Downloads/professor-dotfiles; fi; cd ~/Downloads; tar -zcvf /tmp/professor-dotfiles.tar.gz professor-dotfiles'
|
2022-09-26 22:57:29 -07:00
|
|
|
qvm-run --pass-io provision "cat /tmp/professor-dotfiles.tar.gz" > "/tmp/dotfiles.tar.gz"
|
|
|
|
tar -xzf "/tmp/dotfiles.tar.gz" -C "$HOME"
|
|
|
|
rm -f "/tmp/dotfiles.tar.gz"
|
|
|
|
sudo rm -rf /usr/local/src/professor-dotfiles
|
|
|
|
sudo mv "$HOME/professor-dotfiles" /usr/local/src/professor-dotfiles
|
2022-09-02 19:22:31 -07:00
|
|
|
else
|
2022-09-26 22:57:29 -07:00
|
|
|
if [ -d /usr/local/src/professor-dotfiles/.git ]; then
|
|
|
|
cd /usr/local/src/professor-dotfiles
|
|
|
|
sudo git config pull.rebase false
|
2022-09-22 03:45:01 -07:00
|
|
|
sudo git pull origin master
|
2022-09-02 19:22:31 -07:00
|
|
|
cd ~/
|
|
|
|
else
|
2022-09-26 22:57:29 -07:00
|
|
|
sudo rm -rf /usr/local/src/professor-dotfiles
|
|
|
|
sudo git clone https://gitlab.com/megabyte-labs/dotfiles.git /usr/local/src/professor-dotfiles
|
2022-09-02 19:22:31 -07:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Copy dotfile folders
|
|
|
|
while read DOTFILE_FOLDER; do
|
|
|
|
BASENAME_FOLDER="$(basename "$DOTFILE_FOLDER")"
|
2022-09-03 00:38:09 -07:00
|
|
|
if [ ! -d "$HOME/$BASENAME_FOLDER" ]; then
|
|
|
|
mkdir -p "$HOME/$BASENAME_FOLDER"
|
|
|
|
fi
|
2022-09-03 00:39:26 -07:00
|
|
|
cp -rf "$DOTFILE_FOLDER/"* "$HOME/$BASENAME_FOLDER"
|
2022-09-26 22:57:29 -07:00
|
|
|
done < <(find /usr/local/src/professor-dotfiles/dotfiles -maxdepth 1 -mindepth 1 -type d)
|
2022-09-02 19:22:31 -07:00
|
|
|
|
|
|
|
# Copy dotfile files
|
|
|
|
while read DOTFILE_FILE; do
|
|
|
|
BASENAME_FILE="$(basename "$DOTFILE_FILE")"
|
|
|
|
cp "$DOTFILE_FILE" "$HOME/$BASENAME_FILE"
|
|
|
|
chmod 600 "$HOME/$BASENAME_FILE"
|
2022-09-26 22:57:29 -07:00
|
|
|
done < <(find /usr/local/src/professor-dotfiles/dotfiles -maxdepth 1 -mindepth 1 -type f)
|
2022-09-02 19:22:31 -07:00
|
|
|
|
|
|
|
# Ensure .local/bin contents are executable
|
|
|
|
while read LOCAL_BIN; do
|
|
|
|
chmod +x "${LOCAL_BIN}"
|
2022-09-03 00:33:54 -07:00
|
|
|
done < <(find "$HOME/.local/bin" -maxdepth 1 -mindepth 1 -type f)
|
2022-09-02 19:22:31 -07:00
|
|
|
|
2022-10-29 04:51:19 -07:00
|
|
|
if [ -d /Applications ] && [ -d /System ]; then
|
2022-10-30 18:41:14 -07:00
|
|
|
chown -Rf "$USER":"$(id -g -n)" /usr/local/src/professor-dotfiles
|
2022-10-29 05:41:39 -07:00
|
|
|
mkdir -p "$HOME/Library/Fonts"
|
|
|
|
cp "$HOME/.local/share/fonts/Hack Bold Nerd Font Complete.ttf" "$HOME/Library/Fonts/Hack Bold Nerd Font Complete.ttf"
|
2022-10-29 05:18:52 -07:00
|
|
|
theme=$(<$HOME/.local/theme/Betelgeuse.macOS.terminal)
|
|
|
|
plutil -replace Window\ Settings.Betelgeuse -xml "$theme" ~/Library/Preferences/com.apple.Terminal.plist
|
|
|
|
defaults write com.apple.Terminal "Default Window Settings" -string "Betelgeuse"
|
|
|
|
defaults write com.apple.Terminal "Startup Window Settings" -string "Betelgeuse"
|
2022-10-29 10:47:46 -07:00
|
|
|
|
|
|
|
# Desktop background
|
|
|
|
curl -sSL https://gitlab.com/megabyte-labs/misc/betelgeuse/-/raw/master/share/wallpapers/Next/contents/source.jpg > "$HOME/.local/theme/background.jpg"
|
|
|
|
osascript -e 'tell application "Finder" to set desktop picture to POSIX file "$HOME/.local/theme/background.jpg"'
|
2022-10-29 04:51:19 -07:00
|
|
|
fi
|
|
|
|
|
2022-09-02 19:22:31 -07:00
|
|
|
# Firefox theme
|
2022-10-25 05:09:21 -07:00
|
|
|
# if [ ! -f ~/.mozilla/firefox ] && [ ! -f '/etc/qubes-release' ]; then
|
|
|
|
# if [ -d /usr/local/src/firefox-sweet-theme/.git ]; then
|
|
|
|
# sudo git config pull.rebase false
|
|
|
|
# cd /usr/local/src/firefox-sweet-theme && git pull origin master
|
|
|
|
# else
|
|
|
|
# sudo git clone https://github.com/EliverLara/firefox-sweet-theme /usr/local/src/firefox-sweet-theme
|
|
|
|
# fi
|
|
|
|
# bash /usr/local/src/firefox-sweet-theme/scripts/install.sh
|
|
|
|
# fi
|
2022-09-02 19:22:31 -07:00
|
|
|
|
|
|
|
# grep -q QT_QPA_PLATFORMTHEME=qt5ct /etc/environment || echo QT_QPA_PLATFORMTHEME=qt5ct | sudo tee -a /etc/environment
|
|
|
|
# sudo cp -rv "$HOME/.local/share/qt5ct" /usr/share
|