elvino, Tuesday 10 May 2011 à 10:23
|
|
Subscription date : 02 May 2011
Messages : 7
|
The mail applet is one of the most useful items on the dock. However: As my pc running ubuntu 11.04 is on all the time, the sound of a new email arriving runs 24/7
Is it possible to include a timer so that a new email is only announced in certain hours. For example, 7am until 2000. I know I could turn off the announcement but I do like it during the day. |
Subscription date : 28 October 2009
Messages : 415
|
How about muting your computer at night? |
elvino, Tuesday 10 May 2011 à 10:51
|
|
Subscription date : 02 May 2011
Messages : 7
|
jesuisbenjamin : How about muting your computer at night? :P Yes, good idea. However I am often not here and the family complain! Unless you can tell me how to mute all sounds from the pc between 'x and y' hours |
matttbe, Tuesday 10 May 2011 à 11:25
|
|
Subscription date : 24 January 2009
Messages : 12573
|
You can simply use a cron...
Simply create two files with these three lines:
- turnOff.sh
DISPLAY=:0
sed -i 's/sound=true/sound=false/g' ~/.config/cairo-dock/current_theme/plug-ins/mail/mail.conf
dbus-send --session --dest=org.cairodock.CairoDock /org/cairodock/CairoDock org.cairodock.CairoDock.ReloadModule string:mail
- turnOn.sh
DISPLAY=:0
sed -i 's/sound=false/sound=true/g' ~/.config/cairo-dock/current_theme/plug-ins/mail/mail.conf
dbus-send --session --dest=org.cairodock.CairoDock /org/cairodock/CairoDock org.cairodock.CairoDock.ReloadModule string:mail (it's maybe better to replace '~' by the complete path (/home/USER)
- Add the right to execute it:
chmod +x turnOff.sh turnOn.sh
- Add these two lines in this file /etc/crontab
0 7 * * * USER sh /COMPLETE/PATH/TO/turnOn.sh
0 20 * * * USER sh /COMPLETE/PATH/TO/turnOff.sh (don't forget to replace USER by your username...)
It should work
But you can also change the D-Bus command and the set command if you want to stop the mail applet or mute the sound of your computer (if you have a command for that...) |
Subscription date : 26 October 2008
Messages : 1904
|
That should be put on the tips and trick section. Very clever trick Mattbe. (If it works :mrgreen:) |
Subscription date : 05 August 2009
Messages : 285
|
matttbe : You can simply use a cron...
Simply create two files with these three lines:
- turnOff.sh
DISPLAY=:0
sed -i 's/sound=true/sound=false/g' ~/.config/cairo-dock/current_theme/plug-ins/mail/mail.conf
dbus-send --session --dest=org.cairodock.CairoDock /org/cairodock/CairoDock org.cairodock.CairoDock.ReloadModule string:dustbin
- turnOn.sh
DISPLAY=:0
sed -i 's/sound=false/sound=true/g' ~/.config/cairo-dock/current_theme/plug-ins/mail/mail.conf
dbus-send --session --dest=org.cairodock.CairoDock /org/cairodock/CairoDock org.cairodock.CairoDock.ReloadModule string:dustbin (it's maybe better to replace '~' by the complete path (/home/USER)
- Add the right to execute it:
chmod +x turnOff.sh turnOn.sh
- Add these two lines in this file /etc/crontab
0 7 * * * USER sh /COMPLETE/PATH/TO/turnOn.sh
0 20 * * * USER sh /COMPLETE/PATH/TO/turnOff.sh (don't forget to replace USER by your username...)
It should work
But you can also change the D-Bus command and the set command if you want to stop the mail applet or mute the sound of your computer (if you have a command for that...)
Are you sure it is "dustbin" module? I guess your answer was inspired by here |
matttbe, Wednesday 11 May 2011 à 12:38
|
|
Subscription date : 24 January 2009
Messages : 12573
|
Thank you |
Subscription date : 30 November 2007
Messages : 17118
|
nice idea !
deactivating the applet can be another solution, but the reload seems even better. |
|