Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 25 Oct 2014, 15:09
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
ticker tape PNN - Puppy News Network
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 2 of 3 Posts_count   Goto page: Previous 1, 2, 3 Next
Author Message
seaside

Joined: 11 Apr 2007
Posts: 887

PostPosted: Sun 05 Feb 2012, 00:33    Post_subject:  

One more try.....

/root/.PuppyBrowser/profiles/flashviewer/settings.rc
Code:
always_show_tabs=0
show_bookmarks=0
show_status=0
show_urlbar=0
use_tabs=0
show_no_bars=1
start_fullscreen=0


Code:
#!/bin/sh
#marquee scroller using PuppyBrowser

#setup notitle, noborder, ontop

sed -i 's|</JWM>||' /root/.jwm/jwmrc-personal

echo '<Group>
<Name>puppybrowser-nodec</Name>
<Option>layer:12</Option>
<Option>noborder</Option>
<Option>notitle</Option>
</Group>

</JWM>' >>/root/.jwm/jwmrc-personal

jwm -restart

#setup PuppyBrowser link to allow normal call

ln -s /usr/local/PuppyBrowser/PuppyBrowser /usr/bin/puppybrowser-nodec

#start marquee

WIDTH=500
HEIGHT=80
MESSAGE="     This looks promising... "

# Determine current screen resolution

RES=$(xrandr | grep "current" | cut -d 'c' -f1,3 | tr -cd 'x [:digit:]' | cut -d 'x' -f1,2)
MAXX=$(echo $RES | cut -d 'x' -f1,1)
MAXY=$(echo $RES | cut -d 'x' -f2,3)

X=$(($MAXX-$WIDTH))
Y=$(($MAXY-$HEIGHT))

# seaside's tweaked routine

echo '
<html>
  <font size="+4" face="DejaVu Sans"  color=red>
    <marquee scrollamount="4" scrolldelay="50">'"$MESSAGE"'</marquee>
  </font>
</html>' >/tmp/banner.html

#/usr/local/PuppyBrowser/puppy-browser /tmp/banner.html -title="PNN" -profile=fullscreen -x=$X -y=$Y -w=$WIDTH -h=$HEIGHT

puppybrowser-nodec /tmp/banner.html -profile=flashviewer -x=$(($X/2)) -y=$(($Y/2)) -w=$WIDTH -h=$HEIGHT


The xy coordinates were halved and it shows up around center on my screen.

Regards,
s
Back to top
View user's profile Send_private_message 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Sun 05 Feb 2012, 02:55    Post_subject:  

Quote:
Personally I've no idea what to do with that code...


you need the devx
put the code in test.c
you need code to open a gtk window. Dunno how to
do that and not gonna search

so far:

Code:
# gcc test.c -o test && ./test
test.c:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'partial'

_________________
Puppy WIKI

Edited_time_total
Back to top
View user's profile Send_private_message Visit_website 
SFR


Joined: 26 Oct 2011
Posts: 1078

PostPosted: Sun 05 Feb 2012, 10:22    Post_subject:  

@Lobster:
This C... Rolling Eyes
I found another one (third listing, seems to be complete), but I'm getting:
test.c:1:24: error: ./gtk/gtk.h: No such file or directory
I have all these header files in '/usr/include/gtk-2.0' and in folder where 'test.c' is, but doesn't work...
Nevermind...maybe not today, not for a week, not for a month, but sooner or later I'll do it! Twisted Evil

@seaside:
I was unable to run your code, unfortunately...
I tried to install puppybrowser-0.5.1-1-pup4.pet (+ an older version of Seamonkey, which is required, AFAIK),
but after 15 min. of symlinking, I've got "segmentation fault" in reward. Laughing

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send_private_message 
SFR


Joined: 26 Oct 2011
Posts: 1078

PostPosted: Sun 05 Feb 2012, 13:15    Post_subject:  

Ok, my final attempt to achieve good-looking scroll in GtkDialog.
This time I used Zigbert's routine from GtkDialog-Tips thread, to get monospace font in <entry><input> field.
(I don't know how, but it works. Smile )

Details in code itself...

Code:
#!/bin/sh

# =========================================
# Scroller - The Final Frontier by SFR'2012
# =========================================

# Tweakable parameters

MESSAGE="Maybe this one..? Thanks to Zigbert's routine it looks pretty decent."
WIDTH=320   # Window width
HEIGHT=35   # Window height
SPEED=0.2   # This parameter accepts even "0.01", but CPU dies then...
POSX=2      # 0 = left, 1 = center, 2 = right
POSY=2      # 0 = top,  1 = center, 2 = bottom
# =============================================================================

# Setting up everything

export SPEED

CHARWIDTH=$(($WIDTH/8))
export CHARWIDTH

# Adding spaces in front of the message

for i in `seq 0 $CHARWIDTH`; do
 MESSAGE=" "$MESSAGE
done

# Using temp files to keep the message and current text position

echo "$MESSAGE" > /tmp/scroll_text
echo > /tmp/scroll_var

# Determine current screen resolution and set up X and Y

RES=$(xrandr | grep "current" | cut -d 'c' -f1,3 | tr -cd 'x [:digit:]' | cut -d 'x' -f1,2)
MAXX=$(echo $RES | cut -d 'x' -f1,1)
MAXY=$(echo $RES | cut -d 'x' -f2,3)

case "$POSX" in
  0) X=0 ;;
  1) X=$((($MAXX/2)-($WIDTH/2))) ;;
  2) X=$(($MAXX-$WIDTH)) ;;
  *) X=$((($MAXX/2)-($WIDTH/2))) ;;
esac

case "$POSY" in
  0) Y=0 ;;
  1) Y=$((($MAXY/2)-($HEIGHT/2))) ;;
  2) Y=$(($MAXY-$HEIGHT)) ;;
  *) Y=$((($MAXY/2)-($HEIGHT/2))) ;;
esac


# Zigbert's routine to achieve monospace font.
# Source: OP in http://www.murga-linux.com/puppy/viewtopic.php?t=38608

echo 'style "specialmono"
{
  font_name="Mono 12"
}
widget "*mono" style "specialmono"
class "GtkText*" style "specialmono"' > /tmp/gtkrc_mono
export GTK2_RC_FILES=/tmp/gtkrc_mono:/root/.gtkrc-2.0
# =============================================================================

# Main scroll function

scroll () {
GET=$(cat /tmp/scroll_text)
POS=$(cat /tmp/scroll_var)
LEN=${#GET}

TEXT=${GET:$POS:$CHARWIDTH}
POS=$(($POS+1))
if [ "$POS" == "$LEN" ]; then POS=0; fi
echo $POS > /tmp/scroll_var
echo "$TEXT"
}
export -f scroll

# Gtkdialog structure

export MAIN='
<window title="Puppy News Network" allow-grow="false">
    <vbox>
    <progressbar visible="false">
      <input>while [ A = A ]; do sleep $SPEED; echo 99; echo 100; done</input>
      <action>refresh:SCROLL</action>
    </progressbar>
   
    <entry name=\"mono"\ sensitive="true">
      <variable>SCROLL</variable>
      <input>scroll</input>
    </entry>
    </vbox>
</window>
'

# Ok, let's begin!

gtkdialog -G "$WIDTH"x"$HEIGHT"+$X+$Y -p MAIN

# Cleaning, cleaning...

rm -f /tmp/scroll_text
rm -f /tmp/scroll_var
unset CHARWIDTH
unset SPEED
unset MAIN
unset scroll

# This part is to kill 'broken pipe' or whatever it is...
# To see what I mean, comment the following lines, launch the code in Terminal,
# and close the application's window (but not Terminal).
# If you know better way to do it, change the code please :)

TEST=`ps | grep while | grep sleep | grep done | cut -d"r" -f 1`
kill $TEST
exit

# THE END


Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send_private_message 
vovchik


Joined: 23 Oct 2006
Posts: 1285
Location: Ukraine

PostPosted: Sun 05 Feb 2012, 13:18    Post_subject:  

Dear puppians,

That source seems to be C#, which is not c++ or C. You need Mono, and that ain't a part of any normal devx.

With kind regards,
vovchik
Back to top
View user's profile Send_private_message 
SFR


Joined: 26 Oct 2011
Posts: 1078

PostPosted: Sun 05 Feb 2012, 13:23    Post_subject:  

vovchik wrote:
That source seems to be C#, which is not c++ or C. You need Mono, and that ain't a part of any normal devx.

Well, that explains everything...
Thank you vovchik for saving our time. Smile

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send_private_message 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Sun 05 Feb 2012, 14:18    Post_subject:  

pretty good - so how to display a MESSAGE Using the content of that URL which is your daily message . . .
Code:
#!/bin/sh

# =========================================
# Scroller - The Final Frontier by SFR'2012
# =========================================

# Tweakable parameters

MESSAGE=http://tmxxine.com/test2/t.txt
WIDTH=320   # Window width
HEIGHT=0   # Window height
SPEED=0.2   # This parameter accepts even "0.01", but CPU dies then...
POSX=1     # 0 = left, 1 = center, 2 = right
POSY=0      # 0 = top,  1 = center, 2 = bottom
# =============================================================================

# Setting up everything

export SPEED

CHARWIDTH=$(($WIDTH/8))
export CHARWIDTH

# Adding spaces in front of the message

#for i in `seq 0 $CHARWIDTH`; do
#MESSAGE=" "$MESSAGE
#done

# Using temp files to keep the message and current text position

echo "$MESSAGE" > /tmp/scroll_text
echo > /tmp/scroll_var

# Determine current screen resolution and set up X and Y

RES=$(xrandr | grep "current" | cut -d 'c' -f1,3 | tr -cd 'x [:digit:]' | cut -d 'x' -f1,2)
MAXX=$(echo $RES | cut -d 'x' -f1,1)
MAXY=$(echo $RES | cut -d 'x' -f2,3)

case "$POSX" in
  0) X=0 ;;
  1) X=$((($MAXX/2)-($WIDTH/2))) ;;
  2) X=$(($MAXX-$WIDTH)) ;;
  *) X=$((($MAXX/2)-($WIDTH/2))) ;;
esac

case "$POSY" in
  0) Y=0 ;;
  1) Y=$((($MAXY/2)-($HEIGHT/2))) ;;
  2) Y=$(($MAXY-$HEIGHT)) ;;
  *) Y=$((($MAXY/2)-($HEIGHT/2))) ;;
esac


# Zigbert's routine to achieve monospace font.
# Source: OP in http://www.murga-linux.com/puppy/viewtopic.php?t=38608

echo 'style "specialmono"
{
  font_name="Mono 22"
}
widget "*mono" style "specialmono"
class "GtkText*" style "specialmono"' > /tmp/gtkrc_mono
export GTK2_RC_FILES=/tmp/gtkrc_mono:/root/.gtkrc-2.0
# =============================================================================

# Main scroll function

scroll () {
GET=$(cat /tmp/scroll_text)
POS=$(cat /tmp/scroll_var)
LEN=${#GET}

TEXT=${GET:$POS:$CHARWIDTH}
POS=$(($POS+1))
if [ "$POS" == "$LEN" ]; then POS=0; fi
echo $POS > /tmp/scroll_var
echo "$TEXT"
}
export -f scroll

# Gtkdialog structure

export MAIN='
<window title="Puppy News Network" allow-grow="false">
    <vbox>
    <progressbar visible="false">
      <input>while [ A = A ]; do sleep $SPEED; echo 99; echo 100; done</input>
      <action>refresh:SCROLL</action>
    </progressbar>
   
    <entry name=\"mono"\ sensitive="true">
      <variable>SCROLL</variable>
      <input>scroll</input>
    </entry>
    </vbox>
</window>
'

# Ok, let's begin!

gtkdialog -G "$WIDTH"x"$HEIGHT"+$X+$Y -p MAIN

# Cleaning, cleaning...

rm -f /tmp/scroll_text
rm -f /tmp/scroll_var
unset CHARWIDTH
unset SPEED
unset MAIN
unset scroll

# This part is to kill 'broken pipe' or whatever it is...
# To see what I mean, comment the following lines, launch the code in Terminal,
# and close the application's window (but not Terminal).
# If you know better way to do it, change the code please :)

TEST=`ps | grep while | grep sleep | grep done | cut -d"r" -f 1`
kill $TEST
exit

# THE END



I moved the position of the scroller as it was behind the taskbar . . .

_________________
Puppy WIKI
Back to top
View user's profile Send_private_message Visit_website 
SFR


Joined: 26 Oct 2011
Posts: 1078

PostPosted: Sun 05 Feb 2012, 14:38    Post_subject:  

You almost did it:
Code:
MESSAGE=`wget -q -O - "http://tmxxine.com/test2/t.txt"`

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send_private_message 
SFR


Joined: 26 Oct 2011
Posts: 1078

PostPosted: Sun 05 Feb 2012, 14:57    Post_subject:  

Lobster wrote:
I moved the position of the scroller as it was behind the taskbar . . .

Oh, with JWM it behaves a bit different than with Openbox/Fbpanel...
Insert this line right above Zigbert's part, should be ok:
Code:
if [ "$POSY" -eq 2 ]; then Y=$(($Y-50)); fi

(50 is my panel's height, your may vary.)

EDIT: Whole code here:
Code:
#!/bin/sh

# =========================================
# Scroller - The Final Frontier by SFR'2012
# =========================================

# Tweakable parameters

MESSAGE=`wget -q -O - "http://tmxxine.com/test2/t.txt"`

WIDTH=320   # Window width
HEIGHT=35   # Window height
SPEED=0.2   # This parameter accepts even "0.01", but CPU dies then...
POSX=2      # 0 = left, 1 = center, 2 = right
POSY=2      # 0 = top,  1 = center, 2 = bottom
# =============================================================================

# Setting up everything

export SPEED

CHARWIDTH=$(($WIDTH/8))
export CHARWIDTH

# Adding spaces in front of the message

for i in `seq 0 $CHARWIDTH`; do
 MESSAGE=" "$MESSAGE
done

# Using temp files to keep the message and current text position

echo "$MESSAGE" > /tmp/scroll_text
echo > /tmp/scroll_var

# Determine current screen resolution and set up X and Y

RES=$(xrandr | grep "current" | cut -d 'c' -f1,3 | tr -cd 'x [:digit:]' | cut -d 'x' -f1,2)
MAXX=$(echo $RES | cut -d 'x' -f1,1)
MAXY=$(echo $RES | cut -d 'x' -f2,3)

case "$POSX" in
  0) X=0 ;;
  1) X=$((($MAXX/2)-($WIDTH/2))) ;;
  2) X=$(($MAXX-$WIDTH)) ;;
  *) X=$((($MAXX/2)-($WIDTH/2))) ;;
esac

case "$POSY" in
  0) Y=0 ;;
  1) Y=$((($MAXY/2)-($HEIGHT/2))) ;;
  2) Y=$(($MAXY-$HEIGHT)) ;;
  *) Y=$((($MAXY/2)-($HEIGHT/2))) ;;
esac

if [ "$POSY" -eq 2 ]; then Y=$(($Y-50)); fi

# Zigbert's routine to achieve monospace font.
# Source: OP in http://www.murga-linux.com/puppy/viewtopic.php?t=38608

echo 'style "specialmono"
{
  font_name="Mono 12"
}
widget "*mono" style "specialmono"
class "GtkText*" style "specialmono"' > /tmp/gtkrc_mono
export GTK2_RC_FILES=/tmp/gtkrc_mono:/root/.gtkrc-2.0
# =============================================================================

# Main scroll function

scroll () {
GET=$(cat /tmp/scroll_text)
POS=$(cat /tmp/scroll_var)
LEN=${#GET}

TEXT=${GET:$POS:$CHARWIDTH}
POS=$(($POS+1))
if [ "$POS" == "$LEN" ]; then POS=0; fi
echo $POS > /tmp/scroll_var
echo "$TEXT"
}
export -f scroll

# Gtkdialog structure

export MAIN='
<window title="Puppy News Network" allow-grow="false">
    <vbox>
    <progressbar visible="false">
      <input>while [ A = A ]; do sleep $SPEED; echo 99; echo 100; done</input>
      <action>refresh:SCROLL</action>
    </progressbar>
   
    <entry name=\"mono"\ sensitive="true">
      <variable>SCROLL</variable>
      <input>scroll</input>
    </entry>
    </vbox>
</window>
'

# Ok, let's begin!

gtkdialog -G "$WIDTH"x"$HEIGHT"+$X+$Y -p MAIN

# Cleaning, cleaning...

rm -f /tmp/scroll_text
rm -f /tmp/scroll_var
unset CHARWIDTH
unset SPEED
unset MAIN
unset scroll

# This part is to kill 'broken pipe' or whatever it is...
# To see what I mean, comment the following lines, launch the code in Terminal,
# and close the application's window (but not Terminal).
# If you know better way to do it, change the code please :)

TEST=`ps | grep while | grep sleep | grep done | cut -d"r" -f 1`
kill $TEST
exit

# THE END


EDIT2: Experimental! Put this code at the very beginning of the "scroll" function, right after "scroll () {":
Code:
# update check
TEMP1=`date +%M`      # get current minute
TEMP2=`date +%S`      # get current second
if [ "$TEMP1" -eq 0 ] && [ "$TEMP2" -eq 0 ]; then
  MESSAGE=`wget -q -O - "http://tmxxine.com/test2/t.txt"`
    for i in `seq 0 $CHARWIDTH`; do
      MESSAGE=" "$MESSAGE
    done
  echo "$MESSAGE" > /tmp/scroll_text
  echo > /tmp/scroll_var
fi

The message should be updated every full hour.

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send_private_message 
technosaurus


Joined: 18 May 2008
Posts: 4353

PostPosted: Sun 05 Feb 2012, 16:28    Post_subject:  

noone interested in using rxvt
Code:
#beware, this was coded blind with no terminal to test it in
i=0
LENGTH=20
DELAY=1
while ([ $i -lt ${#1} ]) do
 clear
 echo ${1:$i:$LENGTH}
 sleep $DELAY
 i=$(($i+1))
done


you'd want to play with rxvt -e and geometry, background and forground settings, possibly the name also, to remove the title bar via a jwm group setting

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
trapster


Joined: 28 Nov 2005
Posts: 2009
Location: Maine, USA

PostPosted: Sun 05 Feb 2012, 20:39    Post_subject:  

@ technosaurus

Very nice. Works nice on a transparent console with no decorations!

How can we keep the loop going, repeating the text scroll?
I understand we'd have to kill it with Ctrl-c or maybe run it for x minutes.

_________________
trapster
Maine, USA

Asus eeepc 1005HA PU1X-BK
Frugal install: Puppeee4.31 + 1.0, Puppy4.10 + Lupu52
Currently using Slacko AND lupu52 w/ fluxbox
Back to top
View user's profile Send_private_message Visit_website 
technosaurus


Joined: 18 May 2008
Posts: 4353

PostPosted: Sun 05 Feb 2012, 21:09    Post_subject:  

put the whole thing in a
while : do
...
done

or you could replace the ":" (equivalent of true) with a check for something like ... ([ -f $HOME/.pnn_on ])

now that I think about it printf would be better than echo

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Sun 05 Feb 2012, 23:59    Post_subject:  

Code:
MESSAGE=`wget -q -O - "http://tmxxine.com/test2/t.txt"`

was playing about with wget, curl and piping (unsuccessfully) - but you got it Cool

Quote:
The message should be updated every full hour.

OK have changed the message
I should imagine the program best run once a day or in emergencies . . .
Just having it running would be annoying?
http://puppylinux.org/wikka/NewsNetwork

Using rxvt does not give you control of font sizes unless changing terminal software
I changed to this
Code:
font_name="Mono 22"

_________________
Puppy WIKI
Back to top
View user's profile Send_private_message Visit_website 
technosaurus


Joined: 18 May 2008
Posts: 4353

PostPosted: Mon 06 Feb 2012, 02:01    Post_subject:  

you mean like this?
Code:
rxvt -g 40x1 +sb -name xmessage -fn 'xft:DejaVu Sans Mono-18:dpi=76'


xmessage already has a notitle setting Smile

you may want to change the command prompt value by
PS1=""

then you can use the string size in your terminal's geometry setting (otherwise it will wrap around)

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
SFR


Joined: 26 Oct 2011
Posts: 1078

PostPosted: Mon 06 Feb 2012, 06:12    Post_subject:  

@Lobster:
Lobster wrote:
Just having it running would be annoying?

Hmm, maybe On/Off switch..?

By the way, <window decorated="false"> removes decorations...

@technosaurus:
It's very good idea to explore. Could be more efficient/showy than GtkDialog.
And it's possible to set initial X/Y coordinates too via rxvt -g 40x1+0+0,
so it should be very easy to replace GtkDialog part to rxvt it in my code.

technosaurus wrote:
[...] to remove the title bar via a jwm group setting

But what about Openbox..?

EDIT: a small example how it could look:
Code:
#!/bin/sh
tail -n +4 $0  > /tmp/scroller_temp.txt
exec rxvt -g 40x1+0+0 -name xmessage -fn 'xft:DejaVu Sans Mono-18:dpi=76' -e sh /tmp/scroller_temp.txt

MESSAGE=`wget -q -O - "http://tmxxine.com/test2/t.txt"`

for i in `seq 0 40`; do
  MESSAGE=" "$MESSAGE
done

LEN=${#MESSAGE}
POS=0

# Main scroll function

echo -ne "\033[?25l\033[1;31m\033[1;103m"

while true; do
  TEXT=${MESSAGE:$POS:40}
  POS=$(($POS+1))
  if [ "$POS" == "$LEN" ]; then POS=0; fi
  echo
  echo -n "$TEXT"
  sleep 0.2
done


PS. It's enough to click on the script file to launch it.

EDIT2: second attempt, now it's fully undecorated:
Code:
#!/bin/sh
tail -n +4 $0  > /tmp/scroller_temp.txt
exec rxvt -borderLess +sb -g 40x1+0+0 -fn 'xft:DejaVu Sans Mono-18:dpi=76' -e sh /tmp/scroller_temp.txt

MESSAGE=`wget -q -O - "http://tmxxine.com/test2/t.txt"`

for i in `seq 0 40`; do
  MESSAGE=" "$MESSAGE
done

LEN=${#MESSAGE}
POS=0

# Main scroll function

echo -ne "\033[?25l\033[1;31m\033[1;103m"

while true; do
  TEXT=${MESSAGE:$POS:40}
  POS=$(($POS+1))
  if [ "$POS" == "$LEN" ]; then POS=0; fi
  echo
  echo -n "$TEXT"
  sleep 0.2
done


EDIT3: ...and with pseudo-transparency:
Code:
#!/bin/sh
tail -n +4 $0  > /tmp/scroller_temp.txt
exec rxvt -foreground 4 -transparent -borderLess +sb -g 40x1+0+0 -fn 'xft:DejaVu Sans Mono-18:dpi=76' -e sh /tmp/scroller_temp.txt

MESSAGE=`wget -q -O - "http://tmxxine.com/test2/t.txt"`

for i in `seq 0 40`; do
  MESSAGE=" "$MESSAGE
done

LEN=${#MESSAGE}
POS=0

# Main scroll function

echo -ne "\033[?25l" # to disable cursor

while true; do
  TEXT=${MESSAGE:$POS:40}
  POS=$(($POS+1))
  if [ "$POS" == "$LEN" ]; then POS=0; fi
  echo
  echo -n "$TEXT"
  sleep 0.2
done

...and now I have to go to work. C'ya.

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 2 of 3 Posts_count   Goto page: Previous 1, 2, 3 Next
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1384s ][ Queries: 12 (0.0077s) ][ GZIP on ]