Coder Social home page Coder Social logo

lightwave's Introduction

Lightwave

Lightwave is a lightweight command-line tool designed to manage screen brightness on Linux systems. Written in Rust, Lightwave allows users to easily adjust the brightness of their screens through a clean and efficient interface.

Features:

  • View current brightness level.
  • Set a new brightness level within the allowable range.
  • Increase or decrease brightness by a specified amount.
  • Simple and intuitive command usage.

Lightwave supports single backlight devices typically found on most Linux distributions, including Arch Linux. It provides a straightforward way to control screen brightness from the terminal.

Installation

To build and install Lightwave, you'll need to have Rust installed. Follow these steps:

  1. Clone the repository:

    git clone https://github.com/monikeo281000/lightwave.git
    cd lightwave
  2. Build the project:

    cargo build --release
  3. Install the tool

    sudo cp target/release/lightwave /usr/local/bin/
  4. Run the tool (you may need sudo to adjust brightness):

    sudo lightwave [option]

Usage

Lightwave provides several commands to control screen brightness. You may need sudo to adjust the brightness.

  1. View the current brightness level

    lightwave get
  2. View the maximum allowable brightness level

    lightwave get-max
  3. Set a new brightness level

    sudo lightwave set <value>
  4. Increase the brightness by a specified amount

    sudo lightwave increase <value>
  5. Decrease the brightness by a specified amount

    sudo lightwave decrease <value>

Where is the amount to decrease the brightness by.

For more information and additional commands

lightwave --help

Example Hyprland Setup

To integrate Lightwave with Hyprland for brightness control via keyboard shortcuts, add the following lines to your Hyprland configuration file:

binde = , XF86MonBrightnessUp, exec, lightwave increase 4
binde = , XF86MonBrightnessDown, exec, lightwave decrease 4

These bindings will allow you to increase or decrease the brightness using the respective function keys.

bind supports flags in this format
e -> repeat, will repeat when held.

Permission Issues

If you encounter permission issues when trying to control the brightness, please check the ownership and permissions of the Lightwave binary

  1. Check ownership and permissions

    ls -l /usr/local/bin/lightwave

    Ensure the owner is root and the permissions are set correctly

  2. Set the correct permissions

    sudo chown root:root /usr/local/bin/lightwave
    sudo chmod u+s /usr/local/bin/lightwave

    This sets the setuid bit, allowing the binary to run with root privileges.

  3. If the issue persists

    sudo chmod u+x /usr/local/bin/lightwave

    This ensures the binary is executable.

License

Lightwave is licensed under the MIT License. See the LICENSE file for more information.

lightwave's People

Contributors

monikeo avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.