# !/bin/bash # 图形化窗口 # create : 2019-12-19 # update : 2019-12-19 # author : wuduoqiang # 测试框 # dialog --title 窗口标题 --msgbox 主体信息 窗口高 窗口宽 dialog --title "测试标题" --msgbox "主体信息" 20 50 # 确认框 # dialog --title 窗口标题 --no-shadow --yesno 主体信息 窗口高 窗口宽 dialog --title "确定和取消对话框" --no-shadow --yesno "是否删除文件?" 20 50 # 输入框 # dialog --title 窗口标题 --inputbox 主体信息 窗口高 窗口宽 将输入框的内容输入到文件 dialog --title "输入框" --inputbox "请输入你的名字:" 20 50 2> ./name.txt # 文本框 # dialog --title 窗口标题 --textbox 将文本信息展示到文本框 窗口高 窗口宽 dialog --title "文本框" --textbox ./name.txt 20 50 # 退出框 # dialog --title 窗口标题 --exit-label 退出标签的名字 --textbox 将文本信息展示到文本框 窗口高 窗口宽 dialog --title "退出标签" --exit-label "退出" --textbox ./name.txt 20 50 # 菜单框 # dialog --title 窗口标题 --menu 菜单名 窗口高 窗口宽 菜单高 标签1 选项1 标签2 选项2 ... dialog --title "菜单标签" --menu "请选择:" 20 50 10 1 "吃饭" 2 "睡觉" 3 "打豆豆" # 文件框 # dialog --title 窗口标题 --fselect 路径 窗口高 窗口宽 dialog --title "文件框" --fselect /root/ 20 50 # 进度条 # dialog --title 窗口标题 --gauge 主体信息 窗口高 窗口宽 进度条的值 dialog --title "进度条" --gauge "正在复制文件" 20 50 0 # 密码框 # dialog --title 窗口标题 --insecure --passwordbox 主体信息 窗口高 窗口宽 dialog --title "密码框" --insecure --passwordbox "请输入密码:" 20 50 # 日历框 # dialog --title 窗口标题 --calendar 主体信息 窗口高 窗口宽 dialog --title "日历框" --calendar "日历" 20 50 # 实时条 # 循环1到100; do echo $i; 循环结束 | dialog --title 窗口标题 --gauge 主体信息 窗口高 窗口宽 for i in {1..100}; do echo $i; done | dialog --title "实时进度条" --gauge "正在安装..." 20 50
欢迎来到这里!
我们正在构建一个小众社区,大家在这里相互信任,以平等 • 自由 • 奔放的价值观进行分享交流。最终,希望大家能够找到与自己志同道合的伙伴,共同成长。
注册 关于