Skip to content

Commit 346438c

Browse files
committed
Add zsh installation script
1 parent d0535b7 commit 346438c

File tree

3 files changed

+25
-11
lines changed

3 files changed

+25
-11
lines changed

zsh/.zshenv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Symlinking the zsh config folder is not needed thanks to this.
12
ZDOTDIR="${HOME}/Git/linux-scripts/zsh"
23

34
if [ -f "${HOME}/.cargo/env" ]; then

zsh/README.md

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,23 @@
11
### Installing zsh
22
Zsh is an awesome shell with the extensive plugin collection
33
[Oh My Zsh](https://ohmyz.sh/).
4-
You can install and configure it by cd'ing to the root
5-
of this repository and executing the following commands.
4+
You can install it using the `install_zsh.sh` script.
65

7-
``` bash
8-
sudo apt-get update
9-
sudo apt-get install git zsh
10-
ln -s "<REPOSITORY_FOLDER>/zsh/.zshenv" "${HOME}/.zshenv"
11-
```
126

137
### Additional plugins
148
[zsh-autocomplete](https://github.com/marlonrichert/zsh-autocomplete),
159
[zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions)
1610
and
1711
[zsh-syntax-highlighting](https://github.com/zsh-users/zsh-syntax-highlighting):
1812

13+
1914
### Powerlevel10k theme
2015
Installation of the [Powerlevel10k](https://github.com/romkatv/powerlevel10k) theme:
2116
first download all the
2217
[MesloLGS theme files](https://github.com/romkatv/powerlevel10k#meslo-nerd-font-patched-for-powerlevel10k)
2318
and set it as your default terminal font.
24-
Then run the following command.
25-
``` bash
26-
ln -s "<REPOSITORY_FOLDER>/zsh/.p10k.zsh" "${HOME}/.p10k.zsh"
27-
```
19+
Then run the `install_zsh.sh` script if you haven't yet run iiiit.
20+
2821

2922
### Stderred
3023
With [stderred](https://github.com/sickill/stderred) you can get stderr displayed in red.

zsh/install_zsh.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
set -eu
3+
4+
if [ "${EUID}" -eq 0 ]; then
5+
echo "This script should not be run as root."
6+
exit 1
7+
fi
8+
9+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
10+
11+
echo "Installing zsh and plugin dependencies."
12+
sudo apt-get update
13+
sudo apt-get install autojump build-essential cmake git ruby-dev zsh
14+
gem install colorls
15+
16+
echo "Creating symlinks."
17+
ln -s "${SCRIPT_DIR}/.zshenv" "${HOME}/.zshenv"
18+
ln -s "${SCRIPT_DIR}/.p10k.zsh" "${HOME}/.p10k.zsh"
19+
20+
echo "zsh installed."

0 commit comments

Comments
 (0)