LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-15-2014, 11:19 AM   #16
Darth Vader
Senior Member
 
Registered: May 2008
Location: Romania
Distribution: DARKSTAR Linux 2008.1
Posts: 2,727

Rep: Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247

Quote:
Originally Posted by eloi View Post
Run:

Code:
$ arecord > /path/to/wakeUp.wav
Cry in your microphone "HEY, WAKE UP!", several times. Stop the recording with Ctrl-C. Then open your crontab with:

Code:
$ crontab -e
And write this line to run it at 7:00 AM:

Code:
0 7 * * * aplay /path/to/wakeUp.wav

(All of you should wake up.)
Nice, but, I don't like idea to leave working, one of my computers, all the night. It should automatically power-on from stand-by and boot at ... i.e. 7 A.M., then to make the required noises.

To make automatically power-on possible, we should have an chrono support in BIOS. Unix or NOT, you can't power-on the machine automatically, only with the operating system support (i.e. CRONTAB), because there is no operating system running when the computer is in STAND-BY.

You see the light?
 
1 members found this post helpful.
Old 09-15-2014, 08:48 PM   #17
dslackw
Member
 
Registered: Aug 2014
Location: Orestiada, GR
Distribution: Slackware 15.0 x86_64 -stable
Posts: 158

Rep: Reputation: 44
I create this https://pypi.python.org/pypi/alarm
 
1 members found this post helpful.
Old 09-16-2014, 12:12 PM   #18
rg3
Member
 
Registered: Jul 2007
Distribution: Fedora
Posts: 527

Rep: Reputation: Disabled
On the topic of keeping the computer asleep and waking it up only when the alarm needs to sound, I can give some advice. Does anybody remember how there are a few tasks programmed by default to be run everyday at 4:40 from root's crontab? Specifically, the contents of /etc/cron.daily. Well, I thought it was a good idea to let them run as planned while I wasn't using the computer, so when booting up and as part of those tasks I schedule a wake up event for 4:38 the next day with:

Code:
#!/bin/sh
# Wake up tomorrow at 4:38
time=$( echo $(( $( date -d 00:00 +%s ) + 103080 )) )
exec /usr/sbin/rtcwake -u -m no -t $time >/dev/null
See the manpage for rtcwake and test if it works for you. And the last task in /etc/cron.daily sends the computer to sleep again with a call to pm-suspend.

Code:
$ ls -l /etc/cron.daily/zzz_pm-suspend 
lrwxrwxrwx 1 root root 20 Mar 24 19:27 /etc/cron.daily/zzz_pm-suspend -> /usr/sbin/pm-suspend*
So I go to bed every night having suspended the computer and it wakes up at 4:38 (I should probably test waking up at 4:39), runs the tasks at 4:40 and goes to sleep again, all in its own. I'm sure some of this can be used to create a simple alarm clock that plays a random song from a song collection.

Last edited by rg3; 09-16-2014 at 12:14 PM.
 
1 members found this post helpful.
Old 09-16-2014, 01:57 PM   #19
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,307
Blog Entries: 61

Rep: Reputation: Disabled
Obvious choice of song?
Make sure the volume's at 11.

Last edited by brianL; 09-16-2014 at 01:59 PM.
 
Old 09-18-2014, 06:03 AM   #20
eloi
Member
 
Registered: Nov 2010
Posts: 227

Rep: Reputation: 61
@Bertman123

Some people let the machine up all night (i.e. with the mule), I assume that's your case, otherwise, following the Unix idea, that's no more and no less than common sense applied to computer use, you'd buy some alarm clock in a Chinese bazaar.

Any alternative to the cron job and the Chinese alarm clock means to be seriously perturbed by the dark side.
 
1 members found this post helpful.
Old 09-18-2014, 10:37 AM   #21
Darth Vader
Senior Member
 
Registered: May 2008
Location: Romania
Distribution: DARKSTAR Linux 2008.1
Posts: 2,727

Rep: Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247
Quote:
Originally Posted by eloi View Post
Any alternative to the cron job and the Chinese alarm clock means to be seriously perturbed by the dark side.
Still, your Chinese alarm clock can't play that inspirational song at 5:00 AM, in my 7.1 audio system. While one of my computers, that have the nice ability to program the BIOS, to wake-up the computer from stand-by at specified time, will do...

I should ask for a audience to our Glorious Emperor?
 
1 members found this post helpful.
Old 09-19-2014, 01:45 AM   #22
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,146

Rep: Reputation: Disabled
Here is my proposal.

How to rebuild the computer in such a way that it fits inside the clock is left to the reader as an exercise.
Attached Thumbnails
Click image for larger version

Name:	alarm.clock.gif
Views:	24
Size:	97.6 KB
ID:	16474  

Last edited by Didier Spaier; 09-19-2014 at 01:58 AM.
 
Old 09-19-2014, 06:05 AM   #23
Ilgar
Senior Member
 
Registered: Jan 2005
Location: Istanbul, Turkey
Distribution: Slackware64 15.0, Slackwarearm 14.2
Posts: 1,158

Rep: Reputation: 237Reputation: 237Reputation: 237
Quote:
Originally Posted by Didier Spaier View Post
Here is my proposal.

How to rebuild the computer in such a way that it fits inside the clock is left to the reader as an exercise.
Here is an example:

http://hackaday.com/2014/09/18/sprit...a-clock-radio/

http://spritesmods.com/?art=clockradio&page=1
 
2 members found this post helpful.
Old 09-20-2014, 07:28 AM   #24
Bertman123
Member
 
Registered: Jun 2010
Distribution: Slackware Current 64 bit KDE 5
Posts: 380

Original Poster
Rep: Reputation: 77
Thanks guys, there's a lot of information here for me to test out.
 
Old 09-20-2014, 08:44 AM   #25
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,325

Rep: Reputation: 919Reputation: 919Reputation: 919Reputation: 919Reputation: 919Reputation: 919Reputation: 919Reputation: 919
this seems related:
http://www.linuxquestions.org/questi...0/#post1861811

also, i found this eggtimer zenity script:
Code:
[schneidz@hyper ~]$ cat ./egg-timer.ksh
#!/bin/bash
# Filename: progbar-timer.sh
# Version: 110212
# Author: robz
# Improved from the "Egg Timer" script, a countdown timer with progress bar.
# This one has an indication of time remaining provided by Zenity's progress
# bar function. As usual you'll need to find a sound and icon for the variables
# below, you might find the icon variable is correct, check the directory.

ICON=/usr/share/app-install/icons/kalarm.png              # Existing icon?
SOUND=/home/schneidz/music/Finding-Forever/01-Intro--Intro--Intro--Intro--Intro--Intro--Intro--Intro--Intro--Intro--Intro--Intro--Intro--Intro--Intro--Intro.mp3                               # Your sound pref.

COUNT=$(zenity --title "Egg Timer" --window-icon $ICON --text "No decimals"\
    --entry-text "eg. 10s or 5m or 2h" --entry)           # Input dialogue.
if [ $? = 1 ]; then exit $?; fi

# Determine number of seconds to count down from depending on input suffix.
case "${COUNT: -1}" in
    "S" | "s" ) COUNT=$(echo $COUNT | sed -s "s/[Ss]//") ;;
    "M" | "m" ) COUNT=$(echo $COUNT | sed -s "s/[Mm]//"); ((COUNT*=60)) ;;
    "H" | "h" ) COUNT=$(echo $COUNT | sed -s "s/[Hh]//"); ((COUNT*=3600)) ;;
    *         ) zenity --error --text "<span color=\"red\"><b>\
    \nUse the form of 10s or 5m or 2h\nNo decimals allowed either.</b></span>"
    sh -c "$0"                                            # On error restart.
    exit ;;
esac

START=$COUNT                                              # Set a start point.

until [ "$COUNT" -eq "0" ]; do                            # Countdown loop.
    ((COUNT-=1))                                          # Decrement seconds.
    PERCENT=$((100-100*COUNT/START))                      # Calc percentage.
    echo "#Time remaining$(echo "obase=60;$COUNT" | bc)"  # Convert to H:M:S.
    echo $PERCENT                                         # Outut for progbar.
    sleep 1
done | zenity --title "Egg Timer" --progress --percentage=0 --text=""\
    --window-icon=$ICON --auto-close                      # Progbar/time left.
if [ $? = 1 ]; then exit $?; fi
notify-send -i $ICON "Egg Timer > ## TIMES UP ##"         # Attention finish!
/usr/bin/canberra-gtk-play --volume 4 -f $SOUND           # Ding-dong finish!
zenity --notification --window-icon="$ICON"\
    --text "Egg Timer > ## TIMES UP ##"                   # Indicate finished!

Last edited by schneidz; 09-20-2014 at 08:58 AM.
 
1 members found this post helpful.
Old 09-25-2014, 09:18 PM   #26
Bertman123
Member
 
Registered: Jun 2010
Distribution: Slackware Current 64 bit KDE 5
Posts: 380

Original Poster
Rep: Reputation: 77
Thanks for all of the suggestions. After some testing and more researching I discovered that Orage has an alarm function that seems to work pretty well. Now I have to install slack on the older laptop in question (with MLED + XFCE) and play around with music players. Looks like a task for this weekend. :-)

Thanks for all of your help.
 
Old 10-02-2014, 09:59 AM   #27
Bertman123
Member
 
Registered: Jun 2010
Distribution: Slackware Current 64 bit KDE 5
Posts: 380

Original Poster
Rep: Reputation: 77
Installed slackware & MLED with the xfce desktop. For music players I installed rhythmbox as I am already familiar with starting it from the command line and works nicely with orage. Thanks for all of your help. Marking this as solved.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Alarm clock ColInvictus Linux - General 1 04-23-2009 11:41 PM
i need an alarm clock for 2007 bennythepitbull Mandriva 5 06-01-2007 11:39 AM
Simple Alarm Clock dudeman41465 Linux - Software 11 10-06-2006 11:33 PM
linux alarm clock? DJOtaku Linux - General 1 02-16-2005 01:41 AM
Linux Alarm Clock?? Scruff Linux - General 3 09-02-2003 09:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration