You are not logged in.

#1 2010-10-17 04:50:52

halhen
Member
From: Gothenburg, Sweden
Registered: 2009-04-08
Posts: 56
Website

shic - SHellscript Irc Client

To learn BASH scripting, I made an IRC client along the lines of sic in pure BASH. A hundred lines later, I've got something good enough to try at http://github.com/halhen/shic.

Features are similar to sic, plus support for configurable regexp based coloring.

As I stress in the README, I have only little experience of BASH scripting. Let me know where I screwed up.


statnot - status text manager and notification-daemon for dwm, wmii and the like
shic - SHellscript Irc Client

Offline

#2 2010-10-17 18:15:39

Daenyth
Forum Fellow
From: Boston, MA
Registered: 2008-02-24
Posts: 1,244

Re: shic - SHellscript Irc Client

What a masochistic project. I like it

Offline

#3 2010-10-17 18:52:31

hatten
Arch Linux f@h Team Member
From: Sweden, Borlange
Registered: 2009-02-23
Posts: 736

Re: shic - SHellscript Irc Client

Hm, might be worth checking out.

/me uses ii, it's awesome to sit and write scripts for it.

Offline

#4 2010-10-17 20:04:33

halhen
Member
From: Gothenburg, Sweden
Registered: 2009-04-08
Posts: 56
Website

Re: shic - SHellscript Irc Client

Thanks guys.

Daenyth: thanks for your tip on github. I changed my "$*" to "$@". I'm waiting for mr Mailman to bring Pro Bash Programming any day now, so I can straigthen out a few question marks like this one.

A few additions since the last post:

  • ~/.shicrc and $XDG_CONFIG_HOME/shic/shicrc are read as config files automatically

  • The config variable SHIC_SCRIPT can contain ';'-separated input to be automatically executed at startup. For example, to join #archlinux and #python and set current channel to none at startup:

    SHIC_SCRIPT=":j #archlinux; :j #python; :s;"

My shicrc, while similar to the default, is on github.

Now, I need to think about bloat. Already 90 lines of BASH code, and a whopping 129 lines with comments and blanks. wink


statnot - status text manager and notification-daemon for dwm, wmii and the like
shic - SHellscript Irc Client

Offline

#5 2010-10-18 00:59:06

kittykatt
Member
From: Missouri, USA
Registered: 2009-11-04
Posts: 260
Website

Re: shic - SHellscript Irc Client

Interesting. Gonna check this out soon. big_smile


- [ My Blog ] | [ AUR Packages ] | [ My deviantART ] | [ screenFetch ] | [ SilverIRC ] -

Offline

#6 2011-07-06 16:19:21

rlp10
Member
Registered: 2009-11-27
Posts: 14

Re: shic - SHellscript Irc Client

Halhen -- great script, well done.  Just the kind of thing that I like.  I actually do use sic, but I prefer bash to c, so I've switched to yours.  And it does colours!

Now a question for you: Would it be possible to connect to shic, disconnect from it and then reconnect again, using socat and unix sockets?

I was trying to figure this out the other day but couldn't get it to work.  Something like:

socat SYSTEM:shic UNIX-LISTEN:shic-pipe
socat - UNIX-CONNECT:shic-pipe

But it dies when I disconnect.  I think I need to get the first one to ignore the "end of file" sent when the second one disconnects.

I realise gnu screen can achieve a similar thing, but this is cooler and more fun. smile

Richard

Offline

#7 2011-07-08 07:04:07

halhen
Member
From: Gothenburg, Sweden
Registered: 2009-04-08
Posts: 56
Website

Re: shic - SHellscript Irc Client

TIL about socat. Very cool indeed!

Try adding fork as an option to UNIX-LISTEN as such:

socat SYSTEM:shic UNIX-LISTEN:shic-pipe,fork

. After this, it works for me.


statnot - status text manager and notification-daemon for dwm, wmii and the like
shic - SHellscript Irc Client

Offline

#8 2011-07-08 08:20:23

rlp10
Member
Registered: 2009-11-27
Posts: 14

Re: shic - SHellscript Irc Client

halhen wrote:

TIL about socat. Very cool indeed!

Great isn't it?  So now you could use shic as an interactive irc client, then disconnect and hand it over to a script to act as a bot (very easy with shic) and then reconnect for interactive use.  socat ftw!

halhen wrote:

Try adding fork as an option to UNIX-LISTEN as such:

socat SYSTEM:shic UNIX-LISTEN:shic-pipe,fork

. After this, it works for me.

Perfect.  Just what I was looking for--thanks for that.

Offline

#9 2011-07-08 09:15:18

rlp10
Member
Registered: 2009-11-27
Posts: 14

Re: shic - SHellscript Irc Client

rlp10 wrote:

So now you could use shic as an interactive irc client, then disconnect and hand it over to a script to act as a bot (very easy with shic) and then reconnect for interactive use.

Or... have it log to a file so you can see what was said when you come back.

Offline

Board footer

Powered by FluxBB