Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

notifications doesn't work #20

Open
sheinz opened this issue Apr 14, 2017 · 6 comments
Open

notifications doesn't work #20

sheinz opened this issue Apr 14, 2017 · 6 comments

Comments

@sheinz
Copy link

sheinz commented Apr 14, 2017

Hi, thanks for the awesome project!

I have an issue with notifications.
I checked that notifications works on my machine.
I investigated why they are not called by ncTelegram and discovered that conditions for them aren't met:

# notif on hl
if 'text' in msg and 'username' in self.Telegram_ui.me and \
        self.Telegram_ui.me['username'] != None and\
        "@" + self.Telegram_ui.me['username'] in msg['text']:
    self.Telegram_ui.display_notif(msg)

Can you suggest what to check next?

@Nanoseb
Copy link
Owner

Nanoseb commented Apr 14, 2017

Hi,
What kind of notifications were you expecting? here it notifies you only when your username is mentionned (preceded by a "@"). Also you have to have a username defined (that is not the case by default).

@sheinz
Copy link
Author

sheinz commented Apr 14, 2017

I was expecting a pop-up notification when I receive a message and ncTelegram is not focused. Now thinking about it, I'm not sure if it even possible for a terminal application to track a focus.
Thanks for the explanation about preceding "@". It wasn't obvious :)
But It would be nice to have some kind of notification for a common (not muted) messages.
As an option it can send a terminal 'bell'. So, the windows in tmux (in my case) would be highlighted.

@Nanoseb
Copy link
Owner

Nanoseb commented Apr 14, 2017

Yes, nctelegram can't know if it is in focus or not that's why I couldn't do that. But sending a bell is a really good idea, I don't know why I didn't think about it earlier.
(at the moment I have a script that gets the terminal title and triggers an 'urgent' state when a new message arrives, the bell is definitely a better solution ;) )

@15bitgames
Copy link

I was wondering how you would get dunst to work ncTelegram? It has a thing its configuration for the applications like the following:

[signed_off]                                                                      
    appname = Pidgin                                                              
    summary = *signed off*                                                        
    urgency = low   

Just not sure how to integrate it into dunst (I do have libnotify installed).

@Nanoseb
Copy link
Owner

Nanoseb commented Jul 15, 2017

@z1lt0id: apparently notifications in python now need python-gobject. It should work fine without any configuration on dunst side with this package.

Thanks for reporting this, I'm going to update the readme (and thanks for the discovery as well, I'll use dunst form now on ;) ).

@15bitgames
Copy link

@Nanoseb Did you ever get notifications to work? Or have you some wonderful hack and if so I can you share :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants