This is a simple GTK-based program written in C that allows you to toggle sleep inhibition (preventing the screen from automatically turning off) on Ubuntu Desktop.
- GTK 3 development libraries
- Install via:
sudo apt update && sudo apt install libgtk-3-dev
- Install via:
- Provides a small window with:
- A button to toggle sleep inhibition on and off.
- A label showing the current status of sleep inhibition, displayed in bold and color:
- Green text for "Enabled"
- Red text for "Disabled"
-
Build the Program
Runmake
in the project directory to compile the program intomain.out
. -
Run the Program
Execute the program with:./main.out
-
(Optional) If you want to register the compiled binary as an application for your Ubuntu Desktop, run
./register_as_app.sh
with a root(sudo
) permission. It eliminates the need of manually opening the terminal, finding the path ofmain.out
of this project, and manually run.sudo ./register_as_app.sh