Що означають категорія, підказки та параметри версії сповіщень?


18

В notify-sendінструкції з команди написано

Usage:
  notify-send [OPTION...] <SUMMARY> [BODY] - create a notification

Help Options:
  -?, --help                        Show help options

Application Options:
  -u, --urgency=LEVEL               Specifies the urgency level (low, normal, critical).
  -t, --expire-time=TIME            Specifies the timeout in milliseconds at which to expire the notification.
  -i, --icon=ICON[,ICON...]         Specifies an icon filename or stock icon to display.
  -c, --category=TYPE[,TYPE...]     Specifies the notification category.
  -h, --hint=TYPE:NAME:VALUE        Specifies basic extra data to pass. Valid types are int, double, string and byte.
  -v, --version                     Version of the package.

Значення останніх 3 -х параметрів: category, hintі versionмені не ясно.


1
Без сумніву, "параметр" version- це найлегше пояснити. :)
jimmij

@jimmij Чи б ви були так люб'язно зробити це тоді? :-) Який пакет?
Іван

2
пакет libnotify. Просто біжи notify-send -v. -vабо --versionдуже стандартний варіант у світі Linux, щоб попросити програму надрукувати свій внутрішній номер версії. Спробуйте, наприклад ls --version.
jimmij

Спасибі @jimmij, я подумав, що це ще один параметр, який я повинен вказати, коли я викликаю команду (як версія сценарію, який її викликає, або щось подібне).
Іван

Відповіді:


7

Програма manpage(в Debian GNU / Linux) пропонує переглянути http://www.galago-project.org/specs/notification/ .

З версії 0.9.

Категорія

+------------------------------------------------------------------------+
   |          Type          |                  Description                  |
   |------------------------+-----------------------------------------------|
   | "device"               |   A generic device-related notification that  |
   |                        | doesn't fit into any other category.          |
   |------------------------+-----------------------------------------------|
   | "device.added"         | A device, such as a USB device, was added to  |
   |                        | the system.                                   |
   |------------------------+-----------------------------------------------|
   | "device.error"         | A device had some kind of error.              |
   |------------------------+-----------------------------------------------|
   | "device.removed"       |   A device, such as a USB device, was removed |
   |                        | from the system.                              |
   |------------------------+-----------------------------------------------|
   | "email"                |   A generic e-mail-related notification that  |
   |                        | doesn't fit into any other category.          |
   |------------------------+-----------------------------------------------|
   | "email.arrived"        | A new e-mail notification.                    |
   |------------------------+-----------------------------------------------|
   | "email.bounced"        | A notification stating that an e-mail has     |
   |                        | bounced.                                      |
   |------------------------+-----------------------------------------------|
   |                        |   A generic instant message-related           |
   | "im"                   | notification that doesn't fit into any other  |
   |                        | category.                                     |
   |------------------------+-----------------------------------------------|
   | "im.error"             | An instant message error notification.        |
   |------------------------+-----------------------------------------------|
   | "im.received"          | A received instant message notification.      |
   |------------------------+-----------------------------------------------|
   | "network"              |   A generic network notification that doesn't |
   |                        | fit into any other category.                  |
   |------------------------+-----------------------------------------------|
   |                        |   A network connection notification, such as  |
   | "network.connected"    | successful sign-on to a network service. This |
   |                        | should not be confused with device.added for  |
   |                        | new network devices.                          |
   |------------------------+-----------------------------------------------|
   |                        |   A network disconnected notification. This   |
   | "network.disconnected" | should not be confused with device.removed    |
   |                        | for disconnected network devices.             |
   |------------------------+-----------------------------------------------|
   | "network.error"        |   A network-related or connection-related     |
   |                        | error.                                        |
   |------------------------+-----------------------------------------------|
   |                        |   A generic presence change notification that |
   | "presence"             | doesn't fit into any other category, such as  |
   |                        | going away or idle.                           |
   |------------------------+-----------------------------------------------|
   | "presence.offline"     | An offline presence change notification.      |
   |------------------------+-----------------------------------------------|
   | "presence.online"      | An online presence change notification.       |
   |------------------------+-----------------------------------------------|
   |                        |   A generic file transfer or download         |
   | "transfer"             | notification that doesn't fit into any other  |
   |                        | category.                                     |
   |------------------------+-----------------------------------------------|
   | "transfer.complete"    | A file transfer or download complete          |
   |                        | notification.                                 |
   |------------------------+-----------------------------------------------|
   | "transfer.error"       | A file transfer or download error.            |
   +------------------------------------------------------------------------+

Стандартні підказки

       +------------------------------------------------------------------------+
   |       Name       | Value Type |              Description               |
   |------------------+------------+----------------------------------------|
   | "urgency"        | byte       |   The urgency level.                   |
   |------------------+------------+----------------------------------------|
   | "category"       | string     |   The type of notification this is.    |
   |------------------+------------+----------------------------------------|
   |                  |            |   This specifies the name of the       |
   |                  |            | desktop filename representing the      |
   |                  |            | calling program. This should be the    |
   |                  |            | same as the prefix used for the        |
   | "desktop-entry"> | string     | application's .desktop file. An        |
   |                  |            | example would be "rhythmbox" from      |
   |                  |            | "rhythmbox.desktop". This can be used  |
   |                  |            | by the daemon to retrieve the correct  |
   |                  |            | icon for the application, for logging  |
   |                  |            | purposes, etc.                         |
   |------------------+------------+----------------------------------------|
   |                  |            |   This is a raw data image format      |
   |                  |            | which describes the width, height,     |
   | "image_data"     | (iiibiiay) | rowstride, has alpha, bits per sample, |
   |                  |            | channels and image data respectively.  |
   |                  |            | We use this value if the icon field is |
   |                  |            | left blank.                            |
   |------------------+------------+----------------------------------------|
   | "sound-file"     | string     |   The path to a sound file to play     |
   |                  |            | when the notification pops up.         |
   |------------------+------------+----------------------------------------|
   |                  |            |   Causes the server to suppress        |
   |                  |            | playing any sounds, if it has that     |
   | "suppress-sound" | boolean    | ability. This is usually set when the  |
   |                  |            | client itself is going to play its own |
   |                  |            | sound.                                 |
   |------------------+------------+----------------------------------------|
   |                  |            |   Specifies the X location on the      |
   | "x"              | int        | screen that the notification should    |
   |                  |            | point to. The "y" hint must also be    |
   |                  |            | specified.                             |
   |------------------+------------+----------------------------------------|
   |                  |            |   Specifies the Y location on the      |
   | "y"              | int        | screen that the notification should    |
   |                  |            | point to. The "x" hint must also be    |
   |                  |            | specified.                             |
   +------------------------------------------------------------------------+

Помилка Debian GNU / Linux # 869277

Використовуючи наш веб-сайт, ви визнаєте, що прочитали та зрозуміли наші Політику щодо файлів cookie та Політику конфіденційності.
Licensed under cc by-sa 3.0 with attribution required.