-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
53 lines (41 loc) · 1.65 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#-----------------------------------------------------------------------
# Author: Aamnah
# Link: https://aamnah.com
# Github: https://github.com/aamnah/tmux-flat-theme
# Description: installs Flat theme for tmux
# System: Armbian OS - Orange Pi Plus2 / Raspberry Pi 3
# Compatibility: Debian, Ubuntu, Armbian
#-----------------------------------------------------------------------
# Does:
# 1. Creates a `~/.tmux/` directory if one doesn't exist
# 2. Creates a `~/.tmux.conf` file if one doesn't exist
# 3. Copies the required theme files `flattheme.conf` and `flattheme.tmux`
# to the `~/.tmux` folder
# 4. Add the code to load the theme inside `~/.tmux.conf`
# Script
#-----------------------------------------------------------------------
install () {
# Make directory `~/.tmux` if one doesn't exist
if ! [ -d ${HOME}/.tmux ]; then # (-d: file exists and is a dir)
echo -e "\n Creating ~/.tmux/ ... \n"
mkdir ${HOME}/.tmux
fi
# Copy the theme file from this folder to `~/.tmux`
echo -e "\n Copying theme to ~/.tmux/ ... \n"
cp ./flattheme.tmux ${HOME}/.tmux/
cp ./flattheme.conf ${HOME}/.tmux/
# Make the theme executable
# (this avoids the 'returned 126' error)
chmod +x ${HOME}/.tmux/flattheme.tmux
# Create `~/.tmux.conf` if one doesn't exist
if ! [ -e ${HOME}/.tmux.conf ]; then # (-e: file exists)
echo -e "\n Creating ~/.tmux.conf file ... \n"
touch ${HOME}/.tmux.conf
fi
# Source the copied theme file in `~/.tmux` inside `~/.tmux.conf`
echo -e "\n Adding theme to ~/.tmux.conf ... \n"
echo -e "run '${HOME}/.tmux/flattheme.tmux'" >> ${HOME}/.tmux.conf
# SUCCESS
echo -e "\n DONE ! \n"
}
install