You are not logged in.
Pages: 1
Hi there. I'm currently using MPD to wake up with just these 2 commands
sleep 6h && mpc playBut 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.
Offline
Just set your script to run mpc volume +10 repeatedly. For bash parameters google for that phrase, there's tons of information online.
Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.
Offline
Well, one possible way of achieving this would be a cronjob.
crontab -eThere you can give a time and a command. The command will be executed at the given time/interval.
30 7 * * * /usr/bin/mpc playfor example. You can also specify intervals:
35/5 7 * * * "command to increase volume"would increase volume every 5 minutes, starting at 5 minutes after mpc play.
Ogion
(my-dotfiles)
"People willing to trade their freedom for temporary security deserve neither and will lose both." - Benjamin Franklin
"Enlightenment is man's leaving his self-caused immaturity." - Immanuel Kant
Offline
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
doneOffline
Thanks Wintervenom, I was looking for something like that. I will make my own script based on yours, and I'll post it when it's finished. Regards!
Last edited by sironitomas (2010-04-19 16:29:46)
Offline
Pages: 1