Programming :: Make An "alarm Clock" With Mpd And Gxmessage?

Feb 21, 2010

I'm trying to make an "alarm clock" with mpd and gxmessage. Gxmessage allows you to assign unique exit codes for its buttons to use in your script. This is what I have so far:

Code:
#!/bin/bash
vol=$1
mpc clear
mpc load alarm

[Code].....

Now I know I'm way off with the case statement, because when the alarm_message function is called within the case, both of the exit codes I assigned to the buttons (-buttons "Stop":1,"Sleep":2 ) return to their default value.

What I would like is for every time the "Sleep" button is pressed, it would pause mpc, sleep for an amount of time, play, then open gxmessage again to restart the case statement (retaining the exit codes I assigned to the buttons). Am I on the right track?

View 2 Replies


ADVERTISEMENT

Programming :: Make A Flawless Bash Alarm Script

Jan 12, 2011

I am not positive that this is the right subforum for this post. It is technically a programming question but I am not sure if this is the best place for bash scripting questions. Anyhow, I have been having trouble getting up in the morning. I am a pretty good morning person and once I am up, I am good to go. The problem is getting out of bed. Traditional alarms have just not cut it in the past; there is always an easy way to shut them off and go back to sleep.

Recentliesh, I decided to try to make an alarm script in bash that would be more successful in getting my lazy behind out of bed. I am a newbie bash scripter at best so my attempts have been very simple but have not cut it so far. Here are some examples:

[Code]....

The above script was the version of my bash alarm. It will not stop ringing until I input that ridiculous phrase. The big issue with this script was that I would input the phrase quickly and go back to sleep. It was however, much more successful than traditional alarm clocks. Another obvious pitfall was that even though control-c'ing the process would not work, the terminal could be closed and that would be the end of it. I'll get back to that issue. Here is my second attempt:

[Code]....

View 7 Replies View Related

Ubuntu :: Alarm Clock Program Goes Off?

Sep 24, 2010

I'm looking for an easy to use alarm clock program that I can suggest to new users. The two I have tried so far have fallen short of my expectations. "Alarm Clock" from the Ubuntu software repository starts out okay, but when the alarm actually goes off, getting it to stop seems pretty unintuitive. Click on the Alarm Clock icon, then click a Stop button in the new window that pops up. Sounds easy enough except that the icon used for "Stop" is just this grey square, so for users who are not familiar with linux or this program, it isn't even obvious that it is a button. I had one user actually uninstall the thing in order to get it to shut up. Preferably one should be able to silence the alarm by click on the alarm icon (or right clicking, if a 'doze' behavior is preferred) The other one I tried was alarm-clock-applet, which wants me to locate an alarm sound on my filesystem. Uh, no.

Does anyone know of a simple, basic alarm clock system that anyone can just sit down and immediately use without having to 'get in to the head' of the developer? Are the KDE alarms better? Am I missing something about either of these programs which would make them easier to use?

View 4 Replies View Related

Ubuntu :: How To Autostart Alarm Clock In Gnome

Nov 19, 2010

I installed 'Alarm Clock' from the Software Center and would like to have said app autostarts. There is an option in Alarm Clock to autostart with Gnome but that doesn't work so I assume the reason being I'm not root.

How to autostart Alarm Clock?

Also, in System > Preferences > Startup Applications, the 'Add' asks for a command. Is this like Windows whereas I simply point it to the app I want started? I don't even know where apps are installed. Who said ignorance is bliss?

View 3 Replies View Related

Ubuntu :: Alarm Clock Program For Xubuntu

Mar 2, 2011

Any alarm clock program I can run on xubuntu.

View 1 Replies View Related

Ubuntu :: Bash Script - Alarm Clock Without GUI

Jun 13, 2011

So, I'm attempting to write an alarm clock from scratch without a GUI, doing this through a bash script. So far I wrote the file that actually initiates the song, and I was trying to set up a crontab so I could do it at a certain time, making it function like an alarm clock, but it isn't seeming to work, any input on why

Code:
SHELL=/bin/bash
12 5 * * * /home/angelo/music.sh
That is my crontab

View 9 Replies View Related

General :: Writing A Script For An Alarm Clock?

Nov 27, 2010

I left the linux world for a few years and now i am trying to re-learn my shell scripting basics. I am writing a script for an alarm clock, but i seem to be running into a few issues.

declare -i H
declare -i M
declare -i currentH
declare -i currentM
declare -i minutesLeft

[code]....

My script, instead of doing what it should, produces the following errors:

./alarm: line 19: echo 11: No such file or directory
./alarm: line 26: 6: command not found

[code]....

and if i choose the time 11:06, files called 11 and 6 are creating in the working directory. I am sure it is something really simple, but i haven't used linux or scripting on my computers in around 6 years.

View 11 Replies View Related

Ubuntu :: Set Up The Alarm Clock App To Automatically Launch Rhythm Box

Aug 15, 2010

I'm trying to set up the Alarm Clock app to automatically launch Rhythm Box and begin playing a specific internet play lists I have there. I have one template set up to launch Pandora and I could probably get it to launch Rhythm Box but, how do I get it to launch Rhythm Box and begin playing a certain radio station playlist?

View 6 Replies View Related

Ubuntu Installation :: How To Add 'Alarm Clock Applet' To Panel

Jan 13, 2011

I must be overlooking something here, but I can't find out how to add "Alarm Clock Applet" to my panel. In Ubuntu Software Center, there's a picture of the program right in the panel and feature to add to panel, but there's no option for me to do this. "Add to Panel" doesn't have the application either.

View 9 Replies View Related

Ubuntu :: Alarm Clock And Shutdown Signal Command?

Feb 2, 2011

I've installed Alarm Clock and was planning to use it to shut down my PC at a certain time every day. What command would I use to execute the shutdown, "sudo shutdown -P" ?

View 5 Replies View Related

Ubuntu :: How To Launch Installed Alarm Clock - No Icon

Mar 2, 2011

I have just installed alarm clock, I cannot find an icon anywhere after the install. How can I start this program.

View 7 Replies View Related

Fedora :: Crontab - Alarm Clock Functionality To Wake Up Computer

Jul 6, 2010

I have a feature that keeps me going back to Mac every night, and I was wondering if there was an equivalent. I have a nice app called alarm clock on Mac that plays music from my library on specified days of the week and times AND can wake the computer from sleep to do so. I was wondering if there was a Linux equivalent, such as crontab, that could do all those things. It's the last barrier to almost full time Linux use.

View 4 Replies View Related

Ubuntu :: CronJob - Alarm Clock Setup With Snooze Function

Feb 4, 2011

I need to set up an alarm to start at 7:30am and run every 5 seconds until I stop it. How would I acheive this in cron tab?

View 2 Replies View Related

Ubuntu :: Can I Make Internal System Speaker Beep For A Calendar Alarm

Jul 7, 2011

I live in a crowded area so I have to use headphones almost all of the time. I just leave them plugged in so when an alarm goes off from Thunderbird or Evolution, I can't hear it. Is there a way to get some use out of my internal system speaker and have a reliable calendar-event-reminder and alarm? I'm talking about the one that will beep from inside the computer even if you have headphones plugged in.

View 2 Replies View Related

Programming :: Stopping Alarm() From Terminating The Process?

Jan 15, 2010

I am working in Linux and have connected a normal LED to my serial port (with voltage conversion). I am just trying to make that LED blink periodically using alarm ().So in the signal handling routine of my code,i toggle the LED but then the program quits as SIGALRM terminates the process. Shall i make a nested alarm so that the handling routine also has an alram()? I am stuck and i must confess that i am not so convenient with signal handling so can someone provide some pointers?I thought about using sleep(); but the advantage with alarm is that it waits for the exact number of seconds (when the second turn over from previous to new value) before raising the alarm while i am not sure about sleep taht does that or not.

View 2 Replies View Related

General :: Possible To Have Cron Run Xmessage Or Gxmessage At Certain Intervals?

Apr 20, 2010

I wonder if it's possible to have cron run xmessage or gxmessage at certain intervals?

View 7 Replies View Related

Ubuntu :: GTX 460M: Clock Changes Make Screen Flicker?

Dec 6, 2010

My G73JW works really great except for 1 thing. A change in the performance level causes short black flickering on the display, which is absolutely inacceptable (e.g. with compiz). Setting the preferred mode to "performance" locks the performance level and helps but seems like a bad solution (batter life and heat).

View 4 Replies View Related

Ubuntu :: Possible To Use CSS Code To Make Gnome Panel Clock Text Blink?

Sep 7, 2010

I was wondering if it is at all possible to use CSS code to make the Gnome panel clock text blink. I Googled a bunch of CSS code which is supposedly used to create a blinking text effect but none work in the Gnome panel clock. Is there any sort of CSS code which can do that? If so, what is it?

View 3 Replies View Related

Ubuntu :: Need To Make System Stop Updating BIOS Clock To UTC Time

Jan 22, 2011

I have Ubuntu 10.04.1 32bit installed on my flash drive so wherever I go I can have my own mini personal computer, but one problem I'm having is every computer it is run on the next time it's rebooted to the OS on the hard drive it has UTC time instead of the actual time for the timezone you're in that Windows uses. So is their a way I can make Ubuntu not automatically change the clock to what it wants?

View 2 Replies View Related

Programming :: Clock() - Calculate How Much Time Does My Program Run?

May 11, 2011

im trying to calculate how much time does my program run, use very simple script

clock_t end, start;
start= clock();
int i;
printf("initial %d
",(int)start);
[Code]....

but it outputs 0 all the time. cant figure out where could be the problem.

View 2 Replies View Related

Programming :: Getting The Clock Time From Inside A Driver?

Oct 21, 2010

I want to use a function that able to get the current clock time when I call it from inside my wireless driver?

View 1 Replies View Related

Programming :: Clock() - Doesn't Count How Much System() Works?

Jun 3, 2011

im stuck with something trivial again. so i want to calculate how much time my programm runs:

int main (int argc, char* argv[])
{
clock_t end, start;
start= clock();
int i;
int p, q, r;
FILE* f_out_loc;
[Code]....

it returns 1.12 sec. looks like clock() doesnt count how much system() works .... is it possible? and how do i calculate the whole thing?

View 4 Replies View Related

Programming :: Srand (static_cast<unsigned Int>(clock( ))); Seems Not Random Enough

Jul 21, 2011

I copied and test a simple random number generate program

#include <algorithm>
#include <vector>
#include <iterator>
#include <iostream>

[code]....

View 2 Replies View Related

Ubuntu :: Conky Clock And Top Panel Clock Not In Sync

May 27, 2011

I'm using a very simple conky script to diplay the date and time on my desktop. I've noticed that he conky clock is a few seconds early compared to the time displayed in the right hand side of the top panel (Natty). I guess both displays are based on the same "internal" time, so I'm left wondering how this could happen, and how to sync back the clocks.

It seems that Conky is in sync with the system date, while the panel clock is 2 seconds late (on my system). Checked with while true; do date; sleep 0.1; done

View 2 Replies View Related

Ubuntu :: Possible To Have Clock In Center Of Task Bar Centered Clock In U11.04?

Aug 2, 2011

Just curious as to if it is possible to have the clock in the center of the task bar centered clock in Ubuntu 11.04?

View 1 Replies View Related

Hardware :: Interface To A Quartz Clock That Can Be Used For A TOD Clock?

May 2, 2011

Does anyone know of an interface to a quartz clock that can be used for a TOD clock?? I want to interface it to an Arduino board. Can be GPIO or USB.

View 1 Replies View Related

CentOS 5 :: Get Rid Of Virtual Clock And Use Physical Clock?

Sep 2, 2011

I had cloned a centos 5.6 installation from virtualbox virtual machine to physical box. Everything work fine. However, the time showing in os using date command differs from bios time by roughly 4 hours. I am running ntp services which sync the time with another centos server on the network. It appears that some services are using virtual clock and some use physical clock. How do I get rid of virtual clock and only use physical clock?

View 1 Replies View Related

Programming :: Makefile - Error When Run The Make Run - No Rule To Make Target - Shell.h

Sep 15, 2010

I want to gave much details as possible. working directory (~/a1/shell) in the shell directory i have Makefile. also in the shell directory i have subdirectory's (obj, src, include)

My current Makefile

Quote:

#What needs to be built to make all files and dependencies

clean:

# End of Makefile

I wanted it so: all .o files are created in the obj subdirectory, and my application, sshell, is created in the shell directory.

I am getting this error when i run the make run: No rule to make target 'shell.h', needed by 'shutil.o'. stop

View 1 Replies View Related

Ubuntu :: Two Pop-ups For 1 Alarm

Sep 18, 2010

I'm using Alarm-clock, not the alarm-clock-applet, and when i set Schedulle > AllWekdays an AllMonths the alarm gives me two pop-ups

View 1 Replies View Related

Slackware :: Low Battery Alarm Fluxbox

Apr 19, 2010

I'm using fluxbox on my eee pc 1000h and use conky to display % battery charge but (unlike my previous laptop) I don't get a hardware-triggered beep warning me of low battery.I've done a bit of searching but haven't yet found a neat software solution for either a beep or toolbar notification. Any suggestions?(I'm not wanting to switch back to KDE right now.)

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved