Форум русскоязычного сообщества Ubuntu


Следите за новостями русскоязычного сообщества Ubuntu в Twitter-ленте @ubuntu_ru_loco

Автор Тема: macbber, notify-send  (Прочитано 1590 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн Блуждающая девственница

  • Автор темы
  • Новичок
  • *
  • Сообщений: 9
    • Просмотр профиля
macbber, notify-send
« : 23 Августа 2009, 12:40:52 »
Хочу научить mcabber выводить в notify-send имя контакта и его сообщение при входящем сообщении. Все получается кроме самого сообщения.
tit@tubuntu:~$ cat ./.mcabber/mcabberrc.personal
set statefile = ~/.mcabber/mcabber.state
set beep_on_message = 0
set events_command = ~/.mcabber/eventcmd
set eventcmd_use_nickname = 1
set event_log_files = 1
set event_log_dir = ~/.mcabber/event_files

tit@tubuntu:~$ cat ./.mcabber/eventcmd
#! /bin/bash
if [ $2 = "IN" ];then
play ~/.mcabber/sndmsg.wav 2> /dev/null
notify-send -i dialog-information $3
fi

Вот как заставить сообщение в нотифайе выводить?

Оффлайн Vovans

  • Активист
  • *
  • Сообщений: 311
  • zenway.ru
    • Просмотр профиля
    • Про Linux по-русски
Re: macbber, notify-send
« Ответ #1 : 23 Августа 2009, 13:45:19 »
у мня eventcmd выглядит так:

#! /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

# The following sound comes with the gtkboard package,
# you can modify this line to play another one...
CMD_MSG_IN="/usr/bin/play ~/.mcabber/sounds/message2.wav"
STATUS_FILE="/tmp/mcabber.msg";

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...
notify-send -i dialog-information "new mess from: $ARG2"  "`cat $filename`"
        /bin/rm $filename
      fi
      ;;
    MUC)
      # Groupchat message in room $arg2
      if [ -n "$filename" && -f "$filename" ]; then
        # We could process filename here...
        /bin/rm $filename
      fi
      ;;
    OUT)
      # Outgoing message for buddy $arg2
      ;;
  esac
elif [ $event = "STATUS" ]; then
  # Buddy $arg2 status is $arg1 (_, O, I, F, D, N, A)
  echo > /dev/null
elif [ $event = "UNREAD" ]; then
  # $arg1 is the number of unread buffers
#  notify-send -i dialog-information "read!"  "test $arg1"
  echo $arg1 > $STATUS_FILE

RRRR="`cat $STATUS_FILE`"
  if [ $arg1 -ne $RRRR ]; then
  notify-send -i dialog-information "read!"  "test $arg1"
  echo $arg1 > $STATUS_FILE
  fi

#  if [ $arg1  == "0" ] ; then
#  fi
fi

--
о Linux по-русски: ссылка вырезана

--
ссылки - в профиль, в поле url
-- kwah
« Последнее редактирование: 24 Августа 2009, 15:11:53 от Kwah »

 

Страница сгенерирована за 0.034 секунд. Запросов: 24.