PDA

View Full Version : [Anounce] [N9] Volume/Power Button Monitor


Pages : [1] 2

wolke
2012-02-23, 20:11
Add actions to volume/power/proximitySensor from lockscreen, camera, and other apps.

N9 Button Monitor (https://openrepos.net/content/teleshoes/n9-button-monitor) | mt-toggle for n9bm (https://openrepos.net/content/teleshoes/n9bm-toggle)

Highlights:

Toggle flashlight/torch from lockscreen
Take pictures from lockscreen {quickSnap}
Focuses/snaps pix in camera, using VOL+ instead of touch-button
Music suite lockscreen controls
Take a screenshot {goes into MyDocs}


Features:

Run arbitrary commands or certain builtin actions
Per-screen actions {do different things in lockscreen, camera, FBReader, mplayer, etc.}
Buttons: proximitySensor, volumeUp, volumeDown, cameraBtn {n950}, powerBtn, bluetoothHeadsetButtons
Click patterns: single-click, double-click, treble-click, long-click-start, long-click-stop
Simple config file, plus an ugly gui for editing it if you really want.
Changes are automatically picked up without restart when you edit or use the gui.
Optional mt-toggle for turning on/off



Installation:
dpkg --force-depends -i n9-button-monitor_*.deb
#force-depends installs dependencies, like apt-get -f install


https://github.com/teleshoes/n9-button-monitor

config file is located at /home/user/.config/n9-button-monitor.conf
Default Config (https://github.com/teleshoes/n9-button-monitor/blob/0.5.3/data/default-config.ini) {this gets created if there is no file}

feel generous?
http://api.flattr.com/button/flattr-badge-large.png (https://flattr.com/thing/616727/teleshoesn9-button-monitor-on-GitHub) {or send money via paypal to elliot.wolk@gmail.com}

wolke
2012-02-23, 20:16
you need to define your own getActions() function.

heres an example that does the camerra hack {vol+ to take pictures in camera app} and play/pauses music using mplayer

def getActions():
return [
Action(volup, cond=appOnTop("camera-ui"),
action=cmd("xresponse -d 820x240,820x240 -w 1")),

Action(volup, cond=screenLocked,
action=cmd(
"killall mplayer || " +
"find ~/MyDocs/Music -iname *.mp3 -print0 | " +
"xargs -0 mplayer"))
])

wolke
2012-02-23, 20:18
v0.1

#!/usr/bin/python
#n9-button-monitor v0.1
#Copyright 2012 Elliot Wolk
#based on:
#####
# Ye Olde Camerra Hack - Another fine Harmattan Hack Powered by Python(tm)!
# 2012-01-12; Thomas Perl <thp.io/about>
#####
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#

from QmSystem import *
from PySide.QtGui import *
from PySide.QtDeclarative import *

import sys
import os
import subprocess
import re

###############
###############
###############
def getActions():
return ([ None
, Action(volup, cond=appOnTop("camera-ui"), action=cmd("camera-click"))
, Action(volup, cond=screenLocked, action=cmd("klomp-cmd pause"))
, Action(voldn, cond=screenLocked, action=cmd("klomp-cmd next"))
])

def readProc(cmdarr):
out, err = subprocess.Popen(cmdarr, stdout=subprocess.PIPE).communicate()
return out

def screenLocked():
return "locked\n" == readProc(['lock', '-g'])
def screenUnlocked():
return not screenLocked()

def appOnTop(app):
return lambda: isAppOnTop(app)
def isAppOnTop(app):
winId = readProc(["xprop", "-root", "_NET_ACTIVE_WINDOW"]) [40:]
winCmd = readProc(["xprop", "-id", winId, "WM_COMMAND"]) [24:-4]
return app in winCmd

def cmd(cmd):
return lambda: runcmd(cmd)
def runcmd(cmd):
print 'running cmd: "' + cmd + '"'
subprocess.Popen(['bash', '-c', cmd])
###############
###############
###############

evtPressed = 'pressed'
evtRepeated = 'repeated'
evtReleased = 'released'

stateOn = 2
stateOff = 0

power = 20
volup = 2
voldn = 3

class Action():
def __init__(self, key, event=evtPressed, action=None, cond=None, stop=True):
self.key = key
self.event = event
self.action = action
self.cond = cond
self.stop = stop

keysPressed = set()
actions = getActions()

def keyEvent(key, state):
event = None
if state == stateOn:
if key not in keysPressed:
event = evtPressed
else:
event = evtRepeated
elif state == stateOff:
event = evtReleased

if state == stateOn:
keysPressed.add(key)
elif state == stateOff:
keysPressed.discard(key)

for action in actions:
if action != None and action.key == key and action.event == event:
if action.cond == None or action.cond():
action.action()
if action.stop:
return

def main():
app = QApplication(sys.argv)
keys = QmKeys()
keys.keyEvent.connect(keyEvent)
app.exec_()

if __name__ == "__main__":
sys.exit(main())

wolke
2012-02-23, 20:22
i put the above script in /usr/bin/n9-button-monitor, chmod +x.

i run it on startup with upstart.

/etc/init/n9-button-monitor.conf

# Description of the script, mandatory
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 bash -c 'DISPLAY=:0 n9-button-monitor'

aRTee
2012-02-24, 09:21
Thanks for sharing, I have to think on how I can used this for my wife's N9.

F2thaK
2012-02-24, 10:02
Cool!

Any aims for this? GUI maybe?

wolke
2012-02-24, 18:45
Cool!

Any aims for this? GUI maybe?

the next things i plan on doing are
1) investigating consuming button presses, overriding the default button actions like zooming/volume when an action is defined in the script. {or maybe just overriding it period in all cases, and simulating all the actually useful ones with actions in the script}

2) making the volume keep the phone's ringer volume and speaker volume in lockstep. so many times ive turned down the vol only to have loud music blast out of it. what id do is make it so that every time you press a volume button, ill get the ringer volume and set the phone volume to some variation on that.

3) separating out the action configuration from the script, so you dont need to be a python developer to use it. i imagine a simple rc file a la
~/.n9-button-monitor
[volume-up-press]
screen_lock = start_music
camera_on_top = snap_picture

[volume-up-release]
always = sync_volume

i would need to find out what people would even want to use this for, and add all of them to the rc-file grammar.

4) implement state for macro-ish controls
e.g.: make it so pressing and holding volume up, and then pressing volume down, and then releasing volume down and then releasing volume up, turned on the flashlight for 20 seconds

"UP DOWN down up" => "flashlight on; sleep 20; flashlight off"

{i think im going to rename the vol+/vol- keys INC and DEC to avoid confusion with button-up and button-down for keypresses.}

wolke
2012-02-24, 18:51
Thanks for sharing, I have to think on how I can used this for my wife's N9.

please please share when you do. im dying for things for this to actually do. so far:

1) play/pause/skip/prev music players on the lock-screen
2) flashlight on/off on the lock-screen
3) camera take picture {and maybe focus first}
4) camera take delayed picture
5) answer calls, instead of swiping up

1, 3, and 4 are easy and done. the camera doesnt focus first though, so what id REALLY like to do is make it so volUp-PRESS focuses, and volUp-RELEASE snaps. i dont think i have enough control to do this, though.

if anybody thinks of anything even remotely awesome, please post.

wolke
2012-03-27, 01:58
i got torch/flashlight toggling to work from the lowpowerscreen.

Arie
2012-03-27, 02:00
i got torch/flashlight toggling to work from the lowpowerscreen.

This is becoming pretty cool.

wolke
2012-03-27, 02:03
This is becoming pretty cool.

:D see first post for the update

Arie
2012-03-27, 02:08
:D see first post for the update

Where does it talk about the flashlight function?

wolke
2012-03-27, 02:09
Where does it talk about the flashlight function?

check again, sry

wolke
2012-03-27, 02:11
the relevant line in the code is:

, Action([voldn, volup, volup], cond=screenLocked, action=torch.toggle)

i.e.: press and hold volume down, double-tap volume up, and torch is toggled

a_petrov303
2012-03-27, 07:45
this is great!

thank you for sharing!

could anyone (if the author is focused on more principal things) write a tutorial or how-to use this finding?

I understand the potential of the script, but don't really know how to use it. shall I just write everything in the terminal? please help, as the default buttons are just useless!!!

many thanks for your work!

biatch0
2012-03-27, 15:34
What would be cool is pressing and holding button X

1) unlock
2) launch camera
3) focus
4) snap a photo

Similar to how the hardware camera button on the Lumia 800 functions.

wolke
2012-03-27, 16:52
this is great!

thank you for sharing!

could anyone (if the author is focused on more principal things) write a tutorial or how-to use this finding?

I understand the potential of the script, but don't really know how to use it. shall I just write everything in the terminal? please help, as the default buttons are just useless!!!

many thanks for your work!

yea, sry, this is more of a do-it-yourself toolbox for making an app than an app.

ill see if i can put together something you can just run from the terminal and have it work.

some questions first {anyone else, feel free to chime in}:

1)
which of these sounds better for the flashlight/torch on lowpower lock screen?
a) vol+ toggles the torch
b) vol+ will toggle the flashlight {it will turn off after 30s}
c) press and hold vol+ to turn on the flash, release to turn it off
d) press and hold vol+, double-tap vol-, release vol+, to toggle the flash {this makes it more or less impossible to pocket-flash}

2)
i dont know if anyone else cares about the music play/pause/skip/prev, but to me thats the vital feature. how should this work/not work?

3)
also, should it simulate thomas perl's camerra hack? {vol+ to take picture when in camera mode} ive found that i like it.

4)
does anyone care about 10s delayed picture? its more or less impossible to take a good picture without holding the n9 anyway, so it seems fairly useless to me so far.

wolke
2012-03-27, 17:03
What would be cool is pressing and holding button X

1) unlock
2) launch camera
3) focus
4) snap a photo

Similar to how the hardware camera button on the Lumia 800 functions.

so i dont know how the lumia 800 does this. i assume that you want to do this while inside the camera app; press and hold vol+, wait 1s for it to focus, release to snap picture.

totally feasible, except for the focusing bit. the built-in camera doesnt expose any way to forcibly make it focus {that i know about}. one could easily just write another camera application for doing this with qt mobility, but it wouldnt be as full-featured or polished.

wolke
2012-03-27, 17:03
one thing ive been thinking about is simply snapping pictures from the lock screen, with no viewfinder. extremely often i find that im not quick enough to unlock my phone, open up the camera app, and actually snap one off before the phenomenon im trying to capture stops.

the way i imagine this would work is to press and hold vol+ from the lock screen, and then tap vol- repeatedly to snap off pix. i would use the qtmobility framework for this, too, which i havent tested. it seems that it borrows the settings from the camera app already, which should be convenient.

does this sound useful to anybody?

alephito
2012-03-27, 19:13
Yes, I would like to have that option.

Mada22009
2012-03-27, 19:38
this is really getting interesting
i think it would be in perfect order if:
1-long press on power button when on stand by turns on flash light and off when short press after that
2-short press on power button unlocks the device.
3- when camera is opened use power button for shooting with focus
4- when player is opened power button for pause and resume and volume button + for next track when short pressed and forward when long pressed, volume button - previous track when short pressed and rewind when long pressed.

guess for the camera shooting from stand by screen it could be double press on power button or something ?

if we could all agree on a pattern for the buttons then a dep file could be made with that pattern code and uploaded to the store so all N9 users could enjoy it and even for profit to who ever would like to make it :)

biatch0
2012-03-27, 21:46
so i dont know how the lumia 800 does this. i assume that you want to do this while inside the camera app; press and hold vol+, wait 1s for it to focus, release to snap picture.

totally feasible, except for the focusing bit. the built-in camera doesnt expose any way to forcibly make it focus {that i know about}. one could easily just write another camera application for doing this with qt mobility, but it wouldnt be as full-featured or polished.The useful portion would be pressing button X and getting the device to unlock AND launch the camera app. From that point on, using something like the Vol+ as Camera button app would work (or your existing code).

The entire idea revolves around one handed operation... while cycling in my case. Trying to find the shutter button on screen, holding it down, and waiting for it to focus before releasing tends to be very difficult :D

wolke
2012-03-27, 22:09
The useful portion would be pressing button X and getting the device to unlock AND launch the camera app. From that point on, using something like the Vol+ as Camera button app would work (or your existing code).

The entire idea revolves around one handed operation... while cycling in my case. Trying to find the shutter button on screen, holding it down, and waiting for it to focus before releasing tends to be very difficult :D

oh thats easy as pie. ill add that to the list of hard-coded actions you can change in the config file, when {and if} i actually make this into a gui-configged app.

wolke
2012-03-28, 00:07
this is really getting interesting
i think it would be in perfect order if:
1-long press on power button when on stand by turns on flash light and off when short press after that
2-short press on power button unlocks the device.
3- when camera is opened use power button for shooting with focus
4- when player is opened power button for pause and resume and volume button + for next track when short pressed and forward when long pressed, volume button - previous track when short pressed and rewind when long pressed.

guess for the camera shooting from stand by screen it could be double press on power button or something ?

if we could all agree on a pattern for the buttons then a dep file could be made with that pattern code and uploaded to the store so all N9 users could enjoy it and even for profit to who ever would like to make it :)

in order for the power button to do all these things, it would need to not lock/unlock the screen. i personally like its single-naturedness and am fine using vol+/- for everything.

also, i really wanna know what buttons people want, but no consensus need be reached; it should be configurable {preferably without coding}.

Rusnak-COBRA
2012-03-28, 13:01
I would suggest:
1 - c) press and hold vol+ to turn on the flash, release to turn it off
2 - double tap on + to next, double tap on - for previous. press both together for pause (is it possible? physically yes)
4 - camerra hack is extremely slow for me to use, really. need to find out something more quick. toggling camera from lockscreen is a good ideal

HtheB
2012-03-28, 14:44
Can you also change the Vol up and the Vol down button to force the volume instead of changing the profile?

It's very annoying, see this bug what I mean:
http://forum.meego.com/showthread.php?t=5202
https://harmattan-bugs.nokia.com/show_bug.cgi?id=210

late88
2012-03-28, 15:21
I would suggest:
1 - c) press and hold vol+ to turn on the flash, release to turn it off
2 - double tap on + to next, double tap on - for previous. press both together for pause (is it possible? physically yes)
4 - camerra hack is extremely slow for me to use, really. need to find out something more quick. toggling camera from lockscreen is a good ideal

My suggest:

1. exactly like yours, the best option for flashlight imo
2. Agreed too. Double tap vol+/- next/prev sounds good, but pause... it's hard to push both exactly same time. If not possible, its ok. i rarely use the pause option and it isn't so bad to do it on the usual way.
3. hold down vol- for camera use. possibility to open camera app, focus and take a picture.

Of course the best option would be possibility to choose by yourself one command for one action with UI.
Like this:

A. flashlight: choose option (1.long press vol+-, 2.double press vol,3.... etc)

B. next/previous track: 1...2...3.

Rusnak-COBRA
2012-03-28, 15:29
have you tried to push both buttons at once? :) I am doing it right now, it is not a problem.

late88
2012-03-28, 15:34
have you tried to push both buttons at once? :) I am doing it right now, it is not a problem.

It depens how responsive it is. (delay) if you don't have to push exactly the same time, its ok for me.

wolke
2012-03-28, 15:51
have you tried to push both buttons at once? :) I am doing it right now, it is not a problem.

yea, but try doing it while driving/jogging/etc. for me, play/pause and skip are the two most important features.

wolke
2012-03-30, 19:50
ok, so here is my plan for the next release, based on the enormously helpful feedback and my own experiments.
this will be the first one that will work out of the box {maybe just for inception-users and open-moders, but ill do my best to make it work for anybody that can use a terminal and follow instructions in it once}.

goals:
1) make installation easy, with an incept-able or just straight up installable deb. apply for ovi store, etc.

2) move the button config to a file {e.g.: /home/user/.config/button-monitor/keys.conf}. it will be configurable live at runtime.

3) make the buttons you can configure reasonable. there will be 5 events per button.
{for now, just volume up, and volume down; power down is right out, until i work out how to both disable the default action, and ensure that you can still shut down the phone and lock it safely. also out are multi-button combinations, because i think they are too hard to do usefully, and complicate the detection of patterns; in my tests, i wound up doing things i didnt mean most of the time.}

(a) press-and-hold-start
(b) press-and-hold-release
(c) click
(d) double-click
(e) treble-click

for example:
-press-hold-start VOL+ might focus the camera, and press-and-hold-release VOL+ take the picture
-press-hold-start VOL- might turn on the flash, and press-and-hold-release VOL- turn it back off
-click VOL+ would play/pause music, double-click VOL+ would next song, and treble-click VOL+ would prev song

4) add some actions
(a) flash on, with configurable auto-shutoff {ready}
(b) flash off {ready}
(c) snap picture inside the camera program {ready}
(d) focus camera inside the camera program {ready}
(e) snap picture without camera program {possible, but nowhere near ready, not essential for next release}
(f) volume control, not ****ing profile {havent explored it yet, i think this is critical and should be simple}
(h) play/pause music {i use magic perl scripts + mplayer, so not done yet for anybody but me}
(i) skip song {ditto}
(j) prev song {ditto}

5) add some conditions. you can specify a list of them.
(a) lock screen is on/off {ready}
(b) low power screen is on/off {ready}
(c) phone is/is not in-pocket screen-off {might be impossible; PLEASE LET ME KNOW IF YOU KNOW HOW TO DO THIS there are no mce dbus messages for it, anyway, and the brightness device doesnt stop reading 0 in lowpowerscreen}
(d) camera program has focus {ready}
(e) generic program is on top {ready, but you need to know the window name; camera is camera-ui, firefox is fennec, etc}

ill put the features in a wiki or list or something, and post when theyre done

wolke
2012-03-30, 23:47
features im adding:
https://teleshoes.tadalist.com/lists/2175153/public

this is to show that progress is just slow, not dead; im on my way to making something useful.

complain here and ill see it. propose any actions or conditions you may think of here, and ill add them if they make sense.

HtheB
2012-03-31, 03:08
features im adding:
https://teleshoes.tadalist.com/lists/2175153/public

this is to show that progress is just slow, not dead; im on my way to making something useful.

complain here and ill see it. propose any actions or conditions you may think of here, and ill add them if they make sense.

Great!
From the todo list:
action: volumeUp {not profile}
action: volumeDown {not profile}

Please put this one the highest priority on the list.. :(
You will make A LOT of users happy with this very functional option!

wolke
2012-03-31, 03:48
Great!
From the todo list:
action: volumeUp {not profile}
action: volumeDown {not profile}

Please put this one the highest priority on the list.. :(
You will make A LOT of users happy with this very functional option!

unfortunately, it wont be terribly easy; i need to SELECTIVELY disable the default actions, and figure out under what circumstances to allow them.

however, i dreamt up a compromise; sync the profile to the volume after each press.
SILENT => 0%
BEEP => 0%
RINGING_1 => 25%
RINGING_2 => 50%
RINGING_3 => 75%
RINGING_4 => 100%

lemme know if you think this makes sense as a compromise if actually selectively disabling default actions {like zoom in the browser, zoom in the camera, etc} is hard or even impossible.

HtheB
2012-03-31, 05:34
unfortunately, it wont be terribly easy; i need to SELECTIVELY disable the default actions, and figure out under what circumstances to allow them.

however, i dreamt up a compromise; sync the profile to the volume after each press.
SILENT => 0%
BEEP => 0%
RINGING_1 => 25%
RINGING_2 => 50%
RINGING_3 => 75%
RINGING_4 => 100%

lemme know if you think this makes sense as a compromise if actually selectively disabling default actions {like zoom in the browser, zoom in the camera, etc} is hard or even impossible.


Hmmm... You could try that as a workaround for now.
I only want a vibrate profile though. I think I might have a solution for that:
I will make a special ringtone that is silent, but it will vibrate longer by default (because if you set the ringtone on "(no sound)" it will only vibrate very short).

About zooming on browser: Pinch to zoom
About camera zooming: on the camera app, there is a slider at the top, you can slide that to zoom in or to zoom out.

so the Volume button is only meant for the Volume! (and to boot NITDroid :p )

wolke
2012-03-31, 16:40
Hmmm... You could try that as a workaround for now.
I only want a vibrate profile though. I think I might have a solution for that:
I will make a special ringtone that is silent, but it will vibrate longer by default (because if you set the ringtone on "(no sound)" it will only vibrate very short).

About zooming on browser: Pinch to zoom
About camera zooming: on the camera app, there is a slider at the top, you can slide that to zoom in or to zoom out.

so the Volume button is only meant for the Volume! (and to boot NITDroid :p )

i am toootally inclined to agree; everywhere its used in default apps is stupid and redundant. the volume buttons CAN have real uses though, in other apps, and those apps will probably not expose a way to trigger them. see fbreader's volume-to-turn-page, and any app that decides to make something you can ONLY do with volume keys,

until i find a way to not eat the events under certain circumstances, i cant really make this feature work.

HtheB
2012-03-31, 18:13
i am toootally inclined to agree; everywhere its used in default apps is stupid and redundant. the volume buttons CAN have real uses though, in other apps, and those apps will probably not expose a way to trigger them. see fbreader's volume-to-turn-page, and any app that decides to make something you can ONLY do with volume keys,

until i find a way to not eat the events under certain circumstances, i cant really make this feature work.

You can at least make some "option" to enable "volume only" for users like me :D

wolke
2012-04-01, 05:52
0.3 should actually work, full of bugs, but otherwise pretty much exactly as advertised, if youre terminal savvy enough to get it working. {if you have any trouble installing it, ill try to help; ask here or on irc}

key features are missing, like music-control and HtheB-style-volume-control, and its a ***** to install and run because it needs super-privileges.

also, i just got it working so its not especially well-tested. it seems to use no power at all when idle, which is my #1 priority in terms of regression testing. if you get it working, and notice power usage increases, PLEASE TELL ME.

wolke
2012-04-02, 17:55
0.4 => music suite actions

action=musicPlayPause,volumeUp,singleClick,screenL ocked
action=musicNext,volumeDown,singleClick,screenLock ed
action=musicPrev,volumeDown,doubleClick,screenLock ed

wolke
2012-04-02, 18:01
I CANT FIGURE OUT HOW TO CHANGE THE GODDAM SYSTEM VOLUME.

tried with built-in clis:
pulseaudio-utils, alsamixer, amixer

tried with c libraries and all audio APIs i found in the developer api:
qmediaplayer, phonon.audiooutput.

this should SO not be difficult. anybody know how to do this? {programmatically adjust the system volume, such that the slider in the status bar also moves with it}

Arie
2012-04-02, 18:12
I CANT FIGURE OUT HOW TO CHANGE THE GODDAM SYSTEM VOLUME.

tried with built-in clis:
pulseaudio-utils, alsamixer, amixer

tried with c libraries and all audio APIs i found in the developer api:
qmediaplayer, phonon.audiooutput.

this should SO not be difficult. anybody know how to do this? {programmatically adjust the system volume, such that the slider in the status bar also moves with it}

Have you asked thp?

HtheB
2012-04-05, 06:36
key features are missing, like music-control and HtheB-style-volume-control, and its a ***** to install and run because it needs super-privileges.

Never heard of inception before? You have super priviliges if you incept the package. You can make a special version for inception users, so we can activate this.

Inception (http://talk.maemo.org/showthread.php?t=82835)

wolke
2012-04-05, 15:06
Never heard of inception before? You have super priviliges if you incept the package. You can make a special version for inception users, so we can activate this.

Inception (http://talk.maemo.org/showthread.php?t=82835)

thanks, but i know about inception;
'
this will be the first one that will work out of the box {maybe just for inception-users and open-moders, but ill do my best to make it work for anybody that can use a terminal and follow instructions in it once}.
'

the thing is that you currently need to use a terminal, and set up an upstart file that manages your path depending on how you have it set up. power users will have it set up differently, and non-power users will have know idea how to do it at all.

im hoping to make this app-store-able, which inception makes impossible. also, even using inception, i make a lot of privileged shell calls so im going to need to use aegis-ctl as well.

n9-button-monitor works very nicely out of the box, but just for open-moders right now, and anyone who knows how to use aegis-ctl when permission errors occur. {i dont know what permission errors youd get, because i havent run it on a non-hacked kernel yet}

Arie
2012-04-05, 15:15
thanks, but i know about inception;
'
this will be the first one that will work out of the box {maybe just for inception-users and open-moders, but ill do my best to make it work for anybody that can use a terminal and follow instructions in it once}.
'

the thing is that you currently need to use a terminal, and set up an upstart file that manages your path depending on how you have it set up. power users will have it set up differently, and non-power users will have know idea how to do it at all.

im hoping to make this app-store-able, which inception makes impossible. also, even using inception, i make a lot of privileged shell calls so im going to need to use aegis-ctl as well.

n9-button-monitor works very nicely out of the box, but just for open-moders right now, and anyone who knows how to use aegis-ctl when permission errors occur. {i dont know what permission errors youd get, because i havent run it on a non-hacked kernel yet}

I don't think it being app store useable is that important. I think once the idea is implemented it's easier to work from there.

GuSec
2012-04-06, 07:21
Hi there, I'm not succeeding with your script.

I installed xresponse, x11-utils, python-qmsystem, python-qtmobility.multimediakit, python-qtmobility.systeminfo, python-pyside.qtgui and python-pyside.qtcore (is "deps" a package?). Then I created the file /usr/bin/n9-button-monitor containing v0.4 of the script. I gave this executable rights. I also created the .conf-file, and your autostart script in /etc/init/apps (/etc/init isn't writeable).

This is the output from "devel-su -c 'python /home/user/MyDocs/n9-button-monitor'":
torch on
Permission denied: opening file /home/user/.omap3cam
Starting camera without viewfinder available
Permission denied: opening file /home/user/.omap3cam
auto shut-off
torch off
Permission denied: opening file /home/user/.omap3cam

After I've locked the screen and pressed VOL+:
2: long-start
torch on
running cmd "xprop -root _NET_ACTIVE_WINDOW"
running cmd "xprop -id 0xe0006e
WM_COMMAND"
2: long-stop
torch off
Permission denied: opening file /home/user/.omap3cam
running cmd "xprop -root _NET_ACTIVE_WINDOW"
running cmd "xprop -id 0xe0006e
WM_COMMAND"

Nothing happens... What am I doing wrong?

wolke
2012-04-06, 16:19
Hi there, I'm not succeeding with your script.
....
Permission denied: opening file /home/user/.omap3cam

Nothing happens... What am I doing wrong?

first, thanks! youre the first person to try it out in the wild and tell me about it.

so, thats a root permission that i didnt realize that aegis didnt give you by default.
ive been testing it mostly on open mode, and i forgot to test the camera flash on closed mode since i changed it.

for a solution, it is probably sufficient to just run develsh first.
i.e.:
# devel-su
PASSWORD: {rootme}
# develsh
# python /usr/bin/n9-button-monitor

please lemme know if that does it, and ill update the instructions. thanks again!

GuSec
2012-04-06, 17:08
first, thanks! youre the first person to try it out in the wild and tell me about it.

so, thats a root permission that i didnt realize that aegis didnt give you by default.
ive been testing it mostly on open mode, and i forgot to test the camera flash on closed mode since i changed it.

for a solution, it is probably sufficient to just run develsh first.
i.e.:
# devel-su
PASSWORD: {rootme}
# develsh
# python /usr/bin/n9-button-monitor

please lemme know if that does it, and ill update the instructions. thanks again!
Now it worked just fine and did exactly what it was supposed to do! It's a bit slow though, which matter most with the camera, but it may be affected by a simultaneous execution of the non working start script.

So how do I rewrite the start script to grant the correct permissions?

wolke
2012-04-06, 17:38
Now it worked just fine and did exactly what it was supposed to do! It's a bit slow though, which matter most with the camera, but it may be affected by a simultaneous execution of the non working start script.

So how do I rewrite the start script to grant the correct permissions?

just do devel-su -c "develsh -c 'CMD'".

try this to get it to auto-start at boot {i havent tested it on closed mode}.

/etc/init/apps/n9-button-monitor.conf

description "Startup script for n9-button-monitor"
author "elliot.wolk@gmail.com"
console none
respawn
exec bash -c 'source /etc/profile; PATH=$PATH:/usr/local/bin; develsh -c n9-button-monitor'

there are 3 things that make camera actions slow:
1) the click delays {for single/long click actions, you have to wait a half second before they start. for double-click actions, you have to wait .75s. for treble-click, you dont have to wait at all, since there is no quadruple-click actions.}
this is very solvable, if you only do long-clicks, partially solvable if you never double-click or treble-click, and unsolvable if you ever wanna do double-treble clicks.

2) the condition detection {figuring out whether youre actually in the camera app, or on the screen-lock, etc} this is not particularly solvable , unless you dont mind weird behaviours in other apps {for instance, the camera-snap would make volume-up click the screen in other apps}.

3) the actions actually take time.
e.g.: the camera submodule is slow to initialize. this makes the flash bulb, for instance, take 1-2 full seconds no matter what. theres nothing you can do about this.


so! if you only care about the long press actions {flashing and the camera}, you can make it considerably faster by changing the longClickDelayMs from 500 => 1. this will effectively disable all single/double/treble click actions, though.
to do this, copy the default config on the OP to /home/user/.config/n9-button-monitor.conf and change the delay. {you have to restart the program}.

GuSec
2012-04-06, 21:25
just do devel-su -c "develsh -c 'CMD'".

try this to get it to auto-start at boot {i havent tested it on closed mode}.

/etc/init/apps/n9-button-monitor.conf

description "Startup script for n9-button-monitor"
author "elliot.wolk@gmail.com"
console none
respawn
exec bash -c 'source /etc/profile; PATH=$PATH:/usr/local/bin; develsh -c n9-button-monitor'
This did not work out (chmod 755 /etc/init/apps/n9-button-monitor.conf)! The strange thing is that "source /etc/profile; PATH=$PATH:/usr/local/bin; develsh -c n9-button-monitor" works out just fine in the terminal, it does exactly what it's supposed to. So what's up with autostart?

Extremely useful script though! I love the way I can just pull up the phone and hold one button to get a flashlight!

wolke
2012-04-06, 21:44
This did not work out (chmod 755 /etc/init/apps/n9-button-monitor.conf)! The strange thing is that "source /etc/profile; PATH=$PATH:/usr/local/bin; develsh -c n9-button-monitor" works out just fine in the terminal, it does exactly what it's supposed to. So what's up with autostart?

Extremely useful script though! I love the way I can just pull up the phone and hold one button to get a flashlight!

cool! glad you like it.

maybe you dont have bash, that should be 'sh' instead.
try 'start n9-button-monitor' and 'stop n9-button-monitor'

guillermorojaz
2012-04-07, 01:45
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

wolke
2012-04-07, 03:07
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

#just to torch on/off for guillermorojaz
torchAutoShutOffTimeMs=60000
longClickDelayMs=400
doubleClickDelayMs=400
trebleClickDelayMs=600
action=torchOn,volumeUp,singleClick,screenLocked
action=torchOff,volumeDown,singleClick,screenLocke d


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'.

F2thaK
2012-04-07, 04:15
This is getting really good. Im yet to use it. A GUI would be awesome, I would donate if you get that far!

guillermorojaz
2012-04-07, 05:08
Release where the components python?

wolke
2012-04-07, 05:23
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.}

GuSec
2012-04-07, 13:41
I've tried for hours now. It is impossible to get it to autostart. Seriously what should I do?
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?

wolke
2012-04-07, 15:57
I've tried for hours now. It is impossible to get it to autostart. Seriously what should I do?
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
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.

wolke
2012-04-07, 17:54
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

Jare
2012-04-13, 00:10
I've tried for hours now. It is impossible to get it to autostart. Seriously what should I do?

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:

<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: 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.

wolke
2012-04-13, 18:27
"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.

Jare
2012-04-14, 13:55
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.

I haven't really investigated this. I think it should be possible with Inception, but is it absolutely necessary? Isn't it enough that the daemon starts automatically during start-up? At least I didn't have any autostart issues after creating a deb with _aegis and digsigsums. I didn't even use Inception during installation and the flashlight, camera shutter and my own script work fine. Which of your program's functions need more rights than are already available in the stock installation?

Watchmaker
2012-04-16, 21:30
If/when this will be a deb install with a GUI to configure it, I'll be glad to use it and pay for it! Just sayin' :P

qwazix
2012-04-16, 21:53
me too

too short

Arie
2012-04-16, 23:16
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.

Ask itsnotabigtruck and a few others. He is the head of inception.

wolke
2012-04-17, 17:22
build a deb, aegisized.

turns out i need 'GRP :: pulse-access' to work the flash...

wolke
2012-04-17, 18:35
anyone wanna test the deb in the OP?

all you should need to do is install the deb {and the dependencies}, and it should work immediately. {if you reboot, it will start back up after a minute}

you can stop it and restart it as root like this:
stop apps/n9-button-monitor
start apps/n9-button-monitor

anig
2012-04-18, 06:54
Just installed the deb. Works great thanks.

Dousan
2012-04-18, 11:49
I've tried the .deb file from the first post but I'm running onto problems when installing it.
1. It wont install with either the app manager nor with xterm "apt-get install".
2. When trying to install the dependency packages it's abborting with an error code 1 (aegis rejecting it).
3. apt-get -f install same problem as 2.
4. It's breaking alot of installed apps when trying to install the n9_monitor.deb, wich can be fixed by reinstalling one of the broken apps.
If you need more info just ask, if you want i can upload screenshots.

Regards Dousan...

I've flashed a custom zImage/kernel to be able to dualboot Nitdroid, could that be the issue?

wolke
2012-04-18, 16:25
I've tried the .deb file from the first post but I'm running onto problems when installing it.
1. It wont install with either the app manager nor with xterm "apt-get install".
2. When trying to install the dependency packages it's abborting with an error code 1 (aegis rejecting it).
3. apt-get -f install same problem as 2.
4. It's breaking alot of installed apps when trying to install the n9_monitor.deb, wich can be fixed by reinstalling one of the broken apps.
If you need more info just ask, if you want i can upload screenshots.

Regards Dousan...

I've flashed a custom zImage/kernel to be able to dualboot Nitdroid, could that be the issue?

apt-get is for installing packages that come from repositories, not manually downloaded deb packages. to install this, you should type "dpkg -i n9-button-monitor*.deb". {you can then do "apt-get -f install" to automatically fetch missing dependencies and complete the install, if you like, or you can just install the dependencies first}

HOWEVER, if you cant apt-get install the dependencies, then something is wrong with your system. these packages are available through normal repositories, and should all 'just work'.

this will show you where the packages are coming from:
{they should all be downloads.maemo.nokia.com}
{run as root}
apt-cache policy xresponse x11-utils python-qmsystem python-qtmobility.multimediakit python-qtmobility.systeminfo python-pyside.qtgui python-pyside.qtcore

if youre still having trouble, paste that output, the aegis-rejecting output from installing the dependencies, and the output of this
{run as root}
cat /etc/apt/sources.list.d/*

p.s. i dont know anything about dual booting nitdroid, but i do flash zany kernels all the time, and it shouldnt affect this.

Dousan
2012-04-18, 16:38
Thanks for your reply wolke, i'll try it again.

My mistake, it's a mis type of command, i did use dpkg -i 'your.deb' file to try to install it through xterm.

Regards Dousan...

Dousan
2012-04-18, 17:43
I get this with 'apt-cache policy' command

# apt-cache policy xresponse x11-utils python
-qmsystem python-qtmobility.multimediakit pytho
n-qtmobility.systeminfo python-pyside.qtgui pyt
hon-pyside.qtcore
xresponse:
Installeret: 0.3.2-1osso29+0m6
Kandidat: 0.3.2-1osso29+0m6
Versionstabel:
0.3.2-1osso29+0m6 0
500 https://downloads.maemo.nokia.com ./ Packages
0.3.2-1osso29+0m6 0
500 http://harmattan-dev.nokia.com harmattan/sdk/free Packages
*** 0.3.2-1osso29+0m6 0
100 /var/lib/dpkg/status
x11-utils:
Installeret: 7.5+4-meego441+0m6
Kandidat: 7.5+4-meego441+0m6
Versionstabel:
7.5+4-meego441+0m6 0
500 https://downloads.maemo.nokia.com ./ Packages
7.5+4-meego441+0m6 0
500 http://harmattan-dev.nokia.com harmattan/sdk/free Packages
*** 7.5+4-meego441+0m6 0
100 /var/lib/dpkg/status
python-qmsystem:
Installeret: (ingen)
Kandidat: 0.1-0maemo5+0m6
Versionstabel:
0.1-0maemo5+0m6 0
500 https://downloads.maemo.nokia.com ./ Packages
0.1-0maemo5+0m6 0
500 http://harmattan-dev.nokia.com harmattan/sdk/free Packages
python-qtmobility.multimediakit:
Installeret: (ingen)
Kandidat: 0.2.2.1-0maemo3+0m6
Versionstabel:
0.2.2.1-0maemo3+0m6 0
500 https://downloads.maemo.nokia.com ./ Packages
0.2.2.1-0maemo3+0m6 0
500 http://harmattan-dev.nokia.com harmattan/sdk/free Packages
0.2.2-0maemo4+0m6 0
500 https://downloads.maemo.nokia.com ./ Packages
python-qtmobility.systeminfo:
Installeret: (ingen)
Kandidat: 0.2.2.1-0maemo3+0m6
Versionstabel:
0.2.2.1-0maemo3+0m6 0
500 https://downloads.maemo.nokia.com ./ Packages
0.2.2.1-0maemo3+0m6 0
500 http://harmattan-dev.nokia.com harmattan/sdk/free Packages
0.2.2-0maemo4+0m6 0
500 https://downloads.maemo.nokia.com ./ Packages
python-pyside.qtgui:
Installeret: (ingen)
Kandidat: 1.0.7-1maemo2+0m6
Versionstabel:
1.0.7-1maemo2+0m6 0
500 https://downloads.maemo.nokia.com ./ Packages
1.0.7-1maemo2+0m6 0
500 http://harmattan-dev.nokia.com harmattan/sdk/free Packages
1.0.2-1maemo1+0m6 0
500 https://downloads.maemo.nokia.com ./ Packages
python-pyside.qtcore:
Installeret: (ingen)
Kandidat: 1.0.7-1maemo2+0m6
Versionstabel:
1.0.7-1maemo2+0m6 0
500 https://downloads.maemo.nokia.com ./ Packages
1.0.7-1maemo2+0m6 0
500 http://harmattan-dev.nokia.com harmattan/sdk/free Packages
1.0.2-1maemo1+0m6 0
500 https://downloads.maemo.nokia.com ./ Packages
~ #

And the 'cat /etc/apt/sources.list.d/*'

# cat /etc/apt/sources.list.d/*
deb https://qa9recEP:Pat2UGuP@downloads.maemo.nokia.com/harmattan/001 ./
deb https://qa9recEP:Pat2UGuP@downloads.maemo.nokia.com/harmattan/apps ./
deb https://qa9recEP:Pat2UGuP@downloads.maemo.nokia.com/harmattan/tools ./
deb http://repo.apps.formeego.org/harmattan/apps/ ./ #Apps for MeeGo
deb http://harmattan-dev.nokia.com/ harmattan/sdk free non-free #Harmattan developer repository
deb http://repo.pub.meego.com/home:/rzr:/harmattan/MeeGo_1.2_Harmattan_Maemo.org_MeeGo_1.2_Harmattan_ standard/ ./ #Community shared repository
deb-exec /usr/bin/osa
deb http://qtlabs.org.br/~lmoura/qt5 unstable main xcb
~ #

Regards Dousan...

wolke
2012-04-18, 17:45
I get this with 'apt-cache policy' command
...
And the 'cat /etc/apt/sources.list.d/*'
...
Regards Dousan...


you left out the important part; can i see the error when you try to install the dependencies?

apt-get install xresponse x11-utils python-qmsystem python-qtmobility.multimediakit python-qtmobility.systeminfo python-pyside.qtgui python-pyside.qtcore

Dousan
2012-04-18, 17:53
you left out the important part; can i see the error when you try to install the dependencies?

apt-get install xresponse x11-utils python-qmsystem python-qtmobility.multimediakit python-qtmobility.systeminfo python-pyside.qtgui python-pyside.qtcore

Ohh, sorry, here we go

# apt-get install xresponse x11-utils python-
qmsystem python-qtmobility.multimediakit python
-qtmobility.systeminfo python-pyside.qtgui pyth
on-pyside.qtcore
Reading package lists
Building dependency tree
Reading state information... Done
Building dependency tree
Reading state information... Done
xresponse is already the newest version.
x11-utils is already the newest version.
x11-utils set to manually installed.
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies.
python-pyside.qtcore: Depends: libpyside1.0 (>= 1.0.5) but it is not going to be installed
Depends: libshiboken1.0 (>= 1.0.5) but it is not going to be installed
Depends: python-support (>= 0.90.0) but it is not going to be installed
python-pyside.qtgui: Depends: libpyside1.0 (>= 1.0.5) but it is not going to be installed
Depends: libshiboken1.0(>= 1.0.5) but it is not going to be installed
Depends: python-support(>= 0.90.0) but it is not going to be installed
python-qmsystem: Depends: libpyside1.0 but it is not going to be installed
Depends: libshiboken1.0 butit is not going to be installed
Depends: python-support (>=0.90.0) but it is not going to be installed
python-qtmobility.multimediakit: Depends: libpyside1.0 but it is not going to be installed
Depends: libshiboken1.0 but it is not going to be installed
Depends: python-support (>= 0.90.0) but it is not going tobe installed
Depends: python-pyside.qtnetwork but it is not going to beinstalled
python-qtmobility.systeminfo: Depends: libpyside1.0 but it is not going to be installed
Depends: libshiboken1.0 but it is not going to be installed
Depends: python-support (>= 0.90.0) but it is not going to beinstalled
Depends: python-pyside.qtnetwork but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
~ #

Regards Dousan...

wolke
2012-04-18, 17:56
Ohh, sorry, here we go

# apt-get install xresponse x11-utils python-
qmsystem python-qtmobility.multimediakit python
-qtmobility.systeminfo python-pyside.qtgui pyth
on-pyside.qtcore
Reading package lists
Building dependency tree
Reading state information... Done
Building dependency tree
Reading state information... Done
xresponse is already the newest version.
x11-utils is already the newest version.
x11-utils set to manually installed.
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies.
python-pyside.qtcore: Depends: libpyside1.0 (>= 1.0.5) but it is not going to be installed
Depends: libshiboken1.0 (>= 1.0.5) but it is not going to be installed
Depends: python-support (>= 0.90.0) but it is not going to be installed
python-pyside.qtgui: Depends: libpyside1.0 (>= 1.0.5) but it is not going to be installed
Depends: libshiboken1.0(>= 1.0.5) but it is not going to be installed
Depends: python-support(>= 0.90.0) but it is not going to be installed
python-qmsystem: Depends: libpyside1.0 but it is not going to be installed
Depends: libshiboken1.0 butit is not going to be installed
Depends: python-support (>=0.90.0) but it is not going to be installed
python-qtmobility.multimediakit: Depends: libpyside1.0 but it is not going to be installed
Depends: libshiboken1.0 but it is not going to be installed
Depends: python-support (>= 0.90.0) but it is not going tobe installed
Depends: python-pyside.qtnetwork but it is not going to beinstalled
python-qtmobility.systeminfo: Depends: libpyside1.0 but it is not going to be installed
Depends: libshiboken1.0 but it is not going to be installed
Depends: python-support (>= 0.90.0) but it is not going to beinstalled
Depends: python-pyside.qtnetwork but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
~ #

Regards Dousan...

ok, please paste this output:
apt-get install libpyside1.0 libshiboken1.0 python-support python-pyside.qtnetwork -s

Dousan
2012-04-18, 17:58
ok, please paste this output:
apt-get install libpyside1.0 libshiboken1.0 python-support python-pyside.qtnetwork -s

Here you go:

# apt-get install libpyside1.0 libshiboken1.0
python-support python-pyside.qtnetwork -s
Reading package lists
Building dependency tree
Reading state information... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies.
n9-button-monitor: Depends: python-qmsystem but it is not going to be installed
Depends: python-qtmobility.multimediakit but it is not going to be installed
Depends: python-qtmobility.systeminfo but it is not going to be installed
Depends: python-pyside.qtgui but it is not going to be installed
Depends: python-pyside.qtcore but it is not going to be installed
python-pyside.qtnetwork: Depends: python-pyside.qtcore (= 1.0.7-1maemo2+0m6) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
~ #

wolke
2012-04-18, 17:59
Here you go:

# apt-get install libpyside1.0 libshiboken1.0
python-support python-pyside.qtnetwork -s
Reading package lists
Building dependency tree
Reading state information... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies.
n9-button-monitor: Depends: python-qmsystem but it is not going to be installed
Depends: python-qtmobility.multimediakit but it is not going to be installed
Depends: python-qtmobility.systeminfo but it is not going to be installed
Depends: python-pyside.qtgui but it is not going to be installed
Depends: python-pyside.qtcore but it is not going to be installed
python-pyside.qtnetwork: Depends: python-pyside.qtcore (= 1.0.7-1maemo2+0m6) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
~ #

whoops, can you run "apt-get -f install", then rerun this?

wolke
2012-04-18, 18:01
nevermind, its probably this causing it:
deb http://qtlabs.org.br/~lmoura/qt5 unstable main xcb

implies you are using unstable qt5 libs that are breaking dependencies.

Dousan
2012-04-18, 18:02
whoops, can you run "apt-get -f install", then rerun this?

Sure thing:

# apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies...Done
The following extra packages will be installed:
libpyside1.0 libshiboken1.0
python-pyside.qtcore python-pyside.qtgui
python-pyside.qtnetwork python-qmsystem
python-qtmobility.multimediakit
python-qtmobility.systeminfo python-support
The following NEW packages will be installed
libpyside1.0 libshiboken1.0
python-pyside.qtcore python-pyside.qtgui
python-pyside.qtnetwork python-qmsystem
python-qtmobility.multimediakit
python-qtmobility.systeminfo python-support
0 upgraded, 9 newly installed, 0 to remove and6 not upgraded.
1 not fully installed or removed.
Need to get 0B/6,484kB of archives.
After this operation, 20.7MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
aegis-deb-release: Missing ':' in ' b27838cd7450c6f10d39ce9491ec20a1 756954 free/source/Sources
d91852b967d8dbeab6248c6f1556405c 224347 free/source/Sources.gz
144e299a324fedc82763cb3ddfacadd1743cd7ed 756954 free/source/Sources
44afe3219b48edd1fe357726716df2e02dcf4759 224347 free/source/Sources.gz
c3ca448e424cefa1c2f1468847a2230fccea9ef3afafcb5cd9 27cd99914e8cea 756954 free/source/Sources
f507ece4b736634f52ef579e5742313df4ba1b19da1f9483f8 bb2e214e578690 224347 free/source/Sources.gz
'
Aegis rejecting /var/cache/apt/archives/python-support_1.0.8maemo5+0m6_all.deb: package 'python-support' origin cannot be determined -- signature check failed
Aegis rejecting /var/cache/apt/archives/python-qtmobility.systeminfo_0.2.2.1-0maemo3+0m6_armel.deb: package 'python-qtmobility.systeminfo' origin cannot be determined -- signature check failed
Aegis rejecting /var/cache/apt/archives/python-qtmobility.multimediakit_0.2.2.1-0maemo3+0m6_armel.deb: package 'python-qtmobility.multimediakit' origin cannot be determined -- signature check failed
Aegis rejecting /var/cache/apt/archives/python-qmsystem_0.1-0maemo5+0m6_armel.deb: package 'python-qmsystem' origin cannot be determined --signature check failed
Aegis rejecting /var/cache/apt/archives/python-pyside.qtnetwork_1.0.7-1maemo2+0m6_armel.deb: package 'python-pyside.qtnetwork' origin cannotbe determined -- signature check failed
Aegis rejecting /var/cache/apt/archives/python-pyside.qtgui_1.0.7-1maemo2+0m6_armel.deb: package 'python-pyside.qtgui' origin cannot be determined -- signature check failed
Aegis rejecting /var/cache/apt/archives/python-pyside.qtcore_1.0.7-1maemo2+0m6_armel.deb: package 'python-pyside.qtcore' origin cannot be determined -- signature check failed
Aegis rejecting /var/cache/apt/archives/libshiboken1.0_1.0.7-1maemo1+0m6_armel.deb: package 'libshiboken1.0' origin cannot be determined --signature check failed
Aegis rejecting /var/cache/apt/archives/libpyside1.0_1.0.7-1maemo2+0m6_armel.deb: package 'libpyside1.0' origin cannot be determined -- signature check failed
aegis aborting dpkg -- all listed package files rejected
Compilation failed in require.
Updating desktop entries... Done
E: Sub-process /usr/bin/dpkg returned an errorcode (255)
~ # apt-get install libpyside1.0 libshiboken1.0
python-support python-pyside.qtnetwork -s
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies.
n9-button-monitor: Depends: python-qmsystem but it is not going to be installed
Depends: python-qtmobility.multimediakit but it is not going to be installed
Depends: python-qtmobility.systeminfo but it is not going to be installed
Depends: python-pyside.qtgui but it is not going to be installed
Depends: python-pyside.qtcore but it is not going to be installed
python-pyside.qtnetwork: Depends: python-pyside.qtcore (= 1.0.7-1maemo2+0m6) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
~ #

Regards Dousan...

wolke
2012-04-18, 18:12
Sure thing:

# apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies...Done
The following extra packages will be installed:
libpyside1.0 libshiboken1.0
python-pyside.qtcore python-pyside.qtgui
python-pyside.qtnetwork python-qmsystem
python-qtmobility.multimediakit
python-qtmobility.systeminfo python-support
The following NEW packages will be installed
libpyside1.0 libshiboken1.0
python-pyside.qtcore python-pyside.qtgui
python-pyside.qtnetwork python-qmsystem
python-qtmobility.multimediakit
python-qtmobility.systeminfo python-support
0 upgraded, 9 newly installed, 0 to remove and6 not upgraded.
1 not fully installed or removed.
Need to get 0B/6,484kB of archives.
After this operation, 20.7MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
aegis-deb-release: Missing ':' in ' b27838cd7450c6f10d39ce9491ec20a1 756954 free/source/Sources
d91852b967d8dbeab6248c6f1556405c 224347 free/source/Sources.gz
144e299a324fedc82763cb3ddfacadd1743cd7ed 756954 free/source/Sources
44afe3219b48edd1fe357726716df2e02dcf4759 224347 free/source/Sources.gz
c3ca448e424cefa1c2f1468847a2230fccea9ef3afafcb5cd9 27cd99914e8cea 756954 free/source/Sources
f507ece4b736634f52ef579e5742313df4ba1b19da1f9483f8 bb2e214e578690 224347 free/source/Sources.gz
'
Aegis rejecting /var/cache/apt/archives/python-support_1.0.8maemo5+0m6_all.deb: package 'python-support' origin cannot be determined -- signature check failed
Aegis rejecting /var/cache/apt/archives/python-qtmobility.systeminfo_0.2.2.1-0maemo3+0m6_armel.deb: package 'python-qtmobility.systeminfo' origin cannot be determined -- signature check failed
Aegis rejecting /var/cache/apt/archives/python-qtmobility.multimediakit_0.2.2.1-0maemo3+0m6_armel.deb: package 'python-qtmobility.multimediakit' origin cannot be determined -- signature check failed
Aegis rejecting /var/cache/apt/archives/python-qmsystem_0.1-0maemo5+0m6_armel.deb: package 'python-qmsystem' origin cannot be determined --signature check failed
Aegis rejecting /var/cache/apt/archives/python-pyside.qtnetwork_1.0.7-1maemo2+0m6_armel.deb: package 'python-pyside.qtnetwork' origin cannotbe determined -- signature check failed
Aegis rejecting /var/cache/apt/archives/python-pyside.qtgui_1.0.7-1maemo2+0m6_armel.deb: package 'python-pyside.qtgui' origin cannot be determined -- signature check failed
Aegis rejecting /var/cache/apt/archives/python-pyside.qtcore_1.0.7-1maemo2+0m6_armel.deb: package 'python-pyside.qtcore' origin cannot be determined -- signature check failed
Aegis rejecting /var/cache/apt/archives/libshiboken1.0_1.0.7-1maemo1+0m6_armel.deb: package 'libshiboken1.0' origin cannot be determined --signature check failed
Aegis rejecting /var/cache/apt/archives/libpyside1.0_1.0.7-1maemo2+0m6_armel.deb: package 'libpyside1.0' origin cannot be determined -- signature check failed
aegis aborting dpkg -- all listed package files rejected
Compilation failed in require.
Updating desktop entries... Done
E: Sub-process /usr/bin/dpkg returned an errorcode (255)
~ # apt-get install libpyside1.0 libshiboken1.0
python-support python-pyside.qtnetwork -s
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies.
n9-button-monitor: Depends: python-qmsystem but it is not going to be installed
Depends: python-qtmobility.multimediakit but it is not going to be installed
Depends: python-qtmobility.systeminfo but it is not going to be installed
Depends: python-pyside.qtgui but it is not going to be installed
Depends: python-pyside.qtcore but it is not going to be installed
python-pyside.qtnetwork: Depends: python-pyside.qtcore (= 1.0.7-1maemo2+0m6) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
~ #

Regards Dousan...

ok, so i dont think its your xcb/qt5 repo thats breaking it, but it could be.

i have absolutely no idea why those wont install. fix the dep problems, then apt-get update && apt-get upgrade, then try again.

Dousan
2012-04-18, 18:25
Thanks for your help wolke :)

when i do 'apt-get update' i get this error


W: GPG error: http://repo.apps.formeego.org ./Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 700116F6792563E3
~ #

Regards Dousan...

e: shouldn't one be cautious with 'apt-get upgrade'?

wolke
2012-04-18, 18:44
Thanks for your help wolke :)

e: shouldn't one be cautious with 'apt-get upgrade'?

generally speaking, no, not really.

it depends on how much you trust the maintainers of the repositories. i dont trust nokia much, so im a bit cautious about upgrading, but i still install the upgrades unless theres damn good reason not to, and there hasnt been yet.

IMO, you shouldnt have a repo installed that youre afraid to do apt-get upgrade with. for unstable repos, you should enable them, upgrade carefully and judiciously, and disable them, if you want to have some semblance of stability.

anyway, do what you feel. it could fix the problem, or give you cancer.

Dousan
2012-04-18, 18:50
generally speaking, no, not really.

it depends on how much you trust the maintainers of the repositories. i dont trust nokia much, so im a bit cautious about upgrading, but i still install the upgrades unless theres damn good reason not to, and there hasnt been yet.

IMO, you shouldnt have a repo installed that youre afraid to do apt-get upgrade with. for unstable repos, you should enable them, upgrade carefully and judiciously, and disable them, if you want to have some semblance of stability.

anyway, do what you feel. it could fix the problem, or give you cancer.

Once again thanks for your help, time and advise. It turned out to be Meecatalog that caused the problems. I disabled all extra reps from I've enabled in Meecatalog and that did the trick.

Ohh and thanks for this app/script it is working just fine.

Regards Dousan...

wolke
2012-04-29, 23:29
new release is up.

includes an ugly config gui, and hopefully should work without inception now.

wolke
2012-04-29, 23:50
feedback would be appreciated, especially on the gui {which is the ugliest thing ive ever seen; pyside is surprisingly ugly out of the box, without any qml or whatever you gui-kids use these days}.

as far as i can tell, the gui works, but isnt too friendly to use. ill see about styling it up in a modern, harmattan-ish way next release.

if someone who does NOT use inception could confirm that this works for them, i would appreciate it.

wolke
2012-04-30, 03:42
left out a critical feature; 0.4.3 is up now

config file is automatically reloaded now without a phone restart {no upstart restart necessary, either}

AB3S
2012-05-01, 17:41
I just installed the new version, maybe the gui is a little bit ugly and too small but this app works just fine for me! Many thanks

P.S.
I don't use inception ;)

Dousan
2012-05-01, 18:01
Also installed and working without inception here aswell, only thing is that the 'change songs' doesn't work for me when on lockscreen it only turns the volume down, no biggie though.
About the UI, it's not fancy in anyway, but works and reminds me of some of the GUI's from the mods on the N900 :)

On another note 'descovered' that the remote on the earpiece works aswell when plugged in. The volume rocker does the same thing as the volume HW buttons does. Nice thing when taking photos, less of a chance they get shaken when pressing volume up.
Could the extra buttons on the earpiece remote be used to change other stuff in the camera app? e.g. the flash mode or the white balance and such?

Ohh one thing nothing would show in the txt fields in the app before i hit the 'save config' button and then after that i could load 'default config'.

Regards Dousan...

Yeahh also a big thanks from me for this app, very usefull...

wolke
2012-05-01, 18:30
I just installed the new version, maybe the gui is a little bit ugly and too small but this app works just fine for me! Many thanks
P.S. I don't use inception ;)

Also installed and working without inception here aswell, only thing is that the 'change songs' doesn't work for me when on lockscreen it only turns the volume down, no biggie though.
About the UI, it's not fancy in anyway, but works and reminds me of some of the GUI's from the mods on the N900 :)

On another note 'descovered' that the remote on the earpiece works aswell when plugged in. The volume rocker does the same thing as the volume HW buttons does. Nice thing when taking photos, less of a chance they get shaken when pressing volume up.
Could the extra buttons on the earpiece remote be used to change other stuff in the camera app? e.g. the flash mode or the white balance and such?

Ohh one thing nothing would show in the txt fields in the app before i hit the 'save config' button and then after that i could load 'default config'.

Regards Dousan...

Yeahh also a big thanks from me for this app, very usefull...

thanks for testing guys!

thats pretty cool about the volume rocker. alas, i have no way of testing it to see what it does, but i suspect that theres no way to differentiate between the hardware vol keys and the headset rocker.

odd, playpause/next/prev works just fine for me. however, it ALSO changes the volume for me when on the bluerain-lockscreen {not the lowpower-lockscreen}.

could you do me a favor and try running it directly and pasting the output? {as root, 'stop apps/n9-button-monitor', then as user, '/opt/n9-button-monitor/n9-button-monitor.py'}

also, if anyone else has this problem, please let me know.


about the text not showing up, it starts out blank, and you can load either the default or the current config, modify it, and save it.

i did it that way because i found some painting issues in pyside when initializing a bunch of ui elements at once. {gui-library-type-problems, not bugs in my code} these painting issues could explain what youre seeing; elements would appear/disappear, text would show doubled up or not at all, the mouse would be slightly off, etc.
i have no idea why pyside doesnt just work; i dont really want to write QML and C++ code for such a simple thing.

Dousan
2012-05-01, 18:44
Hi wolke.

First command gives me 'sh: stop not found'

Second command gives me:
$ /opt/n9-button-monitor/n9-button-monitor.py
/home/user/.config/n9-button-monitor.ini 121 881a4 29999 29999 b303 3973 1 0 0 1335852756 1335852756 1335852756 4096

refreshing config
torch on
libomap3camd 1.133
Staring camera without viewfinder available
libomap3camd 1.133
auto shut-off
torch off

Regards Dousan...

wolke
2012-05-01, 18:48
Hi wolke.

First command gives me 'sh: stop not found'

Second command gives me:
$ /opt/n9-button-monitor/n9-button-monitor.py
/home/user/.config/n9-button-monitor.ini 121 881a4 29999 29999 b303 3973 1 0 0 1335852756 1335852756 1335852756 4096

refreshing config
torch on
libomap3camd 1.133
Staring camera without viewfinder available
libomap3camd 1.133
auto shut-off
torch off

Regards Dousan...

sorry, first comand should be:

devel-su
/sbin/stop apps/n9-button-monitor

and then run the second command like you did, configure it to skip songs while locked, start a multi-song playlist/album/thing in the mediaplayer, and then try to skip a song while locked a few times. im hoping it doesnt print aegis errors.

Dousan
2012-05-01, 19:09
sorry, first comand should be:

devel-su
/sbin/stop apps/n9-button-monitor

and then run the second command like you did, configure it to skip songs while locked, start a multi-song playlist/album/thing in the mediaplayer, and then try to skip a song while locked a few times. im hoping it doesnt print aegis errors.

This time the first command gives me this

# /sbin/stop apps/N9_button_monitor.py
stop: Unknown job: apps/N9_button_monitor.py
~ #


And the second command
$ /opt/n9-button-monitor/n9-button-monitor.py
/home/user/.config/n9-button-monitor.ini 121 881a4 29999 29999 b303 3973 1 0 0 1335852756 1335852756 1335852756 4096

refreshing config
torch on
libomap3camd 1.133
Staring camera without viewfinder available
libomap3camd 1.133
auto shut-off
torch off
/home/user/.config/n9-button-monitor.ini 121 881a4 29999 29999 b303 3973 1 0 0 1335852756 1335852756 1335852756 4096

3: longClickStart
/home/user/.config/n9-button-monitor.ini 121 881a4 29999 29999 b303 3973 1 0 0 1335852756 1335852756 1335852756 4096

3: longClickStop
/home/user/.config/n9-button-monitor.ini 121 881a4 29999 29999 b303 3973 1 0 0 1335852756 1335852756 1335852756 4096

3: longClickStart
/home/user/.config/n9-button-monitor.ini 121 881a4 29999 29999 b303 3973 1 0 0 1335852756 1335852756 1335852756 4096

3: longClickStop
/home/user/.config/n9-button-monitor.ini 121 881a4 29999 29999 b303 3973 1 0 0 1335852756 1335852756 1335852756 4096

3: longClickStart
/home/user/.config/n9-button-monitor.ini 121 881a4 29999 29999 b303 3973 1 0 0 1335852756 1335852756 1335852756 4096

3: longClickStop
/home/user/.config/n9-button-monitor.ini 121 881a4 29999 29999 b303 3973 1 0 0 1335852756 1335852756 1335852756 4096


Regards Dousan...

wolke
2012-05-01, 19:22
This time the first command gives me this

# /sbin/stop apps/N9_button_monitor.py
stop: Unknown job: apps/N9_button_monitor.py
~ #


And the second command
$ /opt/n9-button-monitor/n9-button-monitor.py
/home/user/.config/n9-button-monitor.ini 121 881a4 29999 29999 b303 3973 1 0 0 1335852756 1335852756 1335852756 4096

refreshing config
torch on
libomap3camd 1.133
Staring camera without viewfinder available
libomap3camd 1.133
auto shut-off
torch off
/home/user/.config/n9-button-monitor.ini 121 881a4 29999 29999 b303 3973 1 0 0 1335852756 1335852756 1335852756 4096

3: longClickStart
/home/user/.config/n9-button-monitor.ini 121 881a4 29999 29999 b303 3973 1 0 0 1335852756 1335852756 1335852756 4096

3: longClickStop
/home/user/.config/n9-button-monitor.ini 121 881a4 29999 29999 b303 3973 1 0 0 1335852756 1335852756 1335852756 4096

3: longClickStart
/home/user/.config/n9-button-monitor.ini 121 881a4 29999 29999 b303 3973 1 0 0 1335852756 1335852756 1335852756 4096

3: longClickStop
/home/user/.config/n9-button-monitor.ini 121 881a4 29999 29999 b303 3973 1 0 0 1335852756 1335852756 1335852756 4096

3: longClickStart
/home/user/.config/n9-button-monitor.ini 121 881a4 29999 29999 b303 3973 1 0 0 1335852756 1335852756 1335852756 4096

3: longClickStop
/home/user/.config/n9-button-monitor.ini 121 881a4 29999 29999 b303 3973 1 0 0 1335852756 1335852756 1335852756 4096


Regards Dousan...

thanks, but its "/sbin/stop apps/n9-button-monitor"
not "/sbin/stop apps/N9_button_monitor.py" {all lowercase, no .py at the end, and dashes not underscores}

however, dont bother rerunning; the long click thing shows that you have nothing set to long click.

im assuming that you dont mean to long-click, tho.
can i see your n9-button-monitor.ini? judging from what you said about the textboxen being empty before, my guess is that your delays are probably 0.
if they ARE zeros, try opening up the gui, loading default, and saving again.

Dousan
2012-05-01, 19:41
Lol yeah sorry about the mistyping gotten to used to write 'N9' and '_' from instalking .deb files and memory ain't my strong side today and don't like to use copy/paste function on the N9 it's a killer to use.

Anyway, reloading and saving the config file once again solved the problem.

Thanks for your time once again :)

Regards Dousan...

wolke
2012-05-01, 19:42
cool, we aims to please

late88
2012-05-02, 16:29
First of all I would like to say thanks to wolke for such a good app! I found it very useful and practical.

There is one thing that bothers me. If you activate the led/torch in lowpower screen and after releasing, there's a little "snap" sound from the device. It doesn't sound good. Think it could be harmful in the long run for the LED?

Edit: I just found out that you can hear the same sound after closing camera app (after photo taken) and also from closing a flashlight app. Wonder why...

HtheB
2012-05-02, 16:41
any update regarding to "HtheB style volume button"?

wolke
2012-05-02, 16:45
First of all I would like to say thanks to wolke for such a good app! I found it very useful and practical.

There is one thing that bothers me. If you activate the led/torch in lowpower screen and after releasing, there's a little "snap" sound from the device. It doesn't sound good. Think it could be harmful in the long run for the LED?

Edit: I just found out that you can hear the same sound after closing camera app (after photo taken) and also from closing a flashlight app. Wonder why...

youre welcome!

yea, i dont know why either. i has assumed it was the shutter, but i dont hear it when taking a picture.

it happens every time you unload the camera object. {this happens whenever you close the camera app, navigate away from the camera app, lock the phone while in the camera app, or call unload() directly like in my torch}

as for harmful to the LED, i seriously doubt it. anything that would happen as often as the camera going to sleep cant be too bad.

you got me real curious; anybody know? i hear two soft, mechanical clicks, in rapid succession.


P.S. if you use the torch enough, it will obviously decrease the life of the led, as will taking lots of pictures with flash.

Dousan
2012-05-02, 16:51
First of all I would like to say thanks to wolke for such a good app! I found it very useful and practical.

There is one thing that bothers me. If you activate the led/torch in lowpower screen and after releasing, there's a little "snap" sound from the device. It doesn't sound good. Think it could be harmful in the long run for the LED?

Edit: I just found out that you can hear the same sound after closing camera app (after photo taken) and also from closing a flashlight app. Wonder why...

It's the camera starting up/shutter opening/closing. The led flash must be connected to the camera and when used only as torch the camera still gets activated.

Regards Dousan...

AB3S
2012-05-02, 16:52
There is one thing that bothers me. If you activate the led/torch in lowpower screen and after releasing, there's a little "snap" sound from the device. It doesn't sound good. Think it could be harmful in the long run for the LED?


I don't hear anything like that from mine...


I'm wondering why the led turn off immediately when I release the button, any ideas?

wolke
2012-05-02, 16:59
I don't hear anything like that from mine...


I'm wondering why the led turn off immediately when I release the button, any ideas?

yes, its by design. there are two actions responsible for it, longPressStart, and longPressStop.

if you want it merely to toggle the flashlight:
1) delete the stop action {longPressStop => torchOff}
2) find the action longPressStart => torchOn, and change it "torchOn" to "torchToggle"

late88
2012-05-02, 17:04
@AB3S:

Are you sure there's no sound? Listen carefully, put you ear directly to te phone and listen. It's not very loud sound though.

I have the same thing with the LED turning off (less than half second), but i think it's supposed to do so, when longpressing button. Delay time is for activating led without long press I think?

Edit: wolke was quicker...

wolke
2012-05-02, 17:05
any update regarding to "HtheB style volume button"?

im still trying to figure out how to get mafw initialized; there are no opensource programs that do it, so im trying, rather unsuccessfully, to reverse engineer how qmafw-gui does it. {after mafw is initialized, like when mediaplayer is open, theres a dbus interface that works perfectly}.

as for the other half of the project, that too hit an annoying wall.
there are no python bindings for libresourceqt. my current idea is to make a separate, standalone c++ application that does nothing but disable normal volume button actions.

so, current status:
if i put them in now, youd have to have qmafw-gui open in the backgroun {or media player}, and the profile would still change.

wolke
2012-05-02, 17:11
@AB3S:
Delay time is for activating led without long press I think?


the slowness of the LED to turn on has three components:
1) longPressDelay: make sure that youre not trying to do a single-press {this is set to 400ms}
2) check the conditions to find the correct action {this can take like 500ms, but i with the current setup its much less}
3) initialize the camera {camera app wouldnt work if i kept the camera loaded up all the time} {this takes maybe 1000ms}

for me, the LED turns on in ~2s. you can make it faster by removing the condition for all longPressActions {this would make it work even when the phone isnt locked, tho}, and decreasing the longPressDelay{this would make it hard to do single click actions}. its never going to be less than a full second though

HtheB
2012-05-02, 17:15
im still trying to figure out how to get mafw initialized; there are no opensource programs that do it, so im trying, rather unsuccessfully, to reverse engineer how qmafw-gui does it. {after mafw is initialized, like when mediaplayer is open, theres a dbus interface that works perfectly}.

as for the other half of the project, that too hit an annoying wall.
there are no python bindings for libresourceqt. my current idea is to make a separate, standalone c++ application that does nothing but disable normal volume button actions.

so, current status:
if i put them in now, youd have to have qmafw-gui open in the backgroun {or media player}, and the profile would still change.

Can you make some daemon that runs in the background that acts like its a mediaplayer?
This way, if you press the vol up or down, it just change the volume instead of the profile. This could be a very usefull workaround

AB3S
2012-05-02, 17:16
yes, its by design. there are two actions responsible for it, longPressStart, and longPressStop.


Perfect! I didn't see the second action, my fault ;)

@AB3S:
Are you sure there's no sound? Listen carefully, put you ear directly to te phone and listen. It's not very loud sound though.


Ok I did as you said... and yes, now I can hear this sound, but only if I put my ear directly to the phone. It's a very very feeble sound.

wolke
2012-05-02, 17:20
Can you make some daemon that runs in the background that acts like its a mediaplayer?
This way, if you press the vol up or down, it just change the volume instead of the profile. This could be a very usefull workaround

thats precisely what im trying to do. the 'acts like its a mediaplayer' thing is extremely difficult to figure out, because the mediaplayer and everything else that initializes mafw is closed source. {the thing that the mediaplayer does to make the volume work is to initialize mafw}.

late88
2012-05-03, 12:44
@wolke:

I have another problem with the app. I have playpause configured in vol- double click, and it works like it should, but it also decreases music volume one level every time I pause the music. Any ideas for this?

wolke
2012-05-03, 14:50
@wolke:

I have another problem with the app. I have playpause configured in vol- double click, and it works like it should, but it also decreases music volume one level every time I pause the music. Any ideas for this?

sorry, the default actions for buttons still happen, no matter where you do this.

adding an option to disable them is one of the three high priority features for a future release. {the other two are media volume control, and quick-snap pictures from lockscreen}. all three require figuring out some rough stuff, though.

on the regular lockscreen, volume keys change the volume when music player is running. when its not, they change the profile. on the lowpower lockscreen, they do nothing by default.

you might want to consider using the lp lockscreen as a workaround for this missing feature; there are no default actions there. i personally have the power button unlock both so that i never see the regular lockscreen. {i use lpsmagic to make the low power screen useful; it shows battery % and discharge rate, and my currently playing song}

late88
2012-05-03, 15:43
You got it wrong. The volume decrease happens in LOWPOWER screen.

wolke
2012-05-03, 15:44
you got it wrong. The volume decrease happens in lowpower screen.

**** .

wolke
2012-05-03, 15:50
again, an oversight on my part because i dont use the built-in music app. AAAARGH, this is so annoying. i guess i just have to work on disabling the buttons, which means writing quite a bit of c++.

also means i cant develop it without a computer because ****ING NOKIA DOESNT RELEASE ALL THE DEV SOURCE PACKAGES IN THE DEV REPO.

just so you know, a good deal of the development for this was done on the phone while riding the train, with a btkb. HATE HATE HATE HATE HATE

late88
2012-05-03, 15:50
**** .

actually it is default action to increase and decrease volume in lowpower screen.

sorry, my mistake.

wolke
2012-05-03, 15:56
actually it is default action to increase and decrease volume in lowpower screen.

sorry, my mistake.

yea, still sucks; this means whole goddam thing is fairly useless when running the music player. such stupid design. you should be able to do exactly one thing while the phone is locked, and thats unlock it.

Rusnak-COBRA
2012-05-03, 17:44
Hello Wolke. Sorry for my question, maybe it is answered somewhere in this topic... is there any chance to bind an action - start camera app from locked screen? I mean, I will hold on vol+ for a while and it will unlock screen and launch camera app. is it possible?

wolke
2012-05-03, 17:53
sure! just make a binding with the CMD action, and place the path for your script for doing it in the CMD action param.

your script just needs to unlock the phone, and call camera-ui

Dousan
2012-05-03, 17:55
Hello Wolke. Sorry for my question, maybe it is answered somewhere in this topic... is there any chance to bind an action - start camera app from locked screen? I mean, I will hold on vol+ for a while and it will unlock screen and launch camera app. is it possible?

@wolke stated in an earlier post that he will work on snap picture from locked device (lp screen) ;)

Regards Dousan...

wolke
2012-05-03, 17:57
@wolke stated in an earlier post that he will work on snap picture from locked device (lp screen) ;)

Regards Dousan...

thats, in my opinion, the good longterm fix for quick snapping, but rusnak, you can do what you asked for right now, with the latest version.

Rusnak-COBRA
2012-05-04, 01:08
hm, i must admitt that I really do not know how should this cmd syntax look like for this kind of task.

wolke
2012-05-05, 01:27
yay, quick snap works!
as root anyway, gotta make sure that aegis perms are sufficient, add the shutter sound, action bindings, and as many configs as i can think of and reasonably implement.

ill stick em here for now: ~/MyDocs/quicksnap/`date +%s`.py

anyone have any ideas/inputs/etc?

-quicksnap can have flash auto/on/off. i think auto makes sense. i could add actions for each so you could pick on the fly {double-click is no flash, treble-click is always flash, etc}, or make a separate config item so you can pick once {tom likes flash always off, mary likes flash auto}

-quicksnap can focus first, or there can be a separate focus action, or both. there can be a config, too, for how long to give it to focus, etc

-video recording doesnt seem feasible

-shutter sound makes sense to use whatever's at '/usr/share/sounds/ui-tones/snd_camera_shutter.wav', but maybe an option as well

Dousan
2012-05-05, 10:40
Great news about the quick snapper :)

I have a question:
When using the headset listning to music and the device is locked (lp lockscreen/lockscreen) the volume button on the remote has the same actions as the HW volume buttons, changing song and play/pause. So when i have to turn up sound I have to long press volume up on the remote and sound is turning up until the torch starts lighting. Sometimes i just want to take it up/down one nudge and ends up pausing/skipping songs.
Here's my question, can you somehow comment out the volume button app to not work with the media when the jackstick is pkugged in while still work with the camera?
It's no biggie though it would be more convinient if it was 'turned off' as described above :)

Ohh i think about the quick shutter you should make it as custom options wich actions you'll like it to do when quick snapping.

Regards Dousan...

wolke
2012-05-05, 20:05
thx for the quicksnap input {the more feedback now, the better, cause once i actually code this up, it will be hard to get your two cents in}

i dont know how to detect 'jackstick is plugged in', and, in my opinion, its a low-priority thing compared with totally disabling the volume buttons {which would be the best solution, again just in my opinion}.

im pretty ticked off that the volume keys work in the lockscreen to begin with; i think its a dirty-urty trick that nokia preemptively played on me particularly, in the future-past.

my recommendations are to either/both:
1) remove the music actions
2) change the volume from the status bar after unlocking it

i mean, i generally adjust the volume once and use an equalizer to make sure my ear drums dont get blasted. i then routinely skip through songs, and play/pause, waaay more often than id ever want to adjust the volume. this is me personally, tho, and my music player doesnt have volume-key-controls. {so for me, my buttons just skip my music without messing with the volume}

rexii23
2012-05-06, 11:17
For quick snap I would personally prefer a config file. click, double-click, treble-click could be messy when trying to snap a pic ASAP. I would love to have the option of disabling the AF light too. It blinds my cats and I have missed some great shots.

wolke
2012-05-06, 17:13
heh, i dont know how to do that, even with the regular camera. i cover the bulb with my finger when focusing.

wolke
2012-05-09, 16:26
{100 downloads on github. yay!}

guillermorojaz
2012-05-26, 09:18
Greetings.
Great job, man.
In my case I just want to have the torch as a function.
Edit config.py to keep it with that configuration.
I would like to know how one could do to also be on the desktop.
action=torchToggle,volumeUp,SingleClick, screenLocked and desktop\n"
It is possible that the action of the volume keys is both the screelocker and the desktop?
Thanks in advance.

wolke
2012-05-26, 16:06
Greetings.
Great job, man.
In my case I just want to have the torch as a function.
Edit config.py to keep it with that configuration.
I would like to know how one could do to also be on the desktop.
action=torchToggle,volumeUp,SingleClick, screenLocked and desktop\n"
It is possible that the action of the volume keys is both the screelocker and the desktop?
Thanks in advance.

for disjunction, simply add two identical actions, one with
cond=appOnTop("first-place-it-should-work")
and one with
cond=appOnTop("second-place-it-should-work")

i forget what the 'desktop' screen is called {you want the title property of the window for it}.

beware! what you want is probably not possible, because the default action {i.e. changing the volume} WILL happen no matter what other actions you do. im working on this, not sure its possible yet.

guillermorojaz
2012-05-26, 20:54
for disjunction, simply add two identical actions, one with
cond=appOnTop("first-place-it-should-work")
and one with
cond=appOnTop("second-place-it-should-work")

i forget what the 'desktop' screen is called {you want the title property of the window for it}.

beware! what you want is probably not possible, because the default action {i.e. changing the volume} WILL happen no matter what other actions you do. im working on this, not sure its possible yet.

Thanks for responding.

I want to say that as you have seen in the config.py let it set for 5 min. works perfect.
Turns the flash with any of the keys vol.
A small detail. while turning the key flash vol, and then unlock the screen, vol keys stop working;

- On Call does not increase or decrease the volume.
- In desktop profile does not change.
- In the camera, not opening. (Camera does not respond, restart If the problem persists).

Only panpalla relock, click on vol. and ready.

I mention it so you know what happens with these settings.

I actually think it's perfect.

It is an excellent work.

wolke
2012-05-27, 06:42
Thanks for responding.

Turns the flash with any of the keys vol.

- On Call does not increase or decrease the volume.
- In desktop profile does not change.
- In the camera, not opening. (Camera does not respond, restart If the problem persists).



i noticed in the config.py, the only changes you made were to the default config; you should instead make your own ini file.

the ini file goes at /home/user/.config/n9-button-monitor.ini
you should simply put this there, and use the deb file as it is:

torchAutoShutOffTimeMs=300000
longClickDelayMs=400
doubleClickDelayMs=400
trebleClickDelayMs=600
action=torchToggle,volumeUp,singleClick,screenLock ed
action=torchToggle,volumeDown,singleClick,screenLo cked


{do what you like, modifying the source to be how you want is what the gpl is all about. what im suggesting is better if you want to just change the config, though. you can change the ini at runtime without restarting, and you dont invalidate the deb files in aegis.}



now, as for your keys not changing the volume or the profile, i have no idea how you achievd this, but i would really like to know! do you use inception? do you run the program as root? are you on openmode? {if youre not, you could brick your phone by modifying the source files without updating the digsigsums. perhaps this is also causing your camera troubles.}

Storm_11
2012-05-27, 07:32
one big idea that is on android roms that could be useful with this application is using volume buttons to move cursor in text. for example, up moves the arrow right and down moves cursor left. will make the lack of hwkb easier for those of us who dont use swype.

guillermorojaz
2012-05-27, 07:45
{do what you like, modifying the source to be how you want is what the gpl is all about. what im suggesting is better if you want to just change the config, though. you can change the ini at runtime without restarting, and you dont invalidate the deb files in aegis.}


now, as for your keys not changing the volume or the profile, i have no idea how you achievd this, but i would really like to know! do you use inception? do you run the program as root? are you on openmode? {if youre not, you could brick your phone by modifying the source files without updating the digsigsums. perhaps this is also causing your camera troubles.}

Hi.
If openmode.
As I mentioned before,
When you start the flash key vol->unlock screen->phone call->volume keys do not work.
When you start the flash key vol->unlock screen->desktop->volume keys do not change the profile.
Screen lock->keys vol->flash off->returns to normal.


The error in the camera is simply the flash on, try any app (theflashlight), is the same.

I imagine the mistakes mentioned above is due to start the flash and then try to give use volume keys while the flash is on.

You can disable the flash function to unlock screen?

locked screen->key vol->flash on->unlock screen->flash off.

guillermorojaz
2012-05-27, 08:13
one big idea that is on android roms that could be useful with this application is using volume buttons to move cursor in text. for example, up moves the arrow right and down moves cursor left. will make the lack of hwkb easier for those of us who dont use swype.

It would be helpful.

ladoga
2012-07-15, 12:45
again, an oversight on my part because i dont use the built-in music app. AAAARGH, this is so annoying. i guess i just have to work on disabling the buttons, which means writing quite a bit of c++.

also means i cant develop it without a computer because ****ING NOKIA DOESNT RELEASE ALL THE DEV SOURCE PACKAGES IN THE DEV REPO.

just so you know, a good deal of the development for this was done on the phone while riding the train, with a btkb. HATE HATE HATE HATE HATE

We could just add those -dev packages into community repository, no?

[edit] btw. how would I start a camera app from the stand-by screen using the button monitor? I'm interested in long tap on vol-up key unlocking the phone and launching the app.

redgael
2012-07-15, 14:25
Hello, how to throw the flashlight by double pressing power button ?

late88
2012-07-15, 14:53
Hello, how to throw the flashlight by double pressing power button ?

After closer look I think it's impossible at the moment. Why not double press volume keys? Or long press volume up --> flash ON release --> flash OFF.

It works from the low power mode.

ssciberras
2012-07-15, 15:10
how do u use the program? I have run the gui, do you have to run anythibg else in terminal?

Dousan
2012-07-15, 15:21
how do u use the program? I have run the gui, do you have to run anythibg else in terminal?

When in the gui press 'load default config' and it show in the boxes. Make your changes if any and press 'save config file' and if you don't make any also press 'save config file'. That should work atleast it did for me.

Regards Dousan...

redgael
2012-07-15, 17:13
I have not included all :s

flopjoke
2012-07-15, 17:35
this is a very useful app thingy. Yeah, the GUI may be ugly, but whether that's fixed or not, it still is very handy. Especially the torch part.

wolke
2012-07-16, 00:52
this is a very useful app thingy. Yeah, the GUI may be ugly, but whether that's fixed or not, it still is very handy. Especially the torch part.

glad you like it!

i dont use the gui myself, i made it for the terminal-wary. literally all it does is edit a text a file.

wolke
2012-07-16, 01:04
We could just add those -dev packages into community repository, no?

[edit] btw. how would I start a camera app from the stand-by screen using the button monitor? I'm interested in long tap on vol-up key unlocking the phone and launching the app.

the development headers need to be repackaged by someone with a lot of time, and experience managing these things.


unlocking the phone when you press a volume key is quite tricky. starting the camera app is trivial.

you need to make a script that can be run as user that unlocks the phone.


this will start the camera, but doesnt unlock it:
action=cmd(camera-ui),volumeUp,longClickStart,screenLocked

wolke
2012-07-17, 18:22
200 downloads!
1 donations!
;)

wolke
2012-07-18, 22:19
anyone know if it works on pr1.3?

Kabouik
2012-07-18, 22:38
It does, I'm using it, and it's great. Thanks for this Wolke. :)

I've added an action for opening the dialer when double pressing the Vol + button when the device is locked. Together with the tweak (from N9 Qtweak) to unlock the device by double pressing the power button. It's really handy: when you have to call someone but are not currently using the phone, two double-press actions while picking up the phone in your pocket, and you have the application in focus, ready to use for dialing a number or browsing a contact.

Dousan
2012-07-19, 11:57
anyone know if it works on pr1.3?

Also using it on a freshly fully flashed PR1.3 and working as it should :)

Regards Douan...

wolke
2012-07-21, 07:06
300 downloads!!
1 donations!!

wolke
2012-08-24, 18:15
400 downloads!!!
1 donations!

noetus
2012-08-26, 17:23
Hey, this is great! I've read through the thread and I have the default config saved, but there are extra actions I'd like to configure. It seems people have already implemented these but I'm not certain how to do it. Basically (1) unlock and open the phone app; (2) unlock and open the camera app. The actions are not in the standard list so how do I get them configured?

Will donate once I have this all set up as required. Also like the idea of being able to move the cursor using the volume keys when in text editing mode.

danested
2012-08-26, 18:30
400 downloads!!!
1 donations!

Havent downloaded it yet, but if you want to be paid for ypur work then i suggest u put this on the store and give that link here. Also makes more sense because all countries dont have paypal, but Nokia can work around this as they have more payment options.... Like pay via phone bill...

wolke
2012-08-27, 14:54
Hey, this is great! I've read through the thread and I have the default config saved, but there are extra actions I'd like to configure. It seems people have already implemented these but I'm not certain how to do it. Basically (1) unlock and open the phone app; (2) unlock and open the camera app. The actions are not in the standard list so how do I get them configured?

Will donate once I have this all set up as required. Also like the idea of being able to move the cursor using the volume keys when in text editing mode.

you can run any shell command. this means you can do literally anything that you can figure out how to do in a terminal; what those things are and how to do them are outside the scope of this app.

locking/unlocking the screen with a command is trivial {in openmode; probably also trivial with inception; maybe not in closed mode}. i have a script {attached} that i use for it. try it out!
if you can get it to lock/unlock in ssh, you can get it to work in n9-button-monitor.

wolke
2012-08-27, 17:55
if you want to be paid for ypur work then i suggest u put this on the store and give that link here

thanks for the tip danested, but im not sure i can put this app in the store. it interferes with {sucky} harmattan functionality, like zooming in the camera with the volume buttons. also, i dont like the store because of stupid harmful policies like the 5 download limit, and the lack of friendliness to free software {no sorting by license, no spot to even ENTER a license}.


while i was vaguely hoping the 8 or 9 people who said theyd pay me for a gui would accept the shitty gui i made and give me a free sandwich, i made this app for me, not for $$. {thanks again to the generous donor!}

if theres someone out there who really wants to give me money and cant use flattr for some reason, let me know and ill see what i can do! {flattr's pretty cool, btw: https://flattr.com/register}

wout.martens
2012-08-27, 21:08
Is it just me but is this app consuming quite some battery during standby?

wolke
2012-08-27, 21:37
Is it just me but is this app consuming quite some battery during standby?

i idle at about 6 mA with and without n9-button-monitor. ive tested it numerous times, under many different circumstances.

what numbers are you getting? if you dont have numbers, heres a good test:
1) install lpsmagic
2) uninstall n9-button-monitor completely {apt-get purge n9-button-monitor}
3) reboot
4) without doing anything else, lock the phone and observe the battery usage every 2 minutes over the course of 10 minutes
5) install n9-button-monitor
6) reboot
7) without doing anything else, lock the phone and observe the battery usage every 2 minutes over the course of 10 minutes

i get the same numbers for 4) and 7) in openmode on pr1.3, namely 6 mA average, with a high of 13 mA and a low of 4 mA.

wolke
2012-09-17, 22:10
500 downloads!
2 very generous donations!

wolke
2012-10-19, 21:54
600 downloads!
2 donations!

flopjoke
2012-10-19, 22:17
The toggle flashlight with volume keys is probably the most used thingy on my N9 now. It doesn't require you to open an app all the time or stuff like that.. just blended perfectly with the OS - really amazing stuff.. thanks!

Question - will this app ever have a proper GUI for settings?

wolke
2012-10-19, 23:48
very glad to hear it!

ahhahahha, i know the gui is ugly and unusable.
there is a good reason for this!

namely, that gui configs are silly and i hate them.
config files are so much nicer, because you can

perhaps i should just make an icon that opens up 'redak ~/.config/n9-button-monitor.ini'

p.s. the next thing i would do for this would be quiksnap, which i have working but not plugged in because life is hard. i also want to make the buttons not do volume/profile/etc in normal apps, but thats probably more or less impossible

flopjoke
2012-10-20, 09:28
quiksnap? As in screenshot? Like press volume up and down together to take a screenshot .. or am I dreaming too much? :D

Leave the GUI as it is if you want it that way.. it's not biggie really. I used it to show some iPhone people that "oh look, N9 can even run Windows 98!" So it is cool sometimes :P

HtheB
2012-10-20, 11:19
Well, I'm still waiting for the "volume button a la HtheB" :p (force to use "always media volume control)"

wolke
2012-10-20, 18:14
lolololollololololololololololololol win98

htheb, youre aware of the two obstacles right?
1) we have to cancel ALL default actions in ALL apps. i dont know if this is possible without touching the apps themselves, which are mostly closed. {this needs to still let n9-button-monitor receive the events; disabling the buttons completely wont solve it, of course}
2) {and i HALF solved this one} we have to be able to programmatically control the volume. i can only do this with a mafw application running in the background, which i may be able to do as a daemon


solicit someone who has some experience with the mostly-closed-source guts of harmattan to do #1 for us, and i will deliver you your application. i personally cant fathom how to accomplish #1, and i spent awhile banging my head.

wolke
2012-10-20, 18:17
quiksnap like take a picture with the camera from the lockscreen. like when the cat is being cute.

for screenshot, we could do long-click of volume down, but be aware that your phone would go into silent mode while we did...because of the problem#1 in the post above

thedead1440
2012-10-20, 18:26
quiksnap like take a picture with the camera from the lockscreen. like when the cat is being cute.

for screenshot, we could do long-click of volume down, but be aware that your phone would go into silent mode while we did...because of the problem#1 in the post above

i vote for both :D

The silent mode is a small price for the ease of access...

wolke
2012-10-20, 18:31
i vote for both :D

The silent mode is a small price for the ease of access...

im afraid i cant quite agree. i personally only use n9-button-monitor on the standby screen and specific apps where i can cancel the vol+/- button actions like FBReader.

the fact that the buttons also changes the profile {or the volume, or the camera zoom, or whatever weird fit takes their fancy} is a large detriment to n9bm's usability elsewhere.


you can do the screenshot bit yourself, btw, with n9-button-monitor as it stands.

make a script that will take a screenshot, and add an action with "cmd(that-script.sh)" and no condition, et voila

flopjoke
2012-10-20, 18:45
My phone is always on silent anyway, so I'm not bothered by that..

But maybe to get past that, can we have two button presses at the same time? Like I said before - press volume up and down together to take screenshot. Or Press up and then down in rapid succession, so if your phone was in silent, it'll go to beep, then back to silent again and there will be no change. Is it possible to detect that by the button monitor?

HtheB
2012-10-20, 18:49
lolololollololololololololololololol win98

htheb, youre aware of the two obstacles right?
1) we have to cancel ALL default actions in ALL apps. i dont know if this is possible without touching the apps themselves, which are mostly closed. {this needs to still let n9-button-monitor receive the events; disabling the buttons completely wont solve it, of course}
2) {and i HALF solved this one} we have to be able to programmatically control the volume. i can only do this with a mafw application running in the background, which i may be able to do as a daemon


solicit someone who has some experience with the mostly-closed-source guts of harmattan to do #1 for us, and i will deliver you your application. i personally cant fathom how to accomplish #1, and i spent awhile banging my head.

Yeah, the plan was to make some deamon running in the background to make the volume buttons work as media volume buttons. I haven't heard anything from it anymore, thats why im still waiting for it :)

make this and ull get your 3th donation ;)

wolke
2012-10-21, 05:54
htheb
heh. actually thats the easy part, and i could get that working fairly easily.
the HARD part is in stopping the default actions like profile change and camera zoom. without THAT, a volume-change-key-daemon would obviously be useless.

flopjoke
actually, it USED to work like that, so that you could define arbitrary button press patterns, like "UpPress, DownPress, DownRelease, UpRelease".
everyone told me that the patterns were ridiculous, confusing to describe, hard to press, and fairly useless. they were quite right.


what you can do instead is simply bind the screenshot button to double-press up, and then double-press down on your own to compensate. or vice-versa, depending on whether you like silent mode on more often or not.

{what im describing here is still perfectly do-able without any change to n9bm}

wolke
2012-11-07, 16:25
so i dont have an n9 anymore thanks to hurricane sandy.

turns out an empty condition is a parse error, so i did need to add a condition to support the feature flopjoke wanted. i added the screenshot action while i was there for convenience, with flopjoke compiling and testing it for me.

new version 0.4.5

1) condition=always
2) action=screenShot

note that the screen shot is always in portrait mode, like screenshotmee. screenshotmee lets you rotate the pic afterwards in a gui. n9bm just makes the file and lets you do what you want with it.

thedead1440
2012-11-07, 18:44
wolke,

So you have now lost 2 n9s? :p

wolke
2012-11-07, 20:35
oh, i see youve heard the phrase 'rubbing it in' and are a fan of it!

wolke
2013-01-06, 18:30
im adding a dbus listener to get bluetooth speaker buttons.

i just finished testing a standalone python script. if anyone has a bluetooth thingie with media buttons, i would appreciate your testing this out.

i have a hipe shower speaker, and mine does this silly thing where it occasionally sends button clicks 8 times from a single click. im especially curious to know whether this is my fault, hipe's, or nokia's.

wolke
2013-01-06, 18:34
heres the python script. you have to install some stuff.

apt-get install python-dbus python-pyside.qtcore


name it dbusbtn.py. copy it to MyDocs and run it like this:


user:~$ python /home/user/MyDocs/dbusbtn.py
button: previous-song
ignored: previous-song
ignored: previous-song
ignored: previous-song
ignored: previous-song
ignored: previous-song
ignored: previous-song
ignored: previous-song
button: next-song
button: play-cd
button: stop-cd




#!/usr/bin/python
#N9 Button Monitor
#Copyright 2012 Elliot Wolk
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

import sys
import time
import signal
from traceback import print_exc

import dbus
from dbus.mainloop.glib import DBusGMainLoop
from PySide.QtCore import QCoreApplication

signal.signal(signal.SIGINT, signal.SIG_DFL)
dbus_service="org.freedesktop.Hal"
dbus_path="/org/freedesktop/Hal/devices/computer_logicaldev_input_0"
dbus_interface="org.freedesktop.Hal.Device"
dbus_member="Condition"

## for some horrible reason, i get 8 clicks sometimes
## this buffer ignores repeated clicks within a certain time
## set it to -1 to never ignore
repeat_buffer_millis=800

last_button_click_millis = dict()

def button_clicked(button, handler):
now_millis = int(round(time.time() * 1000))
if button in last_button_click_millis:
then_millis = last_button_click_millis[button]
if now_millis - then_millis < repeat_buffer_millis:
print >> sys.stderr, " ignored: " + button
return

last_button_click_millis[button] = now_millis
handler(button)

def defaultHandler(button):
print >> sys.stderr, "button: " + button

def connectButtonDbus(handler=defaultHandler):
dbus.mainloop.glib.DBusGMainLoop(set_as_default=Tr ue)
bus = dbus.SystemBus()
try:
obj = bus.get_object(dbus_service, dbus_path)
iface = dbus.Interface(obj, dbus_interface)
except dbus.DBusException:
print_exc()
sys.exit(1)

iface.connect_to_signal(dbus_member,
lambda cond, arg: button_clicked(arg, handler))

if __name__ == '__main__':
app = QCoreApplication([])
connectButtonDbus()
app.exec_()

wolke
2013-01-06, 18:50
sorry, i typoed in the previous post. if you grabbed it before my edit, please re-grab.

wolke
2013-01-07, 17:19
new release with bluetooth speaker buttons. you set the button to "dbus" and the button-param to the name of the button as reported by hal. use "dbus-monitor --system" to get the name of the button; if that doesnt show anything, it wont work.

i currently use the buttons to control my music and audio books in the shower. i dont use the builtin media player, where the buttons presumably already work.

on the hipe shower speaker, the play/pause button is alternately "play-cd" and "pause-cd", holding it down is "stop-cd". back is always "previous-song" and forward is always "next-song".
the volume buttons are internal volume, power is internal, and the phone button does something weird through another interface
http://www.amazon.com/Hipe-Waterproof-Bluetooth-Handsfree-speakerphone/dp/B005Z3GINK

wolke
2013-01-16, 21:29
version 0.5.1, quickSnap

add an action like:
action=quickSnap(auto),volumeUp,doubleClick,screen Locked

you double click vol+ on the lockscreen, and it focuses, takes the picture, processes it for like 3 seconds, and THEN makes a camera click noise using the file camera-ui uses. total time from press to pic saved is 6s.

the auto is the flash mode. valid flash modes are 'auto', 'on', and 'off'. note that 'torch' and 'manual' are also allowed and may or may not work.

i could have the shutter sound happen when it actually takes the pic, but then theres no guarantee that it made a file. if you hear a click now, it took a picture.


it puts it in DCIM with a filename like 1358370984758.jpg. {millis since epoch}.

it may or may not show up in gallery, i dont use the tracker so i wouldnt know.

HtheB
2013-01-18, 20:05
wolke, still no ''control media volume only'' option... right? :(

wolke
2013-01-19, 00:02
wolke, still no ''control media volume only'' option... right? :(

correct. no one has yet figured out a way to:
1) stop the buttons from doing what they usually do
or
2) programmatically set volume when mfaw isnt running

I WISH SOMEONE WOULD

guillermorojaz
2013-01-19, 01:38
Hello Wolke.

You can modify the action of a SingleClick, making faster response?

Thanks in advance for your answer.

wolke
2013-01-19, 02:35
Hello Wolke.

You can modify the action of a SingleClick, making faster response?

Thanks in advance for your answer.

are you talking about quickSnap? if so, is your concern:
1) the amount of time it takes between pushing the button and capturing an image
2) the time it takes between pushing the button and saving the processed image

if youre worried that you will miss the cat being cute, be aware that the picture is taken a LONG time before the sound happens {picture is taken about 3 seconds after press. booting the camera takes some time, but also the autofocus takes time}. maybe i should make it make two sounds, one when the pic is actually being taken, and one when it is done.


P.S.: if youre taking about something other than quickSnap, lemme know

guillermorojaz
2013-01-19, 03:32
are you talking about quickSnap? if so, is your concern:
1) the amount of time it takes between pushing the button and capturing an image
2) the time it takes between pushing the button and saving the processed image

if youre worried that you will miss the cat being cute, be aware that the picture is taken a LONG time before the sound happens {picture is taken about 3 seconds after press. booting the camera takes some time, but also the autofocus takes time}. maybe i should make it make two sounds, one when the pic is actually being taken, and one when it is done.


P.S.: if youre taking about something other than quickSnap, lemme know

actually is to turn the flashlight on the screen lock status, to just click on any of the volume keys, it takes some time to turn on the LED , could be shorter this time? and please excuse my English. :o

optimaxxx
2013-01-19, 20:09
Brilliant idea with dual-sound quick snap functionality.

Might I ask why all the hate for almost every inbuilt function the N9 has?

Is there any chance you could add GPS position as another condition group?
Would be very cool to change my layout based on whether I'm at home, or out!

testing ATM, GUI really is dog's balls. Any way we could help with it?

optimaxxx
2013-01-19, 20:10
Brilliant idea with dual-sound quick snap functionality.

Might I ask why all the hate for almost every inbuilt function the N9 has?

Is there any chance you could add GPS position as another condition group?
Would be very cool to change my layout based on whether I'm at home, or out!

testing ATM, GUI really is dog's balls. Any way we could help with it?

wolke
2013-01-20, 19:19
Brilliant idea with dual-sound quick snap functionality.

dunno whether to use the camera snap twice, or perhaps some other builtin sound file. opinion?


Might I ask why all the hate for almost every inbuilt function the N9 has?

if you mean the default button actions in apps, its because you have to a have a sixth sense to know what the hell your buttons are going to do at any given time. i like consistency in my ux.


Is there any chance you could add GPS position as another condition group?


n9bm runs 100% of the time, so it must be extremely low power. i dont want to risk accidentally killing someones battery to add features like this. i do not want to add features that cause radios to run more often, including bt, wifi, or gps.

however, i should probably make a shell-command-condition that lets folks do whatever they want. {for example, all you would do is write a script called gps-is-home that exits with 0 if you are home and 1 otherwise.}



testing ATM, GUI really is dog's balls. Any way we could help with it?
in my opinion, the best gui for this app would be a nice text editor that opens the config file. the config is straighforward, and reloading is automatic. in fact, the gui literally just modifies the config file and exits.

i maintain the gui only because a LOT of folks are really averse to opening up a text editor. i certainly will never use it, and wouldnt ask anyone else to.

the only extra feature i would like a gui to have is to check the syntax and make sure there are no typos. perhaps ill take redak or something and repackage it with this feature some day.

all that being said, i would love for someone to write a nice qml gui for this so everyone would stop worrying about it already. {i do not think i will ever do this.}

wolke
2013-01-20, 19:28
actually is to turn the flashlight on the screen lock status, to just click on any of the volume keys, it takes some time to turn on the LED , could be shorter this time? and please excuse my English. :o

no worries. unfortunely, no. the API for accessing the flashlist is QCamera and it has a cold initialization of 2-4 seconds.

if your flashlight is taking more than 2-4 seconds, you have some sort of performance problem with your phone. {perhaps you use dropcache, or you run many things at once}

sorry i cant help.

PIDk
2013-02-04, 13:17
Hi, wolke!

When I launch n9-button-monitor.py it gives me the following error:ERROR:dbus.proxies:Introspect error on :1.2:/org/freedesktop/Hal/devices/computer_logicaldev_input_0: dbus.exceptions.DBusException: org.freedesktop.Hal.NoSuchDevice: No device with id /org/freedesktop/Hal/devices/computer_logicaldev_input_0
But besides this error it works ok. Though I can't test with bluetooth media buttons because I don't use bluetooth headset.

I'm using it on N9.

wolke
2013-02-04, 17:02
When I launch n9-button-monitor.py it gives me the following error:
But besides this error it works ok. Though I can't test with bluetooth media buttons because I don't use bluetooth headset.

thanks for the report!

yea, i saw that right after release. it happens only if you dont have a bt input device connected at startup. i saw also that everything works. in fact, bluetooth buttons still work when you then DO connect a bt device later, without restarting.

so its a harmless, if misleading, error message. i decided not to fix it, because actively hiding error messages that n9bm didnt actually generate seems wrong.

p.s.: as you probably know, you shouldnt have to start this on the CLI. it should startup all by itself about 90 seconds after boot, and it should reload your changes to the conf file automatically.

wolke
2013-02-12, 18:25
added some features from lcferrum:
-n950 cambutton
-power button
-config option to turn off quicksnap and flashlight/torch
-on/off home icons {a .desktop that changes icons when you push it; these depend on sudo and openmode for now, and wont be in a deb. i will probably make a plugin for sysuid-mt-toggles someday, if anyone cares about turning it on/off nicely}

the next deb i build will have the buttons and the cam option; does anyone have a special interest in any of these features?

solbrit
2013-02-23, 20:28
Have been reading the thread but I'm not clear on this: can you set a short press of the power button (from low power screen) to run an arbitrary command?

Thanks

wolke
2013-02-23, 21:24
Have been reading the thread but I'm not clear on this: can you set a short press of the power button (from low power screen) to run an arbitrary command?

Thanks

first, power button support is merged into github, but not in any release. {i can build a deb for you off of master if you like}

second, the biggest missing component in n9bm is the ability to cancel the button's default action. no one has any idea how to do this. this makes n9bm useless except in standby, and in apps that override the volume keys.

SO, technically, yes, but it probably wont work because the screen will unlock first and thus you will no longer be on lowpower screen.

however, double-clicking power should work, from any screen, and may even be useful.

solbrit
2013-02-23, 23:43
Hmm... Then it seems that what I had in mind is more difficult than I thought...
My idea was to enable the security lock when trying to unlock the screen (from low power screen) by pressing the power button, whereas double tapping the screen would unlock it as normal. I always unlock the phone in the second manner, while someone who doesn't know how the N9 works (most people) would try to unlock it by hitting the power button if they, say, stole the phone.
An attempt to make the phone useless to your average pickpocket ;)

wolke
2013-02-23, 23:52
clever. and yes, that may work, but not consistently.

however, i think double-tapping is the more obvious unlock method, because the buttons are so unlabeled.
usually friends and such who unlock my phone try to double-tap first {which doesnt work because i turned off double-tap-unlock}.


heres the best implementation i can think of. set the click delay to 2000 millis, and set the single-click-cmd to when the screen is NOT locked. that way, 2 seconds after you click it, the screen will either be locked like you wanted and nothing will run, or it will be unlocked and then suddenly security-locked.

solbrit
2013-02-24, 01:59
Yes, that's a good idea. Can you implement that?

Edit: and you have smarter friends than the people I've come across, who all start looking for buttons as soon as the screen goes blank :D

wolke
2013-02-24, 02:17
here ya go. this is NOT a release, as i havent tested it. literally havent even run it, sorry.

this deb has new conditions: screenUnlocked, appNotFocused
and new buttons: cameraButton {n950}, powerButton


all you do to configure n9bm how i said, is change /home/user/.config/n9-button-monitor.ini


doubleClickDelayMs=2000
trebleClickDelayMs=3000
action=cmd(SECURITY-LOCK-CMD),powerButton,singleClick,screenUnlocked


by the way, this assumes you HAVE a command that will enter security lock mode. i have no idea how to do that, and it has nothing to do with n9bm.

wolke
2013-02-24, 02:30
ok, i tested it, and it works fine.

turns out double-click-power IS useful. it will work in lock, unlock, and different apps, where the volume buttons already have actions reserved.

it could, for instance, toggle power saving mode when locked, open my most recent pictures in meeseepics if im on the home screen, and toggle silent/ring everywhere else.

solbrit
2013-02-24, 16:46
Thankyou!
I just installed the deb, although no /home/user/.config/n9-button-monitor.conf (or /home/user/.config/n9-button-monitor.ini) is created. Is this normal? Do i grab the one in OP and throw it in there (changing it according to your instrucions)?

Edit: ...you load the default config file from the ui, got it!

wolke
2013-02-24, 19:05
Thankyou!
I just installed the deb, although no /home/user/.config/n9-button-monitor.conf (or /home/user/.config/n9-button-monitor.ini) is created. Is this normal? Do i grab the one in OP and throw it in there (changing it according to your instrucions)?

Edit: ...you load the default config file from the ui, got it!

oh snap, i thought the default one got created when the file didnt exist. apparently not, so thats a bug i should fix. ;)

i wouldnt recommend using the gui for anything at all ever.

solbrit
2013-02-24, 19:15
It works perfectly, thankyou! :D

Btw, the torch feature is really nice too. No more unlock-screen-locate-flashlight-app-in-the-app-menu-activate-flashlight...

wolke
2013-02-24, 19:51
It works perfectly, thankyou! :D

Btw, the torch feature is really nice too. No more unlock-screen-locate-flashlight-app-in-the-app-menu-activate-flashlight...

cool. glad you like it!

Hacker
2013-02-24, 20:07
There is a great new open source camera app for the N9 located here: http://talk.maemo.org/showthread.php?t=89278

I think that this could be my new default camera app, but I don't want to lose the Button Monitor camera functions.

Could you set up Button Monitor so that this camera app can be a new condition name in the GUI? Is there an easy way I can make this happen?

wolke
2013-02-24, 20:19
AWESOME! im so excited, i despise the n9 camera app. thanks for this news, ill be checking it out very soon.

now, its very easy to do the condition. you just do appFocused(window-class-name). default camera app is "camera-ui", and his is probably "camera-plus".

cameraFocused == appFocused(camera-ui)
both do exactly the same thing.


now as for the ACTIONS, theyre a little trickier.
what they really do is simulate dragging your finger to certain spots on the screen. if he moved the camera button a little, it will break.

so if he DID move the button, you will need to play with the "tap" action. again, clickCameraSnap and clickCameraFocus are just shorthand for the tap action with an argument.

these do exactly the same thing:
clickCameraSnap == tap(820x240,820x240)
clickCameraFocus == tap(820x240-820x100*200+5)

wolke
2013-02-24, 20:31
i lied, its not class name, its WM_COMMAND.
so you dont even have to use xprop to find out, you can just use the executable name.

wolke
2013-02-25, 16:03
btw, released 0.5.2
buttons: camera {n950}, power
conditions: screenUnlocked, appNotFocused
actions: tap {generic click}

wolke
2013-02-26, 05:07
woo, new features from lcferrum, including proximity sensor support!

lots of changes to project structure though, so merge-o-clock

wolke
2013-02-27, 06:45
preparing 0.5.3.
i added the proximity sensor button from lcferrum's source. i also wrote an mt-toggles plugin, which is a separate, optional deb that will only work with 0.5.3 or higher.

the toggle turns n9bm on/off, and of course it depends on mt-toggles.

if someone feels like testing this, i would appreciate it. ;)

https://www.dropbox.com/s/cki0sq7z4mpc555/n9-button-monitor_0.5.3_armel.deb

https://www.dropbox.com/s/n8w24z0sopb4112/n9bm-toggle_0.1_armel.deb

wolke
2013-02-27, 07:39
0.5.3 also auto-loads a default config when you first install it.
{edit: only when no config file exists; your config file should never be overwritten}

the default config is now user-friendly and hand-editable, with things you can uncomment like cameraplus.

wolke
2013-03-02, 18:39
released 0.5.3

wolke
2013-03-11, 22:44
released n9bm-toggle v0.2 the toggle now detects whether n9bm is running.

imaginaryenemy
2013-04-21, 04:09
I'm trying to have an application launched with double click on power button. For some reason I am too dense to make this happen...
action=xdg-open /usr/share/applications/shutdown_harmattan.desktop, powerButton, doubleClick, always
I have also tried it with keeping "cmd" in the line also.
What am i missing? This IS possible, right?

wolke
2013-04-21, 06:46
you need the cmd, and parentheses around the cmd.
action=cmd(xdg shutdown.desktop)

wolke
2013-04-21, 06:57
this works for me:
action=cmd(xdg-open /usr/share/applications/clock.desktop),powerButton,doubleClick,always

imaginaryenemy
2013-04-21, 07:13
I tried that also (based on an example you gave in another post) without any luck. I just tried again, and it still won't work. Is there some simple step I'm forgetting?

wolke
2013-04-21, 07:14
oh snap, there is; reboot! 0.5.3 has a bug where it never reloads your config file! ill upload 0.5.4 with it fixed right now.

wolke
2013-04-21, 07:19
uploaded new version 0.5.4
config changes are automatically reloaded; there is no need to reboot or restart n9bm.

{this was always the case; there was a regression in 0.5.3.}

imaginaryenemy
2013-04-21, 07:22
That did the trick! Thanks!

imaginaryenemy
2013-04-21, 12:34
Reboot still appears to be necessary...

wolke
2013-04-22, 05:50
oh, are you sure? i tested it a bunch, and it works fine for me in 0.5.4. it explicitly does not work for me, ever, in 0.5.3

one easy way to test is to take a known working config, and then swap volumeUp/Down. save the file, and then check if the buttons are swapped. if they are NOT, do nothing and then restart. if they are then swapped, let me know.

imaginaryenemy
2013-04-22, 06:10
I had changed the config file and rebooted before you uploaded 0.5.4. I updated to 0.5.4 and changed the desktop file that it opened just to verify a reboot wasn't needed. Though the config file showed it was changed, it opened the previous desktop file not the new one. I had to reboot to make the change work. HOWEVER, i have since decided that maybe i didn't want that action after all, so i deleted the action from the config file and the changes took affect without needing a reboot...

wolke
2013-04-22, 16:40
thanks, that makes sense. yea, i still dont use double-click power. cant think of anything to use it for.

funny, i currently already use double-click power in lowpowerscreen, as a workaround to get lpsmagic to update, but thats not part of n9bm.

maxdroid
2013-06-01, 16:17
can i make volume up or down into powerbutton if phone is off or in standyby mode?
Would be cool since my powerbutton is completely broken atm.

wolke
2013-06-01, 16:48
can i make volume up or down into powerbutton if phone is off or in standyby mode?
Would be cool since my powerbutton is completely broken atm.

damn that sux. {im sure you know this already, but you can boot it using the nokia flasher program from a computer.}


the most useful thing i can think of that n9bm could do for you, is make double-tap volume-up unlock the phone when in low-power-screen. {is that what you mean by standby?}

as for when the phone is off, the answer is simply no, sorry. this is an application; it requires the machine to be powered on, a kernel to be loaded, and user software to be running.

maxdroid
2013-06-01, 18:46
damn that sux. {im sure you know this already, but you can boot it using the nokia flasher program from a computer.}


the most useful thing i can think of that n9bm could do for you, is make double-tap volume-up unlock the phone when in low-power-screen. {is that what you mean by standby?}

as for when the phone is off, the answer is simply no, sorry. this is an application; it requires the machine to be powered on, a kernel to be loaded, and user software to be running.
Yea, I know.. But I'll live.
Yes I heard about it, but never tried it. I guess you need to connect the usb in off mode to a computer that has some program installed then and runt the reboot command.

Yes that is what I mean by standby. Although I've disabled the clock so it's black until I tap it.
Would be nice with the volume up to make it wake up since the tap is a bit buggy at times and I can't slide the screen, so then I have to wait until it goes into standby again (lock screen goes black) and try it again.
Can I use the volume up as normal when phone is wokened with this app you think? Would be nice to be able to lock it with volume up in lock screen (to shorten the wait until next try if buggy)
Thankyou! =)

wolke
2013-06-01, 18:48
yes, you can make it so that in low-power-screen, double-vol-up unlocks the phone, and when NOT in low-power-screen, it does everything as normal

maxdroid
2013-06-01, 18:51
yes, you can make it so that in low-power-screen, double-vol-up unlocks the phone, and when NOT in low-power-screen, it does everything as normal
Okey perfect. I guess I just need to make sure my phone is charged decently before I head out then and install this app and I'll be okay :)

Hey Wolke, I also wondered if I can lock it in lock screen with the volume up ( just the opposite of waking it up low power screen) and have it work like normal once I'm in.

wolke
2013-06-01, 18:52
lock it while IN lock screen? sorry, i dont follow.

wolke
2013-06-01, 18:55
btw, unlocking is not a built-in part of n9bm.

you will need to find a script that works for your flavor {inception, open mode, open mode + aegis-neutered kernel, whtaever}.

then simply put cmd(/home/user/MyDocs/unlock-script.sh) in the n9bm conf file.

maxdroid
2013-06-01, 18:57
lock it while IN lock screen? sorry, i dont follow.
I mean if you double tap it you're in lock screen, then if it is buggy and I can't slide the screen to "get in" I could just double volume it and screen goes black and then I do it once more and I see lock screen again so I can slide it and get in.

As I said sometimes my phone is buggy and then I have to wait until screen goes black (a few sec) to try it again and see if sliding registers.

wolke
2013-06-01, 19:09
ah. i was already assuming that you wanted vol+ to unlock it from the lock screen AND the low-power-screen. that makes more sense, right?

maxdroid
2013-06-01, 19:17
ah. i was already assuming that you wanted vol+ to unlock it from the lock screen AND the low-power-screen. that makes more sense, right?

Sure! Why not!! :)
Although a single press on volume button for lock screen would be nice, cause i got meecast widget installed there just left of clock which looks really nice imo. Although as long as double tap works for seeing it it's okay too.

How would I go about making this work? All I have is fastern9 installed (and alternative os at boot, nitdroid, which I never use)

wolke
2013-06-01, 19:24
first, tackle the problem of getting a command the locks/unlocks that works for you. heres mine:


#!/usr/bin/perl
#Copyright 2012 Elliot Wolk
#License: GNU GENERAL PUBLIC LICENSE v3 or later, at your choice
use strict;
use warnings;

my $usage = "Usage:
$0 or $0 [-t|--toggle|toggle]
simulates pushing the power-button
$0 [-g|--get|get]
prints locked or unlocked, or exits with error code
determined by dbus method com.nokia.mce.request.get_tklock_mode
$0 [-l|--lock|lock]
if 'get' returns unlocked, simulates pushing the power-button
$0 [-u|--unlock|unlock]
if 'get' returns locked, simulates pushing the power-button
";

sub getLock(){
my @cmd = qw(dbus-send
--system
--print-reply
--type=method_call
--dest=com.nokia.mce
/com/nokia/mce/request
com.nokia.mce.request.get_tklock_mode
);

my $tklockMode = `@cmd`;
if($tklockMode =~ /string "(locked|unlocked)"/){
return $1;
}else{
die "Error- couldnt understand dbus reply '$tklockMode'\n";
}
}

sub powerButton(){
my $EVENT_POWER_KEY='\x74\x00';
my $POWERBUTTON_EVENT_FILE='/dev/input/pwrbutton';
my $EVENT_TIMESTAMP='\x48\x67\x98\x45\x5f\x16\x0b\x00 ';
my $EVENT_KEY_TYPE='\x01\x00';
my $EVENT_PRESS_VALUE='\x01\x00\x00\x00';
my $EVENT_RELEASE_VALUE='\x00\x00\x00\x00';

my $bytes = join '', (
$EVENT_TIMESTAMP,
$EVENT_KEY_TYPE,
$EVENT_POWER_KEY,
$EVENT_PRESS_VALUE,
$EVENT_TIMESTAMP,
$EVENT_KEY_TYPE,
$EVENT_POWER_KEY,
$EVENT_RELEASE_VALUE,
);

system "printf \"$bytes\" > $POWERBUTTON_EVENT_FILE";
}

sub main(@){
my $arg = shift;
$arg = '--toggle' if not defined $arg;
die $usage if @_ > 0;
if($arg =~ /^(-t|--toggle|toggle)$/){
powerButton;
}elsif($arg =~ /^(-l|--lock|lock)$/){
powerButton if getLock eq 'unlocked';
}elsif($arg =~ /^(-u|--unlock|unlock)$/){
powerButton if getLock eq 'locked';
}elsif($arg =~ /^(-g|--get|get)$/){
print getLock() . "\n";
}else{
die $usage;
}
}

&main(@ARGV);


i have NO IDEA if this works without open mode.
to test it out, save it as lock.pl and copy it to MyDocs.

test it in a terminal by running: perl ~/MyDocs/lock.pl

if that locks your phone, then it works.

after that, install n9bm, and make sure it works for you by going into low-power-screen and holding down volume-up. the torch should come on.

THEN, modify the config file: /home/user/.config/n9-button-monitor.ini and add this line:

action=cmd(perl /home/user/MyDocs/lock.pl),volumeUp,doubleClick,screenLocked

wolke
2013-06-01, 19:35
ok, so the word on the street is that you need probably inception to do this.

install inception, {look up how to do this, theres plenty of resources available}, and then run the lock script with ariadne like this:
ariadne perl /home/user/MyDocs/lock.pl

if that works, you can stick that in your n9bm config file.

if that doesnt work, try poking around the inception thread and asking how to lock/unlock with a command as user in closed mode.

maxdroid
2013-06-01, 19:36
cool!

I almost am a complete noob about this. How do I actually save your text/script into a .pl file that I need to transfer to my phone?

wolke
2013-06-01, 19:40
you can either open up a text editor, paste it in, save it.
or just download it directly with this link:
https://raw.github.com/teleshoes/n9-config/master/CONFIG_FILES/bin/lock

wolke
2013-06-01, 19:41
in most browsers, thats right-click, save link as, "lock.pl"

maxdroid
2013-06-01, 19:51
you can either open up a text editor, paste it in, save it.
or just download it directly with this link:
https://raw.github.com/teleshoes/n9-config/master/CONFIG_FILES/bin/lock
Inception then huh. Feels like I'm in limbo. :p
Think I will have to make this happen soon. Tanks for your effort in helping! Hope it works! :)
Have a good one Wolke!

wolke
2013-06-01, 20:14
no problem. good luck

manialog
2013-06-01, 22:29
Not uninstalling. How to do needed

wolke
2013-06-02, 07:08
Not uninstalling. How to do needed

sorry, is there something i can do for you?

manialog
2013-06-02, 07:10
I managed to uninstall using terminal thanx

adnankamal9
2013-06-25, 14:09
This is really nice. but can you please tell me the easiest way of installing & uninstalling this mod. i really wanted to check this. Please do let me know what to do and how to do. thanks. :)

wolke
2013-06-25, 15:18
the same way youd install any deb. perhaps something like this:

download the deb
copy it to MyDocs
open a terminal
devel-su
dpkg -i MyDocs/n9-button-monitor*.deb
apt-get -f install

open a terminal
devel-su
apt-get remove n9-button-monitor




to customize it, open up redak, or your favorite text editor, and edit /home/user/.config/n9-button-monitor.ini

adnankamal9
2013-06-26, 08:33
the same way youd install any deb. perhaps something like this:

download the deb
copy it to MyDocs
open a terminal
devel-su
dpkg -i MyDocs/n9-button-monitor*.deb
apt-get -f install

open a terminal
devel-su
apt-get remove n9-button-monitor




to customize it, open up redak, or your favorite text editor, and edit /home/user/.config/n9-button-monitor.ini


Thank you very much. You people are great. You think so much that in my opinion even Nokia didnt think about.

wolke
2013-06-26, 15:35
you are very welcome!

wolke
2013-08-20, 03:03
added n9-button-monitor and n9bm-toggle to openrepos

https://openrepos.net/content/teleshoes/n9-button-monitor
https://openrepos.net/content/teleshoes/n9bm-toggle

deb http://harmattan.openrepos.net/teleshoes personal main

Mikkosssss
2013-08-22, 15:07
Is there way to get snapshot working with action like up down up?

I want that because I use double press up for torch and double pressdown for cyclotron.
Another reason is that I use short double press time 250ms but I dont always manage to press so fast and snapshot needs to be more reliable.

wolke
2013-08-22, 15:25
Is there way to get snapshot working with action like up down up?

I want that because I use double press up for torch and double pressdown for cyclotron.
Another reason is that I use short double press time 250ms but I dont always manage to press so fast and snapshot needs to be more reliable.

nope, sorry, patterns are not available in 0.5.4.

this is certainly possible to code, and i might add something like it eventually. {in fact, you used to be able to specify arbitrary patterns like hold up, double-tap down, release up, but it was too complicated, both in the code, and in the complex hand maneuvering. the way it is now, with default timeouts, i dont make mistakes. with the patterns and the rigorous timeouts needed to make sure overlapping patterns work, i fukt up more often than i actually clicked it correctly}

personally, i like triple-tap-up for snapshot, but i dont think i could do it in 1/4 of a second. {for my double/triple timeouts, i use 400ms/600ms.} so far, ive managed to use it several times to great success, but just as often im too slow to capture the Moment.
you might also want to consider double-tap lock.

Mikkosssss
2013-08-22, 16:04
Ok I come back when/if you do it someday. :p
I use short delay on double press because I have many times found that my flashlight is on in my pocket, I dont know how that's possible.
Yes, I know there's timeout for flashlight. :D
I dont like treble press because with short delay that I need I need sometimes try start flashlight few times so it would probably take pictures when I am trying. :D
I dont like double press to unlock and if that single press powerbutton was snapshot my memory would be soon full of black pictures. :p

wolke
2013-08-22, 16:06
Ok I come back when/if you do it someday. :p
I use short delay on double press because I have many times found that my flashlight is on in my pocket, I dont know how that's possible.
Yes, I know there's timeout for flashlight. :D
I dont like treble press because with short delay that I need I need sometimes try start flashlight few times so it would probably take pictures when I am trying. :D

heh, yea. ok, i will let you know if i do it

Mikkosssss
2013-08-22, 16:46
Then I have another thing.
I disabled camera sound from camera.py (just messed filename)
(Yes, I am secred spy)

Could notification led be used to tell that picture is taken. 0.5sec light when taking and another 0.5 sec when saved.

Thanks.

wolke
2013-08-22, 17:33
sounds cool. assuming that LED patterns are easy to fire, ill try to do it soon-ish.

initial proposal for next release is to add the following options:
1) quickSnapShutterSound {default is none}
2) quickSnapSaveSound {default is snd_camera_shutter.wav}
3) quickSnapShutterLEDPattern {default is blink}
4) quickSnapSaveLEDPattern {default is blink twice}
5) quickSnapShutterCmd {default is none}
6) quickSnapSaveCmd {default is none}

what you can do, temporarily, is bind another action to the same sequence, to run a command that performs the led notify. it will fire roughly 3s before the picture is snapped.

Mikkosssss
2013-08-22, 18:04
It will fire roughly 3s before the picture is snapped.

I can just add sleep delay then.

Thanks

Edit: Here is python script that uses led: http://talk.maemo.org/showthread.php?t=91044

masen
2013-08-25, 17:19
Thanks for a great app. I installed it and it works with camera and musicplayer, but I cant get the torch to work. According to the default file it should start when holding volume+ when on stand-by screen? Am I stupid who can't make it work? (not necessary to answer :)).
That feature would be so nice to have. Anyone who can help me?

wolke
2013-08-25, 18:36
Thanks for a great app. I installed it and it works with camera and musicplayer, but I cant get the torch to work. According to the default file it should start when holding volume+ when on stand-by screen? Am I stupid who can't make it work? (not necessary to answer :)).
That feature would be so nice to have. Anyone who can help me?

try closing any camera apps and other torch apps first. only one app can control the camera at a time.

try holding it for ~10s just to make sure your phone isnt being sluggish.
the button push takes about 1s to start, to make sure you meant to hold it down, and then the torch normally takes about 3s to start, but maybe yours is taking longer.

try rebooting {note that n9bm doesnt start up as soon as the phone boots; extra applications are made to wait until all system services starts. this means that after you reboot, it takes 1-3min for n9bm to turn on}

try normal flash in camera; maybe your hardware is defective?