Well, that explains everything...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.
Thank you vovchik for saving our time.
Greetings!
Well, that explains everything...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.
Code: Select all
#!/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
Code: Select all
MESSAGE=`wget -q -O - "http://tmxxine.com/test2/t.txt"`
Oh, with JWM it behaves a bit different than with Openbox/Fbpanel...Lobster wrote:I moved the position of the scroller as it was behind the taskbar . . .
Code: Select all
if [ "$POSY" -eq 2 ]; then Y=$(($Y-50)); fi
Code: Select all
#!/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
Code: Select all
# 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
Code: Select all
#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
Code: Select all
MESSAGE=`wget -q -O - "http://tmxxine.com/test2/t.txt"`
OK have changed the messageThe message should be updated every full hour.
Code: Select all
font_name="Mono 22"
Code: Select all
rxvt -g 40x1 +sb -name xmessage -fn 'xft:DejaVu Sans Mono-18:dpi=76'
Hmm, maybe On/Off switch..?Lobster wrote:Just having it running would be annoying?
But what about Openbox..?technosaurus wrote:[...] to remove the title bar via a jwm group setting
Code: Select all
#!/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
Code: Select all
#!/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
Code: Select all
#!/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
Code: Select all
#!/bin/sh
PRECODELENGHT=25 # This parameter is the number of lines from the very beginning to the "START" comment
# It MUST be very accurate to make the script working!!!
# checking if there's temporary scroll state file, create one if not
if [ ! -f /tmp/scroller_state ]; then
echo -n "OFF" > /tmp/scroller_state
fi
# checking if the script is working now: if yes - kill, if not - launch
ONOFFTEST=$(cat /tmp/scroller_state)
if [ "$ONOFFTEST" == "ON" ]; then
kill $(cat /tmp/scroller_pid) # kills scroller process
echo -n "OFF" > /tmp/scroller_state
rm -f /tmp/scroller_pid
exit
else
echo -n "ON" > /tmp/scroller_state
fi
tail -n +$PRECODELENGHT $0 > /tmp/scroller_temp.txt
exec rxvt -foreground 7 -transparent -borderLess +sb -g 40x1+0+0 -fn 'xft:DejaVu Sans Mono-18:dpi=76' -e sh /tmp/scroller_temp.txt
# START
# Here the main scroller's code starts
echo -ne "\033[?25l" # to disable cursor
# Get the message and add spaces in front of it
function getmessage () {
echo -n "UPDATING..."
MESSAGE=$(wget -q -O - "http://tmxxine.com/test2/t.txt")
for i in `seq 0 40`; do
MESSAGE=" "$MESSAGE
done
LEN=${#MESSAGE}
POS=0
}
getmessage
echo -n $$ > /tmp/scroller_pid # export PID into temp file
# Main loop
while true; do
TEXT=${MESSAGE:$POS:40}
POS=$(($POS+1))
if [ "$POS" == "$LEN" ]; then POS=0; fi
echo
echo -n "$TEXT"
# update check (every full hour)
TEMP1=`date +%M` # get current minute
TEMP2=`date +%S` # get current second
if [ "$TEMP1" -eq 0 ] && [ "$TEMP2" -eq 0 ]; then
getmessage
fi
sleep 0.2
done
# The End
Sorry, I didn't notice that before... I was in trance, perhaps I'm a "code-junkie"..?vovchik wrote:http://www.murga-linux.com/puppy/viewto ... 401#602401
...because it's a good idea, too!seaside wrote:I still had hoped to get PuppyBrowser to work with newer pups since it works perfectly in pup431, so that the full use of the marquee tag could be exploited with all it's extra functions. Alas, it seems it is loathe to work on the newer ones.
Why not, it's just a single-letter modificationseaside wrote:Perhaps the rxvt command should be changed to urxvt, because sometimes it's a link to urxvt and sometimes not. (many extra functions in urxvt not in rxvt)
because you can't simply make a symlink for urxvt using a rxvt binarySFR wrote:Why not, it's just a single-letter modificationseaside wrote:Perhaps the rxvt command should be changed to urxvt, because sometimes it's a link to urxvt and sometimes not. (many extra functions in urxvt not in rxvt)
AFAIK urxvt = Unicode rxvt
Thanks to it shoud be possible to get diacritic characters...maybe multilanguage news..?
Greetings!
Code: Select all
#!/bin/bash
PRECODELENGHT=25 # This parameter is the number of lines from the very beginning to the "START" comment
# It MUST be very accurate to make the script working!!!
# checking if there's temporary scroll state file, create one if not
if [ ! -f /tmp/scroller_state ]; then
echo -n "OFF" > /tmp/scroller_state
fi
# checking if the script is working now: if yes - kill, if not - launch
ONOFFTEST=$(cat /tmp/scroller_state)
if [ "$ONOFFTEST" == "ON" ]; then
kill $(cat /tmp/scroller_pid) # kills scroller process
echo -n "OFF" > /tmp/scroller_state
rm -f /tmp/scroller_pid
exit
else
echo -n "ON" > /tmp/scroller_state
fi
tail -n +$PRECODELENGHT $0 > /tmp/scroller_temp.txt
exec urxvt -foreground 7 -transparent -borderLess +sb -g 40x1+0+0 -fn 'xft:DejaVu Sans Mono-18:dpi=76' -e sh /tmp/scroller_temp.txt
# START
# Here the main scroller's code starts
echo -ne "\033[?25l" # to disable cursor
# Get the message and add spaces in front of it
function getmessage () {
echo -n "UPDATING..."
MESSAGE=$(wget -q -O - "http://tmxxine.com/test2/t.txt")
for i in `seq 0 40`; do
MESSAGE=" "$MESSAGE
done
LEN=${#MESSAGE}
POS=0
}
getmessage
echo -n $$ > /tmp/scroller_pid # export PID into temp file
# Main loop
while true; do
TEXT=${MESSAGE:$POS:40}
POS=$(($POS+1))
if [ "$POS" == "$LEN" ]; then POS=0; fi
echo
echo -n "$TEXT"
# update check (every full hour)
TEMP1=`date +%M` # get current minute
TEMP2=`date +%S` # get current second
if [ "$TEMP1" -eq 0 ] && [ "$TEMP2" -eq 0 ]; then
getmessage
fi
sleep 0.2
done
# The End
SFR,SFR wrote:seaside wrote: I even was looking for a tiny browser with javascript (it's needed by <marquee>, am I right?) that could be compatibile with as many Puppies as possible.
I found Links2 - very, very nice one, but doesn't support <marquee>
Why not, it's just a single-letter modificationseaside wrote:Perhaps the rxvt command should be changed to urxvt, because sometimes it's a link to urxvt and sometimes not. (many extra functions in urxvt not in rxvt)
AFAIK urxvt = Unicode rxvt
Thanks to it shoud be possible to get diacritic characters...maybe multilanguage news..?
Greetings!
Did not work for me, bits of it did . . .PS. The transparent rxvt version is fabulous. Thanks, technosaurus!
Code: Select all
rxvt -g 40x1+0+0 +sb -name xmessage -fn 'xft:DejaVu Sans Mono-28:dpi=76'
Code: Select all
#!/bin/bash
# run from command line with ./Script
# will read the text file "autocue"
# and display one character after another
INPUT=autocue
clear
while IFS= read -r -n1 char
do
sleep 0.05
echo -n "$char"
done < "$INPUT"