Notices


Reply
Thread Tools
lorenzo's Avatar
Posts: 491 | Thanked: 299 times | Joined on Jul 2012 @ Pordenone IT
#1031
i wanted to display icon offline mode when N9 goes offline and network name when online, so i wrote
{cell-network!<<path/to/icon.png>>}
now happens that there is no output, what's wrong?
 
Posts: 49 | Thanked: 8 times | Joined on Oct 2013
#1032
Lorenzo, you need to enter {cell-network} before your text:
{cell-network}{cell-network!<<path/to/icon.png>>}

The first {cell-network} shows the network name when there is one. If there is no network then this element will have no output. In that case the second element will show your icon.
If there is a network name, the second element will not show anything.
 

The Following User Says Thank You to fhutt For This Useful Post:
Posts: 49 | Thanked: 8 times | Joined on Oct 2013
#1033
Has anyone developed a script to show profile icons as distinct from the {profile} command in Billboard?
Thanks
 
Posts: 277 | Thanked: 319 times | Joined on Jan 2010
#1034
Originally Posted by fhutt View Post
Has anyone developed a script to show profile icons as distinct from the {profile} command in Billboard?
Thanks
Pass {profile} as an argument to a script.

For example, in BB:

Code:
{script:sh profile.sh {profile}}
...and profile.sh:

Code:
#!/bin/sh


profile=$1
if [ $profile = "general" ]
then echo -n "<<path/to/someicon>>"
else if [ $profile = "meeting" ]
then echo -n "<<path/to/someothericon>>"
else if [ $profile = "silent" ]
then echo -n "<<path/to/somethirdicon>>"
fi;fi;fi

Last edited by slarti; 2013-11-07 at 18:14. Reason: Added some fi's. Damn bash.
 

The Following User Says Thank You to slarti For This Useful Post:
Posts: 49 | Thanked: 8 times | Joined on Oct 2013
#1035
Slarti, thank you for the idea.
Unfortunately, I have no experience with sh and have difficulty getting it to work.
I substituted General, Beep and Silent for your /path strings without the <<>> like this:

#!/bin/sh


profile=$1
if [ $profile = "general" ]
then echo -n "General"
else if [ $profile = "meeting" ]
then echo -n "Beep"
else if [ $profile = "silent" ]
then echo -n "Silent"
fi;fi;fi

It doesn't work with Billboard. So, I tried with opening terminal in my folder /home/user/Billboard and tried to run:
sh Profile.sh general
I get errors like this:
: not found: line 2:
: not found: line 3:
sh: missing ]
sh: missing ]
sh: missing ]

Where do I go from here?
Thanks

Last edited by fhutt; 2013-11-07 at 22:40. Reason: Left out command line argument "general"
 
Posts: 49 | Thanked: 8 times | Joined on Oct 2013
#1036
I think I found the problem.
I saved and edited the script with windows notepad and caused these errors when I copied the script to the phone.
When I edited the script in the phone with MeeTxtEditor, the errors disappeared.
The script now works in Billboard also.
What editor can I use in windows so I don't have this problem in the future?
Thanks
 
Posts: 49 | Thanked: 8 times | Joined on Oct 2013
#1037
I have another problem.
I like icons on the standby screen. I have the bluetooth status icon and and the power save icon showing. The python scripts are working in that they show the icons, but on different lines. I would like them to be on the same line. Here is the Billboard script I use:

{script: python /home/user/Billboard/Bluetoothi.py}{script: python /home/user/Billboard/PSMi.py}

Here is the python script for the bluetooti.ph:

# Print bluetooth status icon off/disconnected/connected
# Show the correct icon for connected or disconnected states.
# No icon is shown when BT is off.
# When BT is off the word 'off' is shown.
#
# Author: Slarti
# Source: http://talk.maemo.org/showpost.php?p...&postcount=444

import dbus

bus = dbus.SystemBus()

bluez = bus.get_object('org.bluez', '/')
adapter_path = bluez.ListAdapters(dbus_interface='org.bluez.Manag er')[0]
adapter = bus.get_object('org.bluez', adapter_path)
powered = adapter.GetProperties(dbus_interface='org.bluez.Ad apter')['Powered']
btstatus = bus.get_object('com.nokia.policy.pcfd', '/com/nokia/policy/bluetooth_override')
connected = btstatus.Get(dbus_interface='org.maemo.contextkit. Property')[0]

if powered:
if 'default' in connected:
print '<</usr/share/themes/blanco/meegotouch/icons/icon-s-status-bluetooth-active.png>>',
else:
print '<</usr/share/themes/blanco/meegotouch/icons/icon-s-status-bluetooth.png>>',
else:
print '<</home/user/Billboard/icon-s-status-bluetooth-off.png>>',

I looked on the internet, and found that a comma at the end of the print line should prevent a line feed. I have found it not working and I still get a line feed or carriage return.
How do I place these icons from these 2 python scripts on the same line?
Thanks
 
Posts: 58 | Thanked: 19 times | Joined on Jan 2012 @ Finland
#1038
Originally Posted by fhutt View Post
I think I found the problem.
I saved and edited the script with windows notepad and caused these errors when I copied the script to the phone.
When I edited the script in the phone with MeeTxtEditor, the errors disappeared.
The script now works in Billboard also.
What editor can I use in windows so I don't have this problem in the future?
Thanks
If you use Notepad, make sure the file encoding is UTF-8. I suggest using Notepad++.
 
Posts: 277 | Thanked: 319 times | Joined on Jan 2010
#1039
Originally Posted by fhutt View Post
I looked on the internet, and found that a comma at the end of the print line should prevent a line feed. I have found it not working and I still get a line feed or carriage return.
How do I place these icons from these 2 python scripts on the same line?
Thanks
Use stdout (look up how to use it, you need to import the sys module) or try this.
 
thp's Avatar
Posts: 1,391 | Thanked: 4,272 times | Joined on Sep 2007 @ Vienna, Austria
#1040
Originally Posted by fhutt View Post
What editor can I use in windows so I don't have this problem in the future?
(Not trying to turn this thread into an Editor war, but...) When I'm on Windows, I usually use gVim. However, for beginners, I'd recommend gedit. I heard some people also like Sublime Text these days, but it doesn't really give me any advantage over Vim.

The nice thing about Vim (and Emacs, for that matter) is that you can also use it directly on your device through the Terminal, the bad thing about both is that there's a non-trivial learning curve.

For editing on-device in a user-friendly way, try KhtSimpleText.
 

The Following User Says Thank You to thp For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 23:45.