문제

Im trying to make my first bash script and im trying to use kdialog .

How do i make the progress bar a certain width here is my attempt

dbusRef=`kdialog --title "Sweet As Buckup Demon" --progressbar "Initializing" 8`
qdbus $dbusRef Set "" value 1
qdbus $dbusRef setLabelText "Getting web site folder and creating mysqldump and grabbing configuration files from the apache Server"
cp -rf /usr/local/websites/sweetassurfwear /home/brett/sweetback/
sleep 4
qdbus $dbusRef Set "" value 2
cd /home/brett/sweetback/

And so on.. if you need the entire script i will post it

Basically at each part of the process it out puts text on the progress bar but the dialog keeps changing width.

How do i make the size standard

도움이 되었습니까?

해결책

Use the --geometry argument, e.g.

kdialog --geometry 300x300+300+300 --title "Sweet As Buckup Demon" --progressbar "Initializing"

You can see the documentation for this option by typing:

kdialog --help-all|grep geometry

다른 팁

I was trying to use the --geometry option to widen an input box dialog and it wouldn't work. Eventually I found out that adding spaces to the end of the input box label forces the dialog to be wider, e.g. if you use

kdialog --title "Input dialog" --inputbox "Input"

You may get something like this:

narrow input box dialog

But if you add extra spaces at the of the input box label:

# The expression $(printf "%0.s " {1..70}) adds 70 space characters to the label
kdialog --title "Input dialog" --inputbox "Input $(printf "%0.s " {1..70})"

You'll get something like this:

enter image description here

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top