]> oss.titaniummirror.com Git - smckown/dotfiles.git/commitdiff
mcabber: changes to config
authorR. Steve McKown <rsmckown@gmail.com>
Sat, 26 Mar 2016 00:07:12 +0000 (18:07 -0600)
committerR. Steve McKown <rsmckown@gmail.com>
Sat, 26 Mar 2016 00:36:05 +0000 (18:36 -0600)
* Set up eventcmd, and have it play a sound on new message and buddy
  status changes.

* Activate fifo, in expectation of the screen saver mechanism changing
  status.  This replaces the autoaway setting, which does not understand
  the system but only activity in the mcabber application.

install.sh
mcabber.eventcmd [new file with mode: 0755]
mcabberrc

index 0c2f837e14960e38918909aecf0b345ae585906b..c2c947f74dc9de3e74306a780989cc8d79d60684 100755 (executable)
@@ -47,4 +47,5 @@ dolink ../.dotfiles/gpg.conf  .gnupg/gpg.conf
 dolink ../.dotfiles/gpg-agent.conf  .gnupg/gpg-agent.conf
 dolink ../.dotfiles/ssh_config  .ssh/config
 dolink ../.dotfiles/mcabberrc  .mcabber/mcabberrc
+dolink ../.dotfiles/mcabber.eventcmd  .mcabber/eventcmd
 dolink ../../.dotfiles/profrc .config/profanity/profrc
diff --git a/mcabber.eventcmd b/mcabber.eventcmd
new file mode 100755 (executable)
index 0000000..12aa549
--- /dev/null
@@ -0,0 +1,64 @@
+#! /bin/sh
+#
+# Sample events script for mcabber
+# Plays a sound when receiving a message
+#
+# To use this script, set the "events_command" option to the path of
+# the script (see the mcabberrc.example file for an example)
+#
+# MiKael, 2005-07-15
+
+# Script execution comments from 'man mcabber':
+#   $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)
+#
+# Sounds from the freedesktop project (available by default in Xubuntu)
+CMD_MSG_IN="/usr/bin/play /usr/share/sounds/freedesktop/stereo/message-new-instant.oga"
+CMD_STATUS_ONLINE="/usr/bin/play /usr/share/sounds/freedesktop/stereo/service-login.oga"
+CMD_STATUS_OFFLINE="/usr/bin/play /usr/share/sounds/freedesktop/stereo/service-logout.oga"
+
+event=$1
+arg1=$2
+arg2=$3
+filename=$4
+# Note that the 4th argument is only provided for incoming messages
+# and when 'event_log_files' is set.
+
+if [ "$event" = "MSG" ]; then
+  case "$arg1" in
+    IN)
+      # Incoming message from buddy $arg2
+      $CMD_MSG_IN > /dev/null 2>&1
+      if [ -n "$filename" -a -f "$filename" ]; then
+        # We could process filename here...
+        /bin/rm $filename
+      fi
+      ;;
+    MUC)
+      # Groupchat message in room $arg2
+      if [ -n "$filename" -a -f "$filename" ]; then
+        # We could process filename here...
+        /bin/rm $filename
+      fi
+      ;;
+    OUT)
+      # Outgoing message for buddy $arg2
+      ;;
+    STATUS)
+      # Status change for buddy $arg2, new status is $arg1
+      echo "New status $arg1 for buddy $arg2" >> /tmp/xaa
+      ;;
+  esac
+elif [ "$event" = "STATUS" ]; then
+  # Buddy $arg2 status is $arg1 (_, O, I, F, D, N, A)
+  echo > /dev/null
+elif [ "$event" = "UNREAD" ]; then
+  # $arg1 contains 4 numbers separated with space chars:
+  # Nr of unread buffers, nr of unread buffers with attention sign,
+  # nr of MUC unread buffers, nr of MUC unread buffers with attention sign.
+  echo > /dev/null
+fi
index 9f442ea38af22a413822ce46f28d96a579758bcf..0779db681035b6e54c771b250c72278738cf5a07 100644 (file)
--- a/mcabberrc
+++ b/mcabberrc
@@ -259,7 +259,7 @@ set beep_on_message = 1
 #   $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 = ~/.mcabber/eventcmd
+set events_command = ~/.mcabber/eventcmd
 #
 #set events_ignore_active_window = 0
 #
@@ -297,11 +297,11 @@ set beep_on_message = 1
 # When FIFO  is configured, you can turn it off and on in real time with
 # the 'fifo_ignore' option (default: 0).  When set to 1, the FIFO input is
 # still read but it is discarded.
-#set fifo_name = ~/.mcabber/mcabber.fifo
+set fifo_name = ~/.mcabber/mcabber.fifo
 #set fifo_hide_commands = 0
 #set fifo_ignore = 0
 #
-#module load fifo
+module load fifo
 
 # URL extractor
 # Set 'url_regex' to a regular expression matching urls.  If it matches an
@@ -332,7 +332,7 @@ module load xttitle
 # (command, message, move in the buddylist...).  Note: auto-away only changes
 # the status when it is "available" (online) or "free_for_chat".
 # See 'message_autoaway' below.
-set autoaway = 300
+#set autoaway = 0
 
 # Message blocking
 # Set 'block_unsubscribed' to 1 if you want to block (drop) incoming