Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    [Anounce] [N9] Volume/Power Button Monitor

    Reply
    Page 6 of 30 | Prev |   4     5   6   7     8   16 | Next | Last
    guillermorojaz | # 51 | 2012-04-07, 01:45 | Report

    HOLA. congratulations on your work. I find it very ineresante.
    You could create a script to:
    VOLUME + = torch - on
    VOLUME - = torch - off
    I would greatly appreciate it

    Edit | Forward | Quote | Quick Reply | Thanks

     
    wolke | # 52 | 2012-04-07, 03:07 | Report

    Originally Posted by guillermorojaz View Post
    HOLA. congratulations on your work. I find it very ineresante.
    You could create a script to:
    VOLUME + = torch - on
    VOLUME - = torch - off
    I would greatly appreciate it
    gracias!
    v0.4 supports this, through modification of the config file
    paste the below code into /home/user/.config/n9-button-monitor.conf

    Code:
    #just to torch on/off for guillermorojaz
    torchAutoShutOffTimeMs=60000
    longClickDelayMs=400
    doubleClickDelayMs=400
    trebleClickDelayMs=600
    action=torchOn,volumeUp,singleClick,screenLocked
    action=torchOff,volumeDown,singleClick,screenLocked
    p.s.: if anyone should be overwhelmed with charitable urges and needs an outlet, ive added a flattr button and a paypal email to the first post.

    p.p.s.: be careful with these easy on/off buttons for torch; the flash could turn on in your pocket.
    the example above auto-turns off after 60 seconds, as a precaution against this. you can make it last longer by changing 'torchAutoShutOffTimeMs=60000' to your liking. to make the flash stay on for an hour, change it from '60000' to '3600000'.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to wolke For This Useful Post:
    F2thaK

     
    F2thaK | # 53 | 2012-04-07, 04:15 | Report

    This is getting really good. Im yet to use it. A GUI would be awesome, I would donate if you get that far!

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to F2thaK For This Useful Post:
    Watchmaker

     
    guillermorojaz | # 54 | 2012-04-07, 05:08 | Report

    Release where the components python?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    wolke | # 55 | 2012-04-07, 05:23 | Report

    Originally Posted by guillermorojaz View Post
    Release where the components python?
    not sure what youre asking me;

    follow the installation instructions in the first post, and then add the config file i put in the post above. {the release im talking about is the 'v0.4' link.}

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to wolke For This Useful Post:
    guillermorojaz

     
    GuSec | # 56 | 2012-04-07, 13:41 | Report

    I've tried for hours now. It is impossible to get it to autostart. Seriously what should I do?
    Code:
    description "Startup script for n9-button-monitor"
    
    # Author e-mail address, mandatory
    author "elliot.wolk@gmail.com"
    
    start on filesystem or runlevel [2345]
    stop on runlevel [!2345]
    
    #none: stdout to /dev/null
    #output: direct stdout to console
    console output
    
    #if application exits, restart max 3 times within 300 secs
    respawn
    #respawn limit 3 300
    
    exec /usr/bin/aegis-exec -s -u user sh -c 'source /etc/profile; PATH=$PATH:/usr/local/bin; develsh -c n9-button-monitor'
    #exec sh -c 'source /etc/profile; PATH=$PATH:/usr/local/bin; develsh -c n9-button-monitor'
    #exec /usr/bin/aegis-exec -s -u user sh -c 'DISPLAY=:0 n9-button-monitor'
    How can I debug it?

    Now I can't start it at all from terminal. Can't get necessary permissions from develsh. How is this possible? Is aegis having fun giving permissions one day and blocking them the next?

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by GuSec; 2012-04-07 at 14:19.

     
    wolke | # 57 | 2012-04-07, 15:57 | Report

    Originally Posted by GuSec View Post
    I've tried for hours now. It is impossible to get it to autostart. Seriously what should I do?
    Code:
    description "Startup script for n9-button-monitor"
    
    # Author e-mail address, mandatory
    author "elliot.wolk@gmail.com"
    
    start on filesystem or runlevel [2345]
    stop on runlevel [!2345]
    
    #none: stdout to /dev/null
    #output: direct stdout to console
    console output
    
    #if application exits, restart max 3 times within 300 secs
    respawn
    #respawn limit 3 300
    
    exec /usr/bin/aegis-exec -s -u user sh -c 'source /etc/profile; PATH=$PATH:/usr/local/bin; develsh -c n9-button-monitor'
    #exec sh -c 'source /etc/profile; PATH=$PATH:/usr/local/bin; develsh -c n9-button-monitor'
    #exec /usr/bin/aegis-exec -s -u user sh -c 'DISPLAY=:0 n9-button-monitor'
    How can I debug it?

    Now I can't start it at all from terminal. Can't get necessary permissions from develsh. How is this possible? Is aegis having fun giving permissions one day and blocking them the next?
    sucks. i also had tons of trouble getting my autostart script to work, and that was on openmode.

    my current hypothesis for your problem is that its running at startup with incorrect permissions, and then somehow mucking you up.

    1) try starting and stopping them manually, instead of restarting. {if you change the /etc/init file, start/stop pick up on the changes instantly.}
    /sbin/stop n9-button-monitor
    /sbin/start n9-button-monitor

    2) try putting the n9-button-monitor.conf in /etc/init instead of /etc/init/apps; /etc/init/apps scripts have restrictions on what they can and cant say about starting and stopping, and setting nice values, etc.

    3) try variations on the exec like youve been doing. use full paths to executables, and try the simpler stuff first.
    e.g.:
    exec /usr/bin/n9-button-monitor
    exec /bin/sh -c /usr/bin/n9-button-monitor

    4) verify no other instances are running, with pidof n9-button-monitor {killall -9 n9-button-monitor}. make PIDs show up after starting the job, and make sure stop says its really stopping the job, instead of it wasnt running at all.


    here is a script that should work for you {only in /etc/init, not in /etc/init/apps}

    /etc/init/n9-button-monitor.conf
    Code:
    description "Startup script for n9-button-monitor"
    author "elliot.wolk@gmail.com"
    
    start on DESKTOP_VISIBLE
    stop on core_shutdown
    
    console none
    respawn
    
    exec /bin/develsh -c 'source /etc/profile; /usr/bin/n9-button-monitor'
    note that i need /usr/local/bin on my path ONLY because i use the cmd() action in my config, for execs that i stuck in /usr/local/bin.
    e.g.: i pause my music like this
    action=cmd(udo klomp-cmd pause),volumeUp,singleClick,screenLocked

    source /etc/profile is necessary to get the dbus session.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to wolke For This Useful Post:
    optimaxxx

     
    wolke | # 58 | 2012-04-07, 17:54 | Report

    yea, it seems like you cant run things as root from /etc/init/apps in closed mode. put it in /etc/init

    if we cant do that, i think we need to bring inception into the picture

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Jare | # 59 | 2012-04-13, 00:10 | Report

    Originally Posted by wolke View Post
    Originally Posted by GuSec View Post
    I've tried for hours now. It is impossible to get it to autostart. Seriously what should I do?
    Code:
    exec /usr/bin/aegis-exec -s -u user sh -c 'source /etc/profile; PATH=$PATH:/usr/local/bin; develsh -c n9-button-monitor'
    #exec sh -c 'source /etc/profile; PATH=$PATH:/usr/local/bin; develsh -c n9-button-monitor'
    #exec /usr/bin/aegis-exec -s -u user sh -c 'DISPLAY=:0 n9-button-monitor'
    How can I debug it?

    Now I can't start it at all from terminal. Can't get necessary permissions from develsh. How is this possible? Is aegis having fun giving permissions one day and blocking them the next?
    sucks. i also had tons of trouble getting my autostart script to work, and that was on openmode.

    my current hypothesis for your problem is that its running at startup with incorrect permissions, and then somehow mucking you up.
    "You are holding it wrong."


    Your approach won't work even with Inception. You have to do a proper debian package, which contains the needed _aegis and digsigsums files. Otherwise "root" will not be able to execute the scripts or python application as "user". Aegis-exec won't give you permissions, if those aren't requested in the first place (during installation).

    Here is an example _aegis file:
    Code:
    <aegis>
            <request>
                    <credential name="UID::user" />
                    <credential name="GID::users" />
                    <credential name="GRP::users" />
                    <for path="/opt/n9-button-monitor/start.sh" />
                    <for path="/opt/n9-button-monitor/stop.sh" />
                    <for path="/opt/n9-button-monitor/n9-button-monitor.py" />
            </request>
    </aegis>
    You should find out, which credentials your application needs in addition to the listed above. There will be no need to use "develsh" in order to start the application, when you have included the needed credentials in the _aegis file.

    The upstart script will work after installing a debian package with this file and correct digsigsums included. Digsigsums should be added for "n9-button-monitor.py", "start.sh" and "stop.sh". In order to autostart the application as "user", you need to execute it like this:
    Code:
    exec /usr/bin/aegis-exec -s -l -u user /opt/n9-button-monitor/start.sh
    All third party upstart scripts must be in "/etc/init/apps" or they won't be executed during startup.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to Jare For This Useful Post:
    optimaxxx

     
    wolke | # 60 | 2012-04-13, 18:27 | Report

    Originally Posted by Jare View Post
    "You are holding it wrong."

    Your approach won't work even with Inception. You have to do a proper debian package, which contains the needed _aegis and digsigsums files. Otherwise "root" will not be able to execute the scripts or python application as "user". Aegis-exec won't give you permissions, if those aren't requested in the first place (during installation).
    mmhmm, i was in the middle of making such a deb last weekend, but my jobby job got jobby.

    p.s.: is there really no way to put a file in /etc/init even with an incepted deb? nokia debs put stuff there; i guess those debs update the immutable-dir hash somehow.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Page 6 of 30 | Prev |   4     5   6   7     8   16 | Next | Last
vBulletin® Version 3.8.8
Normal Logout