View previous topic :: View next topic |
Author |
Message |
crookedmaze n00b
Joined: 05 Jan 2013 Posts: 2
|
Posted: Sun Jan 06, 2013 3:15 pm Post subject: Permission Woes |
|
|
Hello fellow Gentoo Linux users!
I wasn't sure where to post so I decided to post here. I am having a bit of trouble (Permissions wise) with /sys/class/backlight/acpi_video0/brightness I wrote two scripts that change brightness one takes the value in /sys/class/backlight/acpi_video0/brightness and decrements it by 1 and the other one increments it when I use the fn + f5 (decrement) and fn + f6 (increment) keys. The problem is when I reboot the file permission is changed and the file is owned by root and the scripts don't work because they don't have permission. I tried making both of the scripts SUID and run as root but the script still fails unless I am in a root shell and run the script. I am thinking that maybe I could create a shell script that runs on startup and runs "sudo chown crookedmaze /sys/class/backlight/acpi_video0/brightness" but I am not sure how I should go about doing this or if this would be a viable solution to my problem.
To make the scripts SUID I did the following (perhaps I did something wrong here?)
Code: |
(Normal_User)$ sudo /bin/bash
(Root)# chmod u+s /bin/dec_brightness (this is my script that decrements brightness)
(Root)# chmod u+s /bin/inc_brightness (this is my script that increments brightness)
|
This is the script that I use to decrease brightness
Code: |
#!/bin/bash
#SCRIPT: dec_brightness
#PURPOSE: Decrease Brightness
FILENAME=/sys/class/backlight/acpi_video0/brightness
value=$(sed -n '1p' $FILENAME)
let value=$value-1
echo -n $value > /sys/class/backlight/acpi_video0/brightness
|
This is the script that I use to increase brightness
Code: |
#!/bin/bash
#SCRIPT: inc_brightness
#PURPOSE: Increase Brightness
FILENAME=/sys/class/backlight/acpi_video0/brightness
value=$(sed -n '1p' $FILENAME)
let value=$value+1
echo -n $value > /sys/class/backlight/acpi_video0/brightness
|
Also I am using KDE4
Thank you for taking the time to read my post!
-Crookedmaze _________________ The more I know the more I know I know nothing... |
|
Back to top |
|
|
PaulBredbury Watchman
Joined: 14 Jul 2005 Posts: 7310
|
|
Back to top |
|
|
crookedmaze n00b
Joined: 05 Jan 2013 Posts: 2
|
Posted: Sun Jan 06, 2013 5:01 pm Post subject: Re: Permission Woes |
|
|
Ok, Thank you! _________________ The more I know the more I know I know nothing... |
|
Back to top |
|
|
|