Author Topic: Adjust screen brightness in Flux Box Edition  (Read 1094 times)

0 Members and 1 Guest are viewing this topic.

Offline bendavis

  • Neuling
  • *
  • Posts: 4
  • I'm new. Be nice!
    • BenDavis.me
  • Branch: Stable
  • Desktop: Gnome / Fluxbox / Pantheon
  • GPU Card: Intel + Nvidia GT 630m
  • GPU driver: non-free
  • Kernel: 4.1
  • Skill: Intermediate
Adjust screen brightness in Flux Box Edition
« on: 07. September 2015, 23:04:19 »
Hi there, new to Manjaro (and Arch as it goes) however I've used Fedora and Debian for many years now. I have to say Manjaro is fast! And I am truly loving all the well crafted and varied "spins" available. I don't think my usb stick has ever taken such a battering. Anyway, I digress.

I just thought I would share a little snippet to add screen brightness keys to fluxbox. As a laptop user I find this is crucial for prolonging battery life.

The snippet is as follows and can be added to your keys file which can be found in /home/yourusername/.fluxbox folder.

Code: [Select]
# Adjust screen brightness
none XF86MonBrightnessDown :Exec xbacklight -dec 10%
none XF86MonBrightnessUp :Exec xbacklight -inc 10%

Note that the XF86MonBrightnessDown/Up refers to my laptops' brightness up and down keys. Yours may be different so run the xev command in a terminal to see what your buttons come up as. I think a lot of modern laptops use this but I've been wrong before...

Hope this is useful to someone  ;D

Offline gohlip

  • Held Mitglied
  • *****
  • Posts: 1689
  • Desktop: OpenBox
  • GPU Card: nvidia
  • GPU driver: nonfree
  • Kernel: linux46 - x64
  • Skill: Intermediate
Re: Adjust screen brightness in Flux Box Edition
« Reply #1 on: 07. September 2015, 23:14:52 »
My old fluxbox works automatically for brightness buttons. It's a dell inspiron.
Anyway, welcome to Manjaro. I agree it's one of the best linux community (perhaps we try very hard to keep it that way, know what I mean?  ;D  ). Cheers.
Life is a sexually transmitted disease with a 100% mortality rate.

Offline oberon

  • Core Team
  • *****
  • Posts: 3858
  • I'm nice. Be new!
  • Branch: unstable
  • Desktop: i3, Deepin, Cinnamon
  • GPU Card: Intel ValleyView Gen7
  • GPU driver: Intel
  • Kernel: 4.1 / 4.4
  • Skill: Intermediate
Re: Adjust screen brightness in Flux Box Edition
« Reply #2 on: 08. September 2015, 00:04:01 »
Hi bendavis and welcome! :)
Thanks for your contribution.
On both my Acer laptops the brightness keys have been working fine with the preinstalled package cbatticon that delivers the tray-icon...
Obviously it's not working on every machine... I will see if I can include your keybinding without conflicts  - maybe I will just comment it out.
Or maybe I could even play with that cbatticon-app a bit ... let me see ::)
manjaro is addictive ::)
* manjaro-i3  * manjaro-cinnamon  * manjaro-deepin

Offline bendavis

  • Neuling
  • *
  • Posts: 4
  • I'm new. Be nice!
    • BenDavis.me
  • Branch: Stable
  • Desktop: Gnome / Fluxbox / Pantheon
  • GPU Card: Intel + Nvidia GT 630m
  • GPU driver: non-free
  • Kernel: 4.1
  • Skill: Intermediate
Re: Adjust screen brightness in Flux Box Edition
« Reply #3 on: 08. September 2015, 09:44:07 »
Wow two replies already - I do like this community!

Thanks for the info oberon, I don't have a brightness tray icon on my HP laptop for some reason. I have only been running it live so far - could that be the reason for its absence? That or my optimus setup? Now I know what I'm looking for, I'll read up on cbatticon and see if I can't figure it out.

Either way, thanks for the great spin. I'm very tempted to replace my fedora 22 install with this when I get a new sdd. It will fly!

Thanks for all your hard work and your welcomes  :)

Offline oberon

  • Core Team
  • *****
  • Posts: 3858
  • I'm nice. Be new!
  • Branch: unstable
  • Desktop: i3, Deepin, Cinnamon
  • GPU Card: Intel ValleyView Gen7
  • GPU driver: Intel
  • Kernel: 4.1 / 4.4
  • Skill: Intermediate
Re: Adjust screen brightness in Flux Box Edition
« Reply #4 on: 08. September 2015, 11:30:01 »
So are you saying, you have launched the live ISO as it is and you get not battery icon? ???
That's weird! Please checksum your download!
Meanwhile I have dug a little into cbatticon source code and could not really find out where the keybinding is located.
Then I tried uninstalling cbatticon and my brightness keys still work  ;D So obviously I was wrong with cbatticon being the provider of this functionality ;)
Also I could not find any other package to be responsible.
Strange also about your solution: When I add a notification with it I do see them when I use my keys - and that tells me that the key identifiers are indeed the same ...  :o
So. This is a bit mysterious to me ;)
Why not just stick with your addition to the keys-file if it works!? :)
manjaro is addictive ::)
* manjaro-i3  * manjaro-cinnamon  * manjaro-deepin

Offline oberon

  • Core Team
  • *****
  • Posts: 3858
  • I'm nice. Be new!
  • Branch: unstable
  • Desktop: i3, Deepin, Cinnamon
  • GPU Card: Intel ValleyView Gen7
  • GPU driver: Intel
  • Kernel: 4.1 / 4.4
  • Skill: Intermediate
Re: Adjust screen brightness in Flux Box Edition
« Reply #5 on: 08. September 2015, 11:33:31 »
I don't have a brightness tray icon on my HP laptop for some reason.
Ah sorry, now I understand I think.
Cbatticon is not a brightness-icon! It's just the battery icon.
I was simply suspecting it for supplying the brightness funcionality because in other environments xfce4-power-manager does the same.
This by the way would be another option for you: You could get rid of cbatticon and install
Code: [Select]
sudo pacman -S xfce4-power-manager and then autostart that one in ~/.fluxbox/startup instead.
But again: If it works with your keybindings, why bother... ;)
manjaro is addictive ::)
* manjaro-i3  * manjaro-cinnamon  * manjaro-deepin

Offline bendavis

  • Neuling
  • *
  • Posts: 4
  • I'm new. Be nice!
    • BenDavis.me
  • Branch: Stable
  • Desktop: Gnome / Fluxbox / Pantheon
  • GPU Card: Intel + Nvidia GT 630m
  • GPU driver: non-free
  • Kernel: 4.1
  • Skill: Intermediate
Re: Adjust screen brightness in Flux Box Edition
« Reply #6 on: 08. September 2015, 13:47:43 »
That makes sense about cbatticon. My sleepy morning brain didn't twig what it's likely job was - I certainly do have a battery icon!

Oberon, do you specify the vendor backlight in your grub boot command? Or perhaps in your ACPI settings? Keystrokes, specifically those that have a specific job (brightness, volume, WiFi toggle etc) I'm pretty sure are normally picked and controlled by X. Hence why your key identifiers are the same. The only reason I can think of that I need to bind my keys manually and you don't is because I'm not using the vendor prefix as I've only run live so far. Maybe...  ;)

I'll have a poke around when I get home from work. Your spin has really intrigued me as I've always loved the speed and simplicity of fluxbox. I feel a blog post extolling its virtues coming on  :D

P.S why don't you have your own forum page yet? Because you should do!

Offline oberon

  • Core Team
  • *****
  • Posts: 3858
  • I'm nice. Be new!
  • Branch: unstable
  • Desktop: i3, Deepin, Cinnamon
  • GPU Card: Intel ValleyView Gen7
  • GPU driver: Intel
  • Kernel: 4.1 / 4.4
  • Skill: Intermediate
Re: Adjust screen brightness in Flux Box Edition
« Reply #7 on: 08. September 2015, 14:11:04 »
Thank you, bendavis! :)
Good point about the vendor backlight settings. I used to have to set them specifically, but recently I realized that they appear to be taken care of by the nevest kernels automatically and it is working live, too...  - just maybe it's not working for your hardware plus live.
Keep us posted in any case!  8)
manjaro is addictive ::)
* manjaro-i3  * manjaro-cinnamon  * manjaro-deepin