-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup
More file actions
executable file
·153 lines (117 loc) · 6.76 KB
/
setup
File metadata and controls
executable file
·153 lines (117 loc) · 6.76 KB
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#!/bin/sh
# void setup script - developed by acidvegas
# note: After importing keys: printf "FINGERPRINTHERE:6:" | gpg --import-ownertrust
set -xev
# Configuration
ARCH=x86_64 # x86_64 or x86_64-musl
CPU=intel # amd or intel
DISPLAY_SERVER=xorg # xorg or wayland (leave blank for none)
GFX_DRIVER=intel # amd or intel (leave blank for none)
REMOTE_ACCESS=dropbear # ssh or dropbear
REMOTE_PORT=2023 # CHANGE THIS
GIT_URL="https://raw.githubusercontent.com/strangeprogram/voidconf/master"
setup_root() {
xbps-install -Su && xbps-install void-repo-nonfree && xbps-install -Su
if [ $GFX_DRIVER = "intel" ]; then
xbps-install linux-firmware-intel mesa-dri vulkan-loader mesa-vulkan-intel intel-video-accel
fi
if [ $DISPLAY_SERVER = "xorg" ]; then
xbps-install xorg libX11-devel libX11 libXft-devel libXft libXinerama-devel libXinerama libXrandr-devel libXrandr
xbps-install dmenu pinentry-dmenu scrot unclutter xclip
fi
if [ ! -z $DISPLAY_SERVER ]; then
xbps-install dunst firefox Signal-Desktop
xbps-install ohsnap-font font-unifont-bdf freefont-ttf noto-fonts-ttf noto-fonts-ttf-extra noto-fonts-cjk noto-fonts-emoji
fi
xbps-install alsa-utils cmus ffmpeg id3v2 eyeD3 youtube-dl
xbps-install checkbashisms go make patch pkg-config python3 python3-pip shellcheck
if [ $ARCH = "x86_64" ]; then
xbps-install gcc vscode
fi
xbps-install bandwhich bind-utils btop curl earlyoom exa git gitui net-tools ncdu oath-toolkit progress rsync socklog-void tmate tor tree unzip weechat zip
xbps-install asciiquarium cointop cmatrix no-more-secrets tty-solitaire
xbps-install kismet masscan nmap termshark wireshark
useradd -m -s /bin/bash fractal && gpasswd -a fractal wheel && passwd fractal
usermod -aG kismet fractal && usermod -aG wireshark fractal
ln -sfv /etc/sv/earlyoom /var/service/
ln -sfv /etc/sv/socklog-unix /var/service
ln -sfv /etc/sv/nanoklogd /var/service
wget -O /usr/share/kbd/consolefonts/ohsnap6x11r.psfu $GIT_URL/font/ohsnap6x11r.psfu
wget -O /usr/share/kbd/consolefonts/ohsnap7x12r.psfu $GIT_URL/font/ohsnap7x12r.psfu
wget -O /usr/share/kbd/consolefonts/ohsnap7x14r.psfu $GIT_URL/font/ohsnap7x14r.psfu
printf "set boldtext\nset minibar\nset nohelp\nset nowrap\nset quickblank\nset tabsize 4\nunbind ^J main\nset selectedcolor black,red\ninclude \"/usr/share/nano/*.nanorc\"\n" > /etc/nanorc
printf "\nexport HISTFILE=/dev/null\nexport LESSHISTFILE=/dev/null\nexport PYTHONHISTFILE=/dev/null\n" >> /etc/profile
printf "\nFONT=\"ohsnap6x11r\"\n" >> /etc/rc.conf
if [ $REMOTE_ACCESS = "ssh" ]; then
printf "AuthenticationMethods publickey\nBanner /etc/issue\nClientAliveInterval 0\nDisableForwarding yes\nPermitRootLogin no\nPort CHANGEME\nPrintLastLog no\n" > /etc/ssh/sshd_config
elif [ $REMOTE_ACCESS = "dropbear" ]; then
xbps-install dropbear
printf '#!/bin/sh\nexec 2>&1\n[ -r conf ] && . ./conf\npkill -9 dropbear\nexec dropbear -p $REMOTE_PORT -w -s -R -F\n' > /etc/sv/dropbear/run
ln -sf /etc/sv/dropbear /var/service/
fi
printf "Defaults lecture = always\nDefaults lecture_file = /etc/sudoers.d/sudoers.lecture\nroot ALL=(ALL) ALL\n%%wheel ALL=(ALL) ALL\n" > /etc/sudoers
printf "\n\033[1m \033[32m\"Bee\" careful \033[34m__\n \033[32mwith sudo! \033[34m// \ \n \\\\\\_/ \033[33m//\n \033[35m''-.._.-''-.._.. \033[33m-(||)(')\n '''\033[0m\n" > /etc/sudoers.d/sudoers.lecture
printf "#\!/bin/sh\nclear && (printf \"\" && printf \" E N T E R T H E V O I D\" && printf \"\") | nms -af red\n" > /etc/profile.d/motd.sh
printf "\nhsts=0\n" >> /etc/wgetrc
printf "\nmax-jobs=10\n" > /etc/xbps.d/10-parallel-downloads.conf
}
setup_configs() {
wget -O $HOME/.bashrc $GIT_URL/bash/.bashrc
wget -O $HOME/.bash_aliases $GIT_URL/bash/.bash_aliases
wget -O $HOME/.bash_functions $GIT_URL/bash/.bash_functions
. $HOME/.bashrc # POSIX shell doesn't support source
mkdir -p $HOME/.config/cmus && wget -O $HOME/.config/cmus/autosave $GIT_URL/cmus/autosave
mkdir -p $HOME/.config/dunst && wget -O $HOME/.config/dunst/dunstrc $GIT_URL/dunst/dunstrc
wget -O $HOME/.gitconfig $GIT_URL/git/.gitconfig
mkdir $HOME/.gnupg && wget -O $HOME/.gnupg/gpg.conf $GIT_URL/gpg/gpg.conf
if [ $DISPLAY_SERVER = "xorg" ]; then
printf "pinentry-program $HOME/.gnupg/pinentry-wrapper\ndefault-cache-ttl 3600\n" > $HOME/.gnupg/gpg-agent.conf
printf "if [ \"\$PINENTRY_USER_DATA\" = \"dmenu\" ]; then\n\texec /usr/local/bin/pinentry-dmenu \"$@\"\nelse\n\texec /usr/bin/pinentry-curses \"$@\"\nfi\n" > $HOME/.gnupg/pinentry-wrapper && chmod +x $HOME/.gnupg/pinentry-wrapper
fi
chmod 700 $HOME/.gnupg && chmod 600 $HOME/.gnupg/*
mkdir $HOME/.ssh && touch $HOME/.ssh/config && chown -R $USER $HOME/.ssh && chmod 700 $HOME/.ssh && chmod 600 $HOME/.ssh/config
wget -O $HOME/.xinitrc $GIT_URL/xorg/.xinitrc
mkdir $HOME/.scripts
for SCRIPT in cmus-now gitremote irc-post-commit-hook mutag shotz sync todo; do
wget -O $HOME/.scripts/$SCRIPT $GIT_URL/scripts/$SCRIPT && chmod +x $HOME/.scripts/$SCRIPT
done
wget -O $HOME/.scripts/irc2ansi.py https://github.com/internet-relay-chat/archive/blob/master/art/irc2ansi.py
mkdir -p $HOME/.local/share/fonts && wget -O $HOME/.local/share/fonts/BlockZone.ttf $GIT_URL/font/BlockZone.ttf
}
setup_builds() {
BUILD=$HOME/dev/build
mkdir -p $BUILD
git clone --depth 1 http://git.suckless.org/dwm $BUILD/dwm
wget -O $BUILD/dwm/config.h $GIT_URL/dwm/config.h
wget -O $BUILD/dwm/patch_nosquares.diff $GIT_URL/dwm/patch_nosquares.diff
wget -O $BUILD/dwm/patch_notitles.diff $GIT_URL/dwm/patch_notitles.diff
patch $BUILD/dwm/drw.c $BUILD/dwm/patch_nosquares.diff
patch $BUILD/dwm/dwm.c $BUILD/dwm/patch_notitles.diff
sudo make -C $BUILD/dwm clean install
git clone --depth 1 git://git.suckless.org/slstatus $BUILD/slstatus
wget -O $BUILD/slstatus/config.h $GIT_URL/slstatus/config.h
sudo make -C $BUILD/slstatus clean install
git clone --depth 1 git://git.suckless.org/st $BUILD/st
wget -O $BUILD/st/config.h $GIT_URL/st/config.h
sed -i 's/it#8,/it#4,/g' $BUILD/st/st.info
sudo make -C $BUILD/st clean install
git clone --depth 1 git://git.suckless.org/tabbed $BUILD/tabbed
wget -O $BUILD/tabbed/config.h $GIT_URL/tabbed/config.h
wget -O $BUILD/tabbed/patch_autohide.diff $GIT_URL/tabbed/patch_autohide.diff
wget -O $BUILD/tabbed/patch_clientnumber.diff $GIT_URL/tabbed/patch_clientnumber.diff
patch $BUILD/tabbed/tabbed.c $BUILD/tabbed/patch_autohide.diff
patch $BUILD/tabbed/tabbed.c $BUILD/tabbed/patch_clientnumber.diff
sudo make -C $BUILD/tabbed clean install
git clone https://github.com/AngelJumbo/lavat.git $BUILD/lavat
sudo make -C $BUILD/lavat clean install
}
if [ "$#" -ne 1 ]; then
printf "usage: $0 [root|partition|chroot]\n"
exit 1
fi
case "$1" in
root) setup_root ;;
config) setup_configs ;;
build) setup_builds ;;
*) printf "usage: $0 [root|config|build]\n"; exit 1 ;;
esac