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


Получить помощь и пообщаться с другими пользователями Ubuntu можно
на irc канале #ubuntu-ru в сети Freenode
и в Jabber конференции ubuntu@conference.jabber.ru

Автор Тема: Обращение к индикатору сообщений  (Прочитано 968 раз)

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

Оффлайн Сперанский

  • Автор темы
  • Почётный модератор
  • Старожил
  • *
  • Сообщений: 4055
  • Dictum ac factum
    • Просмотр профиля
Привет всем!
Пришла в голову идея: у меня наличие новых электрических писем проверяет cron+fetchmail каждые 10 минут, вот подумалось, можно ли в случае наличия новых сообщений по dbus, видимо, повесить в индикатор сообщений непрочитанные сообщения, как это делает Pidgin?
Пока писал- проверил и удивился, thunderbird оказывается так не делает, но точно помню что видел такое! Может пакет какой нибудь доустановить нужно?

Оффлайн Vitsliputsli

  • Старожил
  • *
  • Сообщений: 1293
    • Просмотр профиля
Re: Обращение к индикатору сообщений
« Ответ #1 : 29 Июня 2012, 13:26:02 »
Стандартный в 10.04 Evolution так делает - появляется всплывающее сообщение и индикатор непрочитанного сообщения в уведомлениях.

Оффлайн Сперанский

  • Автор темы
  • Почётный модератор
  • Старожил
  • *
  • Сообщений: 4055
  • Dictum ac factum
    • Просмотр профиля
Re: Обращение к индикатору сообщений
« Ответ #2 : 29 Июня 2012, 13:28:51 »
Вот как руками так сделать?

Оффлайн Чистый

  • Почётный модератор
  • Старожил
  • *
  • Сообщений: 3473
  • nix - вот оно счастье...
    • Просмотр профиля
Re: Обращение к индикатору сообщений
« Ответ #3 : 29 Июня 2012, 13:37:12 »
где-то на оф сайте было API ubuntu описано по этому вопросу, там все было расписано что и как...
Тестовый репозиторий kdeNeur ppa:devcode/kdeneur
各々が死ぬことをどのように決定する

TheFalkorr

  • Гость
Re: Обращение к индикатору сообщений
« Ответ #4 : 29 Июня 2012, 13:39:32 »
поставь CloudSN и не парь моцк:)

Оффлайн Сперанский

  • Автор темы
  • Почётный модератор
  • Старожил
  • *
  • Сообщений: 4055
  • Dictum ac factum
    • Просмотр профиля
Re: Обращение к индикатору сообщений
« Ответ #5 : 29 Июня 2012, 13:55:32 »
где-то на оф сайте было API ubuntu описано по этому вопросу, там все было расписано что и как...
Да, вот оно. Как это через bash можно применить?
Цитировать
Adding a message count

While running, a registered application can also provide either a single count of new messages, or a set of separate message sources (for example, mail folders or syndicated feeds) with their own counts or times. For example, a Laconica client may provide only the single count, because it presents its updates in a single list and not as separately navigable items. A Usenet newsreader, on the other hand, may provide an item for each newsgroup that has new messages.

When an application provides separate message sources, each source item should have up to six components.

name: The name of the source. For example, a person’s name, a feed title, or a discussion group name. If a single application has multiple sources with the same name, it should disambiguate them if practical.

icon: A vector or bitmap image representing the message source. Ideally, it should be exactly the same icon as the program uses for the same source in the rest of its interface. We request that the icon be provided only where it represents the person who sent the message, for example, the avatar of a person sending an instant message, with other types of client omitting the icon. Applications should specifically not provide “generic” icons, like “mail” or “IM” or “FedEX”.

count: The number of new messages concerning you from this source. (Currently count is mutually exclusive with time, though this may change in future.)

time: A timestamp for the most recent instant message from that source, in ISO 8601 format. The messaging menu takes care of presenting this time in an easy-to-read and locale-sensitive format. A string not in ISO 8601 format (e.g. “connected”) will be accepted, but not rendered as a time. (Currently time is mutually exclusive with count, though this may change in future.)

draw-attention: A request that the messaging menu communicate to the user that something important has arrived in the menu. Currently this is displayed as a green dot in the menu title.

signal: A signal that the messaging menu should return to the application when the menu item is selected. When it receives this signal, the application should immediately display the message source represented by the item, and ideally also the first relevant message in that source.

# Create a source item
mm_source = indicate.Indicator()
 
# Again, it's not clear which subtypes you are allowed to use here.
mm_source.set_property("subtype", "im")
 
# "Sender" is the text that appears in the source item in the MM
mm_source.set_property("sender", "Unread")
 
# If someone clicks this source item in the MM, fire the user-display signal
mm_source.connect("user-display", show_window_function)
 
# Light up the messaging menu so that people know something has changed
mm_source.set_property("draw-attention", "true")
 
# Set the count of messages in this source.
mm_source.set_property("count", "15")
 
# If you prefer, you can set the time of the last message from this source,
# rather than the count. (You can't set both.) This means that instead of a
# message count, the MM will show "2m" or similar for the time since this
# message arrived.
# mm_source.set_property_time("time", time.time())
mm_source.show()
« Последнее редактирование: 29 Июня 2012, 13:56:35 от Чистый »

Оффлайн Сперанский

  • Автор темы
  • Почётный модератор
  • Старожил
  • *
  • Сообщений: 4055
  • Dictum ac factum
    • Просмотр профиля
Re: Обращение к индикатору сообщений
« Ответ #6 : 29 Июня 2012, 13:56:09 »
поставь CloudSN и не парь моцк:)
Там с кодировками косяк какой то во всплывающем уведомлении, а так, да- примерно то, что хочу

Оффлайн Чистый

  • Почётный модератор
  • Старожил
  • *
  • Сообщений: 3473
  • nix - вот оно счастье...
    • Просмотр профиля
Re: Обращение к индикатору сообщений
« Ответ #7 : 29 Июня 2012, 13:57:15 »
через bash никак, только С/С++, python и /etc
Тестовый репозиторий kdeNeur ppa:devcode/kdeneur
各々が死ぬことをどのように決定する

Оффлайн Сперанский

  • Автор темы
  • Почётный модератор
  • Старожил
  • *
  • Сообщений: 4055
  • Dictum ac factum
    • Просмотр профиля
Re: Обращение к индикатору сообщений
« Ответ #8 : 29 Июня 2012, 14:01:05 »
Это должен быть демон на подобие демона notify-osd, уже к которому можно обращаться из bash?

Оффлайн Чистый

  • Почётный модератор
  • Старожил
  • *
  • Сообщений: 3473
  • nix - вот оно счастье...
    • Просмотр профиля
Re: Обращение к индикатору сообщений
« Ответ #9 : 29 Июня 2012, 14:59:41 »
Это должен быть демон на подобие демона notify-osd, уже к которому можно обращаться из bash?
да вполне возможно, что можно сделать и так
Тестовый репозиторий kdeNeur ppa:devcode/kdeneur
各々が死ぬことをどのように決定する

Оффлайн X.3.

  • Активист
  • *
  • Сообщений: 280
  • Archlinux x86_64
    • Просмотр профиля
Re: Обращение к индикатору сообщений
« Ответ #10 : 29 Июня 2012, 15:19:52 »
thunderbird оказывается так не делает
Делает! Пользую все-же Thunderbird + MinimizeToTray. Конечно жрет память (но мне не жалко), но при нажатии на сообщения переходишь сразу к письму. Удобно при наличии нескольких ящиков.

Оффлайн Сперанский

  • Автор темы
  • Почётный модератор
  • Старожил
  • *
  • Сообщений: 4055
  • Dictum ac factum
    • Просмотр профиля
Re: Обращение к индикатору сообщений
« Ответ #11 : 29 Июня 2012, 15:55:43 »
thunderbird оказывается так не делает
Делает!
Покажите
dpkg --get-selections thunderbird*

Оффлайн X.3.

  • Активист
  • *
  • Сообщений: 280
  • Archlinux x86_64
    • Просмотр профиля
Re: Обращение к индикатору сообщений
« Ответ #12 : 29 Июня 2012, 15:57:31 »
eugene@X-3:~$ dpkg --get-selections thunderbird*
thunderbird install
thunderbird-couchdb install
thunderbird-globalmenu install
thunderbird-gnome-support install
thunderbird-locale-en install
thunderbird-locale-en-gb install
thunderbird-locale-en-us install
thunderbird-locale-ru install

также добавлю что это из офф.репы (это важно)
« Последнее редактирование: 29 Июня 2012, 16:00:37 от X.3. »

 

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