mcabber cli jabber client, with notifications

User avatar
wuxmedia
Grasshopper
Posts: 6445
Joined: Wed Oct 17, 2012 11:32 am
Location: Back in Blighty
Contact:

mcabber cli jabber client, with notifications

Unread post by wuxmedia » Fri Jan 24, 2014 4:02 pm

Hi,
We use jabber at work to chat with colleagues around the country.
So in my slow quest to get a CLI based work station, I found mcabber.

works nice, not as pretty as pidgin, main drawback being no default notifications.
This is pretty important for me as people get upset if they don't get a response to 'Mission critical server XYZ has crashed reboot please!!' in 100ms or less.

So this is the useful bit from the .mcabberrc
BTW the sid install doesn't make one for you - you'll need to pull the gzipped example from the /usr/share/doc/mcabber/examples/ directory.

Code: Select all

# External command for events
# You can specify a script or process to be launched when an event occurs.
# Set 'events_ignore_active_window' to 1 if you don't want the script to
# be run for a message to the current active window (default: 0).
#
# If 'event_log_files' is set, a file is created and contains the body of
# the message (incoming messages only); the file name is the last parameter.
# If you enable this, you can specify the directory mcabber will use to
# create these messages with the 'event_log_dir' variable (default is the
# system temp dir, or MCABBERTMPDIR environment variable).  Please note
# that mcabber won't delete these files, it's your script's job.
#
# The command is called the following way:
#   $events_command MSG IN jabber@id [file] (when receiving a message)
#   $events_command MSG OUT jabber@id       (when sending a message)
#   $events_command MSG MUC room_id [file]  (when receiving a MUC message)
#   $events_command STATUS X jabber@id      (new buddy status is X)
#   $events_command UNREAD "N x y z"        (number of unread buddy buffers)
#   (x=attention y=muc unread buffers z=muc unread buffers with attention sign)
# See sample script in contrib/ directory.
set events_command = ~/event.sh
#
#set events_ignore_active_window = 0
#
#set event_log_files = 1
#set event_log_dir = ~/event_files
This references the event.sh script below:

Code: Select all

#!/bin/bash
echo "$1 $2 $3 $4" >> ~/test.mcabber.log
EVENT_TYPE=$1
EVENT_SUBTYPE=$2
JID=$3
FILE=$4
TITLE="Mcabber Message"
#TIMEOUT=10000
 
 function new_message_in() {
     notify-send "$TITLE" "New message from ${JID}."
         }
          
          if [ $EVENT_TYPE == "MSG" ] && [ $EVENT_SUBTYPE == "IN" ]
          then
              new_message_in
              fi
if [ $EVENT_TYPE == "MSG" ] && [ $EVENT_SUBTYPE == "IN" ]
then
    new_message_in
    fi
I'm using dunst, I guess one could pipe it to a bar, or wherever...
I'm not 100% sure how this script pulls the mssg data of the file, or even where it comes from. XD
But it works.

I pulled the script from here where it is explained better and has more functions that I didn't need.
https://gist.github.com/JamesTheBard/5746867

This outputs simply who sent a mssg, and dunst gives a time counter by default I think - which is fine for me...
I'd really like it to pull the message body out of events_files, but I haven't had much luck.

I guess another way for me to see the whole thing is to open a small tile with mcabber in it. but I tend to copypasta commands and server names via jabber, so i'd need a term window or nine open.
"Seek, and Ye shall find"
"Github | Chooons | Site"

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5877
Joined: Tue Sep 03, 2013 7:05 am

Re: mcabber cli jabber client, with notifications

Unread post by GekkoP » Fri Jan 24, 2014 4:15 pm

Didn't know about this. I'm used to finch now, but this looks lighter.

User avatar
wuxmedia
Grasshopper
Posts: 6445
Joined: Wed Oct 17, 2012 11:32 am
Location: Back in Blighty
Contact:

Re: mcabber cli jabber client, with notifications

Unread post by wuxmedia » Fri Jan 24, 2014 9:25 pm

so finch is a cli version of pidgin, hmm interesting.
looks quite busy.
mcabber just makes me feel like i'm using IRC. 8)
"Seek, and Ye shall find"
"Github | Chooons | Site"

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: mcabber cli jabber client, with notifications

Unread post by machinebacon » Fri Jan 24, 2014 10:58 pm

finch needs the dependencies of pidgin, so it makes really sense if pidgin is already installed and one wants to have a CLI version of it. I'm using centerim for anything related to jabber/msn/... but mcabber comes close, so thanks for the write-up :)
..gnutella..

User avatar
dkeg
Configurator
Posts: 3782
Joined: Sun Nov 18, 2012 9:23 pm
Location: Mid-Atlantic Grill

Re: mcabber cli jabber client, with notifications

Unread post by dkeg » Sat Jan 25, 2014 2:14 am

like mb, use centerim, not mcabber. Thanks for the write up. I have no friends anyway, so really, I don't use it, should have said I have it.

Work hard; Complain less

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5877
Joined: Tue Sep 03, 2013 7:05 am

Re: mcabber cli jabber client, with notifications

Unread post by GekkoP » Sat Jan 25, 2014 9:42 am

Well, centerim is already on Elektra and I wasn't aware of it. Enough with finch, then. :)

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: mcabber cli jabber client, with notifications

Unread post by machinebacon » Sat Jan 25, 2014 10:13 am

Gekko, open a term, enter 'bbq' and browse through all apps :)
..gnutella..

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5877
Joined: Tue Sep 03, 2013 7:05 am

Re: mcabber cli jabber client, with notifications

Unread post by GekkoP » Sat Jan 25, 2014 10:30 am

^ thanks, doing it right now.

Post Reply