get-suckless-code

Submitted scripts and programs
Forum rules
Your own work only.
User avatar
GekkoP
Emacs Sancho Panza
Posts: 5878
Joined: Tue Sep 03, 2013 7:05 am

get-suckless-code

Unread post by GekkoP » Wed Apr 09, 2014 5:37 pm

First, credits: like it says in the comments, this is basically Pidley's get-wmcode, adapted by me to get the suckless tools I regurarly use. Nothing more, really. So be thankful to him too.
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

User avatar
rust collector
Motörhead
Posts: 536
Joined: Mon Jan 13, 2014 3:56 pm
Location: no_nb

Re: get-suckless-code

Unread post by rust collector » Thu Apr 10, 2014 1:14 am

I love you GekkoP!

Ok, I have not got this working yet, but... thanks very much



Heh, got it working, I was missing dialog...

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: get-suckless-code

Unread post by machinebacon » Thu Apr 10, 2014 10:36 am

ah nice! thanks GP and props to Pids!
..gnutella..

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5878
Joined: Tue Sep 03, 2013 7:05 am

Re: get-suckless-code

Unread post by GekkoP » Thu Apr 10, 2014 3:45 pm

^^ yes, I forgot to mention it needs dialog to work. But hey, you figured it out anyway. :)

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: get-suckless-code

Unread post by machinebacon » Thu Apr 10, 2014 4:42 pm

works with all bbq installs.
..gnutella..

User avatar
ChefIronBelly
Approved BBQer
Posts: 1044
Joined: Mon Jan 13, 2014 6:01 am
Location: Michigan

Re: get-suckless-code

Unread post by ChefIronBelly » Tue Apr 15, 2014 1:01 pm

nice work will come in handy
(1/1) Installing: LinuxBBQ...................................[69%]==============[/]

User avatar
bones
Clooney
Posts: 2385
Joined: Fri Jun 28, 2013 11:47 pm
Location: Cascadia

Re: get-suckless-code

Unread post by bones » Tue Apr 15, 2014 1:11 pm

Very nice, thanks!

Post Reply