Skip to content

A simple IDLE timer for any linux system whether it has a DE or it's headless

Notifications You must be signed in to change notification settings

0x0OZ/linux-idletimer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

linux-idletimer

A simple IDLE timer for any linux system whether it has a DE or it's headless


Because I have seen there is no easy way to detect system being IDLE without using Xorg or Wayland which actually mostly will not be a solution, for example when trying to see if system is Idle using from another user on Xorg it will fail, I came with this simple idea to read /dev/input/event* for any events the user perform, this will include keyboard or mouse movements, and it's easy to copy-paste this implementation to any codebase.


Requirements

You will need the g++ compiler and make installed. You also need to install libevdev library

# ubuntu
apt install libevdev-dev
# arch
pacman -S libevdev
# fedora
dnf install libevdev-devel

Build and Run

to build the project simple run the command

make

now before running the file, you need whether to use sudo or give the file permissions to read & execute on /dev/input/event*

sudo ./idletimer
# or 
sudo setfacl -R -m u:`whoami`:rx /dev/input

to clean the compilition run the command

make clean

About

A simple IDLE timer for any linux system whether it has a DE or it's headless

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published