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)

Arf the Lab 2012-11-23 22:18

Re: [Support thread] Billboard Standby Screen
 
Hello.

I copied your sample script verbatim and saved is plain text "wtc.sh" in a "/home/user/MyDocs/scripts" directory. Then I pointed Billboard to it via:

{script:/home/user/MyDocs/scripts/wtc.sh}

But nothing comes up except the {weekday} and {date} that I already have set a line above it. :confused:


Quote:

Originally Posted by thp (Post 1297454)
You can do this already now by creating a shell script that does, e.g.:

Code:

echo -n "Time in Vienna: "
TZ=Europe/Vienna date +"%F %H:%M"
echo -n "Time in Helsinki: "
TZ=Europe/Helsinki date +"%F %H:%M"
echo -n "Time in London: "
TZ=Europe/London date +"%F %H:%M"

Shell scripts can be integrated into Billboard with the {script:/path/to/your/script.sh} command.

A list of all timezones is available on Wikipedia.


thp 2012-11-24 09:29

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by Arf the Lab (Post 1297696)
I copied your sample script verbatim and saved is plain text "wtc.sh" in a "/home/user/MyDocs/scripts" directory. Then I pointed Billboard to it via:

{script:/home/user/MyDocs/scripts/wtc.sh}

You have to place it into /home/user/ (or anywhere except MyDocs), because MyDocs is a vfat partition, and it can't have Unix permission bits set the same way as the other filesystems can. Also, add a shebang line and make it executable:
  • Add "#!/bin/sh" as the first line of the script
  • Save the script in e.g. /home/user/wtc.sh
  • chmod +x /home/user/wtc.sh
  • Add to Billboard: {script:/home/user/wtc.sh}

knobtviker 2012-11-24 10:33

Re: [Support thread] Billboard Standby Screen
 
I have a suggestion...
I'm running out of rows to display info I want visible at all the time.
I tried changing text size to Small in hope that I'll gain more space for more rows, but frame itself shrinks too.
Can that be separated?
Temp frame size set to biggest possible and then text on it rendered separately in it's own size, so some of us can gain more rows?

slarti 2012-11-24 12:28

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by knobtviker (Post 1297814)
I have a suggestion...
I'm running out of rows to display info I want visible at all the time.
I tried changing text size to Small in hope that I'll gain more space for more rows, but frame itself shrinks too.
Can that be separated?
Temp frame size set to biggest possible and then text on it rendered separately in it's own size, so some of us can gain more rows?

I tried getting past this limitation by adding a row that would show me the song when one was playing and network name when one wasn't playing.

Code:

{song!{network-name}}
Sadly, this doesn't work. If there is a song playing, the row is empty and when there isn't, it randomly shows you the network name or just stays empty. I guess it wasn't meant to be used this way. Would be great if it worked.

Arf the Lab 2012-11-27 09:00

Re: [Support thread] Billboard Standby Screen
 
1 Attachment(s)
Quote:

Originally Posted by thp (Post 1297796)
  • Add "#!/bin/sh" as the first line of the script
  • Save the script in e.g. /home/user/wtc.sh
  • chmod +x /home/user/wtc.sh
  • Add to Billboard: {script:/home/user/wtc.sh}

Hm, still doesn't work.

I added the #!/bin/sh, saved the file to /home/user, and did the chmod command. I noticed if I tried the chmod after logging in to root, it replied with, "Operation not permitted." But if I did it immediately after starting Terminal, it just returned to the command prompt. So I assume all is well [?].

Then I added it to Billboard. But nothing comes up.

I've attached my sh file, perhaps I missed something?

Thanks again for your help.

thedead1440 2012-11-27 11:30

Re: [Support thread] Billboard Standby Screen
 
1 Attachment(s)
Arf the Lab,

Your line endings are Windows not Unix hence the issue...


Edit: Attached your script with the change in line endings...

Arf the Lab 2012-11-27 20:22

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by thedead1440 (Post 1298844)
Your line endings are Windows not Unix hence the issue...

Ah, I see. I'll make the appropriate changes via hex editor if / when I make any modifications.

Quote:

Originally Posted by thedead1440 (Post 1298844)
Edit: Attached your script with the change in line endings...

Thank you very much, it's working fine now. Yay!

One more thing, though -- is it possible to get the date for these locations to display as DDMMYY instead of YYYYMMDD (i.e. "11/27/12" or "11-27-2012" instead of "2012-11-27"?) And display time as 12-hour format instead of 24-hour format?

Thanks.

deseven 2012-11-28 05:56

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by Arf the Lab (Post 1299090)
is it possible to get the date for these locations to display as DDMMYY instead of YYYYMMDD (i.e. "11/27/12" or "11-27-2012" instead of "2012-11-27"?) And display time as 12-hour format instead of 24-hour format?
Thanks.

Sure.
Code:

date +"%m/%d/%y %H:%M"
or
Code:

date +"%m-%d-%Y %H:%M"
for 12-hour format and other options check out man date

deseven 2012-11-28 06:04

Re: [Support thread] Billboard Standby Screen
 
Some other useful(?) hints:

kernel name and arch:
Code:

echo "krn: "`uname -r | cut -f1 -d"-"`"-"`uname -m`
load average:
Code:

echo "la: "`cat /proc/loadavg | cut -f1,2,3 -d" "`
uptime:
Code:

uptime=`cat /proc/uptime`
uptime=${uptime%%.*}
m=$(( uptime/60%60 ))
h=$(( uptime/60/60%24 ))
d=$(( uptime/60/60/24 ))
echo "up: "$d"d "$h"h "$m"m"

free/total mem:
Code:

echo "mem: "`awk '/MemFree/ {printf( "%.0f\n", $2 / 1024 )}' /proc/meminfo`"/"`awk '/MemTotal/ {printf( "%.0f\n", $2 / 1024 )}' /proc/meminfo`"M"
free/total space:
Code:

echo "disk: "`df -hP | awk '/MyDocs/ {printf( "%.1f\n", $4 )}'`"/"`df -hP | awk '/MyDocs/ {printf( "%.1f\n", $2 )}'`"G"

Arf the Lab 2012-11-29 02:20

Re: [Support thread] Billboard Standby Screen
 
Wow, this is a very helpful, informative community. That's great, and sadly not so common.

Thanks!


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

vBulletin® Version 3.8.8