#!/bin/sh
cat /dev/null > /tmp/SeTnewtag
dialog --title "xfce(XFce4 Desktop Environment)シリーズの選択" \
  --checklist "xfce シリーズの中からインストールしたいパッケージを \
選んでください．カーソルの上下キーで \
対象を選択し，space キーでマーク(X)します． \
Enter キーでインストールを開始します．" 24 72 15 \
"Terminal" "ターミナルエミュレーター" "off" \
"Thunar" "thunar ファイルマネージャー" "off" \
"exo" "libexo" "off" \
"garcon" "garconメニューライブラリ" "on" \
"gtk_xfce_engine" "gtk-xfce エンジン" "off" \
"libatasmart" "ATA S.M.A.R.T. 用ライブラリ" "on" \
"libxfce4ui" "xfce4 UI ライブラリ" "on" \
"libxfce4util" "Xfce4 用ユーティリティ集" "off" \
"libxfcegui4" "Xfce4 GUI 用ライブラリ" "off" \
"mousepad" "Xfce 用テキストエディタ" "off" \
"orage" "Xfce用カレンダーツール" "off" \
"ristretto" "Xfce 用画像ビューワー ristretto" "off" \
"thunar_vfs" "Thunar VFSレイヤー" "on" \
"thunar_volman" "Thunar用ボリュームマネージャ" "on" \
"tumbler" "DBus用サムネイラー" "on" \
"xfce4_appfinder" "アプリケーション・ファインダー" "off" \
"xfce4_battery_plugin" "Xfce4バッテリ管理プラグイン" "on" \
"xfce4_cpufreq_plugin" "Xfce4 CPU周波数管理プラグイン" "on" \
"xfce4_dev_tools" "Xfce4 用開発ツール" "off" \
"xfce4_icon_theme" "Xfce4 用アイコンテーマ" "off" \
"xfce4_mixer" "Xfce4 ミキサー" "off" \
"xfce4_notes_plugin" "Xfce4 付箋紙ツール" "on" \
"xfce4_notifyd" "Xfce4用通知デーモン" "on" \
"xfce4_panel" "Xfce4 用パネル" "off" \
"xfce4_power_manager" "Xfce4用電源管理ツール" "on" \
"xfce4_screenshooter_plugin" "Xfce4スクリーンショットプラグイン" "on" \
"xfce4_sensors_plugin" "Xfce4センサープラグイン" "on" \
"xfce4_session" "Xfce4 セッション管理" "off" \
"xfce4_settings" "Xfce-4.6用設定ツール" "off" \
"xfce4_systemload_plugin" "Xfce4システム負荷プラグイン" "on" \
"xfce4_taskmanager" "Xfce4タスクマネージャプラグイン" "on" \
"xfce4_time_out_plugin" "Xfce4タイムアウトプラグイン" "on" \
"xfce_utils" "Xfce 用ユーティリティ" "off" \
"xfconf" "Xfce 用設定システム" "off" \
"xfdesktop" "xfdesktop" "off" \
"xfwm4" "Xfce4 ウィンドウマネージャ" "off" \
"xfwm4_themes" "Xfce4 テーマ" "off" \
2> /tmp/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
  rm -f /tmp/SeTpkgs
  > /tmp/SeTnewtag
  for pkg in Terminal Thunar exo garcon gtk_xfce_engine libatasmart libxfce4ui libxfce4util libxfcegui4 mousepad orage ristretto thunar_vfs thunar_volman tumbler xfce4_appfinder xfce4_battery_plugin xfce4_cpufreq_plugin xfce4_dev_tools xfce4_icon_theme xfce4_mixer xfce4_notes_plugin xfce4_notifyd xfce4_panel xfce4_power_manager xfce4_screenshooter_plugin xfce4_sensors_plugin xfce4_session xfce4_settings xfce4_systemload_plugin xfce4_taskmanager xfce4_time_out_plugin xfce_utils xfconf xfdesktop xfwm4 xfwm4_themes  ; do 
  echo "$pkg: SKP" >> /tmp/SeTnewtag
  done
  exit
fi
cat /dev/null > /tmp/SeTnewtag
for PACKAGE in Terminal Thunar exo garcon gtk_xfce_engine libatasmart libxfce4ui libxfce4util libxfcegui4 mousepad orage ristretto thunar_vfs thunar_volman tumbler xfce4_appfinder xfce4_battery_plugin xfce4_cpufreq_plugin xfce4_dev_tools xfce4_icon_theme xfce4_mixer xfce4_notes_plugin xfce4_notifyd xfce4_panel xfce4_power_manager xfce4_screenshooter_plugin xfce4_sensors_plugin xfce4_session xfce4_settings xfce4_systemload_plugin xfce4_taskmanager xfce4_time_out_plugin xfce_utils 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
