########################################
##
## jwmConfigMgr
## 
## author: thoughtjourney
## date: 31/07/2005
##
## jwmConfigMgr is a script designed
## for Puppy Linux versions running
## JWM 0.22 or greater. 
##
## The script presents a configuration 
## GUI for Joe's Window Manager
##
########################################

##-------TO DO------------------------->>

# splash screen--------------done
# tray autohide--------------done
# virtual desktops-----------done
# desktop background---------done
# focus model----------------done
# theme switcher-------------done
# theme creator ------------->> later version
# program shortcut keys------done
# default to theme settings--done
# profiles------------------->> later version
# taskbar insert-------------done
# place icons in icon dir----done
# tidy code------------------done
# integrate GTK/JWM themes---done


#!/bin/sh

##--------variables---------->>

#SCRIPT_DIR="/root/.jwm"
SCRIPT_DIR="/usr/local/jwmconfig"
#IMAGES_DIR="/root/.jwm/images"
IMAGES_DIR="/usr/local/jwmconfig/images"
MINI_ICONS_DIR="/usr/local/lib/X11/mini-icons"

export JWM_Display_Manager="
<window title=\"JWM設定マネージャ\" icon-name=\"gtk-preferences\" window-position=\"1\">
<vbox>
 <frame Information>
  <hbox>
      <text><label>このツールを使うと、JWMを好みの設定にできます。</label></text>
  </hbox>
  <vbox><pixmap><input file>$IMAGES_DIR/gnome-desktop-config.png</input></pixmap></vbox>
  <hbox>
   <pixmap><input file>$IMAGES_DIR/infoBlue.gif</input></pixmap>
   <text><label>注意：設定を変更すると現在のテーマに</label></text>
  </hbox>
  <hbox>
   <text><label>新しいテーマが優先されます。</label></text>
  </hbox>
 </frame>
  <hbox>
   <button ok></button>
  </hbox>
</vbox>
</window>"


# Themes (theme switcher, theme creator, default to theme settings)
# Taskbar (tray autohide, number of virtual desktops)
# GTK setting
# Desktop background

# Focus Model
# Shortcuts
# Advanced (move mode, resize mode, snap mode, double-click options ) 
# Settings (save settings as, load settings)


export JWM_Display="
<window title=\"JWM設定マネージャ\" icon-name=\"gtk-preferences\" window-position=\"1\">
 <vbox>
  <notebook labels=\"JWM|システム\">
   <vbox>
     <pixmap>
      <input file>$IMAGES_DIR/gnome-desktop-config.png</input>
     </pixmap>
    <hbox>
     <text>
      <label>テーマ</label>
     </text>
     <button>
      <input file>$MINI_ICONS_DIR/mini-windows.xpm</input>
      <action>$SCRIPT_DIR/jwmThemeSwitcher &</action>
     </button>
    </hbox>
    <hbox>
     <text>
      <label>タスクバー</label>
     </text>
     <button>
      <input file>$MINI_ICONS_DIR/mini-windows.xpm</input>
      <action>$SCRIPT_DIR/taskbar &</action>
     </button>
    </hbox>
    <hbox>
     <text>
      <label>フォーカスモデル</label>
     </text>
     <button>
      <input file>$MINI_ICONS_DIR/mini-windows.xpm</input>
      <action>$SCRIPT_DIR/focusModel &</action>
     </button>
    </hbox>
    <hbox>
     <text>
      <label>キーボード・ショートカット</label>
     </text>
     <button>
      <input file>$IMAGES_DIR/keys01.gif</input>
      <action>$SCRIPT_DIR/keyboard &</action>
     </button>
    </hbox>
    <hbox>
     <text>
      <label>プロファイル</label>
     </text>
     <button>
      <input file>$IMAGES_DIR/small-gear.png</input>
      <action>$SCRIPT_DIR/personal &</action>
     </button>
    </hbox>
    <hbox>
     <text>
      <label>パネルボタン</label>
     </text>
     <button>
      <input file>$IMAGES_DIR/keys01.gif</input>
      <action>./panel-buttons &</action>
     </button>
    </hbox>
   </vbox>
   <vbox>
    <pixmap>
     <input file>$IMAGES_DIR/emblem-gear.png</input>
    </pixmap>
    <hbox>
     <text>
      <label>GTKテーマ</label>
     </text>
     <button>
      <input file>$MINI_ICONS_DIR/mini.window3d.xpm</input>
      <action>/usr/sbin/gtk-theme &</action>
     </button>
    </hbox>
    <hbox>
     <text>
      <label>デスクトップの色</label>
     </text>
     <button>
      <input file>$MINI_ICONS_DIR/mini.window3d.xpm</input>
      <action>set-bkcolor &</action>
     </button>
    </hbox>
    <hbox>
     <text>
      <label>デスクトップ背景</label>
     </text>
     <button>
      <input file>$MINI_ICONS_DIR/mini.window3d.xpm</input>
      <action>set-bkgrnd &</action>
     </button>
    </hbox>
    <hbox>
     <text>
      <label>Xの設定（キーボード、マウス、フォントなど）</label>
     </text>
     <button>
      <input file>$MINI_ICONS_DIR/mini.window3d.xpm</input>
      <action>gxsetshell &</action>
     </button>
    </hbox>
   </vbox>
  </notebook>
  <frame 重要！>
   <hbox>
    <pixmap>
     <input file>$IMAGES_DIR/infoBlue.gif</input>
    </pixmap>
    <text>
     <label>変更を有効にするには、JWMをリスタートして下さい。</label>
    </text>
   </hbox>
   <hbox>
    <text>
     <label>今すぐJWMをリスタートしますか？</label>
    </text>
    <button yes>
     <action>jwm -restart &</action>
    </button>
   </hbox>
  </frame>
  <hbox>
   <button help>
    <action>xmessage -buttons Exit -bg black -fg green -name 'Sorry...' -center 'Help not written yet' &</action>
   </button>
   <button>
    <label>終了</label>
    <input file stock=\"gtk-quit\"></input>
    <action>EXIT:ok</action>
   </button>
  </hbox>
 </vbox>
</window>
"
##------------run------------->>
gtkdialog3 --program JWM_Display_Manager
gtkdialog3 --program JWM_Display

##----------cleanup------------>>
unset JWM_Display_Manager
unset JWM_Display

#clear
exit 0

