Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Simple single button lirc-capable shut down timer with an OSD
C R Shell
Latest commit 781bde7 @fhirschmann update README
Failed to load latest commit information.
man adjust dates to 2015
po rename to sleeptimer
scripts fix call to kill
src adjust dates to 2015
.gitignore update gitignore
.travis.yml move gettext fix to autogen
AUTHORS update email
COPYING added license info
INSTALL rename to sleeptimer adjust dates to 2015 adjust dates to 2015 adjust dates to 2015


Build Status

Sleeptimer is a LIRC-aware timer with an on-screen-display (OSD) that initiates the shut down sequence after a preset amount of time. It can be controlled by a single button on an infrared remote control (via LIRC) or by a single key on a keyboard.

It resembles what was (is?) commonly found in modern televisions, where it usually called a sleep timer.

Sleeptimer's dependencies are minimal and it can be run on any platform where xosd and LIRC (optionally) are available.



Sleeptimer is written in C and needs the following packages on Debian:

apt-get install libxosd-dev

If LIRC-support is required:

apt-get install liblircclient-dev

It can then be built by executing:

make install

Release tarballs that don't require autotools to be installed can be obtained from this site.


In the simplest case (i.e. no LIRC, systemd poweroff), you can just start sleeptimer by executing


and bind the


command to a key of your choice.


SLEEPTIMER(1)            User Commands           SLEEPTIMER(1)

       sleeptimer - a simple single-button lirc-aware shut down timer

       sleeptimer [OPTION]...

       Waits  for  LIRC  events or SIGUSR1 and sets a timer that will initiate
       the shut down sequence (via 'systemctl poweroff' by default)  when  the
       time is up. The timer's timeout decreases with each keypress by a spec‐
       ified amount of time.

       -f, --font
          font of the OSD text

       -c, --color
          color of the OSD text

       -t, --timeout
          timeout of the OSD text in seconds

       -y, --y-offset
          veritical offset of the OSD text in pixels

       -x, --x-offset
          horizontal offset of the OSD text in pixels

       -a, --align
          alignment of the OSD text; one of {l,c,r}

       -n, --no-lirc
          disable lirc

       -e, --execute
          command to execute when the time is up

       -d, --decrement
          number of minutes to decrement the counter by

       -m, --max
          maximum time of the counter in minutes

       -g, --grace
          time granted to cancel a scheduled shutdown in seconds

       Command Configuration
       First, sleeptimer needs to be able to shut the system down.

       On modern systems using systemd and polkit, this is possible by default
       using 'systemctl poweroff' and there is nothing more to configure.

       On  older  systems,  this  can  be  done in many different ways, but by
       default, sleeptimer executes 'sudo halt'. Therefore, the following line
       must be present in your /etc/sudoers and can be added using visudo(8).

       YOU ALL=(ALL) NOPASSWD: /sbin/halt

       where YOU is your username.

       Second,  sleeptimer  can  be  configured  to wait for a LIRC signal, an
       arbitrary command, or both.

       LIRC Configuration
       If LIRC is desired, append the following to your ~/.lircrc

           prog = sleeptimer
           button = YOUR_BUTTON
           config = sleep
           repeat = 1

       And press YOUR_BUTTON on your remote control. The name of a button  can
       be obtained using irw(1).

       Keyboard Configuration
       You can control sleeptimer by executing:


       or you can simply send the SIGUSR1 signal:

       kill -USR1 `pidof sleeptimer`.

       This command could be bound to a key on your keyboard.

       sleeptimer was written by Fabian Hirschmann <>.

       File that can be used to instruct sleeptimer to wait for a specific
       button on a remote control.

       Use a different shutdown command:
       sleeptimer -e "systemctl poweroff"

       Use a different font:
       sleeptimer    -f    "-misc-liberation        sans-medium-r-nor‐

       Set the maximum timeout to 120min with decrements of 10min:
       sleeptimer -m 120 -d 10


sleeptimer 0.4.2         October 2015            SLEEPTIMER(1)
Something went wrong with that request. Please try again.