How to Suppress Notification from Activate Script [Solved!]

Non release banter
cttan
Shogun
Shogun
Posts: 333
Joined: 26 Jan 2011, 16:15
Distribution: Porteus 3.2 and 4.0 64bit KDE
Location: Malaysia

How to Suppress Notification from Activate Script [Solved!]

Post#1 by cttan » 23 Nov 2012, 04:01

Hi,

How do I suppress the notification message box when I activate a module?

Thank you!
Last edited by cttan on 27 Nov 2012, 13:09, edited 1 time in total.

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: How to Suppress Notification from the Activate Script

Post#2 by Ahau » 23 Nov 2012, 07:34

If you look through the 'activate' script (/opt/porteus-scripts/activate), you will see that when you have an active Xsession, it calls another script, /opt/porteus-scripts/xorg/xactivate, which is what actually creates the notification. This is the line that is responsible for it:

Code: Select all

Xdialog --title "$TITLE" --no-close --no-buttons --infobox "Well done! $BASE: module activated successfully." 0 0 2000 &


So you can rewrite the script to eliminate this line. This is a quick way to comment the line out without removing the code (so it'd be easy to turn the notification back on:

Code: Select all

sed -i '/Well done/s/Xdialog/echo "" #Xdialog/g' /opt/porteus-scripts/xorg/xactivate
sed -i '/Well done/s/Xdialog/echo "" #Xdialog/g' /opt/porteus-scripts/xorg/xdeactivate
This uses sed, the stream editor, to edit the files in place (-i), finding only the line that matches 'Well done', and within that line substituting Xdialog with echoing nothing and a comment to block the rest of the line. If there are any errors, etc., those popups would still appear.
Please take a look at our online documentation, here. Suggestions are welcome!

cttan
Shogun
Shogun
Posts: 333
Joined: 26 Jan 2011, 16:15
Distribution: Porteus 3.2 and 4.0 64bit KDE
Location: Malaysia

Re: How to Suppress Notification from the Activate Script

Post#3 by cttan » 26 Nov 2012, 03:34

Hi Ahau,
Thank you very much for this prompt and wonderful solution!!!
I have been looking for it for a long time. After my Porteus(copy to ram) start up, I ran some scripts which will activate 50+ modules. This has greatly reduced the waiting time and improved the usability of Porteus.

:beer:

Post Reply