Code Sample |
#!/bin/bash # 0 = program name, 1 = program files, 2 = icon files applist=( aterm "usr/bin/aterm usr/bin/rxvt usr/bin/xterm usr/include/rxvtlib.h usr/lib/librxvt*" "home/dsl/.xtdesktop/Aterm.* etc/skel/.xtdesktop/Aterm.*" axyftp "usr/X11R6/bin/axyftp*" "home/dsl/.xtdesktop/Ftp.* etc/skel/.xtdesktop/Ftp.*" beaver "usr/bin/beaver" "home/dsl/.xtdesktop/Beaver.* etc/skel/.xtdesktop/Beaver.*" dillo "etc/dillorc usr/local/bin/dillo usr/local/lib/dillo* usr/local/bin/dpid* usr/local/etc/dillorc usr/local/etc/dpidrc" "home/dsl/.xtdesktop/Dillo.* etc/skel/.xtdesktop/Dillo.*" emelfm "usr/X11R6/bin/emelfm* usr/lib/emelfm" "home/dsl/.xtdesktop/Emelfm.* etc/skel/.xtdesktop/Emelfm.*" firefox "usr/local/bin/firefox usr/local/firefox" "home/dsl/.xtdesktop/Firefox.* etc/skel/.xtdesktop/Firefox.*" fluxbox "usr/bin/flux* usr/share/fluxbox" " " games "usr/games" " " gphone "usr/bin/gphone" " " grun "usr/bin/grun" " " gtkfind "usr/bin/gtkfind" " " jwm "usr/bin/jwm" " " mc "usr/local/bin/mc usr/local/bin/mc.bin" " " nano "bin/nano*" " " netrik "usr/local/bin/netrik" " " perl "usr/bin/perl* usr/lib/perl* usr/lib/libperl* usr/share/perl*" " " rdesktop "usr/bin/rdesktop usr/share/rdesktop usr/local/bin/rdesktop.lua" "home/dsl/.xtdesktop/Rdesktop.* etc/skel/.xtdesktop/Rdesktop.*" siag "usr/lib/libMowitz* usr/local/share/siag usr/local/lib/siag usr/local/lib/libMowitz* usr/local/share/Mowitz usr/local/bin/mowitz-config usr/local/bin/siag*" "home/dsl/.xtdesktop/Siag.* etc/skel/.xtdesktop/Siag.*" smbclient "usr/bin/smb* usr/local/bin/smbclient.lua" " " sqlite "usr/bin/sqlite usr/lib/libsqlite*" " " sylpheed "usr/bin/sylpheed" "home/dsl/.xtdesktop/Sylpheed.* etc/skel/.xtdesktop/Sylpheed.*" ted "usr/local/Ted usr/local/bin/Ted usr/local/bin/ted" "home/dsl/.xtdesktop/Ted.* etc/skel/.xtdesktop/Ted.*" telnet "usr/bin/telnet" " " torsmo "usr/local/bin/torsmo" " " vnc "usr/bin/vnc*" "home/dsl/.xtdesktop/Vnc.* etc/skel/.xtdesktop/Vnc.*" xmms "usr/lib/xmms usr/bin/xmms usr/lib/libxmms.* usr/share/xmms" "home/dsl/.xtdesktop/Xmms.* etc/skel/.xtdesktop/Xmms.*" xpaint "usr/X11R6/bin/xpaint" "home/dsl/.xtdesktop/Xpaint.* etc/skel/.xtdesktop/Xpaint.*" xpdf "etc/xpdf usr/bin/xpdf usr/share/xpdf" "home/dsl/.xtdesktop/Xpdf.* etc/skel/.xtdesktop/Xpdf.*" xtdesk "usr/bin/xtdesk usr/local/bin/xtdesk.sh" "home/dsl/.xtdesktop etc/skel/.xtdesktop" xzgv "usr/bin/xzgv" "home/dsl/.xtdesktop/Xzgv.* etc/skel/.xtdesktop/Xzgv.*" ) cnt=${#applist[*]} # list of filenames build_list() { for (( i = 0; i < cnt; i=i+3 )); do echo $chooser | grep ${applist[$i]} &>/dev/null && filelist="$filelist ${applist[$i+$1]}" done } # intro echo "This script will attempt to remove unwanted applications from the current directory tree. If you're running this script from the root directory (/), files will be removed from your running system. If you wish to use this script while remasting DSL, it should be run from the top of the directory containing your temporary filesystem, and not from the system root. Press Enter to continue." read anykey echo "Do you want to remove desktop icons? [y|N]" read rmicons # build checklist, omitting filenames wtstring="" cnt=${#applist[*]} for (( i = 0; i < cnt; i=i+3 )); do wtstring="$wtstring ${applist[$i]} 0"; done chooser=`whiptail --separate-output --noitem --checklist \ "Use the spacebar to select the applications you want to remove." \ 20 40 12 $wtstring 3>&1 1>&2 2>&3` [ -z "$chooser" ] && exit # list of files to be deleted filelist="" build_list 1 size=`du -h -c $filelist | tail -1 | awk '{print $1}'` cat << EOF You are about to remove the selected applications and their related files, with a total uncompressed size of approximately $size The script may leave a few stray files behind, since I ain't perfect. No guarantee is made about the condition of your system after you complete the following process. The removal of some applications may cause failure in other applications. Proceed at your own risk. Type YES (all caps) to continue. EOF read anykey [ "$anykey" != "YES" ] && exit case $rmicons in [Yy][Ee][Ss]|[Yy]) build_list 2;; esac # remove everything in $filelist echo rm -rfv $filelist |
Quote |
it said xtdesk.sh is missing.... then i installed DSL again and i tryed by not removing xtdesk.sh file and it worked fine... so i think its better to remove this line from ur code rm -rf usr/bin/xtdesk usr/local/bin/xtdesk.sh;; |
Quote |
I'm assuming none of these applications can be removed with apt-get or dpkg? |