PDA

View Full Version : Computer shutdown via anyremote



robi
December 10th, 2008, 05:57 PM
Hi

I would like to write a .cfg file for anyremote that would shutdown my computer. But I'm completely new to programing, so obviously I'm having some problems.
I use anyremote with Totem application and i want to be able to shutdown my computer after watching a movie via my phone.
Here is a part of Totem.cfg, that i changed to add shutdown command

TOTEM_MENU=Set(menu,add,Fullscreen,File Browser,Shutdown);
Shutdown=Exec(shutdown -h now)

but nothing happens when i start the command, probably because shutdown command must be run as root... If anyone has any ideas how to resolve this please let me know.

Thank you

mssever
December 10th, 2008, 10:39 PM
Hi

I would like to write a .cfg file for anyremote that would shutdown my computer. But I'm completely new to programing, so obviously I'm having some problems.
I use anyremote with Totem application and i want to be able to shutdown my computer after watching a movie via my phone.
Here is a part of Totem.cfg, that i changed to add shutdown command

TOTEM_MENU=Set(menu,add,Fullscreen,File Browser,Shutdown);
Shutdown=Exec(shutdown -h now)

but nothing happens when i start the command, probably because shutdown command must be run as root... If anyone has any ideas how to resolve this please let me know.

Thank you
Put sudo before your shutdown command. You'll probably have to modify your sudoers file so that you won't have to provide a password to shutdown.

By the way, the command poweroff is simpler to remember than shutdown -h now. See also halt and reboot.

robi
December 10th, 2008, 11:29 PM
I added sudo in front of a command, and i added:


%admin ALL = NOPASSWD: /sbin/shutdown

to sudoers file, and it works:D

Thank you very much