...and have posted several bash scripts in the past
Now I am combining them into a single script that works like busybox.
here is a list of currently implemented functions
If you have a function to add that isn't implemented please post it
- addgroupgui() { #uses main_dialog() -> #addgroup [-g GID] [user_name] group_name
bashbox() { #todo make this more robust
blockads() { #tweaks /etc/hosts to ban certain sites
brokenlinks() { #find broken links in given input dir or pwd if not given
createlinks() { #make executable links for functions matching "()_{"
for x in `grep "() {" bashbox |cut -d"(" -f1 |grep -v " " |grep -v "#"` do ln -s bashbox $x; done
fixflash() { #mask your flash version as 10.1 rXXXXXX
getflash() { #install latest flash
getflash9() { #flash9 is smaller, fewer deps and still updated
getinput() { #DIALOG box to return user input to stdout
google() { #searches google for $@ or if blank uses $DIALOG
launcher() { #gtkdialog basic launcher program
main_dialog() { #parses template of vars to gen and eval a dialog then return the results
maindialogtemplate() {
percentbar() { #usage: "$0" XX% name=filename fgcolor=XXX bgcolor=XXX height=XXX width=XXX [vertical]
pget() { #download $1 to HOME/my-documents with axel
pickdate() { #choose a date - optional input: $1="text" $2=day $3=month $4=year
picktime() { #output a time - optional input: $1="text" $2=hours $3=minutes $4=seconds
pickfile() { #DIALOG box to return a user chosen file to stdout
pickXcolor() { #DIALOG box to return a user chosen X color to stdout
reset_mixers() { #from /usr/sbin/alsaconf... was called from rc.local0.
setDIALOG() { #sets $DIALOG to Xdialog if in X or dialog if in console
setjwmbg() { #TODO tweaks ... include $HOME/.jwmbg in the jwmrc template
setXCOLORS() { #sets $XCOLORS from ...rgb.txt
webcam2avi() { #capture your webcam to HOME/webcam.avi - requires ffmpeg & rxvt
X2avi() { #capture your desktop to HOME/x11-session.avi - ffmpeg needs x11grab
Xsetvolume() { #set volume with slider
Xshowimage() { #quick view of image
more TODO:
- 1)optimize/integrate puppy bash scripts/functions - replace with links
2)split off functions to compressed file that auto extracts on 1st run
3)make separate documentation file
4)more guis using main_dialog (integrated from my bbgui program)
5)suggestions?
- 1) each function tries to use other functions if possible - rather than duplicate code
2) functions are in alphabetical order to quickly find them
3) functions/comments are set up so that "folding" makes it easy to develop
Code: Select all
#optional description - TODO add $3 for compression type lzma, gz, etc
mkinitrd() { #creates initrd.gz from directory -usage: mkinitrd dir file
[ $2 == "" ] && echo usage: $0 directory /path/initrd.cpio.gz && exit 1
[ ! -d $1 ] && echo First argument must be a directory && exit 1
rm $2
cd $1
find . | cpio -o -H newc | gzip > $2
}
extractinitrd() { #extracts initrd.gz to directory -usage: extractinitrd dir file
[ $2 == "" ] && echo usage: $0 directory /path/initrd.cpio.gz && exit 1
[ ! -d $1 ] && echo First argument must be a directory && exit 1
cd $1
zcat $2 |cpio -id
}