#!/bin/sh
cat /dev/null > /tmp/SeTnewtag
dialog --title "select pkgs from xfce(XFce4 Desktop Environment)" \
  --checklist "select packages from xfce series. \
You can move cursor with UP/DOWN key and push space \
key to select pkgs. After finish selecting, \
push Enter to start installation. " 24 72 15 \
"Terminal" "Terminal" "on" \
"Thunar" "thunar file manager" "on" \
"exo" "libexo" "on" \
"gtk_xfce_engine" "gtk-xfce engine" "on" \
"libxfce4menu" "xfce4 menu library" "on" \
"libxfce4util" "Utilities for Xfce4" "on" \
"libxfcegui4" "Xfce4 GUI library" "on" \
"mousepad" "text editor for Xfce" "on" \
"orage" "Orage: calendar for Xfce" "on" \
"ristretto" "picture viewer for Xfce" "on" \
"thunar_volman" "Thunar volume manager" "on" \
"xarchiver" "archiver for Xfce" "on" \
"xfce4_appfinder" "appfinder for Xfce" "on" \
"xfce4_dev_tools" "Xfce4 development tools" "on" \
"xfce4_icon_theme" "Xfce4 icon theme" "on" \
"xfce4_mixer" "Xfce4 mixer" "on" \
"xfce4_panel" "Xfce4 panel" "on" \
"xfce4_session" "Xfce4 session" "on" \
"xfce4_settings" "Xfce-4.6 Setting tools" "on" \
"xfce_utils" "Xfce utilities" "on" \
"xfconf" "Xfce configuration system" "on" \
"xfdesktop" "xfdesktop" "on" \
"xfprint" "xfprint" "on" \
"xfwm4" "Xfce4 Window Manager" "on" \
"xfwm4_themes" "Xfce4 theme" "on" \
2> /tmp/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
  rm -f /tmp/SeTpkgs
  > /tmp/SeTnewtag
  for pkg in Terminal Thunar exo gtk_xfce_engine libxfce4menu libxfce4util libxfcegui4 mousepad orage ristretto thunar_volman xarchiver xfce4_appfinder xfce4_dev_tools xfce4_icon_theme xfce4_mixer xfce4_panel xfce4_session xfce4_settings xfce_utils xfconf xfdesktop xfprint xfwm4 xfwm4_themes  ; do 
  echo "$pkg: SKP" >> /tmp/SeTnewtag
  done
  exit
fi
cat /dev/null > /tmp/SeTnewtag
for PACKAGE in Terminal Thunar exo gtk_xfce_engine libxfce4menu libxfce4util libxfcegui4 mousepad orage ristretto thunar_volman xarchiver xfce4_appfinder xfce4_dev_tools xfce4_icon_theme xfce4_mixer xfce4_panel xfce4_session xfce4_settings xfce_utils xfconf xfdesktop xfprint xfwm4 xfwm4_themes  ; do
    if grep "$PACKAGE" /tmp/SeTpkgs 1> /dev/null 2> /dev/null ; then
        echo "$PACKAGE: ADD" >> /tmp/SeTnewtag
    else echo "$PACKAGE: SKP" >> /tmp/SeTnewtag
    fi
done
rm -f /tmp/SeTpkgs
