LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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-14-2014, 10:27 AM   #1
Bertman123
Member
 
Registered: Jun 2010
Distribution: Slackware Current 64 bit KDE 5
Posts: 380

Rep: Reputation: 77
How can I use my laptop as an Alarm Clock?


I have an old compaq laptop that had XP on it and currently has linux mint 17 on it.

I like to use it as an alarm clock - using alarm-clock-applet. I have it set to start rhythmbox and automatically shuffle my music.

Is there a similar way that I can set that up with slackware? I've found the website for the program and could try compiling the program on slackware, but before I do that I figured I see if there's another way to do that.
 
Old 09-14-2014, 11:33 AM   #2
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,444

Rep: Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474
Are you using KDE on Slackware? If so, you can use kalarm. Type kalarm or /usr/bin/kalarm in a terminal to open it. If you get no response, it's not installed. If you are not using KDE, you didn't indicate what you are using so...?
 
Old 09-14-2014, 01:32 PM   #3
Bertman123
Member
 
Registered: Jun 2010
Distribution: Slackware Current 64 bit KDE 5
Posts: 380

Original Poster
Rep: Reputation: 77
Quote:
Originally Posted by yancek View Post
Are you using KDE on Slackware? If so, you can use kalarm. Type kalarm or /usr/bin/kalarm in a terminal to open it. If you get no response, it's not installed. If you are not using KDE, you didn't indicate what you are using so...?
Actually the laptop is old enough I'm probably going to use xfce or mate.
 
Old 09-14-2014, 01:38 PM   #4
jmccue
Member
 
Registered: Nov 2008
Location: US
Distribution: slackware
Posts: 682
Blog Entries: 1

Rep: Reputation: 379Reputation: 379Reputation: 379Reputation: 379
Not sure what you mean by 'simple was to set up', but depending upon your music files you can use a combination of at(1) and ogg123(1) to play a music file at a specified date/time. Maybe create a script to pass a shuffled playlist into ogg123 or another command line music player. Or even better use crontab(1) entries instead of at(1)

John
 
2 members found this post helpful.
Old 09-14-2014, 03:17 PM   #5
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453

Rep: Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154
You can use the Lightning plugin for Thunderbird. It has a calendar as well as an alarm function.
 
2 members found this post helpful.
Old 09-14-2014, 03:40 PM   #6
dslackw
Member
 
Registered: Aug 2014
Location: Orestiada, GR
Distribution: Slackware 15.0 x86_64 -stable
Posts: 158

Rep: Reputation: 44
alarm.py

Code:
#!/usr/bin/python
# -*- coding: utf-8 -*-

import os
import sys
import time

ALARM = "23:35:50"
SONG = "/path/to/song/song.mp3"

while True:
    os.system("clear")
    print "Alarm set at %s" % ALARM
    start_time = time.strftime("%H:%M:%S")
    sys.stdout.write("Time : " + start_time)
    sys.stdout.flush()
    time.sleep(0.1)
    if start_time == ALARM:
        os.system("mplayer %s" % SONG)
        break
python alarm.py
 
2 members found this post helpful.
Old 09-14-2014, 08:37 PM   #7
Bertman123
Member
 
Registered: Jun 2010
Distribution: Slackware Current 64 bit KDE 5
Posts: 380

Original Poster
Rep: Reputation: 77
Quote:
Originally Posted by kikinovak View Post
You can use the Lightning plugin for Thunderbird. It has a calendar as well as an alarm function.
Lightning has an alarm function? I'll have to look into that more.

Thanks guys for all of your advice and help.
 
Old 09-14-2014, 08:38 PM   #8
Bertman123
Member
 
Registered: Jun 2010
Distribution: Slackware Current 64 bit KDE 5
Posts: 380

Original Poster
Rep: Reputation: 77
Quote:
Originally Posted by dslackw View Post
alarm.py

Code:
#!/usr/bin/python
# -*- coding: utf-8 -*-

import os
import sys
import time

ALARM = "23:35:50"
SONG = "/path/to/song/song.mp3"

while True:
    os.system("clear")
    print "Alarm set at %s" % ALARM
    start_time = time.strftime("%H:%M:%S")
    sys.stdout.write("Time : " + start_time)
    sys.stdout.flush()
    time.sleep(0.1)
    if start_time == ALARM:
        os.system("mplayer %s" % SONG)
        break
python alarm.py
Thanks, I'm going to play round with this and see how it works for me.
 
Old 09-14-2014, 09:29 PM   #9
moisespedro
Senior Member
 
Registered: Nov 2013
Location: Brazil
Distribution: Slackware
Posts: 1,223

Rep: Reputation: 195Reputation: 195
I would suggest using this as the alarm sound:

# aplay /dev/sda
 
1 members found this post helpful.
Old 09-14-2014, 10:36 PM   #10
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Quote:
Originally Posted by dslackw View Post
alarm.py

Code:
#!/usr/bin/python
# -*- coding: utf-8 -*-

import os
import sys
import time

ALARM = "23:35:50"
SONG = "/path/to/song/song.mp3"

while True:
    os.system("clear")
    print "Alarm set at %s" % ALARM
    start_time = time.strftime("%H:%M:%S")
    sys.stdout.write("Time : " + start_time)
    sys.stdout.flush()
    time.sleep(0.1)
    if start_time == ALARM:
        os.system("mplayer %s" % SONG)
        break
python alarm.py
I wouldn't do short sleeps in a loop, myself...

Code:
#!/usr/bin/python
# -*- coding: utf-8 -*-

import os
import sys
import time
import datetime

ALARM = "23:35:50"
SONG = "/path/to/song/song.mp3"

os.system("clear")
print "Alarm set at %s" % ALARM
(hr, minutes, secs) = ALARM.split(":")
tgttime = datetime.time(int(hr), int(minutes), int(secs))
today = datetime.date.today()
tgt = datetime.datetime.combine(today,tgttime)
if (now < tgt):
    stime = (tgt - now).total_seconds()
else:
    stime = (tgt - now).total_seconds() + 24*60*60
time.sleep(stime)
os.system("mplayer %s" % SONG)
 
Old 09-14-2014, 11:18 PM   #11
ttk
Senior Member
 
Registered: May 2012
Location: Sebastopol, CA
Distribution: Slackware64
Posts: 1,038
Blog Entries: 27

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
When I need an alarm in seven hours, I keep it simple:

Code:
# sleep 25200 ; xine something_raucous.mp3
 
3 members found this post helpful.
Old 09-14-2014, 11:19 PM   #12
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 4,776

Rep: Reputation: 4425Reputation: 4425Reputation: 4425Reputation: 4425Reputation: 4425Reputation: 4425Reputation: 4425Reputation: 4425Reputation: 4425Reputation: 4425Reputation: 4425
If you'd prefer to not have to install anything and you don't mind a bit of Flash, you can use http://onlinealarmclock.ms/
 
1 members found this post helpful.
Old 09-15-2014, 12:23 AM   #13
Ilgar
Senior Member
 
Registered: Jan 2005
Location: Istanbul, Turkey
Distribution: Slackware64 15.0, Slackwarearm 14.2
Posts: 1,156

Rep: Reputation: 234Reputation: 234Reputation: 234
If you're going to use Xfce, there's a panel plugin that I've written: xfce4-timer-plugin. You can set it to run a specific command.
 
1 members found this post helpful.
Old 09-15-2014, 03:45 AM   #14
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
To have a Real Alarm Clock (TM), the victim computer should have the ability to wake-up from stand-by, at specified time, a task available in some BIOS-es...

Then, after your Slack was booted at the right time, enter in the game Your Patented Noise System (TM).

Or, you will leave the computer on, beyond the night?

Last edited by Darth Vader; 09-15-2014 at 03:54 AM.
 
1 members found this post helpful.
Old 09-15-2014, 10:44 AM   #15
eloi
Member
 
Registered: Nov 2010
Posts: 227

Rep: Reputation: 61
Wake Up! This is Unix.

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.)
 
2 members found this post helpful.
  


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 03:33 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