Active Topics

 



Notices


Reply
Thread Tools
Posts: 26 | Thanked: 2 times | Joined on Nov 2012
#281
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.


Originally Posted by thp View Post
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's Avatar
Posts: 1,391 | Thanked: 4,272 times | Joined on Sep 2007 @ Vienna, Austria
#282
Originally Posted by Arf the Lab View Post
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}
 

The Following 3 Users Say Thank You to thp For This Useful Post:
knobtviker's Avatar
Posts: 665 | Thanked: 2,388 times | Joined on Feb 2012 @ Zagreb, Croatia
#283
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?
 
Posts: 277 | Thanked: 319 times | Joined on Jan 2010
#284
Originally Posted by knobtviker View Post
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.
 
Posts: 26 | Thanked: 2 times | Joined on Nov 2012
#285
Originally Posted by thp View Post
  • 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.
Attached Files
File Type: zip wtc.zip (243 Bytes, 79 views)
 
Moderator | Posts: 6,215 | Thanked: 6,400 times | Joined on Nov 2011
#286
Arf the Lab,

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


Edit: Attached your script with the change in line endings...
Attached Files
File Type: zip wtc.zip (205 Bytes, 92 views)
 
Posts: 26 | Thanked: 2 times | Joined on Nov 2012
#287
Originally Posted by thedead1440 View Post
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.

Originally Posted by thedead1440 View Post
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.
 
Posts: 3 | Thanked: 6 times | Joined on Nov 2012
#288
Originally Posted by Arf the Lab View Post
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
 

The Following 2 Users Say Thank You to deseven For This Useful Post:
Posts: 3 | Thanked: 6 times | Joined on Nov 2012
#289
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"
 

The Following 4 Users Say Thank You to deseven For This Useful Post:
Posts: 26 | Thanked: 2 times | Joined on Nov 2012
#290
Wow, this is a very helpful, informative community. That's great, and sadly not so common.

Thanks!
 
Reply


 
Forum Jump


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