#!/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 \
"elementary_xfce" "" "on" \
"exo" "libexo" "off" \
"garcon" "garcon menu library" "on" \
"gtk_xfce_engine" "Gtk+-2.0とGTK+-3.0の双方に対応したXfce用の描画エンジン" "on" \
"libopenraw" "libopenraw" "off" \
"libxfce4ui" "libxfce4ui" "on" \
"libxfce4util" "Utilities for Xfce4" "off" \
"libxfcegui4" "Xfce4 GUI library" "off" \
"mousepad" "text editor for Xfce" "off" \
"orage" "Orage: calendar for Xfce" "off" \
"parole" "parole media player" "on" \
"ristretto" "picture viewer for Xfce" "off" \
"thunar" "Thunar" "on" \
"thunar_volman" "Thunar volume manager" "on" \
"tumbler" "tumbler thumbnailer" "on" \
"xfce4_appfinder" "appfinder for Xfce" "off" \
"xfce4_battery_plugin" "battery plugin for Xfce4" "on" \
"xfce4_cpufreq_plugin" "xfce4 cpufreq plugin" "on" \
"xfce4_cpugraph_plugin" "xfce4 cpugraph plugin" "on" \
"xfce4_dev_tools" "Xfce4 development tools" "off" \
"xfce4_eyes_plugin" "xfce4 xeye plugin" "on" \
"xfce4_icon_theme" "Xfce4 icon theme" "off" \
"xfce4_notes_plugin" "" "on" \
"xfce4_notifyd" "" "on" \
"xfce4_panel" "Xfce4 panel" "off" \
"xfce4_power_manager" "" "on" \
"xfce4_pulseaudio_plugin" "xfce4_pulseaudio_plugin" "on" \
"xfce4_screenshooter_plugin" "" "on" \
"xfce4_sensors_plugin" "" "on" \
"xfce4_session" "Xfce4 session" "off" \
"xfce4_settings" "Xfce Setting tools" "off" \
"xfce4_systemload_plugin" "xfce4 systemload plugin" "on" \
"xfce4_taskmanager" "xfce4 task manager" "on" \
"xfce4_terminal" "xfce4_terminal" "off" \
"xfce4_time_out_plugin" "" "on" \
"xfce_theme_albatross" "Xfce Albatross theme" "on" \
"xfce_theme_greybird" "greybird Xfce Theme" "on" \
"xfce_theme_numix" "Numix xfce Theme" "on" \
"xfce_theme_orion" "Orion Xfce Theme" "on" \
"xfconf" "Xfce configuration system" "off" \
"xfdesktop" "xfdesktop" "off" \
"xfwm4" "Xfce4 Window Manager" "off" \
"xfwm4_themes" "xfwm4 themes" "on" \
2> /tmp/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
  rm -f /tmp/SeTpkgs
  > /tmp/SeTnewtag
  for pkg in elementary_xfce exo garcon gtk_xfce_engine libopenraw libxfce4ui libxfce4util libxfcegui4 mousepad orage parole ristretto thunar thunar_volman tumbler xfce4_appfinder xfce4_battery_plugin xfce4_cpufreq_plugin xfce4_cpugraph_plugin xfce4_dev_tools xfce4_eyes_plugin xfce4_icon_theme xfce4_notes_plugin xfce4_notifyd xfce4_panel xfce4_power_manager xfce4_pulseaudio_plugin xfce4_screenshooter_plugin xfce4_sensors_plugin xfce4_session xfce4_settings xfce4_systemload_plugin xfce4_taskmanager xfce4_terminal xfce4_time_out_plugin xfce_theme_albatross xfce_theme_greybird xfce_theme_numix xfce_theme_orion xfconf xfdesktop xfwm4 xfwm4_themes  ; do 
  echo "$pkg: SKP" >> /tmp/SeTnewtag
  done
  exit
fi
cat /dev/null > /tmp/SeTnewtag
for PACKAGE in elementary_xfce exo garcon gtk_xfce_engine libopenraw libxfce4ui libxfce4util libxfcegui4 mousepad orage parole ristretto thunar thunar_volman tumbler xfce4_appfinder xfce4_battery_plugin xfce4_cpufreq_plugin xfce4_cpugraph_plugin xfce4_dev_tools xfce4_eyes_plugin xfce4_icon_theme xfce4_notes_plugin xfce4_notifyd xfce4_panel xfce4_power_manager xfce4_pulseaudio_plugin xfce4_screenshooter_plugin xfce4_sensors_plugin xfce4_session xfce4_settings xfce4_systemload_plugin xfce4_taskmanager xfce4_terminal xfce4_time_out_plugin xfce_theme_albatross xfce_theme_greybird xfce_theme_numix xfce_theme_orion xfconf xfdesktop 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
