LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-25-2013, 03:13 PM   #1
sayhello_to_the_world
Member
 
Registered: May 2013
Posts: 229

Rep: Reputation: Disabled
a alarm function within the clock - doable?


hello dear linux-experts

i run opensuse linux - version 12.3 and i want to have a alarm function within the clock

is this possible?



The alarm function shall cause the system to generate a Alarm signal - to wake me up


how to do this - is there any similar function within the kde-system?

love to hear from you

greetings
 
Old 09-25-2013, 03:22 PM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Depends on what you really want to do - "generate a Alarm signal" has a different meaning to different people.

There is a "kalarm" utility that pops up a window and give notice, or run a command (which can generate both a display and audible alarm) And can be used to send "alarm signals".

Alarm signals is a specific alarm usually used for clock based events (see kill -l for a list of signals that can be sent to processes).
 
Old 09-25-2013, 03:36 PM   #3
sayhello_to_the_world
Member
 
Registered: May 2013
Posts: 229

Original Poster
Rep: Reputation: Disabled
hello thx for the quick reply

kalarm sounds great - i need some trivial programm- (utility) that gives notice - and a audible alarm


btw - is kalarm a plasmoid - thing - in other words can i find it a t the miniprogrammes

love to hear from you
 
Old 09-26-2013, 05:09 AM   #4
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
I think they are planning to make it one, but isn't now (https://community.kde.org/Plasma/Tasks)

Which would make it a full application (I have run it under LXDE)
 
Old 09-26-2013, 07:40 AM   #5
RockDoctor
Senior Member
 
Registered: Nov 2003
Location: Minnesota, US
Distribution: Fedora, Ubuntu, Manjaro
Posts: 1,791

Rep: Reputation: 427Reputation: 427Reputation: 427Reputation: 427Reputation: 427
Will something this work for you? It's not in the clock, but I find it handy. I just created a .desktop file for it and put the launcher in my panel.
Code:
#!/usr/bin/python
""" A simmple Alarm Clock
    Written by RockDoctor
    20110922  layout instead of boxes
    20120306  clocktime or seconds
              default command
              don't hide window
    20120307  show seconds remaining
"""

import time
import os
from gi.repository import Gtk

class Alarmclock(object):

  def __init__(self):
    w = Gtk.Window()
    w.set_title("RockDoctor's Alarm Clock")
    w.connect("destroy", Gtk.main_quit)
    w.set_default_size(363,142)

    layout = Gtk.Layout()
    w.add(layout)

    #lt = Gtk.Label("Time: ")
    #layout.put(lt,10,14)
    self.rb1 = Gtk.RadioButton(group=None, label="Time on Clock:")
    self.rb2 = Gtk.RadioButton(group=self.rb1, label="Elapsed Time:")
    layout.put(self.rb1,10,11)
    layout.put(self.rb2,10,33)

    self.et1 = Gtk.Entry()
    layout.put(self.et1,120,14)
    self.et2 = Gtk.Entry()
    layout.put(self.et2,120,36)

    self.time_to_go = Gtk.Label("56")
    layout.put (self.time_to_go,290,38)

    lc = Gtk.Label("Command: ")
    layout.put(lc,10,68)

    self.ec = Gtk.Entry()
    self.ec.set_text('mplayer /home/a/.config/autostart/login.mp3')
    self.ec.set_width_chars(35)

    layout.put(self.ec,100,64)

    bb = Gtk.ButtonBox(homogeneous=True,spacing=5)
    button = Gtk.Button(stock="gtk-cancel")
    bb.add(button)
    button.connect("clicked",Gtk.main_quit)
    button = Gtk.Button(stock="gtk-ok")
    bb.add(button)
    button.connect("clicked",self.do_it,w)
    layout.put(bb,178,98)

    w.show_all()
    Gtk.main()

  def do_it(self,button_ok,w):
    mycmd = self.ec.get_text()

    if self.rb1.get_active():
      t = self.et1.get_text()
      t = [int(x) for x in t.split(':')]
      now = time.localtime()
      dh = (t[0]-now.tm_hour)*3600 #convert to seconds
      dm = (t[1]-now.tm_min)*60    #convert to seconds
      ds = -now.tm_sec
      if len(t)==3:
        ds += t[2]
      dt = dh+dm+ds
    else:
      dt = int(self.et2.get_text())

    #w.hide()
    while dt:
      dt -= 1
      self.time_to_go.set_text(str(dt))
      while Gtk.events_pending():
        Gtk.main_iteration_do(False)
      time.sleep (1)
    time.sleep(dt)
    os.system(mycmd)
    Gtk.main_quit()

if __name__ == "__main__":
  app = Alarmclock()
 
  


Reply



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 - Newbie

All times are GMT -5. The time now is 06:03 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