zsh-users
 help / color / mirror / code / Atom feed
* ZIRC - The 100% Zsh IRC client - a few updates
@ 2006-06-30 12:10 Gergely Nagy
  2006-06-30 23:21 ` Andrew Ruder
  0 siblings, 1 reply; 3+ messages in thread
From: Gergely Nagy @ 2006-06-30 12:10 UTC (permalink / raw)
  To: zsh-users

Greetings!

I've recently stumbled upon an earlier post on this list by Andrew
Ruder, and since I spend 90% of my time on the shell, I figured I'll
give ZIRC a try: it works like a charm. And yes, before you ask, I'm
weird/stupid/etc (appropriate word to be underlined) to use it as my
main IRC client at work.

However, it did miss a few little features, so I took the liberty of
adding a few commands I found myself using a lot (op, deop, voice,
devoice, kick, who, whois and names for now).

My modified version is available from
http://bonehunter.rulez.org/~algernon/bzr/zirc/, which is also a bzr
branch, and can be pulled from.

In the coming days, I might be adding some more things, as the need pops up.

Oh... and sorry for not responding in the original thread - I wasn't
subscribed at the time.

-- 
Gergely Nagy


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ZIRC - The 100% Zsh IRC client - a few updates
  2006-06-30 12:10 ZIRC - The 100% Zsh IRC client - a few updates Gergely Nagy
@ 2006-06-30 23:21 ` Andrew Ruder
  2006-07-05  9:25   ` Gergely Nagy
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Ruder @ 2006-06-30 23:21 UTC (permalink / raw)
  To: zsh-users

On Fri, Jun 30, 2006 at 02:10:55PM +0200, Gergely Nagy wrote:
> I've recently stumbled upon an earlier post on this list by Andrew
> Ruder, and since I spend 90% of my time on the shell, I figured I'll
> give ZIRC a try: it works like a charm. And yes, before you ask, I'm
> weird/stupid/etc (appropriate word to be underlined) to use it as my
> main IRC client at work.

*hangs head in shame* It has been my full-time IRC client as well since
I announced it on the list.  Pathetic, I know, but it is pretty cool.
Anyway, if you don't mind (and I'm guessing you don't since you posted
your changes to a GPL program), I'll incorporate your changes into zIRC
and it is looking like I should probably put up some sort of repository
for the thing because I have been working on it quite a bit as well. :)

Ok, anonymous access (subversion):

svn co svn://svn.aeruder.net/svn/zirc/trunk

The most notable change I've finished is auto-quoting for zirc commands.
It is quite similar to how the url-magic-quote plugin works and makes
the thing a heck of a lot more usable, IMO.

For anyone else interested, I've setup a small website at

http://www.aeruder.net/software/ZIRC.html

where I'll eventually post the newer versions (what is there is what I
sent the mailing list still).

I'll get around to incorporating your changes whenever I can figure out
the diff since your editor totally destroyed all the whitespace
settings.

Have fun,
Andy

-- 
Andrew Ruder <andy@aeruder.net>
http://www.aeruder.net


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ZIRC - The 100% Zsh IRC client - a few updates
  2006-06-30 23:21 ` Andrew Ruder
@ 2006-07-05  9:25   ` Gergely Nagy
  0 siblings, 0 replies; 3+ messages in thread
From: Gergely Nagy @ 2006-07-05  9:25 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 888 bytes --]

> *hangs head in shame* It has been my full-time IRC client as well since
> I announced it on the list.  Pathetic, I know, but it is pretty cool.
> Anyway, if you don't mind (and I'm guessing you don't since you posted
> your changes to a GPL program), I'll incorporate your changes into zIRC
> and it is looking like I should probably put up some sort of repository
> for the thing because I have been working on it quite a bit as well. :)

Hehe, of course I don't mind! :)

> I'll get around to incorporating your changes whenever I can figure out
> the diff since your editor totally destroyed all the whitespace
> settings.

Ouch... sorry about that... I didn't notice my emacs screwed it up
that badly. I'll try to teach it not to, in the future.

I'm attaching a diff, which might not apply, but my changes can be
easily seen from it, and copy-pasted and fixing up the indentation.

[-- Attachment #2: zirc.diff --]
[-- Type: text/x-patch, Size: 3984 bytes --]

=== modified file 'zirc'
--- zirc	2006-06-30 09:12:14 +0000
+++ zirc	2006-06-30 12:15:17 +0000
@@ -50,8 +50,7 @@
         zirc_disconnect
 fi
 
-ZIRC_VARS=( ZIRC_LAST ZIRC_CHANNELS ZIRC_CURRENT ZIRC_LOWERCASER ZIRC_FD ZIRC_S
-ERVER "${ZIRC_PARAMS[@]}" )
+ZIRC_VARS=( ZIRC_LAST ZIRC_CHANNELS ZIRC_CURRENT ZIRC_LOWERCASER ZIRC_FD ZIRC_SERVER "${ZIRC_PARAMS[@]}" )
 ZIRC_UNSETSTRING="unset ${ZIRC_VARS[*]}"
 eval "$ZIRC_UNSETSTRING"
 
@@ -919,6 +918,140 @@
         ! [[ -z "$ZIRC_FD" ]]
 }
 
+# Sets channel modes
+function zirc_mode {
+	local modes="${(j: :)@}"
+
+	if [[ -z "$modes" ]]; then
+		echo "Usage: $0 <modes>"
+		echo "Set channel modes to <modes>."
+		echo "Sends to the current focus (Current: '$ZIRC_CURRENT')."
+		return 1
+	fi
+	zirc_connected || { echo "Not connected" ; return 1 }
+	_zirc_write "MODE ${ZIRC_CURRENT} ${modes}"
+}
+
+# Set a single mode for a list of users
+function _zirc_batch_mode {
+	local mode="$1"
+	shift
+	local users="${(j: :)@}"
+
+	for user in $users; do
+		zirc_mode "$mode" "$user"
+	done
+}
+
+# Give operator status to user(s)
+function zirc_op {
+	if [[ -z "$@" ]]; then
+		echo "Usage: $0 <users>"
+		echo "Give operator status to <users>."
+		echo "Works on the current focus (Current: '$ZIRC_CURRENT')."
+		return 1
+	fi
+
+	zirc_connected || { echo "Not connected" ; return 1}
+
+	_zirc_batch_mode "+o" $@
+}
+
+# Revoke operator status from user(s)
+function zirc_deop {
+	if [[ -z "$@" ]]; then
+		echo "Usage: $0 <users>"
+		echo "Revoke operator status from <users>."
+		echo "Works on the current focus (Current: '$ZIRC_CURRENT')."
+		return 1
+	fi
+
+	zirc_connected || { echo "Not connected" ; return 1}
+
+	_zirc_batch_mode "-o" $@
+}
+
+# Give a voice flag to user(s)
+function zirc_voice {
+	if [[ -z "$@" ]]; then
+		echo "Usage: $0 <users>"
+		echo "Give a voice flag to <users>."
+		echo "Works on the current focus (Current: '$ZIRC_CURRENT')."
+		return 1
+	fi
+
+	zirc_connected || { echo "Not connected" ; return 1}
+
+	_zirc_batch_mode "+v" $@
+}
+
+# Revoke the voice flag from user(s)
+function zirc_devoice {
+	if [[ -z "$@" ]]; then
+		echo "Usage: $0 <users>"
+		echo "Revoke the voice flag from <users>."
+		echo "Works on the current focus (Current: '$ZIRC_CURRENT')."
+		return 1
+	fi
+
+	zirc_connected || { echo "Not connected" ; return 1}
+
+	_zirc_batch_mode "-v" $@
+}
+
+# Query the names on a channel
+function zirc_names {
+	zirc_connected || { echo "Not connected" ; return 1}
+
+	_zirc_write "NAMES $ZIRC_CURRENT"
+}
+
+# Issue a WHOIS request
+function zirc_whois {
+	if [[ -z "$1" ]]; then
+		echo "Usage: $0 <user>"
+		echo "Get detailed information about <user>."
+		return 1
+	fi
+
+	zirc_connected || { echo "Not connected" ; return 1}
+
+	_zirc_write "WHOIS $1"
+}
+
+# Issue a WHO request
+function zirc_who {
+	local chan="${1:-${ZIRC_CURRENT}}"
+
+	zirc_connected || { echo "Not connected" ; return 1}
+
+	_zirc_write "WHO $chan"
+}
+
+# Kick user from the current channel
+function zirc_kick {
+	if [[ -z "$@" ]]; then
+		echo "Usage: $0 <user> [<reason>]"
+		echo "Kick <users> from the current channel, due to <reason>."
+		echo "Works on the current focus (Current: '$ZIRC_CURRENT')."
+		return 1
+	fi
+
+	zirc_connected || { echo "Not connected" ; return 1}
+
+	local user=$1
+	shift
+
+	_zirc_write "KICK $ZIRC_CURRENT $user ${@:+:$@}"
+}
+
+# Sets/unsets the automatic away message
+function zirc_away {
+	zirc_connected || { echo "Not connected" ; return 1}
+
+	_zirc_write "AWAY ${@:+:$@}"
+}
+
 # Connect to a server
 function zirc_connect {
         if ! [[ -z "$ZIRC_FD" ]]; then
@@ -980,5 +1113,15 @@
         alias query='zirc_query'
         alias connect='zirc_connect'
         alias help='zirc_help'
+	alias mode='zirc_mode'
+	alias op='zirc_op'
+	alias deop='zirc_deop'
+	alias voice='zirc_voice'
+	alias devoice='zirc_devoice'
+	alias names='zirc_names'
+	alias whois='zirc_whois'
+	alias who='zirc_who'
+	alias kick='zirc_kick'
+	alias away='zirc_away'
 }
 # }}}3


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-07-05  9:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-30 12:10 ZIRC - The 100% Zsh IRC client - a few updates Gergely Nagy
2006-06-30 23:21 ` Andrew Ruder
2006-07-05  9:25   ` Gergely Nagy

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).