LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-24-2013, 12:13 AM   #1
waddles
Member
 
Registered: Sep 2012
Posts: 372

Rep: Reputation: 1
Slow scrolling


I used to be able to automatically scroll a scroll region under a different OS. I tried those escape commands but everyone fails.
Other than doing a where/read line and sleep to display a line are there any shell escape commands or anything to do this automatically?
Is there a way to create a scroll region with bash? I can do it with that where/read and carefully setting margins but am looking for a simpler approach maybe like scrollreg x,y x1,y1?
 
Old 10-24-2013, 12:53 AM   #2
cisneros
Member
 
Registered: Jul 2012
Distribution: Slackware
Posts: 95

Rep: Reputation: 5
i lost you in "scroll a scroll", please explain it with more examples and details.
 
Old 10-24-2013, 12:54 AM   #3
TracyTiger
Member
 
Registered: Apr 2011
Location: California, USA
Distribution: Slackware
Posts: 528

Rep: Reputation: 273Reputation: 273Reputation: 273
Sounds like a bash programming question, not a Slackware specific topic.

Perhaps you're asking about a terminal configuration setting in Slackware?

Last edited by TracyTiger; 10-24-2013 at 04:26 AM. Reason: Fixed Spelling
 
Old 10-24-2013, 03:16 AM   #4
waddles
Member
 
Registered: Sep 2012
Posts: 372

Original Poster
Rep: Reputation: 1
@cisneros: I am looking for escape commands to use in bash/bourne shell scripting that allow for automatic scrolling of text within a defined scroll region.
My fall back method is without defining a region within which to display:
Code:
while read line
do
   echo $line
   sleep 2s
done < ThisOrOtherFile
@Tracy Tiger: not quite. It would be use of escape commands or tput commands (maybe) that limit text to within an area of the current screen. Kinda like a split-screen only split horizontally. It might take a terminal redef but if so I don't know which commands it might be. It could be a use of tput to extract a feature form the terminal definition.
@
 
Old 10-30-2013, 10:27 AM   #5
waddles
Member
 
Registered: Sep 2012
Posts: 372

Original Poster
Rep: Reputation: 1
Actually it is a bit of both bash and terminal.
What I had done was to tell the system/terminal that lines say 15 to 20 would be set aside to output to and whatever file I catted or listed would output only within those lines. It looks like tput csr is close but cannot get it to set aside a scroll area. Hope this helps someone to come up with a genius idea.
 
Old 10-31-2013, 04:29 PM   #6
phoemur
LQ Newbie
 
Registered: Aug 2013
Location: Brazil
Posts: 16

Rep: Reputation: Disabled
How about this:

Quote:
less << EOF
bla
bla
bla
bla
bla
your
text
here
...
...
...
EOF
Then you'll be able to scroll up and down the whole text using the arrow keys, press q to quit...
 
1 members found this post helpful.
Old 10-31-2013, 04:42 PM   #7
phoemur
LQ Newbie
 
Registered: Aug 2013
Location: Brazil
Posts: 16

Rep: Reputation: Disabled
Suppose you have a file.txt to scroll along a small portion of your screen, in the example between lines 10 and 30, I made this:

Code:
#!/bin/bash

n=1
last=$(wc -l < file.txt)
sup_margin=10
inf_margin=30

for i in $(seq 1 $last); do
    tput cup $sup_margin 0
    sed -n "$n,$((n+$inf_margin))p" file.txt
    sleep 1
    let n++
    clear
done
tput sgr0
 
1 members found this post helpful.
Old 10-31-2013, 04:58 PM   #8
phoemur
LQ Newbie
 
Registered: Aug 2013
Location: Brazil
Posts: 16

Rep: Reputation: Disabled
Another one with tput csr, scrolling file.txt

Code:
#!/bin/bash

clear
tput csr 10 30
tput cup 10 0

exec 3< file.txt
while read LINE <&3; do 
  echo "$LINE"
  sleep 1
done
exec 3<&-

tput reset
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Iceweasel really slow when scrolling vavoem Linux - Software 1 01-30-2012 07:57 PM
xpdf slow scrolling in 13.37 prol Slackware 0 07-06-2011 07:05 PM
slow scrolling on one machine, fast scrolling of same files on another rblampain Debian 5 01-22-2008 03:20 AM
Slow Scrolling Speed pankaj_garg Linux - Software 2 09-06-2007 06:27 AM
Slow Scrolling in Suse 10.2 sriram_16a SUSE / openSUSE 2 05-27-2007 10:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration