How To: Prevent Xfce Notifications From Showing On Other Desktops

I don't think I'm the only one with more than one desktop installed. Nor is it the only one that configures all of its desktops differently. HoweverDoesn't it happen to you that sometimes components on one desktop launch on another without permission? That is the case with Xfce notifications, and I'll show you how to avoid it 🙂

HR Xfce notifications come in the package xfce4-notifyd, and one always wonders how do the happy notifications to appear everywhere. More when they don't have a file .desktop let me run them. The answer is simple: D-Bus. Some may have heard of it, as it is responsible for connecting many communications at the software level. Without going too far, D-Bus automatically launches the Xfce notification system at startup all desktops, to allow them to interact with it quickly.

What we are going to do is edit the service that tells D-Bus to always execute those notifications. Let's do this:

  1. We will copy is script, and save it with our preferred text editor. Save it however you want, but remember the name. I saved it as xfce-notifynot.sh.
  2. We give execution permissions to the script, either with a file explorer or with the command: chmod +x nombre-script.sh
  3. We copy the script to / usr / bin /, for an easier and safer execution. We can use command: sudo cp nombre-script.sh /usr/bin/
  4. We will edit the service D-Bus with a text editor. The file is located at: /usr/share/dbus-1/services/org.xfce.xfce4-notifyd.Notifications.service
  5. We will change the line that says: Exec = / usr / lib / xfce4 / notifyd / xfce4-notifyd to match the path of our script. It would look like this:  Desktop
  6. We save and restart to better appreciate the change. Try different desktops with different notification systems, to make sure it works.

Some explanation about the script: what it does is check if the process is running xfce4-session, which only runs next to the desktop Xfce. That way the script confirms that it is being used Xfceand lanza notifications. As soon as we change the desktop, the script detects the change thanks to D-Bus y does not execute xfce4-notifyd. Life is more beautiful with scripts.

I hope you liked it, remember that you can leave suggestions and doubts in the comments 🙂 Greetings.


The content of the article adheres to our principles of editorial ethics. To report an error click here!.

16 comments, leave yours

Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Rodrigo bravo said

    Thanks for the info. I've wanted to know how to do this for a long time. Because when I wanted to use i3wm, the xfce notifications covered my entire screen. 🙂

  2.   elav said

    Great! Sometimes I miss Xfce a bit, but KDE has me hooked! And now with Arch, I don't even know myself 😀

    Good contribution

    1.    cat said

      I walk the same but with MATE instead of KDE 😀

    2.    Rots87 said

      I am on the plains of LXDE and I am liking it, although I miss most of the KDE "assistants" but little by little I am getting used to it

      1.    freebsddick said

        Well, having that environment I don't think you miss the KDE features !! ..

  3.   Leo said

    notify-send "Great Tuto" "Surely more than one will use a lot. \ nI use Xfce notifications a bit tuned on my desktop and they are luxurious. \ nVery good contribution."

    1.    RAW-Basic said

      Would you like to make a post about how you do your notifications in OpenBox? .. ..I have wanted something similar for a long time, and I do not take the time to study it .. ..although I was thinking of using dzen2 ..

      From already thank you very much..

      1.    AurosZx said

        Well I use NotifyOSD Customizable in Openbox. It allows me to change the color, size and much more. I could make a post, yes, but wouldn't that be too weak? If I had something else ...

  4.   Andrés said

    Great, I'm a teacher and sometimes in a slide show, the occasional notification can "intrude" on the class.

    One question, isn't it annoying that NITRUX icons don't have light versions for dark panels?

    1.    AurosZx said

      Yes, it makes me annoying ... It is also annoying that the volume icon is only light, and that the Pause / Play / Advance / Play buttons are dark (I would prefer them in red-orange). When I use Parole in full screen that's very annoying, plus they are tiny buttons. The theme is generally fine, but it is missing: /

  5.   Simon Oroño said

    The contribution is great, one thing, could you give me the specifications of that screenshot? Panel, GTK theme, icon theme, etc. Please and thank you. 🙂

    1.    AurosZx said

      The top panel is the old Xfce panel, the bottom panel is Plank (from elementaryOS), with a theme I found on deviantArt. Searching for "simple plank theme" should come up.
      The icon theme is Nitrux, and the GTK / Xfwm is Numix. The nut on the panel opens the WhiskerMenu 🙂
      And the wallpaper is from a collection called "Gaia" that I found on deviantArt. They are very pretty. You can get one by searching for "Gaia Gibbon", and from there check out the creator's collection.

      regards

      1.    Simon Oroño said

        Thanks compa. Regards.

  6.   MyNameNeed said

    Excellent! I was thinking about exactly this a few days ago.
    Hey, how do you get the app icon to appear on the edge of the window? Modify the show_app_icon = true value in themerc file but it does not appear to me 🙁

    1.    AurosZx said

      No idea about that, it's part of the topic and I didn't even know that it could be changed or something: /

  7.   Juan sosa said

    Thank you very much for the information I had to erase the xfce notification system in Ubuntu to keep the original Ubuntu and it cost me work. Regards.