3 #############################################
4 ## installs all instantOS tools ##
5 #############################################
7 echo "installing instantOS tools"
9 RAW="https://raw.githubusercontent.com"
10 source <(curl -s $RAW/paperbenni/bash/master/import.sh)
14 LINK="$RAW/paperbenni/suckless/master"
16 # fetches and installs program from this repo
19 wget -q "$RAW/paperbenni/suckless/master/programs/$1"
25 gitclone $@ &>/dev/null
30 gitclone instantOS/$@ &>/dev/null
33 # adds permanent global environment variable
35 [ -e /etc/environment ] || sudo touch /etc/environment
36 if [ "$1" = "-f" ]; then
41 if grep -q "$1=" /etc/environment; then
42 if [ -z "$FORCE" ]; then
43 echo "key already there"
46 sudo sed -i "s/$1=.*/$1=$2/g" /etc/environment
49 echo "$1=$2" | sudo tee -a /etc/environment
53 addenv -f "QT_QPA_PLATFORMTHEME" "qt5ct"
54 command -v nvim &>/dev/null && addenv -f "EDITOR" "$(which nvim)"
57 echo "using theme $THEME"
58 [ -e ~/paperbenni ] || mkdir ~/paperbenni
59 echo "$THEME" >~/paperbenni/.theme
67 #iclone instantMENU // weiter
70 if grep -q 'nobody' </etc/groups || grep -q 'nobody' </etc/group; then
71 echo "nobody workaround not required"
76 # add group and add user to group
78 if groups | grep -q "$1"; then
79 echo "user is member of $1"
83 sudo gpasswd -a $USER $1
94 if ! [ -d "$FOLDER" ]; then
95 echo "skipping $FOLDER"
99 if ! [ -e build.sh ]; then
102 sudo make install &>/dev/null
105 ./build.sh "$THEME" &>/dev/null
110 # session for lightdm
111 wget -q $RAW/paperbenni/suckless/master/instantwm.desktop
112 sudo mv instantwm.desktop /usr/share/xsessions/
115 gprogram startinstantwm
116 # shutdown popup that breaks restart loop
117 gprogram instantshutdown
121 # dmenu run but in terminal emulator st
122 # only supported terminal apps (less to search through)
125 gprogram instantswitch
126 gprogram instantnotify
128 # for that extra kick when doingg a typo
131 curl "$LINK/termprograms.txt" >~/.cache/termprograms.txt
133 if ! [ ~/.local/share/fonts/symbola.ttf ]; then
134 mkdir -p ~/.local/share/fonts
135 cd ~/.local/share/fonts
136 echo "installing symbola font"
137 wget -q "http://symbola.surge.sh/symbola.ttf"
142 # laptop specific stuff
143 if acpi | grep -q '[0-9]%'; then
144 # config file to indicate being a laptop
145 touch .cache/islaptop
147 # fix tap to click not working with tiling wms
148 if ! [ -e /etc/X11/xorg.conf.d/90-touchpad.conf ] ||
149 ! cat /etc/X11/xorg.conf.d/90-touchpad.conf | grep -iq 'tapping.*"on"'; then
151 sudo mkdir -p /etc/X11/xorg.conf.d && sudo tee /etc/X11/xorg.conf.d/90-touchpad.conf <<'EOF' 1>/dev/null
153 Identifier "touchpad"
156 Option "Tapping" "on"
164 curl -s "$RAW/paperbenni/suckless/master/monitor.sh" | bash
167 # three and four finger swipes on laptop
168 if ! command -v libinput-gestures &>/dev/null; then
170 git clone --depth=1 https://github.com/bulletmark/libinput-gestures.git
174 rm -rf libinput-gestures
179 # auto start script with instantWM
180 ls .instantos &>/dev/null || mkdir .instantos
181 curl $LINK/autostart.sh >.instantos/autostart.sh
182 chmod +x .instantos/autostart.sh
184 # set up multi monitor config for dswitch
185 if ! [ -e paperbenni/ismultimonitor ]; then
186 if xrandr | grep ' connected' | grep -Eo '[0-9]{3,}x' |
187 grep -o '[0-9]*' | wc -l | grep -q '2'; then
188 mkdir paperbenni &>/dev/null
189 xrandr | grep ' connected' | grep -Eo '[0-9]{3,}x' |
190 grep -o '[0-9]*' >paperbenni/ismultimonitor
191 echo "$(wc -l paperbenni/ismultimonitor) monitors detected"
193 echo "not a multi monitor setup"
196 echo "monitor config: "
197 cat paperbenni/ismultimonitor
204 if ! command -v pfw &>/dev/null; then
206 if git clone --depth=1 https://github.com/wmutils/core.git; then
217 # install win + a menus for shortcuts like screenshots and shutdown
218 curl -s $RAW/paperbenni/menus/master/install.sh | bash
220 # drag and drop x utility for ranger
221 if ! command -v dragon &>/dev/null; then
223 git clone --depth=1 https://github.com/mwh/dragon.git &>/dev/null
232 mkdir -p paperbenni/notifications &>/dev/null
234 # gets executed by dunst on notification
235 curl "$RAW/paperbenni/suckless/master/programs/dunsttrigger" >~/paperbenni/notifications/dunsttrigger
236 chmod +x ~/paperbenni/notifications/dunsttrigger
237 wget -O ~/paperbenni/notifications/notification.ogg "https://notificationsounds.com/notification-sounds/me-too-603/download/ogg"
240 mkdir instantos/wallpapers
241 curl -s "$RAW/instantOS/instantWALLPAPER/master/wall.sh" > intantos/wallpapers/wall.sh
242 chmod +x intantos/wallpapers/wall.sh
244 # set instantwm as default for lightdm
245 echo '[Desktop]' >.dmrc
246 echo 'Session=instantwm' >>.dmrc
247 if [ -e /etc/lightdm/lightdm.conf ]; then
248 sudo sed -i 's/^user-session=.*/user-session=instantwm/g' /etc/lightdm/lightdm.conf
251 # fix java gui appearing empty on instantWM
252 if ! grep -q 'instantwm' </etc/profile; then
253 echo "fixing java windows for instantwm in /etc/profile"
254 echo '# fix instantwm java windows' | sudo tee -a /etc/profile
255 echo 'export _JAVA_AWT_WM_NONREPARENTING=1' | sudo tee -a /etc/profile
257 echo "java workaround already applied"