If you access the preference window of CheckGmail you may notice that under External Commands a shortcode of %u is used to represent the Gmail web address.
Just below this, there is an input box for running a command when new mail arrives.
My goal was to cause a notification bubble to display info from the new email – specifically the Author and Subject. Unfortunately, there is not a shortcode for these items, in fact the only shortcode available is %u for the Gmail url.
I had never seen any perl code before, and certainly had not written any, so I was surprised when I succeeded at this goal. Perl feels very similar to Ruby to me.
The instructions below show how to add shortcodes to reference the Author (%a) and Subject (%s) of the newest email, for use in the External Commands section of the CheckGmail preferences.
Edit the file
Locate this block of code
1 2 3 4 5
After the above block, add this code
1 2 3 4 5 6 7 8 9 10 11
Now you can use the code %a to display the name of the sender of the most recent mail message.
Use %s for the most recent subject.
For example, I use this command to display a notification with this info
notify-send "New Mail\n From: %a\n%s"
The above code is put in the checkgmail preferences in: Command to execute on new mail. It causes my notification popup to show the author and subject of new mail. I use dunst for notifications.