Auteur Sujet: xfce4-notifyd and modified script - help!!  (Lu 19166 fois)

0 Membres et 1 Invité sur ce sujet

Hors ligne Taco.22

  • Membre Senior
  • ****
  • Messages: 391
    • Scorpio_Openbox
xfce4-notifyd and modified script - help!!
« le: 02 juin 2013 à 15:05:12 »
It was a comment ka9yhd made about having a pop-up notification when the network connected that also gave some detail, such as IP and servers etc.  Firing up VillageBox with network-manager-gnome it didn't take me long to track down "notification daemon" from gnome, but then on to "xfce4-notifyd" which is lighter and more OS agnostic.  Once installed it pops up a notification that your network is now up.  It also tells you when it goes down.  So far, so good.

Great, I thought, all I have to do now is find the script it's calling and add some details.  Well that was a few hours ago and I have hit a wall.  Despite a LOT of googling I can find no examples of such a script, even though some distros do run them, nor can I find any examples of modifications to scripts specific to this.   Even ploughing through the Crunchbang archives didn't turn anything up.  I had centered on /etc/NetworkManager/dispatcher.d/01ifupdown, but now I'm not even sure if I'm chasing the right file!

The app that makes this all work is notify-send, and xfce4-notifyd is the frontend.  All seemed so simple a few hours ago!  I think my brain needs a rest!!
Any ideas?
What can go wrong !!!

Hors ligne melodie

  • Administrateur
  • Membre Héroïque
  • *****
  • Messages: 1777
    • Citrotux
Re : xfce4-notifyd and modified script - help!!
« Réponse #1 le: 02 juin 2013 à 17:33:44 »
In Archlinux I have the following packages installed:

Citer
1 core/libevent 2.0.21-2 [installed]
    An event notification library

4 extra/libnotify 0.7.5-1 [installed]
    Desktop notification library

5 extra/startup-notification 0.12-3 [installed]
    Monitor and display application startup

13 community/notification-daemon 0.7.6-2 [installed]
    Notification daemon for the desktop notifications framework


and at some time I also had this one:

Citer
14 community/notify-osd 0.9.34-1
    Canonical's on-screen-display notification agent, implementing the freedesktop.org Desktop Notifications Specification with semi-transparent
    click-through bubbles

Have you looked what the Debian repositories have and tried a "apt-cache search notification" in the console? I would start with that and read the description of the packages in the list.

Good leaders being scarce, following yourself is allowed.

Hors ligne Taco.22

  • Membre Senior
  • ****
  • Messages: 391
    • Scorpio_Openbox
Re : xfce4-notifyd and modified script - help!!
« Réponse #2 le: 02 juin 2013 à 17:57:12 »
I have libnotify-bin and xfce4-notifyd installed.  I can use notify-send through terminal to pop-up a message via xfce4-notifyd on the desktop, even with delayed timeouts and icons.  I can configure the size, shape and position of the bubbles via xfce4-notifyd through the terminal.  Where I am stumped is that I can't find the script that xfce4-notifyd is displaying for the "network up" pop-up.  I think the file I was focusing on was the wrong one - it may be in the /etc/network scripts.  Despite all the bits of info I have found about notify, I still haven't been able to work out where scripts are stored and how they are called.  Finding this info is like getting blood out of a stone!
What can go wrong !!!

Hors ligne mimas

  • Général du Roi
  • Membre Complet
  • ***
  • Messages: 114
  • Jamais content
    • G+
Re : xfce4-notifyd and modified script - help!!
« Réponse #3 le: 02 juin 2013 à 18:32:29 »
> Despite all the bits of info I have found about notify, I still haven't been able to work out where scripts are stored and how they are called.  Finding this info is like getting blood out of a stone!

Network-manager-applet doesn't use scripts to display notifications; the calls to the notify deamon are hardcoded.

I have checked in the code source.
When any government, or any church for that matter, undertakes to say to its subjects, "This you may not read, this you must not see, this you are forbidden to know," the end result is tyranny and oppression, no matter how holy the motives.

Hors ligne melodie

  • Administrateur
  • Membre Héroïque
  • *****
  • Messages: 1777
    • Citrotux
Re : xfce4-notifyd and modified script - help!!
« Réponse #4 le: 02 juin 2013 à 19:31:20 »
About notify-osd, I just found two patched packages which seem nice.

http://www.webupd8.org/2012/11/patched-notifyosd-with-close-on-click.html

http://www.webupd8.org/2013/04/configurable-notifyosd-updated-for.html

I stopped using the popping notifications because I didn't like it when it was hiding a part of the screen on the laptop.

Good leaders being scarce, following yourself is allowed.

djohnston

  • Invité
Re : Re : xfce4-notifyd and modified script - help!!
« Réponse #5 le: 03 juin 2013 à 00:06:58 »
Where I am stumped is that I can't find the script that xfce4-notifyd is displaying for the "network up" pop-up.
I don't think the popup messages come from a "script", per se. I believe the NetworkManager messages are contained in the /usr/share/locale/en_GB/LC_MESSAGES/NetworkManager.mo file. Do a cat on that file and you'll see it is mixed binary and ASCII text. (Your directory may be en_AU.) Look in the directory and you'll see .mo files for aptdaemon, bleachbit, etc.

Gettext and other tools are used for working with .mo files. They are loosely associated with .po files, I believe. You may have already used the xfce4-notifyd-config tool.

Citer
Run xfce4-notifyd-config to display the settings dialog. There aren't any other tunables; if you do not see it in the settings dialog, it's not changeable.
That's all I've been able to glean from my XFCE installation.


Hors ligne melodie

  • Administrateur
  • Membre Héroïque
  • *****
  • Messages: 1777
    • Citrotux
Re : Re : Re : xfce4-notifyd and modified script - help!!
« Réponse #6 le: 03 juin 2013 à 01:01:56 »
They are loosely associated with .po files, I believe.

po files are the text version, mo files the compiled version. It all starts with a pot file which is the model for all the po files to come.

We translated and kept an information from pinoc here, and the original link to here: Howto translate. In pinoc's how-to among else you will find a good summary of the process and some useful commands to get a po file out of a mo file and redo a mo file from a po file, which allows easy modification of the content of a given mo file, if you need to do a fast test, and don't want to bother to get the original pot file from the sources, for instance.

Good leaders being scarce, following yourself is allowed.

Hors ligne Taco.22

  • Membre Senior
  • ****
  • Messages: 391
    • Scorpio_Openbox
Re : xfce4-notifyd and modified script - help!!
« Réponse #7 le: 03 juin 2013 à 02:22:01 »
Well that certainly opened a can of worms!!!

Citation de: mimas
Network-manager-applet doesn't use scripts to display notifications; the calls to the notify deamon are hardcoded.
I have checked in the code source.
No wonder I couldn't find any scripts!

Citation de: melodie
I stopped using the popping notifications because I didn't like it when it was hiding a part of the screen on the laptop.
Using xfce4-notifyd-config allows one to set the theme, position and duration of a pop-up.  I don't think this can be done with notification-daemon from gnome.  Notifyosd is not available for Debian, but it simply gives configuration where gnome doesn't have it.

Citation de: melodie
po files are the text version, mo files the compiled version. It all starts with a pot file which is the model for all the po files to come.
Citation de: djohnston
Gettext and other tools are used for working with .mo files. They are loosely associated with .po files, I believe.
I checked out the links and I'm not going there!!  This is even worse than dealing with a cpio.

Typical gnome stuff tying up things that should be straightforward and editable.  I guess the pop-up, if it stays, will be what it is.  Shame - would have been nice to have included some extra bits but the effort, if achievable, doesn't warrant the work.  I can't even get rid of the "Don't show this message again" button.  A classic example of how to over-complicate things.  The only other thought is that this is a very stripped down version of network-manager-gnome, so maybe something is missing - doesn't matter though as this really is only floss. 



What can go wrong !!!

Hors ligne melodie

  • Administrateur
  • Membre Héroïque
  • *****
  • Messages: 1777
    • Citrotux
Re : Re : xfce4-notifyd and modified script - help!!
« Réponse #8 le: 03 juin 2013 à 05:08:17 »
I checked out the links and I'm not going there!!  This is even worse than dealing with a cpio.

Either or is not a problem as long as you have the magic formula written in your grimoire. :)


How to convert a « mo » file to a « po » file

msgunfmt file.mo -o file.po
To convert a « po » text file which can be edited, to a « mo » compiled version of the file do:

msgfmt file.po -o file.mo
(Replace "file" by the file name, I say just in case someone who does not know comes by).

BTW I have saved the formula for cpio as well, if you ever need it just ask, it's on the pclos-fr wiki. :D


PS: about Notify-OSD (perhaps instead of Xfce notifyd) this might interest you:
http://crunchbang.org/forums/viewtopic.php?id=15819

« Modifié: 03 juin 2013 à 05:14:37 par mélodie »
Good leaders being scarce, following yourself is allowed.

Hors ligne Taco.22

  • Membre Senior
  • ****
  • Messages: 391
    • Scorpio_Openbox
Re : xfce4-notifyd and modified script - help!!
« Réponse #9 le: 03 juin 2013 à 06:42:21 »
This has turned out to be one of my most complicated and frustrating forays into the Land of Linux.  Who would have thought that something so seemingly simple could prove to be such a herculean task!

I bit the bullet, installed gettext and can now translate mo to po and back again.  A mighty useful skill I could add!!  Didn't help though.  Tackled a locale file for nm but it proved to be very large and way over my head.  Besides, what about all the other languages?!?  It's not the source of the dialogue and as mimas said, it's in the code itself.

I have been playing around with dunst as a simple notification daemon but it is way worse than conky to configure, once you actually find an rc for the dratted thing!  Xfce4-notifyd is easy to use and reconfigure, and uses gtk themes that are easy to edit.  It works well and is better than notify-osd, plus it is in the Debian repo.

The big issue in the end is not being able to get access to whatever it is that drives the dialogue in the network pop-up.  That was the only reason for this exercise - to find it and modify it.  Seems that that is verging on the impossible, unless one is capable of modifying source code.  I'm not!

Anyway, thanks for all the suggestions.  If nothing else it was a learning curve ... of sorts!!
What can go wrong !!!

djohnston

  • Invité
Re : xfce4-notifyd and modified script - help!!
« Réponse #10 le: 03 juin 2013 à 07:57:30 »
You might try the XFCE forum. Here's the link for a search I did on the forum for "xfce4-notifyd".


Hors ligne Taco.22

  • Membre Senior
  • ****
  • Messages: 391
    • Scorpio_Openbox
Re : xfce4-notifyd and modified script - help!!
« Réponse #11 le: 03 juin 2013 à 08:55:12 »
Thanks, I had a look but nothing new came to light - I've covered a lot of ground over the last 24 hours!!  I've gone back to xfce4-notifyd with my modified theme - still can't get rid of the "Don't show this message again" button.  It's probably as far as I can go - there seems to be no practical way to modify the nm "bubble".  All of this for the smallest bit of eye-candy!!
What can go wrong !!!

Hors ligne melodie

  • Administrateur
  • Membre Héroïque
  • *****
  • Messages: 1777
    • Citrotux
Re : Re : xfce4-notifyd and modified script - help!!
« Réponse #12 le: 03 juin 2013 à 11:29:03 »
It's probably as far as I can go - there seems to be no practical way to modify the nm "bubble".  All of this for the smallest bit of eye-candy!!

Can you find the mail address of the developers who work on the different applications? (Or find some mailing lists… bugzilla would also be an option but not so direct and not so fast to reach the people).

If you can what about sending them a common mail or post to lists… to explain your wish, and point to the present thread? The ones who hard code this type of thing, could consider putting it out of the code, in some configuration files…



Good leaders being scarce, following yourself is allowed.