maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   Flashing Keyboard lights as patterns (https://talk.maemo.org/showthread.php?t=52239)

Andre Klapper 2010-05-10 10:48

Re: Flashing Keyboard lights as patterns
 
Quote:

Originally Posted by nokiaboy97 (Post 651280)
could someone PM or e-mail me a step by step walk throuhgh of how to apply scripts?

Google for "linux shell script"? :)
Basically you mark a script file as executable and then you can run it.
chmod is your friend.

Pigro 2010-05-10 11:13

Re: Flashing Keyboard lights as patterns
 
ah, shiny toys! As an enhancement proposal: if you place a solar cell beside the keyboard during the light show, and wire it up to the phone's power input, you will have cracked the battery life issue too :-)

(sorry, couldn't resist ... I know the LED flashing is just harmless fun, but it did make me smile to run it on a device that is so "mAh-challenged").

rash.m2k 2010-05-10 14:45

Re: Flashing Keyboard lights as patterns
 
This is cool!

Lets see and iphone do this - oh wait it don't have a keyboard! :D

F2thaK 2010-05-11 11:07

Re: Flashing Keyboard lights as patterns
 
this looks so much better when you do it yourself!

cddiede 2010-05-11 16:51

Re: Flashing Keyboard lights as patterns
 
I'm trying to make a KR.desktop entry that will let me run this from a menu Icon, but I'm stuck due to the root access requirement.

I tried making a script that ran something like:

sudo gainroot;/usr/bin/python /opt/liqbase/KR/KR.py
or
sudo gainroot /usr/bin/python /opt/liqbase/KR/KR.py

But that just dumps the script out at a root prompt and fails to execute KR.py until after the root shell is exited.

Is it possible to post a script to that would not require root privileges to flash the keyboard lights?

lcuk 2010-05-11 16:54

Re: Flashing Keyboard lights as patterns
 
cddiede the script is a prototype and we are looking at how to enable playing with the lighting combinations without requiring root for every single app that uses it.
tho its most likely going to be a bit tricky

qwerty12 2010-05-11 16:58

Re: Flashing Keyboard lights as patterns
 
Quote:

Originally Posted by lcuk (Post 653809)
cddiede the script is a prototype and we are looking at how to enable playing with the lighting combinations without requiring root for every single app that uses it.
tho its most likely going to be a bit tricky

Do an MCE and make a D-Bus service! Or, more simply, just add exceptions in sudoers

MohammadAG 2010-05-11 16:59

Re: Flashing Keyboard lights as patterns
 
Quote:

Originally Posted by qwerty12 (Post 653821)
Do an MCE and make a D-Bus service! Or, more simply, just add exceptions in sudoers

afaik, sudoers would work for echoing into sysfs (I have sudo enabled for all binaries)

Edit: wouldn't*

lcuk 2010-05-11 17:06

Re: Flashing Keyboard lights as patterns
 
Quote:

Originally Posted by MohammadAG (Post 653829)
afaik, sudoers would work for echoing into sysfs (I have sudo enabled for all binaries)

i think MohammadAG is a pretty cool guy
eh runs all binaries as root as doesn't afraid of anything ;)

for normal users however I think a simpler approach would be required.

MohammadAG 2010-05-11 17:08

Re: Flashing Keyboard lights as patterns
 
Quote:

Originally Posted by lcuk (Post 653841)
i think MohammadAG is a pretty cool guy
eh runs all binaries as root as doesn't afraid of anything ;)

for normal users however I think a simpler approach would be required.

lol it shouldn't affect security, a lot... :P
Code:

~ $ sudo echo 0 > /sys/class/i2c-adapter/i2c-2/2-0032/leds\:lp5523\:kb1/brightness     
-sh: cannot create /sys/class/i2c-adapter/i2c-2/2-0032/leds:lp5523:kb1/brightness: Permission denied

Code:

echo "/path/to/script.sh" | root
should work though

On its own I can't see why it needs a .desktop file and .deb package, otherwise I would've made them. It doesn't even have a GUI (yet)


All times are GMT. The time now is 21:16.

vBulletin® Version 3.8.8