Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Make screen brightness settings stick

  1. #11
    Join Date
    May 2010
    Location
    Australia
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Make screen brightness settings stick

    Code:
    #!/bin/bash
    
    ksystraycmd --startonshow --keeprunning --tooltip "Adjust Screen" --icon application-pgp-signature ~/.screen_brightness.sh
    Above is a small script which you can make executable and add to autostart. It will place an icon in your sys_tray on startup by which you can toggle on/off your existing script (which for this purpose I have referred to as ".screen_brightness.sh"), and I have assumed lives in your home folder. (note the . (hidden file)). Names and file locations of course can be changed to your liking

    But only add the above script to autostart as this script will then call your script as required.
    Why your script needs root privileges to function I really don't know. If it is owned by you, and not root, does it still function? I can't imagine screenbrightness settings needing elevated privileges TBH.

    But i'm not a bash expert by any means. Perhaps others might be able to offer some advice on this?

  2. #12
    Join Date
    May 2009
    Location
    Planet Earth
    Beans
    201
    Distro
    Xubuntu 12.04 Precise Pangolin

    Re: Make screen brightness settings stick

    Thanks! I'll give that system-tray script a go. Does the screen_brightness.sh need to be hidden for some special reason? (Right now, it isn't, but I can certainly do that.)

    The existing script is owned by me and executable by me. When I try to run it without permissions I get this error:
    Code:
    pcilib: Cannot open /sys/bus/pci/devices/0000:00:02.0/config
    int main() {
    insert_clever_signature();
    return 0;
    }

  3. #13
    Join Date
    May 2010
    Location
    Australia
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Make screen brightness settings stick

    Please check the contents of /etc/pm/sleep.d/ for files relating to resume/wake.
    Check any files with a text editor and *hopefully* you will recognize some code.
    Here is the contents of 1 file here,
    Code:
    #!/bin/sh
    #
    # 90alsa: suspend/wakeup ALSA devices
    
    case "$1" in
    hibernate|suspend)
    ;;
    thaw|resume)
    aplay -d 1 /dev/zero
    ;;
    *) exit $NA
    ;;
    esac
    I wonder if your script can't be incorporated into this one or called from this alternatively?

Page 2 of 2 FirstFirst 12

Tags for this Thread

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
  •