#!/bin/sh
cat /dev/null > /tmp/SeTnewtag
dialog --title "Select pkgs from IM(Input Methods)"   --checklist "Select packages to install from IM series. Use cursor up/down to select the package, mark(*) by space key. Push Enter to start install." 24 72 15 "anthy_unicode" "IM Anthy in unicode" "on" \
"dbskkd_cdb" "dbskkd_cdb" "on" \
"ddskk" "Daredevil SKK" "on" \
"emacs_mozc" "Mozc module for Emacs" "on" \
"fcitx5" "Fcitx5 input method framework" "on" \
"fcitx5_anthy" "Anthy Wrapper for Fcitx5." "on" \
"fcitx5_configtool" "fcitx5 configuration tool" "on" \
"fcitx5_gtk" "Gtk im module for fcitx5 and glib based dbus client library" "on" \
"fcitx5_mozc" "mozc for fcitx5/emacs" "on" \
"fcitx5_qt" "fcitx5 IM module for Qt" "on" \
"fcitx5_skk" "SKK input method engine for Fcitx5" "on" \
"kasumi_unicode" "Dictionary Management tool Kasumi with unicode" "on" \
"libgee" "utility library for GObject-based interfaces and classes " "on" \
"libotf" "libotf" "on" \
"libskk" "library for SKK input method" "on" \
"m17n_db" "e_title" "on" \
"m17n_lib" "e_title" "on" \
"mozc" "Mozc: Japanese input method editor(IME)" "on" \
"uim" "UIM: Universal Input Method" "on" \
"uim_mozc" "Mozc for UIM" "on" \
"zinnia" "zinnia online hand recognition system" "on" \
2> /tmp/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
  rm -f /tmp/SeTpkgs
  > /tmp/SeTnewtag
  for pkg in anthy_unicode dbskkd_cdb ddskk emacs_mozc fcitx5 fcitx5_anthy fcitx5_configtool fcitx5_gtk fcitx5_mozc fcitx5_qt fcitx5_skk kasumi_unicode libgee libotf libskk m17n_db m17n_lib mozc uim uim_mozc zinnia  ; do 
  echo "$pkg: SKP" >> /tmp/SeTnewtag
  done
  exit
fi
cat /dev/null > /tmp/SeTnewtag
for PACKAGE in anthy_unicode dbskkd_cdb ddskk emacs_mozc fcitx5 fcitx5_anthy fcitx5_configtool fcitx5_gtk fcitx5_mozc fcitx5_qt fcitx5_skk kasumi_unicode libgee libotf libskk m17n_db m17n_lib mozc uim uim_mozc zinnia ; 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

