maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Permissions when running python curses script (https://talk.maemo.org/showthread.php?t=81976)

TheStatsMan 2012-01-30 01:12

Permissions when running python curses script
 
I whipped up a little python script that uses curses (just for fun). The script simply changes the sound volume on the ringer for a user specified amount of time. It calls amixer to do this. If I run it with root permissions it works fine, however I am not sure how to obtain the appropriate permissions when running it from an icon in the applications menu. I installed it in /opt/silent_time and the script is called sound.py. In the .desktop file I am trying to run it with this command

Exec=/usr/bin/meego-terminal -n -e python /opt/silent_time/sound.py

Now it appears to be working when I click on the icon in the applications menu and for options in the UI that don't require root permissions it works without a problem, however when I choose options that call amixer that does require root conditions, it fails. It reports the same error one would get if trying to run amixer from the command line without root permissions.

How do get the file to run with the required permissions for amixer to work when running it by pressing on an icon.


All times are GMT. The time now is 23:09.

vBulletin® Version 3.8.8