Reply
Thread Tools
Posts: 1,313 | Thanked: 2,977 times | Joined on Jun 2011 @ Finland
#1571
Originally Posted by slarti View Post
I got bored yesterday and was thinking about listening to dbus-signals (I assume everyone does exactly this when bored). I also happened to try connecting my N9 to my computer via bluetooth. As a result I came up with a sort of proof-of-concept script to get the bluetooth connected/disconnected rule working with Profilematic.
Thanks, good stuff here... I failed doing this trying to use to official Bluetooth APIs. My next step would have been to try by trying to spy the DBus APIs, but I lost motivation as I had used so much time trying to make the code work already.

But if this works, it might be relatively straight-forward (yet unfortunately still time-consuming) to use this code to include Bluetooth condition into ProfileMatic.
__________________
My N9/N950 projects:
 

The Following User Says Thank You to ajalkane For This Useful Post:
Posts: 1,313 | Thanked: 2,977 times | Joined on Jun 2011 @ Finland
#1572
Originally Posted by smcsa View Post
Can you put a new condition: GPS ON / GPS OFF ?
I need this to stop gprs when I use navi to reduce power consumption when walking. When travel by car I use power from my car.
So I want a rule like this:
Conditions: GPS is ON and Charging is OFF
Action: Custom action for stopping data
I can write this down as feature request, but since I have no use personally for this (nor seen this requested by other users) it'll be a low-priority. Of course, I'll happily accept patches for such functionality.
__________________
My N9/N950 projects:
 

The Following User Says Thank You to ajalkane For This Useful Post:
Posts: 1,313 | Thanked: 2,977 times | Joined on Jun 2011 @ Finland
#1573
Originally Posted by lorenzo View Post
@ajalkane can you please make that i can set time condition more than one time, this is my problem: (i didn't want to create two different rules for just one action) e.g. on monday and saturday go silent from 14:00 to 19:00 other days from 8:00 to 15:00
can you? thanks
I'm sorry, but I can't see how I could make it simpler and more generic than it already is. I have to consider keeping ProfileMatic as simple as it can be, yet providing as much possibilities as is reasonable.

This is how I would do it:

- Top most rule with silent on monday and saturday from 14:00 to 19:00
- Second rule with silent on all days from 08:00 to 15:00
- Default profile with ringing

I don't think that's too many rules considering the use case.
__________________
My N9/N950 projects:
 
Posts: 277 | Thanked: 319 times | Joined on Jan 2010
#1574
Originally Posted by ajalkane View Post
Thanks, good stuff here... I failed doing this trying to use to official Bluetooth APIs. My next step would have been to try by trying to spy the DBus APIs, but I lost motivation as I had used so much time trying to make the code work already.

But if this works, it might be relatively straight-forward (yet unfortunately still time-consuming) to use this code to include Bluetooth condition into ProfileMatic.
It seems to work reliably. Listening for the 'PropertyChanged' signal with a unique device path and org.bluez.Device interface works every time.

The only thing is that the unique bluetooth adapter path (and with it the device path) changes from boot to boot so it has to be looked up. Thanks to thp for that.
 

The Following User Says Thank You to slarti For This Useful Post:
Posts: 36 | Thanked: 1 time | Joined on Dec 2011 @ Lahore, PK
#1575
Originally Posted by Ancelad View Post
Hmm, there is one nice idea in Nokia Amber (GDR2) Update for Windows Phone - sleeping clock (night clock). This mean lowpower screen clock changes it's brightness and color to dark-red (as I see). So, I've made it for our Nokia N9 using ProfileMatic.

Make AmberClock.sh

Code:
#!/bin/sh
#call AmberClock.sh color font size
sed -i "/LockScreen MLabelStyle#LockScreenLowPowerModeClockLabel {/,/color/c\\
LockScreen MLabelStyle#LockScreenLowPowerModeClockLabel {\\
    font: \$FONT_FAMILY_"$2" "$3"mm;\\
    color: #"$1"; " /usr/share/themes/base/meegotouch/libsysuid-screenlock-nokia/style/libsysuid-screenlock-nokia.css
sleep 1 && /sbin/initctl stop xsession/sysuid && sleep 1 && /sbin/initctl start xsession/sysuid
As you can see this script will use 3 parameters:
$1 - your clock color (RGB)
$2 - font style (BOLD or LIGHT)
$3 - font size in mm (12 or 13 is good I think)

Then put it (for example) into
Code:
/home/user/MyDocs/.AmberClock
and go to ProfileMatic. Choose rule you need, set time and days, then go into More - Actions - Custom Action.
http://i.piccy.info/i7/b4fd839c620b8...111024_500.jpghttp://i.piccy.info/a3/2013-07-04-05...81x500-r/i.gif

When rule activates:
Code:
sh -c "echo rootme | devel-su -c '/home/user/MyDocs/.AmberClock/AmberClock.sh 980016 BOLD 13'"
And click test. After some seconds you'll see your new lowpower clock.
http://i.piccy.info/i7/45919d154d945...105608_500.jpghttp://i.piccy.info/a3/2013-07-04-05...81x500-r/i.gif

When rule deactivates:
Code:
sh -c "echo rootme | devel-su -c '/home/user/MyDocs/.AmberClock/AmberClock.sh FFFFFF LIGHT 10'"
And click test. After some seconds you'll see your default lowpower clock
http://i.piccy.info/i7/5a0f76c94cc2d...105734_500.jpghttp://i.piccy.info/a3/2013-07-04-05...81x500-r/i.gif

Also you can change lowpower icons such as beep-icon etc.. Put default icons into
Code:
/home/user/MyDocs/.AmberClock/default/
Then apply new colors and put new icons into
Code:
/home/user/MyDocs/.AmberClock/amber/
Then you need to change AmberClock.sh like this
Code:
#!/bin/sh
#call AmberClock.sh color font size icons
sed -i "/LockScreen MLabelStyle#LockScreenLowPowerModeClockLabel {/,/color/c\\
LockScreen MLabelStyle#LockScreenLowPowerModeClockLabel {\\
    font: \$FONT_FAMILY_"$2" "$3"mm;\\
    color: #"$1"; " /usr/share/themes/base/meegotouch/libsysuid-screenlock-nokia/style/libsysuid-screenlock-nokia.css
cp -rf /home/user/MyDocs/.AmberClock/"$4"/*.png /usr/share/themes/blanco/meegotouch/icons
sleep 1 && /sbin/initctl restart xsession/sysuid
New parameter:
$4 - amber or default

So, ProfileMatic command lines will be
When rule activates:
Code:
sh -c "echo rootme | devel-su -c '/home/user/MyDocs/.AmberClock/AmberClock.sh 980016 BOLD 13 amber'"
And click test. After some seconds you'll see your new lowpower clock and icons.

When rule deactivates:
Code:
sh -c "echo rootme | devel-su -c '/home/user/MyDocs/.AmberClock/AmberClock.sh FFFFFF LIGHT 10 default'"
And click test. After some seconds you'll see your default lowpower clock and icons.

Enjoy

I am following the same instruction but is not working for me using blanco theme, can u please help me,

sencondly, can I make rule to set the brightness to auto and manual using status menue extentions
__________________
----------------------------------

Nokia N9 Black 64gb Prime
Nokia Lumia 720
Nokia N900 Show Piece
 
Ancelad's Avatar
Posts: 1,552 | Thanked: 3,108 times | Joined on Jun 2012 @ Russia, 96
#1576
Make sure that your password is rootme. This script works with any theme
 
Posts: 36 | Thanked: 1 time | Joined on Dec 2011 @ Lahore, PK
#1577
Originally Posted by Ancelad View Post
Make sure that your password is rootme. This script works with any theme
I follow the same instructions as

1) create AmberClock.sh and
2) Paste this in it
(#!/bin/sh
#call AmberClock.sh color font size
sed -i "/LockScreen MLabelStyle#LockScreenLowPowerModeClockLabel {/,/color/c\\
LockScreen MLabelStyle#LockScreenLowPowerModeClockLabel {\\
font: \$FONT_FAMILY_"$2" "$3"mm;\\
color: #"$1"; " /usr/share/themes/base/meegotouch/libsysuid-screenlock-nokia/style/libsysuid-screenlock-nokia.css
sleep 1 && /sbin/initctl stop xsession/sysuid && sleep 1 && /sbin/initctl start xsession/sysuid)

3) save AmberClock.sh to /home/user/MyDocs/.AmberClock as


4) using custom action

in active to run paste
sh -c "echo rootme | devel-su -c '/home/user/MyDocs/.AmberClock/AmberClock.sh 980016 BOLD 13'"

When deactive to run paste
sh -c "echo rootme | devel-su -c '/home/user/MyDocs/.AmberClock/AmberClock.sh FFFFFF LIGHT 10'"

and testing but nothing change using correct time criteria and my default root password is "rootme"
__________________
----------------------------------

Nokia N9 Black 64gb Prime
Nokia Lumia 720
Nokia N900 Show Piece
 
Ancelad's Avatar
Posts: 1,552 | Thanked: 3,108 times | Joined on Jun 2012 @ Russia, 96
#1578
hmm, try
Code:
chmod +x  /home/user/MyDocs/.AmberClock/AmberClock.sh
 
Posts: 36 | Thanked: 1 time | Joined on Dec 2011 @ Lahore, PK
#1579
Originally Posted by Ancelad View Post
hmm, try
Code:
chmod +x  /home/user/MyDocs/.AmberClock/AmberClock.sh
1) nothing happen using this command in terminal

but

2) if enter as root them message is "Operation not permitted"
__________________
----------------------------------

Nokia N9 Black 64gb Prime
Nokia Lumia 720
Nokia N900 Show Piece
 
Ancelad's Avatar
Posts: 1,552 | Thanked: 3,108 times | Joined on Jun 2012 @ Russia, 96
#1580
Do it without root. It will make this script executable.
 
Reply


 
Forum Jump


All times are GMT. The time now is 03:07.