zenity

zenity --info dialog is unstable

让人想犯罪 __ 提交于 2019-12-11 18:07:59
问题 I have a script that randomly generates passwords, I have modified it to display in a GUI using zenity . When I use the original script, I can produce random passwords of any length the user chooses (I tested with 50,000). Here's the code : #!/bin/bash number=10 echo "hello" echo "Please enter your number: $number" read newnumber # read newnumber [ -n "$newnumber" ] && number=$newnumber MATRIX="0123456789<?/_+-!@#$%^&*>ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" # Password will

zenity list and for loop

蹲街弑〆低调 提交于 2019-12-11 08:53:52
问题 for i in $(seq 1 10); do echo 'bla bla' echo 'xxx' echo $i done | select=$(zenity --list --title="title" --text="text" --column="X" --column="Y" --column="Z"); I try to create a checklist with zenity, my problem is that $select is always empty. I try to do it in few other ways, like this one: for i in $(seq 1 10) do x="bla bla" y="xxx" z="$i" table="$table '$x' '$y' '$z'" done eval zenity --list --title="title" --text="text" --column="X" --column="Y" --column="Z" $table In this way the

Control the size of the content in a zenity window?

橙三吉。 提交于 2019-12-09 11:59:44
问题 I can control the size of a zenity window with the --width and the --height arguments: $ zenity --info --text="This is an information box." --width=600 --height=400 Is there a way to control the size of the content? For example, can I double the size of the font used to display the text? 回答1: Zenity allows some markup like <b>, <i> or <span>. In fact it's Pango Markup. So larger text can be achieved with a span that has a font or size attribute: For example: zenity --info --text '<span

Schedule a zenity message on linux

≯℡__Kan透↙ 提交于 2019-12-08 07:14:33
问题 I want to create a simple reminder on linux at a certain time everyday. I am using crontab to schedule running the reminder script, while in the script I am using zenity to display a simple dialog box with a question. In more details, I have the following script reminder.sh : #!/bin/bash zenity --question --text="question?" Then, using crontab -e , I add the following task to run every single minute (just for testing): * * * * * /path/to/reminder.sh But the dialog box doesn't appear. I added

Zenity --progress from Handbrake CLI output

久未见 提交于 2019-12-06 03:40:10
问题 My goal is to create a gtk progress bar with the output of HandBrakeCLI using zenity --progress. I've ran into some snags and I'm wondering if someone knows of a better way or can help me with what I'm currently doing. Normal Output: HandBrakeCLI -i infile -o outfile --preset=iPad Displays Encoding: task 1 of 1, 11.97 % (72.81 fps, avg 86.78 fps, ETA 00h00m43s) HandBrake piped to tr and cut commands so I only have the percentages that zenity will expect. HandBrakeCLI -i infile -o outfile -

Zenity --progress from Handbrake CLI output

回眸只為那壹抹淺笑 提交于 2019-12-04 07:45:37
My goal is to create a gtk progress bar with the output of HandBrakeCLI using zenity --progress. I've ran into some snags and I'm wondering if someone knows of a better way or can help me with what I'm currently doing. Normal Output: HandBrakeCLI -i infile -o outfile --preset=iPad Displays Encoding: task 1 of 1, 11.97 % (72.81 fps, avg 86.78 fps, ETA 00h00m43s) HandBrake piped to tr and cut commands so I only have the percentages that zenity will expect. HandBrakeCLI -i infile -o outfile --preset=iPad 2>&1 | tr -s '\r' '\n' | cut -b 24-28 Results in what I would expect: 1.05 1.06 1.10 1.10 But

What's the simplest cross-platform way to pop up graphical dialogs in Python?

*爱你&永不变心* 提交于 2019-11-28 17:27:30
I want the simplest possible way to pop up simple dialogs in Python scripts. Ideally, the solution would: Work on Windows, OS X, Gnome, KDE Look like a native dialog on any OS Require minimal code To pop up a simple standard dialog should require only minimal code. Essentially you're just saying "Pop up a standard dialog with this text", or "Pop up a dialog with question x and feed response into variable y". This is for simple scripts that would otherwise run on the command line. I don't want to know about GUI frameworks or have to set up code that says "start a GUI thread, register an event

git stderr output can't pipe

五迷三道 提交于 2019-11-28 09:11:50
I'm writing a graphical URI handler for git:// links with bash and zenity, and I'm using a zenity 'text-info' dialog to show git's clone output while it's running, using FIFO piping. The script is about 90 lines long, so I won't bother posting it here, but here's the most important lines: git clone "$1" "$target" 2>&1 | cat >> /tmp/githandler-fifo & cat /tmp/githandler-fifo | zenity --text-info --text='Cloning git repository' & I'm using FIFO instead of a direct pipe to allow them to run asynchronously and allow for killing git if the zenity window is closed. Problem is, the only line that

Redirect output of command with heredoc

蹲街弑〆低调 提交于 2019-11-28 09:05:31
问题 I have a command like this: sftp user@host <<EOF put file.txt exit EOF Now I'd like to pipe the output of that to zenity --progress , but I can't find a place to put it. # SFTP doesn't work anymore sftp user@host | zenity --progress <<EOF put file.txt exit EOF # Invalid syntax, no end of heredoc sftp user@host <<EOF put file.txt exit EOF | zenity --progress # Not picked as part of the command sftp user@host <<EOF put file.txt exit EOF | zenity --progress # Does not help sftp user@host |

What's the simplest cross-platform way to pop up graphical dialogs in Python?

蓝咒 提交于 2019-11-27 10:16:36
问题 I want the simplest possible way to pop up simple dialogs in Python scripts. Ideally, the solution would: Work on Windows, OS X, Gnome, KDE Look like a native dialog on any OS Require minimal code To pop up a simple standard dialog should require only minimal code. Essentially you're just saying "Pop up a standard dialog with this text", or "Pop up a dialog with question x and feed response into variable y". This is for simple scripts that would otherwise run on the command line. I don't want