Alarm clock with MPD

Hi there. I'm currently using MPD to wake up with just these 2 commands
sleep 6h && mpc play
But i'd like to have some script able to turn up the volume progressively. The ideal parameters would be: [% of starting volume], [% of final volume] and [time step]. I'm relatively new to linux, so if someone can help scripting, I will be thankfull.
PS: I think MPC can be useful for make this script.

This is what I have been using to make sure I don't oversleep.  It works quite well:
#!/bin/bash
### Wake-Up Alarm ##############
# Version 0.1 by Scott Garrett #
# Wintervenom [(at)] gmail.com #
# In case we are connected to an amplifier.
volume Master 20
# So our Last.fm account doesn't get filled with night-playlist entries.
killall mpcscribble
mpc clear
mpc load 01-Night
mpc next
mpc play
# Wait until the time specified by the user (in %H%M format) to wake up.
echo "Sleeping until $1."
until [ "`date +'%H%M'`" = "$1" ]; do
sleep 2
done
# We can start scrobbling again.
mpcscribble &
mpc pause
# Crank the volumes past eleven!
volume Master unmute
volume Master 100
volume PCM unmute
volume PCM 100
volume Beep unmute
volume Beep 100
speak It is time to wake your ass up
# Guarenteed to wake the whole dorm wing up when connected to an amplifier.
# (Needs ALSA's PC speaker beep emulation.)
beep -f3200 -l200 -d30 -r50
volume Master 0
mpc clear
mpc load 99-Everything
mpc next
mpc play
# Gracefully increase the volume of our music after having the living demons
# waken within you.
for ((x=0; x<100; x++)); do
volume Master $x
sleep 0.1
done

Similar Messages

  • Alarm clock with Radio on 6230i

    Hi,
    Has anyone used the alarm clock function with the radio to wake you in the morning/evening..?
    Is it possible to use the alarm to play the radio for 15 mins and turn it off say to go to sleep with. The kinda opposite of snooze.??
    Gratful for any info..or 3rd party app maybe?
    Crispy

    No honest ...try it! :-)
    I use it all the time as a morning wakeup alarm! I just wanted to know if it would do the opposite...can't find it yet but I'm sure it would..I suppose I will have to develop the app for it!
    This phone has hidden depths and I don't think there is anyone that knows it fully yet...

  • ITunes Alarm Clock with Airplay

    Up to a year ago, I had an alarm clock application which I got from the App Store that did a nice alarm clock playing one of my iTunes play list at a certain time in the morning. 
    Then I moved my computer from my bedroom to my office.  So I can't hear the iMac from my bedroom.  Ok, so I got a set of speakers that can be invoked using AirPlay from iTunes.  As a manual operation it is exactly what I wanted.  However, the alarm clock application has no option to set the Air Play option on iTunes.  If I run iTunes and select my Air Play speakers, when the Alarm clock plays a Playlist, iTunes resets the output to the Computer.  <Sigh>
    A few months ago, I found a script that would set the Air Play output device and run a play list.  I was set.  However, I found no option to run this on a schedule.  Since Mountain Lion, the option to run a script from a calendar event was removed.  <double sigh>
    Someone suggested Keyboard Maestro which looks like an excellant application for many things.  However, at that point, Apple released iTunes 11 which I installed.  Now I find that the scripts I found on the internet to select Air Play and a particular device via Apple Script no longer works with iTunes 11.  <now I'm up to groan>
    Playing around with Keyboard Maestro, I found a way to record a script within KM that will allow me to manipulate the U/I of iTunes with keystrokes and mouse clicks to do what I want.  Problem solved??
    NO.  It turns out that the macro I defined in Keyboard Maestro works just fine EXCEPT that if the Screen Saver if running, KM cannot do U/I actions (this according to KM's author who has been very responsive to my requests for support).  He is not sure there is any way to do it.
    I'm experimenting to verify this statement by turning off the Energy saver options to turn off the CPU and display and not do Screen Saver.  If that works then I have narrowed down my issue.  I should know tommorrow (I did a test last night but forgot to display the Screen Saver and so it didn't accomplish what I wanted).
    Does anyone know how I could solve the problem?  Is there some kind of program I could run that would turn off the Screen Saver when run so the U/I is up and running again when the script I have would work?
    Any other ideas?
    Thanks,
    Bruce

    Did you ever find a solution? I have the same problem.

  • Alarm clock with longer ring time

    Hello,
    When i'm using my alarm, i want to hear the ring for longer then 1 min.
    Is there any program that can do it?
    Thank you
    Tomer

    On iPad you can still do so. When you pick the alarm sound scroll all the way up and you should see "Pick a song". If you don't
    Try a Restart.
    Press and hold the Sleep/Wake button for a few seconds until the red "slide to power off" slider appears, and then slide the slider. Press and hold the Sleep/Wake button until the Apple logo appears.
    Resetting your settings
    You can also try resetting all settings. Settings>General>Reset>Reset All Settings. You will have to enter all of your device settings again.... All of the settings in the settings app will have to be re-entered. You won't lose any data, but it takes time to enter all of the settings again.
    Resetting your device
    Press and hold the Sleep/Wake button and the Home button together for at least ten seconds, until the Apple logo appears. Apple recommends this only if you are unable to restart it.
    Or if this doesn't work and nobody else on the blog doesn't have a better idea you can contact Apple.
    Here is a link to their contacts with most of the information below.
    http://www.apple.com/contact/

  • Alarm clock with iOS 7

    With the new upgrade, you can no longer play music from your library as the wake-up, you have to use the sound tones.  Any way around this?  The upgrade, btw Apple, is disappointing.  Wish I had kept the 6 version.

    On iPad you can still do so. When you pick the alarm sound scroll all the way up and you should see "Pick a song". If you don't
    Try a Restart.
    Press and hold the Sleep/Wake button for a few seconds until the red "slide to power off" slider appears, and then slide the slider. Press and hold the Sleep/Wake button until the Apple logo appears.
    Resetting your settings
    You can also try resetting all settings. Settings>General>Reset>Reset All Settings. You will have to enter all of your device settings again.... All of the settings in the settings app will have to be re-entered. You won't lose any data, but it takes time to enter all of the settings again.
    Resetting your device
    Press and hold the Sleep/Wake button and the Home button together for at least ten seconds, until the Apple logo appears. Apple recommends this only if you are unable to restart it.
    Or if this doesn't work and nobody else on the blog doesn't have a better idea you can contact Apple.
    Here is a link to their contacts with most of the information below.
    http://www.apple.com/contact/

  • The app "alarm clock with pandora radio" does not work and i cant get any help with it i want my money back

    I have tried to get info on this app and it does not show up on the app store any longer so i cant contact the developer about this app for support. it does not work and i feel i was cheated out of my money for an app that was supposed to play pandora when the alarm goes off but it does nothing. i need help with this.

    As stated All purchased are final.
    Use the e-mail receipt to Report a problem or
    iTunes Store Support
    http://www.apple.com/emea/support/itunes/contact.html

  • Has anyone found a dab radio alarm clock with the latest lightning docking fitting?

    Has anybody found a DAB radio alarm with the latest lightning docking system?

    Did you ever find a solution? I have the same problem.

  • Need help with my alarm clock, with Timer task and Timer classes

    k everything is almost complete to get this alarm to work. It goes off and everything. But the thing is that it has a start button and when you click it to start the alarm the text changes to "Stop". This way if the user wants he can turn it off. Yet it works fine, the only problem is when the alarm actually goes off, the button text doesnt change back to "Start". Im not sure how to control private data members in classes from other classes. This is very fustrating, help would be apprieciated. here is the code that i have so far:
    import java.awt.*;
    import java.util.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.Timer;
    public class Alarm extends JFrame implements ActionListener
         private AlarmSetup as;
         private DigitalClock dc = new DigitalClock();
         private JComboBox amPmBox = new JComboBox();
         private JTextField hourField = new JTextField(2),
                             minuteField = new JTextField(2);
         private JPanel panel = new JPanel();
         private JLabel colon = new JLabel(":");
         private JButton start = new JButton("Start");
         private JMenuBar jmb = new JMenuBar();
         private JMenu file = new JMenu("File"), timeSetting = new JMenu("Time Setting");
         private JMenuItem startItem = new JMenuItem("Start");
         private JRadioButtonMenuItem standard = new JRadioButtonMenuItem("Standard", true),
                                            military = new JRadioButtonMenuItem("Military");
         private boolean standardToMilitary = false;
         private int hour, minute;
         private int[] arr;
         public Alarm()
              setTitle("Alarm");
              Container c = getContentPane();
              panel.add(hourField);
              panel.add(colon);
              panel.add(minuteField);
              panel.add(amPmBox);
              amPmBox.addItem("AM");
              amPmBox.addItem("PM");
              c.setLayout(new BorderLayout());
              c.add(dc, BorderLayout.NORTH);
              c.add(panel, BorderLayout.CENTER);
              c.add(start, BorderLayout.SOUTH);
              setJMenuBar(jmb);
              jmb.add(file);
              file.add(timeSetting);
              timeSetting.add(standard);
              timeSetting.add(military);
              file.add(startItem);
              ButtonGroup bg = new ButtonGroup();
              bg.add(standard);
              bg.add(military);
              military.addActionListener(this);
              standard.addActionListener(this);
              //the start things need to be implemented still in the action
              //performed
              start.addActionListener(this);
              startItem.addActionListener(this);
         public static void main(String[] args)
              Alarm frame = new Alarm();
              frame.pack();
              frame.setVisible(true);
         public void actionPerformed(ActionEvent e)
              String actionCommand = e.getActionCommand();
              if(e.getSource() instanceof JButton)
                   if(actionCommand.equals("Start")){
                   //long seconds;
                   arr = dc.getTimeMilitary();
                   hour = Integer.parseInt(hourField.getText().trim());
              minute = Integer.parseInt(minuteField.getText().trim());
              String comboSelection = (String)amPmBox.getSelectedItem();
              as = new AlarmSetup(this, arr, hour, minute);
              as.setupAlarm(comboSelection, standardToMilitary);
              start.setText("Stop");}
              else if(actionCommand.equals("Stop")){
                   as.stopTimer();
                   start.setText("Start");}
              else if(e.getSource() instanceof JRadioButtonMenuItem)
                   if(actionCommand.equals("Military"))
                        dc.setTimeFormat(DigitalClock.MILITARY_TIME);
                        standardToMilitary = true;
                        panel.remove(amPmBox);
                   else if(actionCommand.equals("Standard"))
                        dc.setTimeFormat(DigitalClock.STANDARD_TIME);
                        standardToMilitary = false;
                        panel.add(amPmBox);
    import javax.swing.*;
    import java.util.Timer;
    import java.util.*;
    public class AlarmSetup
         private Timer alarmTimer = new Timer(true);
         private long seconds;
         private int[] timeArray;
         private int textHour, textMinute;
         public AlarmSetup()
         public AlarmSetup( int[] aarr, int ahour, int aminute)
              timeArray = aarr;
              textHour = ahour;
              textMinute = aminute;
         public void setTimeArray(int[] array)
              timeArray = array;
         public void setHour(int xhour)
              textHour = xhour;
         public void setMinute(int xminute)
              textMinute = xminute;
         public void stopTimer()
              alarmTimer.cancel();
         public void setupAlarm(String combo, boolean tester)
              if(!tester)
                   if(combo.equals("AM"))
                        seconds = (textHour - timeArray[0])*3600 + (textMinute - timeArray[1]) *60 - timeArray[2];
                        try
                             alarmTimer.schedule(new AlarmTask(alarm), seconds*1000);
                        catch(IllegalArgumentException iae)
                             seconds = (24*3600) + seconds;
                             alarmTimer.schedule(new AlarmTask(alarm), seconds*1000);
                   else
                        seconds = (textHour + 12 - timeArray[0])*3600 + (textMinute - timeArray[1]) *60 - timeArray[2];
                        try
                             alarmTimer.schedule(new AlarmTask(alarm), seconds*1000);
                        catch(IllegalArgumentException iae)
                             seconds = (24*3600) + seconds;
                             alarmTimer.schedule(new AlarmTask(alarm), seconds*1000);
              else if(tester)
                   seconds = (textHour - timeArray[0])*3600 + (textMinute - timeArray[1]) *60 - timeArray[2];
                   try
                        alarmTimer.schedule(new AlarmTask(alarm), seconds*1000);
                   catch(IllegalArgumentException iae)
                        seconds = (24*3600) + seconds;
                        alarmTimer.schedule(new AlarmTask(alarm), seconds*1000);
    import java.util.*;
    public class AlarmTask extends TimerTask
         public void run()
              System.out.println("Billy the goat");
              //dont know what to put to change the Alarm button text

    well im trying to get this down. So i made a private class inside the alarmsetup class. But now when i try to use the schedule method on the timer object it says that it doesnt know it? whats the deal? here is my code for that class
    import javax.swing.*;
    import java.util.Timer;
    import java.util.*;
    public class AlarmSetup
         private Alarm alarm;
         private Timer alarmTimer = new Timer();
         private long seconds;
         private int[] timeArray;
         private int textHour, textMinute;
         private class AlarmTask
              public void run()
                   alarm.changeButtonText();
                   System.out.println("Billy the Goat");
         public AlarmSetup(Alarm a)
              alarm = a;
         public AlarmSetup(Alarm al, int[] aarr, int ahour, int aminute)
              alarm = al;
              timeArray = aarr;
              textHour = ahour;
              textMinute = aminute;
         public void setTimeArray(int[] array)
              timeArray = array;
         public void setHour(int xhour)
              textHour = xhour;
         public void setMinute(int xminute)
              textMinute = xminute;
         public void stopTimer()
              alarmTimer.cancel();
         public void setupAlarm(String combo, boolean tester)
              if(!tester)
                   if(combo.equals("AM"))
                        seconds = (textHour - timeArray[0])*3600 + (textMinute - timeArray[1]) *60 - timeArray[2];
                        try
                             alarmTimer.schedule(new AlarmTask(), seconds*1000);
                        catch(IllegalArgumentException iae)
                             seconds = (24*3600) + seconds;
                             alarmTimer.schedule(new AlarmTask(), seconds*1000);
                   else
                        seconds = (textHour + 12 - timeArray[0])*3600 + (textMinute - timeArray[1]) *60 - timeArray[2];
                        try
                             alarmTimer.schedule(new AlarmTask(), seconds*1000);
                        catch(IllegalArgumentException iae)
                             seconds = (24*3600) + seconds;
                             alarmTimer.schedule(new AlarmTask(), seconds*1000);
              else if(tester)
                   seconds = (textHour - timeArray[0])*3600 + (textMinute - timeArray[1]) *60 - timeArray[2];
                   try
                        alarmTimer.schedule(new AlarmTask(), seconds*1000);
                   catch(IllegalArgumentException iae)
                        seconds = (24*3600) + seconds;
                        alarmTimer.schedule(new AlarmTask(), seconds*1000);

  • Ipod nano 2nd gen and dock/alarm clock

    i have read through alot of the posts and have not seen anything similar to my question.
    i got my daughter an ipod nano for xmas.
    we really dont leave the computer on alot and she was wanting a docking station/speaker setup. i found one that charges it/ has speakers and is also an alarm clock.
    she likes the idea of having the alarm clock with it.
    this is the model she got: curtis iMode ip210 link to where it was bought http://hhgregg.com/ProductDetail.asp?SID=0B568914D18A4CBEB2E80A95E8C46043&Produc tID=17180
    we have not hooked it up yet because of a small problem maybe. (hooked up to power that is)
    it came with a bunch of different adapters for the different ipod versions. well the nano one is incorrect. i guess due to ours being a 2nd gen version.
    the ipod goes right on the dock fine with out it.
    the little plastic adapter i got with the ipod kinda works in the slot of the radio but would need a little modification to snap in. the difference is the outside shape and would just needed some sanding. i have called the support number for the radio and all i could get from the was its not compatable. and i am not too sure why.
    from what i have found out is all the ipod dock connectors are the same and there is no difference. not sure about this just what i have noticed.
    i tried to call my local apple store and ask them but that guy started talking about firewire and problems. i told him how it docked and what it was and he still insisted on talking about firewire and those problems. i hung up as it didnt sound like he knew anything.
    so now would i be ok in useing the adapter i got with the ipod and makeing some slight mods(sanding outside edge) to it. or is the something totally different between the 1st gen and 2nd gen that would mess up the ipod if put in this unit.
    the reason i want this unit as it will replace her current alarm clock and she has a loft bed and its the only unit that we have seen that will fit and is in our price range.
    thank you for your help
    dawg
    ipod nano 2nd gen   Windows XP  

    The dock adaptor that came with the iPod is meant to fit Apple's universal dock and not a 3rd party accessory.
    The reason you are having issues is because although the dock connectors on iPods are all the same (the pins are in the same place), the connector on the second gen nano is in a slightly different place than on the first. If you look at it from the bottom with the iPod face up, it's slightly more to the left. This, and the fact that it has a metal case with rounded edges, has made the new nano incompatible with almost all these type of accessories.
    It's been mentioned here several times, and a few people have been able to get the manufacturer of the dock to supply them with an adaptor.

  • Alarm Clock giving weird notification when using song

    When using my alarm clock with the new song feature, I am getting a notification that says "Download over cellular? Additional fees may apply when downloading songs over cellular." Options are Cancel or Download. The songs I have chosen are already on my iPhone so there should be 0 reason to have to download anything. Please advise.
    Thank you,
    Andrew

    Goto Settings--> General--> Cellular--> Is your cellular Data on? I turned mine off and it fixed the problem. You may also want to check Settings--> iTunes&App stores--> Use cellular Data and set to off so you don't eat up data on wifi. Some people have had big charges when left on. 

  • CLI alarm clock

    I would like to use an alarm clock with a command line interface.
    I looked into a combination of "at" and notifications but I think it does not fit. For example atq shows little info about scheduled "alarms".
    Remind seems nice, if only there was a way to get notifications for passed alarms. Most calendar applications will show passed alarms when the computer is turned on.
    Any suggestions?
    Last edited by Markus00000 (2011-10-13 13:12:42)

    This is what I use since years:
    #!/bin/bash
    # Issue an alarm using at and xmessage
    # Usage:
    # AL [@] delay [message timeout]]
    # where @ denotes absolute time
    # If not absolute time:
    # delay is in minutes
    # timeout is in seconds
    # Defaults to 5 minutes delay: "ALARM"
    # Message defaults to "ALARM"
    PREFIX="now + "
    SUFFIX=" minutes"
    DELAY=15
    MSG='ALARM'
    TO=60
    if [ "$1" == "-h" ] || [ "$1" == "--help" ]
    then
    echo "AL - Issue an alarm"
    echo " AL [delay (in minutes) [message [timeout (in seconds)]]]"
    echo " or"
    echo " AL @ time [message [timeout (in seconds)]]"
    echo " defaults: delay=15 message=\"ALARM\" timeout=60"
    exit
    fi
    if [ "$1" == "@" ]
    then
    PREFIX=""
    SUFFIX=""
    shift
    fi
    if [ "$1"x != "x" ]
    then
    DELAY=$1
    if [ "$2"x != "x" ]
    then
    MSG="$2"
    if [ "$3"x != "x" ]
    then
    TO=$3
    fi
    fi
    fi
    # Xdialog Version
    echo "BELL;DISPLAY=:0 Xdialog --timeout $TO --msgbox "\"$MSG\"" 0 0" | at $PREFIX$DELAY$SUFFIX
    # xmessage version
    # echo "BELL;DISPLAY=:0 xmessage -button OK -default OK -timeout $TO ""$MSG""" | at $PREFIX$DELAY$SUFFIX
    if [ "$PREFIX"x != "x" ]
    then
    echo "Alarm \""$MSG"\" in $PREFIX$DELAY$SUFFIX using timeout $TO seconds"
    else
    echo "Alarm \""$MSG"\" at $DELAY using timeout $TO seconds"
    fi
    There is no information about already scheduled alarms as yet. This should be easily implemented by writing the effective alarm command to some log file.

  • Alarm clock on iPad2

    Alarm clock on iPad 2? Does it exist?

    Nightstand is good and so is Radio Alarm Clock with Weather..
    http://itunes.apple.com/us/app/radio-alarm-clock-weather/id307090877?mt=8

  • Battery Drain With Alarm Clock Function

    This just started happening to me last week.  I have 4 alarms set during the week days...in case I hit the 'Dismiss' button by accident. These alarms have been set since I got my phone in October. Well, last week I noticed that after the 4th alarm had gone off, my battery had gone down to 48% while still plugged into the charger.  This phone is usually on the charger all night with no problems and at 100% by the time I leave for work...until now.  Any ideas why this might be?
    I currently am recreating the issue by setting my alarms for PM and seeing if there're any changes.
    Thanks!

    I set the alarm clocks for PM.....but of course it didn't do anything abnormal. So I set them again for the AM. The next morning, my alarms went off as usual, and the battery stayed fully charged. So I am at a loss as to what was going on previously.  My only conclusion is perhaps the mini USB was not completely inside the port ????  If anything new happens I'll be sure to post.  So far the past two mornings have gone without a hitch.  Go figure!

  • HT4972 since update to IOS 5.1.1  -  problem with iluv IMM173 DUAL DOCK ALARM CLOCK DOCKING STATION. - CRASHES WHENEVER UPDATED IPHONE 4S CONNECTED

    Hi, since most recent update (IOS 5.1.1) to my iphone 4s, I am experiencing problems(ONLY SINCE MOST RECENT IOS 5.1.1.UPDATE) with my 'iluv' IMM173 DUAL DOCK ALARM CLOCK DOCKING STATION.
    Every time I connect my iphone it causes the docking station to crash/freeze and become totally non-responsive. However, if I remove my iphone, then connect my wife's
    iphone 4 (IOS 5.0.10) The docking station then syncs time and date as normal with the iphone, and reverts back to function normally.
    Has anyone else experienced the problem please, and if so, is there a remedy ?

    macbarbicus wrote:
    1.  I cannot open my camera from the home screen.  The icon is there but when you click on it it shakes and starts to open up but than slides down back to the home screen.  I have tried closing the camera app resetting my phone but nothing seems to fix it.   I can still open up the camera regularly by unlocking the phone first and than going to the camera app.  But the camera button on the home screen just doesn't work for me anymore.  I know with 5.1 they made it where it wont disappearing from the home screen so my guess is the issue must be related to that somehow.
    From the locked screen, swipe the camera icon upwards to open the camera app.  This is a new feature in 5.1.

  • Trouble with Alarm Clock app

    anyone out there use the Alarm Clock app? it looks great its easy to set up but mine didn't go off this morning (good job i had a back up!)
    it says to set the alarm and leave it running in the background i did this but nada - nothing
    anyone else have this problem and did you find a solution please?
    thanks!

    Are you referring to the built in clock app that comes on the phone, or a 3rd party app from the app store?  I've had mixed results with anything other than the inbuilt clock app when it comes to alarms.

Maybe you are looking for

  • IPhone Not Recognizing Info Changes in iTunes

    Compared to the wave of other problems people seem to be having with the iOS 5, this is somewhat minor. Nonetheless, it's annoying: With certain music files when I edit info in iTunes (changing the artist name or capitalizing an album title, etc.) th

  • Java programming in Mac OS X

    Quick question. Are there any differences in coding Java between a Windows and an OS X environment. I've noticec that when I try to compile the same set of code between Windows and OS X that I will not receive any syntax errors in Windows but will in

  • Re-syncing restored iphone with new pics on it?

    hi, im going to a concert and i would like to know if i could restore my iphone before the concert, take all of my pictures/videos, and then back up my phone

  • How to get keys to display properly

    Hi all, Over the years I have found a lot of great answers through these forums and I was hoping someone could help me with this new problem. I just finally made the leap from OS 9.2 and have not been able to get several of my punctuation keys to wor

  • CSM 411 FTP issue

    Show mod csm 4 conn 1.1.1.1 detail shows ftp control channel port 21 has a valid source and destination port during the INIT and ESTAB phase. However, the DATA channel has a valid source and destination port during the INIT phase but as soon as the p