maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [Support thread] Billboard Standby Screen (https://talk.maemo.org/showthread.php?t=84507)

lorenzo 2013-11-01 13:40

Re: [Support thread] Billboard Standby Screen
 
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?

fhutt 2013-11-02 08:51

Re: [Support thread] Billboard Standby Screen
 
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.

fhutt 2013-11-07 05:17

Re: [Support thread] Billboard Standby Screen
 
Has anyone developed a script to show profile icons as distinct from the {profile} command in Billboard?
Thanks

slarti 2013-11-07 18:04

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by fhutt (Post 1384805)
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


fhutt 2013-11-07 22:32

Re: [Support thread] Billboard Standby Screen
 
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

fhutt 2013-11-08 00:11

Re: [Support thread] Billboard Standby Screen
 
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

fhutt 2013-11-08 03:58

Re: [Support thread] Billboard Standby Screen
 
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

Z3tor 2013-11-08 04:54

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by fhutt (Post 1385036)
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++.

slarti 2013-11-08 06:02

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by fhutt (Post 1385055)
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 2013-11-08 09:26

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by fhutt (Post 1385036)
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.


All times are GMT. The time now is 02:57.

vBulletin® Version 3.8.8