-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathinstall_debian.sh
executable file
·101 lines (88 loc) · 2.09 KB
/
install_debian.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
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
#!/bin/bash
#############################################################
# Install packages for Debian or its derived editions (e.g. Ubuntu, Mint).
# Support Ubuntu 24.04+
# Author: Vincent Zhang <[email protected]>
# URL: https://github.com/seagle0128/dotfiles
#############################################################
# Packages
packages=(
# prerequisite
build-essential
# modern tools
bat
btm
btop
duf
# dust
eza # exa
fd-find
fzf
git-delta
tig # gitui
gping
hyperfine
neofetch
# procs
ripgrep
# sd
# tealdeer
zoxide
# sudo add-apt-repository -y ppa:kelleyk/emacs
# emacs # emacs-snapshot
aspell # hunspell
# parcellite # clipit
# peek
# screenkey
# Quick launcher: synapse/albert/Ulauncher
# sudo add-apt-repository ppa:agornostal/ulauncher
# ulauncher
)
# Get OS name
SYSTEM=`uname -s`
# Use colors, but only if connected to a terminal, and that terminal
# supports them.
if command -v tput >/dev/null 2>&1; then
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
BOLD="$(tput bold)"
NORMAL="$(tput sgr0)"
else
RED=""
GREEN=""
YELLOW=""
BLUE=""
BOLD=""
NORMAL=""
fi
function check {
if ! command -v git >/dev/null 2>&1; then
echo "${RED}Error: git is not installed${NORMAL}" >&2
exit 1
fi
if command -v apt >/dev/null 2>&1; then
APT=apt
elif command -v apt-get >/dev/null 2>&1; then
APT=apt-get
fi
if [ ! "$SYSTEM" = "Linux" ] || [ -z "$APT" ]; then
echo "${RED}Error: Not Debian or its derived edition${NORMAL}" >&2
exit 1
fi
}
function install {
for p in ${packages[@]}; do
printf "${BLUE} ➜ Installing ${p}...${NORMAL}\n"
sudo $APT upgrade -y ${p}
done
}
function main {
check
install
}
main