I tested this script on the recent sid netinstall I did on the Pentium 4 and everything worked fine.
As usual, you are free to do whatever you want with it, even ignoring it if you feel so brutal. I won't get mad. Maybe.
Code: Select all
#!/bin/bash
# get-suckless-code: gets and compiles some suckless tools I usually need
# basically pidsley's get-wmcode edited for suckless tools, nothing more
grn="\e[32m"
rst="\e[0m" # reset
alist=(dependencies st slock swarp dmenu tabbed surf)
let num=${#alist[*]}-1 # number of items in the array (minus one to account for zero index)
tmpfile=$(mktemp) # make a temp file for dialog return value
# make a list in menu format, with a number first, then the name
for i in $(seq 0 $num); do
blist[i]=$(echo $i ${alist[i]} off)
done
# display the list in a dialog, save the return value (the index numbers) in the tmpfile
dialog --no-tags --checklist 'choose one or more' 15 25 10 ${blist[*]} 2>$tmpfile
function get-code {
for code in "$@"
do
case $code in
0 )
echo -e $grn'\ninstalling dependencies'$rst
sudo apt-get install libx11-dev libxft-dev libxext-dev libxinerama-dev libgtk2.0-dev libwebkitgtk-dev libfontconfig1-dev libfreetype6-dev
;;
1 )
echo -e $grn'\ngit clone st'$rst
git clone http://git.suckless.org/st
cd ./st && cp config.def.h config.h && sudo make clean install && cd ..
;;
2 )
echo -e $grn'\ngit clone slock'$rst
git clone http://git.suckless.org/slock
cd ./slock && sudo make clean install && cd ..
;;
3 )
echo -e $grn'\ngit clone swarp'$rst
git clone http://git.suckless.org/swarp
cd ./swarp && sudo make clean install && cd ..
;;
4 )
echo -e $grn'\nwget dmenu'$rst
wget http://dl.suckless.org/tools/dmenu-4.5.tar.gz
tar xvf dmenu-4.5.tar.gz
rm dmenu-4.5.tar.gz
cd ./dmenu-4.5 && sudo make clean install && cd ..
;;
5 )
echo -e $grn'\ngit clone tabbed'$rst
git clone http://git.suckless.org/tabbed
cd ./tabbed && cp config.def.h config.h && sudo make clean install && cd ..
;;
6 )
echo -e $grn'\ngit clone surf'$rst
git clone http://git.suckless.org/surf
cd ./surf && cp config.def.h config.h && sudo make clean install && cd ..
;;
esac
done
}
get-code $(cat $tmpfile)
rm $tmpfile