Saturday, May 19, 2012

Teeny TinyIRC

In the comments of the previous blog post you'll find a bunch of goodies from dronz.
 
His latest iz2jffs setup attempts to squeeze gmenu2x, gmu, glinks, rockbox, and some handy scripted dialogs for multiple wifi profiles and system configs.  I was able squeeze out a little more space by reconfiguring the libs and now I'm tinkering with the rest.
For starters, as seen above, dronz prefers tinyirc to pmirc because tinyirc keeps your keyboard input isolated on a separate line so you don't get mixed messages when someone else is posting at the same time.  Ok, I can see where that might be helpful when composing a long line of text.  But pmirc squishes down to only 2K on the jffs.  At nearly 40K, tinyirc never seemed all that tiny to me.  So I went to work.  First I weaned it off ncurses and switched to ANSI escape sequences for the few simple screen drawing tricks.  That got the executable down around 17K which is much closer to what I'd consider "tiny". 

Once that was out of the way I figured I should probably take the time to zipitize it to make it more useable.  First I fixed it to stop scrolling blank lines whenever it received a PING message.  That was driving me nuts, slowly scrolling the real messages up and off the top of the tiny zipit screen.  Then I added the home, end, pgup, pgdn, and arrow key support to complement the emacs style line editing keys and make composing messages easier on the zipit.  I also added a -t command line switch to turn on message timestamps, and a ctrl-t key to toggle them on or off at runtime.  Finally I added a splash of color; red for errors, magenta for JOIN messages, and green for my messages because all the cool IRC clients have color, even lowly pmirc.

Here you can see my colorful JOIN.  And if you look real carefully, you can also see that I toggled timestamps on just before the JOIN.  If the channel is quiet you can tell if timestamps are on by the uppercase Z after the TinyIRC release number on the status bar.  A lowercase z means timestamps are off.
 I still need to edit the boot scripts to register an IRCNICK environment variable (maybe in ~/.bashrc).  That way I won't keep getting a 30 second countdown to pick a new NICK whenever I startup tinyirc.  Actually I need to edit all the scripts anyhow since they're currently all in french...

Here's the modified source and the smaller tinyirc executable: tinyirc.zip

4 comments:

  1. Bonjour !
    Do not loose your time with translations, I'm doing it. But if you can correct my poor english when done...And there is things I don't understand: I don't know how to switch vt's. If I could, I could take beautiful screenshots like you do with fbshot. I tried to write a little sysinfo script, but ps >> /tmp/sysinfo.tmp does not write in my file ? And I tried to write a right setupTZ.sh with http://prototypeur.free.fr/timezone.txt but I did not succeed.

    ReplyDelete
  2. There are some nice TZ scripts for dialog on the internet. I'll try to adapt one to use your timezone.txt data.

    To switch vts for screenshots you need to add some keys to your keymap files. Key 102 must be F1 to allow you to escape from SDL programs. The others are handy, but you could probably get by with chvt.

    keycode 102 = F1
    keycode 105 = Left
    altgr keycode 105 = Decr_Console
    keycode 106 = Right
    altgr keycode 106 = Incr_Console
    keycode 166 = Decr_Console
    keycode 200 = Incr_Console

    Then you should up another console with the t2 script included in my update to your jffs. Then you can launch gmenu which will use a 3rd vt for it's graphics. Press ctrl-alt-home to get to the text vt that launched gmenu. You can't use that one, so press ctrl-right-arrow to increment vts until you get to the other working vt. Run fbshot with a 30 second delay. Then press ctrl-right-arrow to get back to gmenu and wait for the screenshot.

    If you get confused you can type tty or fgconsole from a working shell vt to see which one you're on. Also, when you exit an SDL program it's probably a good idea to run deallocvt to clean up the released graphics vt.

    ReplyDelete
  3. English version:
    http://prototypeur.net/dataz/iz2jffs-v3-en.zip

    ReplyDelete
    Replies
    1. Nice! I made a set-timezone script for your timezone data file.

      http://pastebin.com/LiAQExih

      Seems to work, but I haven't actually tried it on the zipit yet.

      And before I forget, I use EST5EDT,M3.2.0,M11.1.0 instead of the EST5EDT in the timezone.txt file.

      Delete