maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   General (https://talk.maemo.org/forumdisplay.php?f=7)
-   -   [SOLVED] Stop Connection dialog (https://talk.maemo.org/showthread.php?t=82252)

devian 2012-02-11 03:44

[SOLVED] Stop Connection dialog
 
Hey guys I'm looking for a way to get this annoying dialog (Select connection) to stop showing up every time a song changes, even when I stop the music player this dialog pops up, I find it really unnecessary, is there a way to do that?
Thanx in advance

miked1541 2012-02-11 05:36

Re: Stop Connection dialog
 
I do this from the terminal:

Stop requests:
sudo /etc/init.d/icd2 stop
Start requests:
sudo /etc/init.d/icd2 start

devian 2012-02-12 04:40

Re: Stop Connection dialog
 
Quote:

Originally Posted by miked1541 (Post 1163421)
I do this from the terminal:

Stop requests:
sudo /etc/init.d/icd2 stop
Start requests:
sudo /etc/init.d/icd2 start

Oh cool, thanx, now I need to find out how to put it on a Beecon widget :D

devian 2012-02-13 08:53

Re: Stop Connection dialog
 
Hi, well I created a little "hack" in order to get this process a little bit easier :D
First I wrote this script called conn.sh and put it on /home/user.
So just open a terminal and type
Code:

nano conn.sh
Code:

#!/bin/sh
#check if icd2 is running
var="`ps aux |grep icd2 |awk '{print substr($5,6)}'`"
var1="sbin/icd2"
if [ $var == $var1 ]; then
#stop the manager and send a notification
sudo /etc/init.d/icd2 stop
run-standalone.sh dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:"Network Manager Off"
else
#start manager and run the network dialog
sudo /etc/init.d/icd2 start
sleep 2
run-standalone.sh dbus-send --system --type=method_call --dest=com.nokia.icd_ui /com/nokia/icd_ui com.nokia.icd_ui.show_conn_dlg boolean:false
fi

make sure both of the dbus commands are one single line, check Phone Control for more info
give the script execution permission to run
Code:

chmod +x conn.sh
give the user "user" privileges to stop/run icd2 editing as root /etc/sudoers (check if icd2 stop is already there if not add both, in my case it was)
Code:

user ALL = NOPASSWD: /etc/init.d/icd2 stop
user ALL = NOPASSWD: /etc/init.d/icd2 start

once you've done all this, test it (as user not root) to make sure everything is working fine, if everything is ok we have one more thing to do (unless you want to run the script from the terminal every time which in this case it doesn't make any sense lol).
Go to the app manager and install shortcutd , once installed go to System - Settings - Extras - Shortcutd
Check Use the camera button tap Camera focus short press action and select Custom shell command then scroll all the way down and on the inputbox type
Code:

~/conn.sh
That's it now everytime we want to stop/run icd2 we just have to short-press the camera button, I hope this helps someone else, as I was really annoyed by the Connection dialog showing up every time.

Edit: If someone wants to give it a little polish please do so, as I'm really new to this, and this is actually my first script :D

Resources:
http://shootspeak.com/2010/12/05/nok...rmance-tweaks/
http://wiki.maemo.org/Phone_control


All times are GMT. The time now is 20:32.

vBulletin® Version 3.8.8