Page 1 of 1

How to Suppress Notification from Activate Script [Solved!]

Posted: 23 Nov 2012, 04:01
by cttan
Hi,

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

Thank you!

Re: How to Suppress Notification from the Activate Script

Posted: 23 Nov 2012, 07:34
by Ahau
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.

Re: How to Suppress Notification from the Activate Script

Posted: 26 Nov 2012, 03:34
by cttan
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: