Results 1 to 8 of 8

Thread: Script to adjust brightness with mouse wheel

  1. #1
    Join Date
    May 2011
    Location
    /World/NZ/Auckland
    Beans
    436
    Distro
    Ubuntu 11.04 Natty Narwhal

    Script to adjust brightness with mouse wheel

    Ahoy oh wise Ubuntu users. I'm interested in writing a script to adjust the brightness of my screen when I scroll my mouse-wheel over the battery icon in the notification area. To make myself clear, you know how when you scroll your mouse wheel while hovering over the volume icon in the notification area (top panel for me), the volume is reduced or increased? Well, I'd like functionality like that for brightness when I hover over the battery (power management) icon.

    I have some programming knowledge, but I'm in need of some help.
    Is this kind of thing even possible?
    And if so, how I go about writing such a programme?
    What kind of script should I create?
    How do I invoke it by scrolling the mouse-button over the battery icon?

    Any help would be much appreciated.

    "Ubuntu speaks of the very essence of being human. It is to say, 'My humanity is caught up, is inextricably bound up, in yours.'" - Rev. Dr. Desmond Tutu.

    Don't forget to mark your thread as [SOLVED] (Here's how)

  2. #2
    hakermania's Avatar
    hakermania is offline Τώρα ξέρεις τι γράφω εδώ!
    Join Date
    Aug 2009
    Location
    Greece
    Beans
    1,705
    Distro
    Ubuntu Development Release

    Re: Script to adjust brightness with mouse wheel

    Of course it IS possible
    What you need in my opinion is the following:
    a) Read the source code of the volume icon (which works with the wheel) to find a way to work with a whell
    b) Find a terminal command to call it from your program which changes the brightness instead of increasing the volume.

    To be more specific, you could take the source of the volume notification icon and simply change
    a) The icon itself (its form, to have something like a sun or something that depicts brightness)
    b) The command that the volume icon uses to adjust volume


    It shouldn't be too hard

  3. #3
    Join Date
    May 2011
    Location
    /World/NZ/Auckland
    Beans
    436
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Script to adjust brightness with mouse wheel

    Cool, thanks for that, I'll take a look over the weekend, and post if I run into any issues.
    "Ubuntu speaks of the very essence of being human. It is to say, 'My humanity is caught up, is inextricably bound up, in yours.'" - Rev. Dr. Desmond Tutu.

    Don't forget to mark your thread as [SOLVED] (Here's how)

  4. #4
    Join Date
    Oct 2005
    Location
    Seattle, WA
    Beans
    494
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Script to adjust brightness with mouse wheel

    This would be pretty badass. Please followup!
    www.runtime-era.com - Blog About My Journey as a Developer

  5. #5
    Join Date
    May 2011
    Location
    /World/NZ/Auckland
    Beans
    436
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Script to adjust brightness with mouse wheel

    I will indeed. When/if I figure it out, I'll submit a HOWTO, and post a link here.
    "Ubuntu speaks of the very essence of being human. It is to say, 'My humanity is caught up, is inextricably bound up, in yours.'" - Rev. Dr. Desmond Tutu.

    Don't forget to mark your thread as [SOLVED] (Here's how)

  6. #6
    Join Date
    May 2011
    Location
    /World/NZ/Auckland
    Beans
    436
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Script to adjust brightness with mouse wheel

    Aw man, I feel unworthy of having running Ubuntu. Before getting up to my elbows in code, I decided to see what existed already. Right clicked the panel, Add to Panel, what did I see? Brightness Applet. All the functionality I wanted, without any work. Life's good.
    "Ubuntu speaks of the very essence of being human. It is to say, 'My humanity is caught up, is inextricably bound up, in yours.'" - Rev. Dr. Desmond Tutu.

    Don't forget to mark your thread as [SOLVED] (Here's how)

  7. #7
    hakermania's Avatar
    hakermania is offline Τώρα ξέρεις τι γράφω εδώ!
    Join Date
    Aug 2009
    Location
    Greece
    Beans
    1,705
    Distro
    Ubuntu Development Release

    Re: Script to adjust brightness with mouse wheel

    Quote Originally Posted by nzjethro View Post
    Aw man, I feel unworthy of having running Ubuntu. Before getting up to my elbows in code, I decided to see what existed already. Right clicked the panel, Add to Panel, what did I see? Brightness Applet. All the functionality I wanted, without any work. Life's good.
    LG but I hoped you'd managed to do that
    On the one hand its nice to make things on your own and on the other hand you shouldn't reinvent the wheel
    So, wait for another challenge

  8. #8
    Join Date
    May 2011
    Beans
    15

    Re: Script to adjust brightness with mouse wheel

    I've been looking all over, but is there a brightness applet for Ubuntu 11.04 with the Unity interface? (Not the Classic, aka, gNome 2 -Unity interface) I can't add things to the panel in the same way as 10.10, and would appreciate it if someone could point me in the right direction.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •