Active Topics

 


Reply
Thread Tools
Posts: 54 | Thanked: 8 times | Joined on Aug 2012
#221
Originally Posted by wolke View Post
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.
 
Posts: 986 | Thanked: 1,526 times | Joined on Jul 2010
#222
lock it while IN lock screen? sorry, i dont follow.
__________________
~ teleshoes ~
 
Posts: 986 | Thanked: 1,526 times | Joined on Jul 2010
#223
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.
__________________
~ teleshoes ~
 
Posts: 54 | Thanked: 8 times | Joined on Aug 2012
#224
Originally Posted by wolke View Post
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.
 
Posts: 986 | Thanked: 1,526 times | Joined on Jul 2010
#225
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?
__________________
~ teleshoes ~
 
Posts: 54 | Thanked: 8 times | Joined on Aug 2012
#226
Originally Posted by wolke View Post
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)

Last edited by maxdroid; 2013-06-01 at 19:19.
 
Posts: 986 | Thanked: 1,526 times | Joined on Jul 2010
#227
first, tackle the problem of getting a command the locks/unlocks that works for you. heres mine:

Code:
#!/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
__________________
~ teleshoes ~
 
Posts: 986 | Thanked: 1,526 times | Joined on Jul 2010
#228
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.
__________________
~ teleshoes ~
 
Posts: 54 | Thanked: 8 times | Joined on Aug 2012
#229
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?
 
Posts: 986 | Thanked: 1,526 times | Joined on Jul 2010
#230
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-...FILES/bin/lock
__________________
~ teleshoes ~
 
Reply

Tags
harmattan, nokia n9


 
Forum Jump


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