X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f996b,5280c09988c17578 X-Google-Attributes: gidf996b,public X-Google-ArrivalTime: 2002-10-16 02:37:20 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!nntp-relay.ihug.net!ihug.co.nz!west.cox.net!cox.net!p01!news2.west.cox.net.POSTED!53ab2750!not-for-mail Newsgroups: alt.ascii-art From: Faux_Pseudo Subject: Re: Nerd Boy, episode 291 References: Reply-To: Faux_Pseudo@yahoo.comERCIAL X-PGP-Server: wwwkey.nl.pgp.net X-Why: are you reading this? X-PGP-KeyID: CF4DA06B Message-ID: User-Agent: slrn/0.9.7.4 (Linux) Lines: 79 Date: Wed, 16 Oct 2002 09:37:18 GMT NNTP-Posting-Host: 68.8.9.87 X-Complaints-To: abuse@cox.net X-Trace: news2.west.cox.net 1034761038 68.8.9.87 (Wed, 16 Oct 2002 05:37:18 EDT) NNTP-Posting-Date: Wed, 16 Oct 2002 05:37:18 EDT Organization: Cox Communications Xref: archiver1.google.com alt.ascii-art:19977 _.--- Pete Gunter spoke in alt.ascii-art --------._ > Hi there, > Faux, I just wanted to ask you aout your sig? How do you get that to work? > Is it a winamp plugin or something? /* This is going to make a lot more sence to *nix users then it will to windows users. People who automate everything under the sun should understand all of it. I am one of those people and I need a job. I will replace people with shell scripts for a small fee. */ It is a custom script that feeds off another custom script. First I needed a way to have music started at 8AM every day. So I wrote one with lots of bells and whistles to handle that. The rewrite will have lots more bells and whistles and borderline on the overblown. But then most of my custom stuff does that. I think my autopr0n.sh and its "suit" of apps is a prime example of that. Then I decided that I wanted to make sigs out of what ever was playing so I added one line of code that takes all the songs that are going to play and puts them in a file called ~/.playing. Then via crontab the following script is called. It has 3 bugs in it that I have found so far: 1) if you catch the first song Rev and Now will be listed as the same 2) if you catch the last song Now and Fwd will be listed as the same These two could be fixed very easily if I put in an extra if loop but just haven't done it yet. 3) I haven't debugged so that grep quotes the string in ~/.playing its looking for so it chokes if it goes looking for something like "Once_In_A_While_[Ava_Adore_1998].mp3" because [ and ] have special meaning in regexs. I will fix this in the rewrite. The whole "suit" of apps that make this happen really needs to be rewritten but I haven't gotten around to that yet. But I started. =) #!/bin/bash HOME=/home/faux/ sigfile=.signature PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin/\ :/home/faux/shell:/usr/games/ unbuff() { echo $@ | sed 's/.*\(.\{48\}$\)/\1/' } #nowplaying.sh is me being very lazy as all it is: "cat ~/.nowplaying" LISTAGE="$(grep -1 $(/home/faux/shell/nowplaying.sh) .playing |\ sed -e 's/.*music//' -e 's/.*comedy//' -e \ 's/.*instramental//' -e 's/.*punk//' -e 's/.*metal-rock//' )" Now_Array[0]=" (Now Playing) http://asciipr0n.com/fp updated=10/12" Now_Array[1]="Rev: $(unbuff $(echo "$LISTAGE" | head -1 | tail -1) )" Now_Array[2]="Now: $(unbuff $(echo "$LISTAGE" | head -2 | tail -1) )" Now_Array[3]="Fwd: $(unbuff $(echo "$LISTAGE" | head -3 | tail -1) )" #set -x ONELINER0="$(/usr/games/fortune /usr/share/games/fortunes/fortun-2liners)" #fortune is the app that spits out fun things on nix systems #I made a small fortun mod that has nothing but 2 line 34 byte quotes #in it to fill up the space I had left over. ONELINER1="$(echo "$ONELINER0" | head -1)" ONELINER2="$(echo "$ONELINER0" | tail -1)" #set +x echo -e " ICQ=66618055 : ${Now_Array[0]}" > $sigfile echo -e " YIM=faux_pseudo : ${Now_Array[1]}" >> $sigfile echo -e "$ONELINER1: ${Now_Array[2]}" >> $sigfile echo -e "$ONELINER2: ${Now_Array[3]}" >> $sigfile -- ICQ=66618055 : (Now Playing) http://asciipr0n.com/fp updated=10/12 YIM=faux_pseudo : Rev: Four_-_02_-_Once_In_A_While_[Ava_Adore_1998].mp3 RTFM RTFM RTFM : Now: /smashing_pumkins/perfect_single/02-summer.mp3 RTFM RTFM : Fwd: ns/bullet_with_butterfly_wings/02-said_sadly.mp3