#!/bin/sh
cat /dev/null > /tmp/SeTnewtag
dialog --title "select pkgs from x11(X11 Window System)" \
  --checklist "select packages from x11 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 \
"TTfont" "" "on" \
"Xaw3d" "libXaw3d" "on" \
"Xwindow" "" "on" \
"audiofile" "audiofile" "on" \
"expat" "XML parsing library expat" "on" \
"fonts_append" "" "on" \
"giflib" "" "on" \
"libjpeg_turbo" "" "on" \
"libpng" "PNG library" "on" \
"libpng14" "libpng14" "on" \
"libxklavier" "libxklavier - utility library to make XKB stuff easier" "on" \
"mtdev" "" "on" \
"pcf2bdf" "" "on" \
"pixman" "low-level pixel manipulation library" "on" \
"plotutils" "" "on" \
"pstoedit" "" "on" \
"qmkbold" "" "on" \
"tiff" "" "on" \
"xfplamoconfig" "xfplamoconfig - Configuration tool for Xorg/XFree86" "on" \
"xterm" "xterm terminal emulator" "on" \
2> /tmp/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
  rm -f /tmp/SeTpkgs
  > /tmp/SeTnewtag
  for pkg in TTfont Xaw3d Xwindow audiofile expat fonts_append giflib libjpeg_turbo libpng libpng14 libxklavier mtdev pcf2bdf pixman plotutils pstoedit qmkbold tiff xfplamoconfig xterm  ; do 
  echo "$pkg: SKP" >> /tmp/SeTnewtag
  done
  exit
fi
cat /dev/null > /tmp/SeTnewtag
for PACKAGE in TTfont Xaw3d Xwindow audiofile expat fonts_append giflib libjpeg_turbo libpng libpng14 libxklavier mtdev pcf2bdf pixman plotutils pstoedit qmkbold tiff xfplamoconfig xterm  ; 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
