aboutsummaryrefslogtreecommitdiff
path: root/shell_only.sh
blob: d915b56f1480b882c5af6da1b2bf7617703466ce (plain) (blame)
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#! /bin/bash

# Copyright (C) 2022  HimbeerserverDE
# 
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <https://www.gnu.org/licenses/>.

function command_exists {
	command -v $1 &> /dev/null
}

set -x

if [ $UID -ne 0 ]; then
	if command_exists doas; then
		SUDO="doas"
	elif command_exists sudo; then
		SUDO="sudo"
	fi
fi

if command_exists pacman; then
	${SUDO} pacman -Sy --noconfirm \
		bat \
		lolcat \
		cowsay \
		fortune-mod \
		zsh \
		git \
		figlet \
		curl \
		wget \
		htop \
		oath-toolkit \
		bc \
		units \
		tmux \
		vim \
		neofetch \
		fzf
elif command_exists apt; then
	${SUDO} apt update
	${SUDO} apt install -y \
		bat \
		lolcat \
		cowsay \
		fortune \
		zsh \
		git \
		figlet \
		curl \
		wget \
		htop \
		tty-clock \
		oathtool \
		bc \
		units \
		tmux \
		vim \
		neofetch \
		fzf

	git clone https://aur.archlinux.org/tty-clock-git.git
	(cd tty-clock-git && makepkg -i)
else
	echo "Your distro is not supported."
	exit 1
fi

rm -rf ~/.oh-my-zsh/
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended

ln -sf ${PWD}/bin ~/bin

mkdir -p ~/
ln -sf ${PWD}/zshrc ~/.zshrc
ln -sf ${PWD}/zsh_aliases ~/.zsh_aliases
ln -sf ${PWD}/fzf_key_bindings.zsh ~/.zsh_fzf_key_bindings
ln -sf ${PWD}/fzf_completion.zsh ~/.zsh_fzf_completion
ln -sf ${PWD}/profile ~/.profile
ln -sf ${PWD}/tmux.conf ~/.tmux.conf
ln -sf ${PWD}/vimrc ~/.vimrc

mkdir -p ~/.oh-my-zsh/
ln -sf ${PWD}/himbeer.zsh-theme ~/.oh-my-zsh/themes/himbeer.zsh-theme

mkdir -p ~/.oh-my-zsh/completions/
ln -sf ${PWD}/_totp ~/.oh-my-zsh/completions/_totp

mkdir -p ~/.local/bspwm-setup/
ln -sf ${PWD}/lockscreen.xkb ~/.local/bspwm-setup/lockscreen.xkb

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y