First of all, you can save time and lines using "$(whoami)" variable instead of that long line for $iam.
Ex:
my username is "killer".
echo "Hello $(whoami)"
Output: Hello killer
It's an interesting script, but is confusionary, and, moreover, you CAN'T exit!
Have you inserted some exit functions?
For example after a zenity dialog:
if [ "$?" -eq 0 ]; then
exit
fi
I suggest you to use a dialog per time:
Zenity dialog 1:
[] Change font
[] Change color
...
[] Show preview
and so on.
Hey, thanks!
I didn't know about
echo "Hello $(whoami)"
As for the chain of events, I did consider asking the questions in sequence. In fact that's how it worked at first. I changed it to multiple background tasks later. This was because I found that I might want, for instance, to change the font size repeatedly without cycling through all the prompts again.
So, the last response to each dialog is remembered, and all can be changed independently and in any sequence. However, as you see, it is when clicking OK to the text input that the preview is refreshed.
The way to exit is this: Either type "save" or "quit" in the text dialog. This ends the program. Quit just cleans up and exits. Save triggers a dialog to "save-as" the resulting file.
So that's WHY it was done this way. I wish zenity would allow a multi-section dialog which could have avoided all this confusion.
Does the save/quit help? I realize now that the explanation wasn't so great.
And THANKS for the $(whoami) tip. Setting $iam manually is a habit going way back to my Unix days :-)
-- Marc
Ratings & Comments
3 Comments
First of all, you can save time and lines using "$(whoami)" variable instead of that long line for $iam. Ex: my username is "killer". echo "Hello $(whoami)" Output: Hello killer It's an interesting script, but is confusionary, and, moreover, you CAN'T exit! Have you inserted some exit functions? For example after a zenity dialog: if [ "$?" -eq 0 ]; then exit fi I suggest you to use a dialog per time: Zenity dialog 1: [] Change font [] Change color ... [] Show preview and so on.
Hey, thanks! I didn't know about echo "Hello $(whoami)" As for the chain of events, I did consider asking the questions in sequence. In fact that's how it worked at first. I changed it to multiple background tasks later. This was because I found that I might want, for instance, to change the font size repeatedly without cycling through all the prompts again. So, the last response to each dialog is remembered, and all can be changed independently and in any sequence. However, as you see, it is when clicking OK to the text input that the preview is refreshed. The way to exit is this: Either type "save" or "quit" in the text dialog. This ends the program. Quit just cleans up and exits. Save triggers a dialog to "save-as" the resulting file. So that's WHY it was done this way. I wish zenity would allow a multi-section dialog which could have avoided all this confusion. Does the save/quit help? I realize now that the explanation wasn't so great. And THANKS for the $(whoami) tip. Setting $iam manually is a habit going way back to my Unix days :-) -- Marc
No comments and no votes? Does this work for you?