Tired is a command-line utility designed to manage screen brightness by gradually dimming the display after a specified period of inactivity. This tool replicates the grace period and sleep dimming behavior found in macOS systems.
This project is inspired by Simon Ser's chayang, a tool that gradually dims the screen on Wayland. Through studying chayang, I gained valuable insights into Wayland development, which informed the creation of Tired.
- Customizable Hold Time: Define the duration of inactivity before the screen begins to dim.
- Adjustable Dim Speed: Control the rate at which the screen dims once the hold time has elapsed.
- Configurable Dim Brightness: Set the brightness level during the dim period.
- Pre-Exit Command Execution: Optionally execute a specific command before the program exits.
To install Tired, follow these steps:
On Arch Linux, you can install tired-git from the AUR using an AUR helper like yay or paru:
paru -S tired-gitEnsure the following dependencies are installed:
- CMake (version 3.10 or higher): A cross-platform build system.
- Wayland Client Libraries: Required for Wayland support.
sudo apt-get update
sudo apt-get install cmake libwayland-client-devsudo pacman -S cmake waylandgit clone https://github.com/yourusername/tired.git
cd tiredCreate a build directory and compile the project using CMake:
mkdir build
cd build
cmake ..
makeAfter a successful build, install the tired executable:
sudo make installBy default, this installs tired to /usr/local/bin/. You can specify a different installation directory by setting the CMAKE_INSTALL_PREFIX during the CMake configuration step:
cmake -DCMAKE_INSTALL_PREFIX=/your/desired/path ..Usage: tired [options]
Options:
-t, --hold-time <ms> Set hold time in milliseconds (default: 15000)
-d, --dim-speed <ms> Set dim speed in milliseconds (default: 250)
-b, --brightness <0-100> Set the brightness of the display when in dim period (default: 30)
-c, --command <cmd> Command to execute before exiting
-h, --help Show this help messageMy personal usage:
tired -t 20000 -c "swaymsg output eDP-1 power off; gtklock -d"In this example:
-t 20000: Sets grace period to 20 seconds.-c "swaymsg output eDP-1 power off; gtklock -d": Executes the command to turn off theeDP-1display and then locks the screen usinggtklockbefore exiting.
We welcome contributions! If you'd like to contribute to Tired, please follow these steps:
-
Fork the Repository: Click the "Fork" button at the top right of this page.
-
Clone Your Fork:
git clone https://github.com/yourusername/tired.git cd tired -
Create a New Branch:
git checkout -b feature/your-feature-name
-
Make Your Changes: Implement your feature or fix.
-
Commit Your Changes:
git commit -m "Add your commit message here" -
Push to Your Fork:
git push origin feature/your-feature-name
-
Open a Pull Request: Navigate to the original repository and open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.