LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 03-24-2005, 05:05 AM   #1
box_l
Member
 
Registered: Jul 2003
Location: Hereford,England
Distribution: mandrake 10 , Novell Desktop Linux (suse) , knoppix
Posts: 85

Rep: Reputation: 15
making the cursor spin


hi,
i am looking to find out how to make the cursor spin to show that you are waiting for a process to finish.

i see it when knoppix is booting.

looks like these characters.

|
/
-
\
|
/
-

TIA

BoX
 
Old 03-24-2005, 05:22 AM   #2
keefaz
Senior Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 4,341

Rep: Reputation: 73
This is a little try :
Code:
clear
for i in  '|' '/' '-' '\\' '|' '/' '-'; do
    tput cup 4 20
    echo $i
    sleep 1
done
 
Old 03-24-2005, 05:25 AM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
Hi,

Something like this maybe:
Code:
#!/bin/sh

sleep 10 &
pid=$!

printf "Processing |"
rotate='|/-\'

while kill -n 0 $pid 2>/dev/null; do
    rotate="${rotate#?}${rotate%???}"
    printf '\b%.1s' "$rotate"
    sleep 1
done
echo ''

wait $pid

echo "All done"
Hope this gets you going again.
 
Old 03-24-2005, 05:39 AM   #4
box_l
Member
 
Registered: Jul 2003
Location: Hereford,England
Distribution: mandrake 10 , Novell Desktop Linux (suse) , knoppix
Posts: 85

Original Poster
Rep: Reputation: 15
thank you both for your quick replies.

you have both given me something to work on.

BoX
 
  


Reply

Tags
cursor


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[Mouse cursor] flicking on animated cursor Creak Debian 1 06-10-2005 02:16 AM
to spin down or not to spin down, that is the question maenho Linux - Software 2 02-05-2005 08:41 AM
[SOLVED] CD spin down for knoppix bucovaina78 Linux - Hardware 5 11-03-2004 09:09 AM
hd spin down Henning_1 Linux - Hardware 2 09-24-2004 09:00 AM
Changin cursor -obtaining cursor isaac_linux Linux - General 1 11-05-2003 12:48 PM


All times are GMT -5. The time now is 06:26 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration