3 #############################################
4 ## installs all paperbenni suckless forks ##
5 ## made for personal use, so be warned ;) ##
6 #############################################
8 echo "installing paperbenni's suckless suite"
10 source <(curl -s https://raw.githubusercontent.com/paperbenni/bash/master/import.sh)
14 LINK="https://raw.githubusercontent.com/paperbenni/suckless/master"
16 # fetches and installs program from this repo
19 wget -q "https://raw.githubusercontent.com/paperbenni/suckless/master/programs/$1"
25 gitclone $@ &>/dev/null
28 # adds permanent global environment variable
30 [ -e /etc/environment ] || sudo touch /etc/environment
31 if [ "$1" = "-f" ]; then
36 if grep -q "$1=" /etc/environment; then
37 if [ -z "$FORCE" ]; then
38 echo "key already there"
41 sudo sed -i "s/$1=.*/$1=$2/g" /etc/environment
44 echo "$1=$2" | sudo tee -a /etc/environment
48 addenv -f "QT_QPA_PLATFORMTHEME" "qt5ct"
49 command -v nvim &>/dev/null && addenv -f "EDITOR" "$(which nvim)"
52 echo "using theme $THEME"
53 [ -e ~/paperbenni ] || mkdir ~/paperbenni
54 echo "$THEME" >~/paperbenni/.theme
65 if grep -q 'nobody' </etc/groups || grep -q 'nobody' </etc/group; then
66 echo "nobody workaround not required"
71 # add group and add user to group
73 if groups | grep -q "$1"; then
74 echo "user is member of $1"
78 sudo gpasswd -a $USER $1
87 # install cursors for themes
88 if ! [ -e ~/.icons/osx ]; then
89 curl -s https://raw.githubusercontent.com/paperbenni/cursors/master/install.sh | bash
93 wget -q https://raw.githubusercontent.com/paperbenni/suckless/master/dwm.desktop
94 sudo mv dwm.desktop /usr/share/xsessions/
98 # shutdown popup that breaks restart loop
99 gprogram sucklessshutdown
103 # dmenu run but in terminal emulator st
104 # only supported terminal apps (less to search through)
105 gprogram dmenu_run_st
110 # for that extra kick when doingg a typo
113 curl "$LINK/termprograms.txt" >~/.cache/termprograms.txt
115 for FOLDER in ./*; do
116 if ! [ -d "$FOLDER" ]; then
117 echo "skipping $FOLDER"
121 if ! [ -e build.sh ]; then
124 sudo make install &>/dev/null
127 ./build.sh "$THEME" &>/dev/null
132 if ! [ ~/.local/share/fonts/symbola.ttf ]; then
133 mkdir -p ~/.local/share/fonts
134 cd ~/.local/share/fonts
135 echo "installing symbola font"
136 wget -q "http://symbola.surge.sh/symbola.ttf"
141 # laptop specific stuff
142 if acpi | grep -q '[0-9]%'; then
143 # config file to indicate being a laptop
144 touch .cache/islaptop
146 # fix tap to click not working with tiling wms
147 if ! [ -e /etc/X11/xorg.conf.d/90-touchpad.conf ] ||
148 ! cat /etc/X11/xorg.conf.d/90-touchpad.conf | grep -iq 'tapping.*"on"'; then
150 sudo mkdir -p /etc/X11/xorg.conf.d && sudo tee /etc/X11/xorg.conf.d/90-touchpad.conf <<'EOF' 1>/dev/null
152 Identifier "touchpad"
155 Option "Tapping" "on"
163 curl -s "https://raw.githubusercontent.com/paperbenni/suckless/master/monitor.sh" | bash
166 # three and four finger swipes on laptop
167 if ! command -v libinput-gestures &>/dev/null; then
169 git clone --depth=1 https://github.com/bulletmark/libinput-gestures.git
173 rm -rf libinput-gestures
178 # auto start script with dwm
179 ls .dwm &>/dev/null || mkdir .dwm
180 curl $LINK/autostart.sh >.dwm/autostart.sh
181 chmod +x .dwm/autostart.sh
183 # set up multi monitor config for dswitch
184 if ! [ -e paperbenni/ismultimonitor ]; then
185 if xrandr | grep ' connected' | grep -Eo '[0-9]{3,}x' |
186 grep -o '[0-9]*' | wc -l | grep -q '2'; then
187 mkdir paperbenni &>/dev/null
188 xrandr | grep ' connected' | grep -Eo '[0-9]{3,}x' |
189 grep -o '[0-9]*' >paperbenni/ismultimonitor
190 echo "$(wc -l paperbenni/ismultimonitor) monitors detected"
192 echo "not a multi monitor setup"
195 echo "monitor config: "
196 cat paperbenni/ismultimonitor
203 if ! command -v pfw &>/dev/null; then
205 if git clone --depth=1 https://github.com/wmutils/core.git; then
216 # install win + a menus for shortcuts like screenshots and shutdown
217 curl -s https://raw.githubusercontent.com/paperbenni/menus/master/install.sh | bash
219 # drag and drop x utility for ranger
220 if ! command -v dragon &>/dev/null; then
222 git clone --depth=1 https://github.com/mwh/dragon.git &>/dev/null
231 mkdir -p paperbenni/notifications &>/dev/null
233 # gets executed by dunst on notification
234 curl "https://raw.githubusercontent.com/paperbenni/suckless/master/programs/dunsttrigger" >~/paperbenni/notifications/dunsttrigger
235 chmod +x ~/paperbenni/notifications/dunsttrigger
236 wget -O ~/paperbenni/notifications/notification.ogg "https://notificationsounds.com/notification-sounds/me-too-603/download/ogg"
238 # automatic wallpaper changer
239 # uses reddit r/wallpaper scraper
240 if [ "$2" = "rwall" ]; then
244 mv rwallpaper.py ~/paperbenni/
245 chmod +x wallpaper.sh
246 mv wallpaper.sh ~/paperbenni/
247 sudo pip3 install -r requirements.txt
254 # set dwm as default for lightdm
255 echo '[Desktop]' >.dmrc
256 echo 'Session=dwm' >>.dmrc
257 if [ -e /etc/lightdm/lightdm.conf ]; then
258 sudo sed -i 's/^user-session=.*/user-session=dwm/g' /etc/lightdm/lightdm.conf
261 # install things like fonts or gtk theme
262 echo "installing theme"
263 curl -s "https://raw.githubusercontent.com/instant-os/instant-THEMES/master/$THEME.sh" | bash
265 # fix java gui appearing empty on dwm
266 if ! grep -q 'dwm' </etc/profile; then
267 echo "fixing java windows for dwm in /etc/profile"
268 echo '# fix dwm java windows' | sudo tee -a /etc/profile
269 echo 'export _JAVA_AWT_WM_NONREPARENTING=1' | sudo tee -a /etc/profile
271 echo "java workaround already applied"