zentiy可以帮助你使用脚本创建常用的gtk+对话框。
1、使用日历控件:
2、创建一个Entry对话框:
3、创建一个错误对话框:
4、创建一个Info对话框:
5、创建一个文件选择对话框:
6、创建一个通知对话框:
7、创建一个进度对话框:
8、创建一个question对话框:
9、创建一个警告对话框:
10、创建一个滑动scale对话框:
11、创建一个文本信息对话框:
12、创建一个列表对话框:
radiolist:
checklist:
一个linux elementary主题的安装脚本的例子:
#!/bin/bash zenity --info --text "This is an installation file for elementary theme.\nIt will download latest packages and install them\nand aswell apply the elementary theme.\n\nVisit us at: www.elementary-project.com\nIRC: #elementary on irc.freenode.org\n\nBest Regards\nElementary Team" OPTIONS=$(zenity --list --width=370 --height=350 --title="elementary installation" --text="Please select elementary components you\nwould like to have installed." --checklist --column "Option" --column "Description" TRUE "Elementary Theme" TRUE "Elementary Icons" TRUE "GTK Murrine Engine") ( gksudo "add-apt-repository ppa:elementaryart/ppa" gksudo "apt-get update" DOIT=$(echo $OPTIONS | grep "Engine") if [ -n "$DOIT" ] ; then gksudo apt-get install gtk2-engines-murrine fi DOIT=$(echo $OPTIONS | grep "Theme") if [ -n "$DOIT" ] ; then gksudo apt-get install elementary-theme fi DOIT=$(echo $OPTIONS | grep "Icons") if [ -n "$DOIT" ] ; then gksudo apt-get install elementary-icon-theme fi gconftool-2 --type string --set /desktop/gnome/interface/gtk_theme "elementary" gconftool-2 --type string --set /apps/metacity/general/theme "elementary" gconftool-2 --type string --set /desktop/gnome/interface/icon_theme "elementary" ) | zenity --progress --width 370 --height 180 --pulsate --title "Installing selected components" --text "Installing...\nBe patient please." --auto-close zenity --info --text "elementary theme successfully installed!\n\nScript made by: Nookie^\n\nVisit: elementary-project.com\nIRC: #elementary on irc.freenode.org"