So, I have this script:
#!/bin/sh
#InputBox1Test
title=$(zenity --entry --text 'Type what you want your Notification Title to Say!' --title 'Notification')
text=$(zenity --entry --text 'Type what you want your Notification body to Say!' --title 'Notification')
DISPLAY=:0.0 notify-send "$title" "$text"
This script opens a zenity window, and walks you through generating a notification. I want to make it exit when you press cancel. How do I do that?
Assuming that return value is
1
for "cancel" and0
for "ok" you will want to use:You can make a longer traditional check like this:
however I like the shortcut of:
No matter which method you choose the importance is consistency with your programming style so those that follow in your footsteps and maintain your code can think inside your head.