Skip to content
This repository was archived by the owner on Dec 9, 2023. It is now read-only.

Commit 720e84f

Browse files
committed
Switch to fancier print for beleyenv messages to better separate them from other console outpuut.
1 parent f2e8774 commit 720e84f

18 files changed

+79
-56
lines changed

Diff for: configScripts/link-configs.sh

+12-12
Original file line numberDiff line numberDiff line change
@@ -4,59 +4,59 @@ set -e
44
# Kitty Config
55
mkdir -p ~/.config/kitty
66
ln -sf "$(pwd)/configs/kitty.conf" ~/.config/kitty/kitty.conf
7-
echo "Kitty config installed!"
7+
./print.sh "Kitty config installed!"
88

99
# Zsh Configs
1010
ln -sf "$(pwd)/configs/.zshrc" ~/.zshrc
1111
ln -sf "$(pwd)/configs/.p10k.zsh" ~/.p10k.zsh
12-
echo "ZSH configs installed!"
12+
./print.sh "ZSH configs installed!"
1313

1414
# gtkrc-2.0 config
1515
ln -sf "$(pwd)/configs/.gtkrc-2.0" ~/.gtkrc-2.0
16-
echo "GTK config installed!"
16+
./print.sh "GTK config installed!"
1717

1818
# Todo Config
1919
mkdir -p ~/.todo/
2020
ln -sf "$(pwd)/configs/todo.conf" ~/.todo/config
21-
echo "Todo.sh config installed!"
21+
./print.sh "Todo.sh config installed!"
2222

2323
# Systemd Local Units & Overrides
2424
rm -rf ~/.config/systemd
2525
ln -sf "$(pwd)/configs/systemd" ~/.config/systemd
26-
echo "systemd local units & overrides installed!"
26+
./print.sh "systemd local units & overrides installed!"
2727

2828
# System-wide systemd Config
2929
sudo rm -f /etc/systemd/journald.conf
3030
sudo ln -sf "$(pwd)/configs/etc/systemd/journald.conf" /etc/systemd/journald.conf
3131
sudo systemctl restart systemd-journald
32-
echo "system-wide systemd configs installed!"
32+
./print.sh "system-wide systemd configs installed!"
3333

3434
# Sublime Configs
3535
mkdir -p ~/.config/sublime-text-3/Packages/User
3636
# shellcheck disable=SC2016
3737
find "$(pwd)/configs/sublime" -maxdepth 1 -mindepth 1 -print0 | xargs -n1 -0 -I {} bash -c 'ln -sf "{}" "$HOME/.config/sublime-text-3/Packages/User/$(basename "{}")"'
38-
echo "Sublime configs installed!"
38+
./print.sh "Sublime configs installed!"
3939

4040
# Sublime Merge Configs
4141
mkdir -p ~/.config/sublime-merge/Packages/User
4242
# shellcheck disable=SC2016
4343
find "$(pwd)/configs/sublime-merge" -maxdepth 1 -mindepth 1 -print0 | xargs -n1 -0 -I {} bash -c 'ln -sf "{}" "$HOME/.config/sublime-merge/Packages/User/$(basename "{}")"'
44-
echo "Sublime merge configs installed!"
44+
./print.sh "Sublime merge configs installed!"
4545

4646
INSTALL_ENCRYPTED=$(jq -r '.installThingsWithEncryptedDeps' config.json)
4747

4848
if [[ $INSTALL_ENCRYPTED = 'true' ]]; then
49-
echo "Installing configs relying on encrypted files..."
49+
./print.sh "Installing configs relying on encrypted files..."
5050

5151
# Deluge Configs
5252
mkdir -p ~/.config/deluge
5353
ln -sf "$(pwd)/configs/deluge/gtk3ui.conf" ~/.config/deluge/gtk3ui.conf
5454
ln -sf "$(pwd)/configs/deluge/hostlist.conf" ~/.config/deluge/hostlist.conf
55-
echo "Deluge configs installed!"
55+
./print.sh "Deluge configs installed!"
5656

5757
else
58-
echo "Skipping installing configs relying on encrypted files..."
58+
./print.sh "Skipping installing configs relying on encrypted files..."
5959
fi
6060

6161

62-
echo "All configs installed!"
62+
./print.sh "All configs installed!"

Diff for: configScripts/setup-borg-env.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,6 @@ echo "BORG_REPO=\"${BORG_REPO}\"" >> ~/.beleyenv/borg-env
1717
echo "BORG_PASSPHRASE=\"${BORG_PASSPHRASE}\"" >> ~/.beleyenv/borg-env
1818

1919
echo "export BORG_REPO=\"${BORG_REPO}\"" >> ~/.beleyenv/borg-env.export
20-
echo "export BORG_PASSPHRASE=\"${BORG_PASSPHRASE}\"" >> ~/.beleyenv/borg-env.export
20+
echo "export BORG_PASSPHRASE=\"${BORG_PASSPHRASE}\"" >> ~/.beleyenv/borg-env.export
21+
22+
./print.sh "Borg Environment Setup!"

Diff for: configScripts/setup-git.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ EMAIL=$(jq -r '.email' config.json)
55
NAME=$(jq -r '.name' config.json)
66

77
git config --global user.email "$EMAIL"
8-
git config --global user.name "$NAME"
8+
git config --global user.name "$NAME"
9+
10+
./print.sh "git config setup!"

Diff for: configScripts/setup-ssh-keys.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ keygenExitCode=$?
1616
set -e
1717

1818
if [[ $keygenExitCode != 0 ]]; then
19-
echo "Assuming you entered 'No' when asked to ovewrite keys"
20-
echo "Skipping SSH key-gen generation..."
19+
./print.sh "Assuming you entered 'No' when asked to ovewrite keys\n\
20+
Skipping SSH key-gen generation..."
2121
notify-send -a 'beleyenv' '[WARN] SSH key-gen canceled' \
2222
'If you did not answer no to overwrite keys, something may have gone wrong.'
2323

@@ -33,9 +33,9 @@ fi
3333
printf "\033]52;c;%s\a" "$(cat ~/.ssh/id_rsa.pub | base64)"
3434

3535
# The above does not tend to work, so also print it to the terminal to copy.
36-
echo "If it was not auto-copied, copy your key here and paste it into github."
36+
./print.sh "If it was not auto-copied, copy your key here and paste it into github."
3737
cat ~/.ssh/id_rsa.pub
3838

3939
xdg-open https://github.com/settings/ssh/new
4040

41-
echo "Public key copied to clipboard. Continue to add it on github."
41+
./print.sh "Public key copied to clipboard. Continue to add it on github."

Diff for: configScripts/update-hosts.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ while [ "x${HOSTS[index]}" != "x" ]; do
1111
done
1212

1313

14-
echo "Hosts file updated!"
14+
./print.sh "Hosts file updated!"

Diff for: index.sh

+17-9
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,21 @@ trap 'ctrlC' INT
44
trap 'theEnd $?' EXIT
55

66
ctrlC() {
7-
echo "You canceled beleyenv! This may leave you in a weird state."
8-
echo "Since belyenv is idempotent, you can most likely just re-run beleyenv"
7+
./print.sh "You canceled beleyenv! This may leave you in a weird state.\n\
8+
Since belyenv is idempotent, you can most likely just re-run beleyenv"
9+
910
exit 1
1011
}
1112

1213
theEnd() {
1314
if [[ "$1" != "0" ]]; then
14-
echo 'Beleyenv install failed!'
15+
./print.sh 'Beleyenv install failed!'
1516

1617
if command -v notify-send &> /dev/null; then
1718
notify-send -a 'beleyenv' 'beleyenv install failed!' 'You are probally now very sad.'
1819
fi
1920
else
20-
echo 'SUCCESS! BELEYENV HAS BEEN FULLY INSTALLED!'
21+
./print.sh 'SUCCESS! BELEYENV HAS BEEN FULLY INSTALLED!'
2122

2223
if command -v notify-send &> /dev/null; then
2324
notify-send -a 'beleyenv' 'beleyenv install finished!' 'Have fun!'
@@ -43,14 +44,20 @@ sudo apt-get -y install xz-utils nano apt-transport-https flatpak python3-pip \
4344
python3-dev python3-setuptools git zsh jq shellcheck git-cola imagemagick borgbackup \
4445
ca-certificates gnupg-agent software-properties-common
4546

47+
./print.sh "Installed general apt-get packages!"
48+
4649
# Install Pip dependencies
4750
# pygments is required by https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/colorize
4851
sudo pip3 install deluge thefuck pygments
4952

53+
./print.sh "Installed general pip packages!"
54+
5055
# Install Flatpak repositories & packages
5156
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
5257
sudo flatpak install -y flathub com.valvesoftware.Steam
5358

59+
./print.sh "Installed flatpak & flatpak packages!"
60+
5461
# Package installs that require more effort -- mostly because debian LTS tends to have
5562
# very old packages.
5663
./installScripts/installKitty/index.sh
@@ -67,6 +74,8 @@ sudo flatpak install -y flathub com.valvesoftware.Steam
6774
# Install yarn dependencies
6875
sudo yarn global add eslint prettier
6976

77+
./print.sh "Installed general global yarn packages!"
78+
7079
# User configuration
7180
./configScripts/link-configs.sh
7281
./configScripts/update-hosts.sh
@@ -75,10 +84,9 @@ sudo yarn global add eslint prettier
7584
# Install packages dependent on user configuration being present first.
7685
./installScripts/installBorgTools/index.sh
7786

78-
echo 'SUCCESS! BELEYENV HAS BEEN FULLY INSTALLED!'
79-
echo 'Hints of what to do next: '
80-
echo ' * Run ./devScripts/switch-to-ssh-remote.sh to switch from https to ssh if you are Chris'
81-
echo ' * Some changes only will take effect after a reboot of the container. Run sudo poweroff then start kitty via the app launcher.'
82-
echo ' * You will have to manually run the "Install Package Control" command in sublime.'
87+
./print.sh "Hints of what to do next:\n\
88+
* Run ./devScripts/switch-to-ssh-remote.sh to switch from https to ssh if you are Chris\n\
89+
* Some changes only will take effect after a reboot of the container. Run sudo poweroff then start kitty via the app launcher.\n\
90+
* You will have to manually run the "Install Package Control" command in sublime."
8391

8492
notify-send -a 'beleyenv' 'beleyenv install finished!' 'Have fun!'

Diff for: installScripts/install-docker.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ sudo usermod -aG docker "$USER"
1414

1515
# It seems this is done by default, but adding just for safe-measure.
1616
sudo systemctl enable docker
17-
echo "Docker installed!"
17+
./print.sh "Docker installed!"

Diff for: installScripts/install-fonts.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ mkdir -p ~/.fonts
2828
cp -R OTF/*.otf ~/.fonts/
2929
cp -R patchedFantasqueSansMono/*.ttf ~/.fonts/
3030

31-
echo "Fonts installed!"
31+
../print.sh "Fonts installed!"

Diff for: installScripts/install-hostess.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ chmod +x hostess
1515

1616
sudo cp hostess /usr/local/bin/
1717

18-
echo "Hostess installed to /usr/local/bin"
18+
../print.sh "Hostess installed to /usr/local/bin"

Diff for: installScripts/install-lsd.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ curl -s https://api.github.com/repos/Peltoche/lsd/releases/latest \
1313

1414
sudo dpkg -i ./*.deb
1515

16-
echo "lsd installed!"
16+
../print.sh "lsd installed!"

Diff for: installScripts/install-node.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/source
88

99
sudo apt-get install -y nodejs yarn
1010

11-
echo "Node installed!"
11+
./print.sh "Node installed!"

Diff for: installScripts/install-theme.sh

100644100755
+3-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22
set -e
33

44
sudo apt-get -y install adapta-gtk-theme dconf-editor
5-
gsettings set org.gnome.desktop.interface gtk-theme "Adapta-Nokto"
5+
gsettings set org.gnome.desktop.interface gtk-theme "Adapta-Nokto"
6+
7+
./print.sh "Adapta-Nokto theme installed!"

Diff for: installScripts/install-todo.sh

+15-10
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,21 @@ set -e
66

77
rm -rf temp
88
mkdir temp
9-
cd temp
109

11-
curl -s https://api.github.com/repos/todotxt/todo.txt-cli/releases/latest \
12-
| jq -r '[.assets[].browser_download_url]
13-
| map(select(endswith("gz")))
14-
| .[0]' \
15-
| xargs curl -L \
16-
| tar -zxv
10+
(
11+
cd temp
1712

18-
cd ./*
19-
sudo cp todo.sh /usr/local/bin/
13+
curl -s https://api.github.com/repos/todotxt/todo.txt-cli/releases/latest \
14+
| jq -r '[.assets[].browser_download_url]
15+
| map(select(endswith("gz")))
16+
| .[0]' \
17+
| xargs curl -L \
18+
| tar -zxv
2019

21-
echo "todo.sh installed to /usr/local/bin"
20+
(
21+
cd ./*
22+
sudo cp todo.sh /usr/local/bin/
23+
)
24+
)
25+
26+
./print.sh "todo.sh installed to /usr/local/bin"

Diff for: installScripts/install-zsh.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ sudo ln -sf "$HOME/.p10k.zsh" /root/.p10k.zsh
1616
sudo chsh -s "$(which zsh)"
1717
sudo chsh -s "$(which zsh)" "${USER}"
1818

19-
echo "zsh tooling installed!"
19+
./print.sh "zsh tooling installed!"

Diff for: installScripts/installBorgTools/index.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ set -e
44
BORG_REPO=$(jq -r '.borgRepo' config.json)
55

66
if [[ $BORG_REPO = '' ]] || [[ $BORG_REPO = 'null' ]]; then
7-
echo "No borg repo set in config.json"
8-
echo "Skipping install of borg tools and systemd borg services"
7+
./print.sh "No borg repo set in config.json\nSkipping install of borg tools and systemd borg services"
98
exit 0
109
fi
1110

Diff for: installScripts/installKitty/index.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
set -e
33

44
if [[ ${TERM:?} = "xterm-kitty" ]]; then
5-
echo "[WARN] You are currently running kitty, so instalation of it was skipped."
6-
echo "[WARN] Run ./installScrips/installKitty/index.sh in a differnt terminal if you would like to upgrade kitty."
7-
echo "Skipping kitty install..."
5+
./print.sh "[WARN] You are currently running kitty, so instalation of it was skipped.\n\
6+
[WARN] Run ./installScrips/installKitty/index.sh in a differnt terminal if you would like to upgrade kitty.\n\
7+
Skipping kitty install..."
88

99
notify-send -a "beleyenv" "[WARN] Skipping install/upgrade of kitty"
1010
exit 0
@@ -24,4 +24,4 @@ sudo cp -R temp/kitty.app /usr/local/opt
2424
sudo ln -fs /usr/local/opt/kitty.app/bin/kitty /usr/local/bin/kitty
2525
sudo ln -fs /usr/local/opt/kitty.app/share/applications/kitty.desktop /usr/local/share/applications/kitty.desktop
2626

27-
echo "Kitty installed!"
27+
./print.sh "Kitty installed!"

Diff for: installScripts/installSublime/index.sh

+4-5
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,19 @@ echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sou
66
sudo apt-get update
77
sudo apt-get -y install sublime-text sublime-merge
88

9-
echo "Sublime text installed!"
9+
./print.sh "Sublime text installed!"
1010

1111
SUBLIME_LICENSE=$(jq -r '.sublimeLicense' config.json)
1212

1313
if [[ $SUBLIME_LICENSE = '' ]] || [[ $SUBLIME_LICENSE = 'null' ]]; then
14-
echo "No sublime license present in config.json"
15-
echo "Skipping automatic license install..."
14+
./print.sh "No sublime license present in config.json\nSkipping automatic license install..."
1615
else
1716
mkdir -p ~/.config/sublime-text-3/Local/
1817
echo -e "$SUBLIME_LICENSE" > ~/.config/sublime-text-3/Local/License.sublime_license
19-
echo "Sublime text license installed!"
18+
./print.sh "Sublime text license installed!"
2019
fi
2120

2221
mkdir -p ~/.config/sublime-text-3/Packages
2322
cp installScripts/installSublime/Systemd.sublime-syntax ~/.config/sublime-text-3/Packages
2423

25-
echo "Sublime text plugins not under package control installed"
24+
./print.sh "Sublime text plugins not under package control installed"

Diff for: print.sh

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
set -e
3+
4+
echo -e "\n\e[1;30;1;47m⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤\e[0m"
5+
echo -e "\e[1;30;1;47m${*}\e[0m"
6+
echo -e "\e[1;30;1;47m⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤\e[0m\n"

0 commit comments

Comments
 (0)