Linux java弹出消息框,如何在linux中的bash脚本中显示GUI消息框?

首先,以文本格式标记,窗口 Headers ,按钮标签为特色的zenity示例 .

zenity \

--info \

--text="Time is $(date +%Hh%M).\n\nGet your coffee." \

--title="Coffee time" \

--ok-label="Sip"

gxmessage

gxmessage "my text"

xmessage

xmessage 非常老,所以它很稳定,可能在所有使用X的发行版中都可用(因为它随X一起发布) . 它可以通过X资源进行自定义,对于那些已经使用Linux或Unix足够长的人来了解它的含义( .Xdefaults ,任何人?) .

xmessage -buttons Ok:0,"Not sure":1,Cancel:2 -default Ok -nearmouse "Is xmessage enough for the job ?" -timeout 10

kdialog

(未测试)

在PPA中

echo My text | yad \

--text-info \

--width=400 \

--height=200

一个更大的例子

yad \

--title="Desktop entry editor" \

--text="Simple desktop entry editor" \

--form \

--field="Type:CB" \

--field="Name" \

--field="Generic name" \

--field="Comment" \

--field="Command:FL" \

--field="Icon" \

--field="In terminal:CHK" \

--field="Startup notify:CHK" "Application" "Name" "Generic name" "This is the comment" "/usr/bin/yad" "yad" FALSE TRUE \

--button="WebUpd8:2" \

--button="gtk-ok:0" \

--button="gtk-cancel:1"

其他不在Ubuntu标准存储库中

shellgui

xdialog

gtkdialog

偏离主题(终端)

whiptail --msgbox "my text" 10 20

dialog --msgbox "my text" 10 20

随意编辑 .

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值