maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   How to do something to make cmd-shortcuts be root ? (https://talk.maemo.org/showthread.php?t=71976)

cooperpeng 2011-04-10 15:34

How to do something to make cmd-shortcuts be root ?
 
I use cmd-shortcuts to do a commandline with terminal. But it always permission deny. Can I do something to get root with cmd-shortcuts app?

nicholes 2011-04-10 15:44

Re: Hot to do something to make cmd-shortcuts be root ?
 
i use shorcut maker (but did not work with rooot) actually i am also looking somethig wich can make a shortcut for rooted cmd and one for python

here are code i want to make shortcut for them

1> echo 0 >/sys/class/backlight/acx565akm/brightness (need sudo gainroot)


2>from my own thread where nicolai helped me to make n900's camera a spy cam(thanks to nicolai)

http://talk.maemo.org/showthread.php?t=71326&page=2


python


import gst
bin = gst.element_factory_make("camerabin")
bin.set_property("videoenc", gst.element_factory_make("dspmp4venc"))
bin.set_property("videomux", gst.element_factory_make("hantromp4mux"))
bin.set_property("audioenc", gst.element_factory_make("nokiaaacenc"))
bin.set_state(gst.STATE_PLAYING)
bin.set_property("filename", "test.mp4")
bin.set_property("mode",1)
#starts recording
bin.emit("user-start")

# wait some time

# stops recording
bin.emit("user-stop")
bin.set_state(gst.STATE_PAUSED)
bin.set_state(gst.STATE_NULL)

JohnLF 2011-04-10 15:50

Re: Hot to do something to make cmd-shortcuts be root ?
 
use
Code:

sudo gainroot < "your command here"
e.g.
Code:

sudo gainroot < "echo This is root"

nicholes 2011-04-10 15:56

Re: Hot to do something to make cmd-shortcuts be root ?
 
Quote:

Originally Posted by JohnLF (Post 985096)
use
Code:

sudo gainroot < "your command here"
e.g.
Code:

sudo gainroot < "echo This is root"

does it makes shortcut inthe menu?????????

cooperpeng 2011-04-11 02:45

Re: How to do something to make cmd-shortcuts be root ?
 
Hi,
I do
Code:

sudo gainroot < "echo 0 >/sys/class/backlight/acx565akm/brightness"
Result is
-sh: cannot open echo 0 >/sys/class/backlight/acx565akm/brightness: no such file
so that it is no work in shortcuts by user mode.

Another way, how to do cmd shortcuts become to root mode? Have any idea?

kitwalker 2011-04-11 03:07

Re: How to do something to make cmd-shortcuts be root ?
 
I've mentioned a trick to do this in another thread post here. See if that works for you.

cooperpeng 2011-04-11 05:45

Re: How to do something to make cmd-shortcuts be root ?
 
Quote:

I've mentioned a trick to do this in another thread post here. See if that works for you.
It like good idea, but it didn't work.:(
I try
Code:

sh -c 'echo 0 > /sys/class/backlight/acx565akm/brightness | sudo gainroot'
sh: cannot create /sys/class/backlight/acx565akm/brightness: Permission denied
Root shell enabled

I see the link, get the file "disable_ts.desktop". The code is " Exec=/bin/busybox sh -c 'echo "sleep 15; echo 1 > /sys/devices/platform/omap2_mcspi.1/spi1.0/disable_ts" | sudo gainroot' "
so I try
Code:

/bin/busybox sh -c 'echo 0 > /sys/class/backlight/acx565akm/brightness | sudo gainroot'
But it was the same.:(
In fact, I just run my app.py using by cmd shortcuts launching. But it will modify /sys file so that be permission deny. If it's running in terminal is good by root privilege.

nicholes 2011-04-11 06:25

Re: How to do something to make cmd-shortcuts be root ?
 
@cooperpeng

does this code makes shortcut in the emnu?? can i make shortcut for my code mentioned in ur thread?or you are talking about queen becon or something?

kitwalker 2011-04-11 06:30

Re: How to do something to make cmd-shortcuts be root ?
 
Quote:

Originally Posted by cooperpeng (Post 985359)
It like good idea, but it didn't work.:(
I try
Code:

sh -c 'echo 0 > /sys/class/backlight/acx565akm/brightness | sudo gainroot'
sh: cannot create /sys/class/backlight/acx565akm/brightness: Permission denied
Root shell enabled

I see the link, get the file "disable_ts.desktop". The code is " Exec=/bin/busybox sh -c 'echo "sleep 15; echo 1 > /sys/devices/platform/omap2_mcspi.1/spi1.0/disable_ts" | sudo gainroot' "
so I try
Code:

/bin/busybox sh -c 'echo 0 > /sys/class/backlight/acx565akm/brightness | sudo gainroot'
But it was the same.:(
In fact, I just run my app.py using by cmd shortcuts launching. But it will modify /sys file so that be permission deny. If it's running in terminal is good by root privilege.

Use it this way:

Code:

sh -c 'echo "sleep 1; echo 0 > /sys/class/backlight/acx565akm/brightness" | sudo gainroot'

cooperpeng 2011-04-11 07:08

Re: How to do something to make cmd-shortcuts be root ?
 
Quote:

Use it this way:

Code:

sh -c 'echo "sleep 1; echo 0 > /sys/class/backlight/acx565akm/brightness" | sudo gainroot'

Oh! My god!!!
It is work. :D
Very thanks by kitwalker.

What's diff.? It's amazing!!
Code:

sh -c 'echo "sleep 1; echo 0 > /sys/class/backlight/acx565akm/brightness" | sudo gainroot'
"sleep 1;" is key point.


All times are GMT. The time now is 11:17.

vBulletin® Version 3.8.8