richdesigns81 / growl

Automatically exported from code.google.com/p/growl
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Subscriptions or pushed notifications look like local notifications #581

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Setup computer as server
2. Setup another as client and subscribe to server
3. Send a notification to client

What is the expected output?

I just mentioned that it would be nice to have the hostname in the notification 
from a subscription or the pushed notification. 

What do you see instead?

Up to now all notifications look like "local" notifications if you use Growl on 
multiple machines with the same apps sending notifications this gets quiet 
confusing.

What version of the product are you using? On what operating system?

Any version does this

Please provide any additional information below.

Original issue reported on code.google.com by caos...@gmail.com on 24 Apr 2013 at 8:50

GoogleCodeExporter commented 8 years ago
Im not going to close this one immediately with my answer, but Im going to 
provide you a way to do this in 2.1, and I will leave it open for discussion as 
a more general preferences UI feature in the future.  Growl 2.1 will have a 
rules system that can do a variety of things, including modify the 
notifications body and title, and is sent data about the notification that 
includes the host (the same string we use in the apps preferences to say where 
an app registered from).  

Here is a quick sample script that should work to format all non local note 
titles as "<title> - <host>".  
using terms from application "Growl"
    on evaluate notification with notification
        ignoring case
            if notification's host is not "localhost" then
                set title to notification's title & " - " & notification's host
                set notification's title to title
                return {notification return:notification}
            end if
        end ignoring
    end evaluate notification
end using terms from

For most users that want this, it would probably be nicer of us to provide a UI 
setting for this somewhere, but for 2.1, this is as close as it will get 
(already in string freeze for localization for 2.1)

Original comment by dan...@growl.info on 24 Apr 2013 at 10:51

GoogleCodeExporter commented 8 years ago
Ok that is a nice workaround. I just don't know how to create an action that 
includes this script. I think I have to add this action to every rule in every 
app I want to have the rewritten title? Is this correct? Or can I use this 
script globally in some way?

Can't find a how-to on the Growl website, but perhaps it's just me.

Original comment by caos...@gmail.com on 25 Apr 2013 at 5:28

GoogleCodeExporter commented 8 years ago
By the way a checkbox in the subscriptions preferences saying something like 
"add hostname to notifications" would be really great.

Original comment by caos...@gmail.com on 25 Apr 2013 at 5:39

GoogleCodeExporter commented 8 years ago
Rules will be a global system, one script is used to evaluate/modify all 
notifications.  I believe you are running the Growl 2.1 beta (since this was 
posted to the beta list), make a file called Rules.scpt with that as its 
contents, and put it in the following directory: ~/Library/Application 
Scripts/com.Growl.GrowlHelperApp

Growl will pop up a dialog the next notification asking if you want to use 
Rules, just click yes, and it should start working. 

Original comment by dan...@growl.info on 25 Apr 2013 at 12:04

GoogleCodeExporter commented 8 years ago
Thanks.

I use 2.1b4. 

After creating the rule and putting it in the folder Growl asks me to use it. 
Unfortunatly, the hostname in the title of the notification is not displayed 
with the script.

The hostname should be displayed behind the title in the notification and it 
should be displayed in the history as well, right?

In this screenshot all notifications in the history should have the hostname at 
the end.

Personally, I would prefer the hostname in the behind the application name e.g. 
something like "Plex Media Server (hostname)" or "Plex Media Server (on 
hostname).

Original comment by caos...@gmail.com on 25 Apr 2013 at 2:10

GoogleCodeExporter commented 8 years ago
Sorry the screenshot was send via email.

Original comment by caos...@gmail.com on 25 Apr 2013 at 2:11

Attachments:

GoogleCodeExporter commented 8 years ago
So, I made some mistakes in the script, the innermost part should be: 

set title to (notification's note title) & " - " & (notification's host)
return {notification return:{note title:title}}

It wasn't liking returning the note it was sent for some reason, but I have 
tested this now, and it works, as for formatting, just change the set title 
line to format it however you want, such as (notification's note title) & " (" 
& (notification's host) & ")"

Original comment by dan...@growl.info on 26 Apr 2013 at 5:37

GoogleCodeExporter commented 8 years ago
Issue 576 has been merged into this issue.

Original comment by dan...@growl.info on 28 Apr 2013 at 8:43