Giter Site home page Giter Site logo

coffeeandc0d3 / brightness-controller.non-hardware.controller Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 69 KB

sub-optimal GUI to adjust brightness through software-rendering rather than the hardware controller

Home Page: https://github.com/coffeeandc0d3/gui-brightness-controller.non-hardware.controller

Java 93.77% Shell 6.23%
lenovo legion brightness screen xrandr pop-os linux-mint java arch debian

brightness-controller.non-hardware.controller's Introduction

gui-brightness-controller.non-hardware.controller

sub-optimal GUI to adjust brightness through software-rendering rather than the hardware controller (as best i understand). can only confirm it works to change brightness levels for my Legion Slim 7 on Pop OS and Linux Mint. Brightness did not work prior on fresh installs of both Pop and Mint. Resorted to using xrandr in the terminal to change it but figured a simple GUI with a slider would be convenient until/if we get full hardware compatbility. Haven't tested further to confirm support for other Lenovo Legions unfortunately. Other than the small GUI display for the brightness controller, the only thing this script does is invoke: xrandr --output DP-4 --brightness value where value is grabbed from the current value of the slider.

Note The above command uses a specific display identifier (DP-4), but this likely won't be yours. To find your identifier launch a terminal and type:

xrandr | grep -w connected | awk -F'[ ]' '{print $1}'

Example Output: DP-4

Auto run script will pass the 2 arguments needed for you, but these are them in case you're curious:

[Note You'll need both parameters enclosed with a backtick (`), not the apostrophe]

-1st argument gives program your system's current brightness,

Exanple Input of 1st Argument (enclosed with backticks, but they might not be visible) xrandr --verbose | awk '/ connected /{}/Brightness:/{print $2}

2nd Argument gives program your system's connected display identifier xrandr | grep -w connected | awk -F'[ ]' '{print $1}'

[To Run]

Clone the repo into a ~/build directory.

Execute the ./run.sh script to run the GUI.

sudo chmod u+x run.sh

(optional) cp run.sh /home/$USER

./run.sh

if you want to run manually:

javac solve.java

java solve xrandr --verbose | awk '/ connected /{}/Brightness:/{print $2}' xrandr | grep -w connected | awk -F'[ ]' '{print $1}'

Note The above 2 parameters need to be enclosed with backticks (`), they won't show on Github.

*Tips: This can be useful as a panel plugin that could run the above command when the plugin is clicked on. See https://github.com/levimake/xfce4-genmon-panel-scripts An example (xfce-only) would be adding one of the Genmon Monitor plugins to your XFCE panel and having the plugin run bash /home/$your-name/your-script.sh and inside this script.sh you would have an on-click command: java solve arg0 arg1 (with back-ticks (`) enclosing arg0-1)

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.