LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-06-2012, 09:27 PM   #1
Michal Krzyz
Member
 
Registered: Nov 2011
Distribution: OpenBSD, Ubuntu, Debian, Slackware, LFS
Posts: 44

Rep: Reputation: Disabled
OpenBox - question: how to make it simplier to execute command as root


Hello,
Using OpenBox rc.xml I want to bind W++ & W+- keys for changes on lcd backlight:

W++: increase brightness
(pseudo bash: echo (some data += 1) > /sys/class/backlight/acpi_video0/brightness)
W+-: decrease brightness
(pseudo bash: echo (some data -= 1) > /sys/class/backlight/acpi_video0/brightness)



problem is that I have to execute it as a root and I know it is possible to run it using gksudo 'echo...', but it isn't nice to type my root password each time when I want to perform step of brightness change. Do You know if there is any nice solution for this situation.

Thanks in advance.
 
Old 04-06-2012, 09:36 PM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
I do something similar with xbacklight in my windowmanager (wmii). xbacklight doesn't need root-privileges, may be that works for you, too.
A different approach would be to put your commands in a script and configure sudo in that way that your user can launch those scripts with sudo without a password.
 
1 members found this post helpful.
Old 04-07-2012, 07:06 AM   #3
Michal Krzyz
Member
 
Registered: Nov 2011
Distribution: OpenBSD, Ubuntu, Debian, Slackware, LFS
Posts: 44

Original Poster
Rep: Reputation: Disabled
Thanks a lot it is very good solution!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Execute root command without sudo tom4everitt Linux - General 8 01-29-2010 02:44 PM
execute command as root without inputing password deathalele Linux - General 6 03-19-2009 08:52 PM
Execute shortcut as Root Command? batorma Linux - Newbie 2 11-08-2005 02:22 PM
How to make a command execute on it every reboot? peterguo Linux - Software 5 11-04-2004 07:23 PM
Cant execute MAKE command Mandrake 10 kolchuga Mandriva 3 08-17-2004 09:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration