![]() |
Automatic Muting via cron
I'd like to use cron to automatically mute the volume of my OS2008 N800 every night and unmute it again in the morning , is this possible ?
thanks |
Re: Automatic Muting via cron
In short: yes :)
|
Re: Automatic Muting via cron
Thanks maillaxa, thats great!
For anyone else who would like to get this working , here is what I have done. I set all this up via SSH on my desktop rather than the built-in terminal, this allows easy copy & paste as well as file transfers via secure copy (scp)
Good Luck cybergypsy |
Re: Automatic Muting via cron
You should put this onto the wiki, I guess.
Bravo ! |
Re: Automatic Muting via cron
Thanks, Cybergypsy.
My first contact with Linux was with my N810 and managing to set a crontab to mute and un-mute the device was really entertaining. What other uses you have for cron? |
Re: Automatic Muting via cron
I wonder if it would be possible to do something similar to this for the indicator light. I sometimes wake up to an annoying flashing blue light in the middle of the night when I receive an email.
|
Re: Automatic Muting via cron
I have turned off the LED notifications :-
Settings > Control Panel > Display > LEDs ....and sleep easy. |
Re: Automatic Muting via cron
Quote:
|
Re: Automatic Muting via cron
I already clicked it, but THANK YOU! (the automated ones are a little cheap)
I was envisioning that this would be an ideal task for a linux handheld, just never got to test it and list it out so directly. I have also set it to mute for regularly scheduled meetings I have. |
Re: Automatic Muting via cron
Quote:
Make cron run gconftool which turns off the LED value (not sure on specifics but I know for SURE that the LED's are controlled via gconf) |
Re: Automatic Muting via cron
Quote:
|
Re: Automatic Muting via cron
Maybe this thread can be of help.
|
Re: Automatic Muting via cron
Here is a rip of cybergypsy's brilliant instructions but to do something else.
Putting the following into crontab should in theory put the tablet into offline mode at 11:30 PM and take it out at 7:00 AM. Well, the dbus commands work as I spent 30 mins figuring them out but I don't know if cron will use them :p (you also may need to do dbus-uuidgen --ensure=/var/lib/dbus/machine-id as root) 30 23 * * * /usr/bin/dbus-send --system --type=signal /com/nokia/mce/signal com.nokia.mce.signal.sig_device_mode_ind string:"flight" 00 7 * * * /usr/bin/dbus-send --system --type=signal /com/nokia/mce/signal com.nokia.mce.signal.sig_device_mode_ind string:"normal" |
Re: Automatic Muting via cron
Thanks for all of the great advice and I'm definitely going to see if I can the LED situation improved through cron.
But I was thinking what might possibly be an even better solution would be turn dim the LED based on the light sensor. So the darker it is the dimmer the LED gets. Because the LED tends to fade in and out at times I assume that it's able to be dimmed. I'm a web developer so I don't have a lot of experience in programming at this level or in most of the languages typically used in Maemo. But if somebody can point me in the right direction I'd be happy to attempt to write something to do this sort of thing. Right now it's looking like I'll have to do my homework on DBUS and maybe Python. I'm comfortable with C# so maybe Vala would be better for me than Python? |
Re: Automatic Muting via cron
That's quite interesting; it's a good idea, and possible from a hardware perspective, but I doubt it's readily doable right now. Support should exist for an overall brightness control in mce, and I'm pretty sure it doesn't exist now. Alternatively, all LED patterns could be scaled and resubmitted, but I'm not sure whether there's a clean way to apply such changes. That's an inferior solution, anyway; if filing feature requests, the former is what you really want.
|
Re: Automatic Muting via cron
Is there any way to set special hours for weekends?
For instance: 00 7 * * 1,2,3,4,5 aumix -w 90 00 10 * * 0,6 aumix -w 90 Is this valid if I want to sleep longer on Saturdays and Sundays? |
Re: Automatic Muting via cron
Quote:
This has stopped the device flashing the blue LED to indicate that the device is switched on when the display is in power save mode. Now, with cron muting and switching to offline mode, there is no possible sound and LED use by night. Great. |
Re: Automatic Muting via cron
After upgrading to Diablo I am trying to install cron again.
After running 'tar zxvvf cron.tar.gz', I execute './cron/INSTALL' (as root) but the output is '/bin/sh: ./cron/INSTALL: Permission denied'. What am I doing wrong? I don't remember if I had this problem the first time. |
Re: Automatic Muting via cron
I think you need to make sure you are root and make sure that the INSTALL script is set as executable.
|
Re: Automatic Muting via cron
I am sure I am root (I see the # in the command line) and I run tar with the 'zxvvf' parameters. How can I check if the script is set as executable?
|
Re: Automatic Muting via cron
Quote:
As root, I installed cron, and run crontab -e .. I entered something similar, " 30 23 * * * mplayer file.mp3 " but nothing happens at 23:30... I tried to edit /etc/crontab.. nothing happened thx |
Re: Automatic Muting via cron
you might need to specify the path to the .mp3 file as the command will be running as root and not as user.
I don't think the crontab files are stored in /etc , I think they're in /var somewhere but I can't check at the moment as I don't have it all installed currently due to the diablo upgrade this afternoon. |
Re: Automatic Muting via cron
The crontab files are stored in /tmp.
|
Re: Automatic Muting via cron
Quote:
Now, I get this when I execute ./cron/INSTALL: ~# ./cron/INSTALL ./cron/INSTALL: line 3: ./UNINSTALL: not found cp: omitting directory './cron' cp: cannot stat './crontab': No such file or directory chmod: /usr/bin/cron: No such file or directory chmod: /usr/bin/crontab: No such file or directory ln: /etc/rc2.d/S89cron: File exists |
Re: Automatic Muting via cron
I solved doing this:
cd /root/cron ./INSTALL Why './cron/INSTALL' did not work to begin? |
Re: Automatic Muting via cron
Because it was looking for ./UNINSTALL, not ./cron/UNINSTALL, and so on.
|
Re: Automatic Muting via cron
Quote:
Anyway.. doesn't work for me >o< # more /var/cron/tabs/root gives me =========== # DO NOT EDIT THIS FILE - edit the master and reinstall. # (/tmp/crontab.3312 installed on Wed Jun 25 13:33:30 2008) # (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $) 35 13 * * * /usr/sbin/reboot =========== which i created with crontab, as root. But no reboot at 13H35.. Is my command ok? I think cron is running since it shows with ps -aux | grep cron I'm puzzled |
Re: Automatic Muting via cron
Quote:
Mplayer sends a dbus command along the line. cron runs as root. dbus and root don't go so well on tablets hence the run-standalone.sh. |
Re: Automatic Muting via cron
Quote:
What am I doing wrong??? Recap : 1- on my n810, downloaded the package from the thread "cron has gone".. cron.tar.gz (.zip) 2- as root, used the INSTALL script 3 - rebooted, checked with ps -aux | grep cron... which gives me 1220 root 1548 SW /etc/rc2.d/S89cron start 4 - as root, crontab -e, added the line 30 23 * * * run-standalone.sh mplayer file.mp3 5 - checked it's in /var/cron/tabs/root 6 - wait 7 - weep |
Re: Automatic Muting via cron
Quote:
|
Re: Automatic Muting via cron
Quote:
|
Re: Automatic Muting via cron
Quote:
|
Re: Automatic Muting via cron
Quote:
|
Re: Automatic Muting via cron
Quote:
No crontab.3312 in /tmp.. though there is mention of it in /var/cron/tabs/root ... A problem with my config? |
Re: Automatic Muting via cron
DistantFire asked me :-
Quote:
|
Re: Automatic Muting via cron
A couple of modifications should be made to the detailed procedure...
if you copy to an external memory card, it's probably going to be FAT or FAT32. chmod probably won't do anything. I suggest that a) it either be temporarily copied to root's home directory and done from there or b) explicitly passed to the interpreter (probably the best choice) as in: # sh /media/mmc2/cron/INSTALL Are there any other problems foreseen with that? |
Re: Automatic Muting via cron
Quote:
Another thing I do not think is OK is the recommendation to install all Gronmayer repositories. Why not just install the required ones? |
Re: Automatic Muting via cron
|
Re: Automatic Muting via cron
I made the change to copy it to the root folder, it seemed like the lowest impact change to make. I also changed it so you unpack on the device instead.
If you disagree, or prefer running it off the card, or whatever, feel free to re-edit. |
Re: Automatic Muting via cron
i've made a tar.gz of dcron 3.2 that support also:
user crontab (not only root) /etc/cron.daily /etc/cron.hourly /etc/cron.weekly /etc/cron.montly for more info and download see here hope it helps |
All times are GMT. The time now is 16:23. |
vBulletin® Version 3.8.8