Posts

Showing posts with the label Zenity

[Level 2] Shell Interactive With Zenity Episode 9 -- text-info (Finished)

Image
If you want to show a multi-line text info, you can use the option "--text-info". Ths Synopsis as below: SYNOPSIS      zenity --text-info [--title=title] [--window-icon=path]  [--width=width]   [--height=height]   [--timeout=seconds]   [--filename=path] [--editable] Just like " --calendar ", if you press "ESC" key or click button "Cancel", the return code will be "1". If you select one option and click "OK", zenity will response the option and return the code will be "0". And also the same effect about the options "--title", "--timeout"...etc, for saving your time, please refer to the previous post " [Level 2] Shell Interactive With Zenity Episode 1 -- calendar ", too. The command that you can try is "zenity --text-info". Ex. # zenity --text-info # In above case, the text column is not editable, and when you click the button "Close" the terminal won't ...

[Level 2] Shell Interactive With Zenity Episode 8 -- scale

Image
If you want to let user to set the scale, you can use the option ""--scale" to show a scale diagram. The synopsis as below: SYNOPSIS      zenity  --scale  [--title=title]  [--window-icon=path]   [--width=width]   [--height=height]   [--timeout=seconds]   [--text=text]  [--value=number]  [--min-value=number]   [--max-value=number]   [--step=number]  [--print-partial]  [--hide-value] Just like " --calendar ", if you press "ESC" key or click button "Cancel", the return code will be "1". If you select one option and click "OK", zenity will response the option and return the code will be "0". And also the same effect about the options "--title", "--timeout"...etc, for saving your time, please refer to the previous post " [Level 2] Shell Interactive With Zenity Episode 1 -- calendar ", too. The fist command that you can try is "zenity --scale", When user poll the bar and ...

[Level 2] Shell Interactive With Zenity Episode 7 -- progress

Image
Sometime we want to show a progress bar to let user know the process is still running or how many percentage of task has done. For this purpose, you can use an option "--progress" to fullfill your need. Ths Synopsis as below: SYNOPSIS      zenity --progress [--title=title]  [--window-icon=path]  [--width=width]   [--height=height]   [--timeout=seconds]  [--text=text] [--percentage=number] [--pulsate]  [--auto-close] [--auto-kill] Just like " --calendar ", if you press "ESC" key or click button "Cancel", the return code will be "1". If you select one option and click "OK", zenity will response the option and return the code will be "0". And also the same effect about the options "--title", "--timeout"...etc, for saving your time, please refer to the previous post " [Level 2] Shell Interactive With Zenity Episode 1 -- calendar ", too. The first command that you can try is "z...

[Level 2] Shell Interactive With Zenity Episode 6 -- notification

Image
What option can we use, if we want to let user get something show? You can use the option "--notification", the synoposis as the following: SYNOPSIS      zenity --notification [--window-icon=path] [--timeout=seconds] [--text=text] [--listen] Just like " --calendar ", if you press "ESC" key or click button "Cancel", the return code will be "1". If you select one option and click "OK", zenity will response the option and return the code will be "0". And also the same effect about the options "--title", "--timeout"...etc, for saving your time, please refer to the previous post " [Level 2] Shell Interactive With Zenity Episode 1 -- calendar ", too. When you enter the command ¨zenity --notification¨, you will get a warning sign on the panel. Ex. # zenity --notification # zenity --notification --text="Here is the tip" The notification also support listening, that means t...

[Level 2] Shell Interactive With Zenity Episode 5 -- list

Image
If you want to give a list for user to choose, you can use the option "--list". The command synopsis as below: SYNOPSIS      zenity  --list [--title=title] [--window-icon=path] [--width=width]    [--height=height] [--timeout=seconds] [--column=text] [--checklist]       [--radiolist] [--separator=character] [--multiple] [--editable] [--print-column=number] [--hide-column=number] Just like " --calendar ", if you press "ESC" key or click button "Cancel", the return code will be "1". If you select one option and click "OK", zenity will response the option and return the code will be "0". And also the same effect about the options "--title", "--timeout"...etc, for saving your time, please refer to the previous post " [Level 2] Shell Interactive With Zenity Episode 1 -- calendar ", too. About "--multiple" and "--separator", please refer to tht previous post " [Lev...

[Level 2] Shell Interactive With Zenity Episode 4 -- file-selection

Image
Does zenity provide the file/directory GUI? Yes, you can use the option "--file-selection". The command synopsis as following: SYNOPSIS      zenity --file-selection [--title=title] [--window-icon=path]  --width=width]  [--height=height] [--timeout=seconds]  [--filename=path]  [--multiple]  [--directory] [--save] [--separator=character] [--confirm-overwrite] When you use the option "--file-selection", you will see a pop out screen at the directory that you run this command, like below. # cd /etc # zenity --file-selection Just like " --calendar ", if you press "ESC" key or click button "Cancel", the return code will be "1". If you select one file and click "OK", zenity will response the filename and return the code will be "0". And also the same effect about the options "--title", "--timeout"...etc, for saving your time, please refer to the previous post " [Level 2] Shell I...

[Level 2] Shell Interactive With Zenity Episode 3 -- error / info / question / warning

Image
If you want to pop out a alter, you can use the option "--error, --info, --question or --warning". The command synopsis as the following: SYNOPSIS      zenity  --entry  [--title=title]  [--window-icon=path]   [--width=width]   [--height=height]   [--timeout=seconds]   [--text=text] [--entry-text=text] [--hide-text] # zenity --error # zenity --info # zenity --question # zenity --warning Just like " --calendar ", if you press "ESC" key or click button "Cancel", the return code will be "1". If you click "OK", zenity will return the code will be "0". And also the same effect about the options "--title", "--timeout"...etc, for saving your time, please refer to the previous post " [Level 2] Shell Interactive With Zenity Episode 1 -- calendar ", too. One thing that confuse me is "--nowrap", every time I use it, the zenity will show the error return as "This option ...

[Level 2] Shell Interactive With Zenity Episode 2 -- entry

Image
When shell script needs to communicate with user, we usually use the command "read" to receive your's input. Does zenity has something like this? Yes, you can use the option "--entry". The command synopsis as the following: SYNOPSIS      zenity  --entry  [--title=title]  [--window-icon=path]   [--width=width]   [--height=height]   [--timeout=seconds]   [--text=text] [--entry-text=text] [--hide-text] The first command you can try is "zenity --entry", then you can see a pop out screen like below: # zenity --entry Just like " --calendar ", if you press "ESC" key or click button "Cancel", the return code will be "1". If you key some text in the column and click "OK", zenity will response the text that you key in and the return code will be "0". And also the same effect about the options "--title", "--timeout"...etc, for saving your time, please refer to the previous pos...