From f9a39b44803e6347c72c1edd8ba46f633e99dd57 Mon Sep 17 00:00:00 2001 From: Robert Tari Date: Sun, 8 Nov 2020 13:50:13 +0100 Subject: Rewrite to indicator-ng, simplify, drop all GTK references, move to CMake fixes #9, fixes #12 --- data/CMakeLists.txt | 83 ++++++++ data/Makefile.am | 21 -- data/ayatana-indicator-notifications.desktop.in | 8 + data/ayatana-indicator-notifications.service.in | 11 + data/icons/Makefile.am | 11 - ...atana-indicator-notification-close-deselect.svg | 79 -------- ...ayatana-indicator-notification-close-select.svg | 61 ------ .../ayatana-indicator-notification-read-dnd.svg | 155 -------------- data/icons/ayatana-indicator-notification-read.svg | 133 ------------ .../ayatana-indicator-notification-unread-dnd.svg | 218 -------------------- .../ayatana-indicator-notification-unread.svg | 224 --------------------- .../ayatana-indicator-notification-read-dnd.svg | 155 ++++++++++++++ .../status/ayatana-indicator-notification-read.svg | 133 ++++++++++++ .../ayatana-indicator-notification-unread-dnd.svg | 218 ++++++++++++++++++++ .../ayatana-indicator-notification-unread.svg | 224 +++++++++++++++++++++ data/org.ayatana.indicator.notifications | 11 + ....ayatana.indicator.notifications.gschema.xml.in | 25 +++ 17 files changed, 868 insertions(+), 902 deletions(-) create mode 100644 data/CMakeLists.txt delete mode 100644 data/Makefile.am create mode 100644 data/ayatana-indicator-notifications.desktop.in create mode 100644 data/ayatana-indicator-notifications.service.in delete mode 100644 data/icons/Makefile.am delete mode 100644 data/icons/ayatana-indicator-notification-close-deselect.svg delete mode 100644 data/icons/ayatana-indicator-notification-close-select.svg delete mode 100644 data/icons/ayatana-indicator-notification-read-dnd.svg delete mode 100644 data/icons/ayatana-indicator-notification-read.svg delete mode 100644 data/icons/ayatana-indicator-notification-unread-dnd.svg delete mode 100644 data/icons/ayatana-indicator-notification-unread.svg create mode 100644 data/icons/scalable/status/ayatana-indicator-notification-read-dnd.svg create mode 100644 data/icons/scalable/status/ayatana-indicator-notification-read.svg create mode 100644 data/icons/scalable/status/ayatana-indicator-notification-unread-dnd.svg create mode 100644 data/icons/scalable/status/ayatana-indicator-notification-unread.svg create mode 100644 data/org.ayatana.indicator.notifications create mode 100644 data/org.ayatana.indicator.notifications.gschema.xml.in (limited to 'data') diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt new file mode 100644 index 0000000..b806dd1 --- /dev/null +++ b/data/CMakeLists.txt @@ -0,0 +1,83 @@ +## +## GSettings schema +## + +include (UseGSettings) +set (SCHEMA_NAME "org.ayatana.indicator.notifications.gschema.xml") +set (SCHEMA_FILE "${CMAKE_CURRENT_BINARY_DIR}/${SCHEMA_NAME}") +set (SCHEMA_FILE_IN "${CMAKE_CURRENT_SOURCE_DIR}/${SCHEMA_NAME}.in") + +# generate the .xml file using intltool +set (ENV{LC_ALL} "C") +execute_process (COMMAND intltool-merge -quiet --xml-style --utf8 --no-translations "${SCHEMA_FILE_IN}" "${SCHEMA_FILE}") + +# let UseGSettings do the rest +add_schema (${SCHEMA_FILE}) + +## +## Systemd Unit File +## + +pkg_check_modules(SYSTEMD systemd) +if (${SYSTEMD_FOUND}) + pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir) + message (STATUS "${SYSTEMD_USER_DIR} is the systemd user unit file install dir") + + set (SYSTEMD_USER_NAME "${CMAKE_PROJECT_NAME}.service") + set (SYSTEMD_USER_FILE "${CMAKE_CURRENT_BINARY_DIR}/${SYSTEMD_USER_NAME}") + set (SYSTEMD_USER_FILE_IN "${CMAKE_CURRENT_SOURCE_DIR}/${SYSTEMD_USER_NAME}.in") + + # build it + set (pkglibexecdir "${CMAKE_INSTALL_FULL_PKGLIBEXECDIR}") + configure_file ("${SYSTEMD_USER_FILE_IN}" "${SYSTEMD_USER_FILE}") + + # install it + install (FILES "${SYSTEMD_USER_FILE}" + DESTINATION "${SYSTEMD_USER_DIR}") +endif() + +## +## XDG Autostart File +## + +# where to install +set (XDG_AUTOSTART_DIR "/etc/xdg/autostart") +message (STATUS "${XDG_AUTOSTART_DIR} is the DBus Service File install dir") + +set (XDG_AUTOSTART_NAME "${CMAKE_PROJECT_NAME}.desktop") +set (XDG_AUTOSTART_FILE "${CMAKE_CURRENT_BINARY_DIR}/${XDG_AUTOSTART_NAME}") +set (XDG_AUTOSTART_FILE_IN "${CMAKE_CURRENT_SOURCE_DIR}/${XDG_AUTOSTART_NAME}.in") + +# build it +set (pkglibexecdir "${CMAKE_INSTALL_FULL_PKGLIBEXECDIR}") +configure_file ("${XDG_AUTOSTART_FILE_IN}" "${XDG_AUTOSTART_FILE}") + +# install it +install (FILES "${XDG_AUTOSTART_FILE}" + DESTINATION "${XDG_AUTOSTART_DIR}") + +## Ayatana Indicators File +## + +# where to install +set (AYATANA_INDICATOR_DIR "${CMAKE_INSTALL_FULL_DATAROOTDIR}/ayatana/indicators") +message (STATUS "${AYATANA_INDICATOR_DIR} is the Ayatana Indicators install dir") + +set (AYATANA_INDICATOR_NAME "org.ayatana.indicator.notifications") +set (AYATANA_INDICATOR_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${AYATANA_INDICATOR_NAME}") + +install (FILES "${AYATANA_INDICATOR_FILE}" + DESTINATION "${AYATANA_INDICATOR_DIR}") + +## +## Icons +## + +# where to install +set (ICON_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/icons/hicolor") +message (STATUS "${ICON_DIR} is the Icon install dir") + +install (DIRECTORY icons/scalable DESTINATION "${ICON_DIR}" FILES_MATCHING PATTERN "*.svg") + +install(CODE "execute_process (COMMAND gtk-update-icon-cache -t -f ${ICON_DIR})" + CODE "message (STATUS \"Updating icon cache\")") diff --git a/data/Makefile.am b/data/Makefile.am deleted file mode 100644 index 1960ad7..0000000 --- a/data/Makefile.am +++ /dev/null @@ -1,21 +0,0 @@ -SUBDIRS = icons - -gsettings_file = org.ayatana.indicator.notifications.gschema.xml -gsettings_SCHEMAS = $(gsettings_file) - -@INTLTOOL_XML_NOMERGE_RULE@ - -$(gsettings_file).in: $(gsettings_file).in.in - sed \ - -e "s|\@GETTEXT_PACKAGE\@|$(GETTEXT_PACKAGE)|" \ - $< > $@ - -@GSETTINGS_RULES@ - -EXTRA_DIST = \ - $(gsettings_file).in.in - -CLEANFILES = \ - $(gsettings_file) \ - $(gsettings_file).in \ - *.gschema.valid diff --git a/data/ayatana-indicator-notifications.desktop.in b/data/ayatana-indicator-notifications.desktop.in new file mode 100644 index 0000000..7dac4fd --- /dev/null +++ b/data/ayatana-indicator-notifications.desktop.in @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Application +Name=Ayatana Indicator Notifications +Exec=@pkglibexecdir@/ayatana-indicator-notifications-service +OnlyShowIn=Unity;MATE;XFCE; +NoDisplay=true +StartupNotify=false +Terminal=false diff --git a/data/ayatana-indicator-notifications.service.in b/data/ayatana-indicator-notifications.service.in new file mode 100644 index 0000000..223cea9 --- /dev/null +++ b/data/ayatana-indicator-notifications.service.in @@ -0,0 +1,11 @@ +[Unit] +Description=Ayatana Indicator Notifications +PartOf=graphical-session.target +PartOf=ayatana-indicators.target + +[Service] +ExecStart=@pkglibexecdir@/ayatana-indicator-notifications-service +Restart=on-failure + +[Install] +WantedBy=ayatana-indicators.target diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am deleted file mode 100644 index 47d1ac1..0000000 --- a/data/icons/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -iconsdir = $(INDICATORICONSDIR) - -icons_DATA = \ - ayatana-indicator-notification-close-select.svg \ - ayatana-indicator-notification-close-deselect.svg \ - ayatana-indicator-notification-read.svg \ - ayatana-indicator-notification-read-dnd.svg \ - ayatana-indicator-notification-unread.svg \ - ayatana-indicator-notification-unread-dnd.svg - -EXTRA_DIST = $(icons_DATA) diff --git a/data/icons/ayatana-indicator-notification-close-deselect.svg b/data/icons/ayatana-indicator-notification-close-deselect.svg deleted file mode 100644 index 3e92220..0000000 --- a/data/icons/ayatana-indicator-notification-close-deselect.svg +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/data/icons/ayatana-indicator-notification-close-select.svg b/data/icons/ayatana-indicator-notification-close-select.svg deleted file mode 100644 index 21f5026..0000000 --- a/data/icons/ayatana-indicator-notification-close-select.svg +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - diff --git a/data/icons/ayatana-indicator-notification-read-dnd.svg b/data/icons/ayatana-indicator-notification-read-dnd.svg deleted file mode 100644 index d262e90..0000000 --- a/data/icons/ayatana-indicator-notification-read-dnd.svg +++ /dev/null @@ -1,155 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - diff --git a/data/icons/ayatana-indicator-notification-read.svg b/data/icons/ayatana-indicator-notification-read.svg deleted file mode 100644 index 97e1f1e..0000000 --- a/data/icons/ayatana-indicator-notification-read.svg +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - diff --git a/data/icons/ayatana-indicator-notification-unread-dnd.svg b/data/icons/ayatana-indicator-notification-unread-dnd.svg deleted file mode 100644 index 23b859e..0000000 --- a/data/icons/ayatana-indicator-notification-unread-dnd.svg +++ /dev/null @@ -1,218 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - diff --git a/data/icons/ayatana-indicator-notification-unread.svg b/data/icons/ayatana-indicator-notification-unread.svg deleted file mode 100644 index beb2292..0000000 --- a/data/icons/ayatana-indicator-notification-unread.svg +++ /dev/null @@ -1,224 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - diff --git a/data/icons/scalable/status/ayatana-indicator-notification-read-dnd.svg b/data/icons/scalable/status/ayatana-indicator-notification-read-dnd.svg new file mode 100644 index 0000000..d262e90 --- /dev/null +++ b/data/icons/scalable/status/ayatana-indicator-notification-read-dnd.svg @@ -0,0 +1,155 @@ + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/data/icons/scalable/status/ayatana-indicator-notification-read.svg b/data/icons/scalable/status/ayatana-indicator-notification-read.svg new file mode 100644 index 0000000..97e1f1e --- /dev/null +++ b/data/icons/scalable/status/ayatana-indicator-notification-read.svg @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/data/icons/scalable/status/ayatana-indicator-notification-unread-dnd.svg b/data/icons/scalable/status/ayatana-indicator-notification-unread-dnd.svg new file mode 100644 index 0000000..23b859e --- /dev/null +++ b/data/icons/scalable/status/ayatana-indicator-notification-unread-dnd.svg @@ -0,0 +1,218 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/data/icons/scalable/status/ayatana-indicator-notification-unread.svg b/data/icons/scalable/status/ayatana-indicator-notification-unread.svg new file mode 100644 index 0000000..beb2292 --- /dev/null +++ b/data/icons/scalable/status/ayatana-indicator-notification-unread.svg @@ -0,0 +1,224 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/data/org.ayatana.indicator.notifications b/data/org.ayatana.indicator.notifications new file mode 100644 index 0000000..ec72e17 --- /dev/null +++ b/data/org.ayatana.indicator.notifications @@ -0,0 +1,11 @@ +[Indicator Service] +Name=ayatana-indicator-notifications +ObjectPath=/org/ayatana/indicator/notifications +Position=100 + +[phone] +ObjectPath=/org/ayatana/indicator/notifications/phone +Position=25 + +[desktop] +ObjectPath=/org/ayatana/indicator/notifications/desktop diff --git a/data/org.ayatana.indicator.notifications.gschema.xml.in b/data/org.ayatana.indicator.notifications.gschema.xml.in new file mode 100644 index 0000000..b85f14b --- /dev/null +++ b/data/org.ayatana.indicator.notifications.gschema.xml.in @@ -0,0 +1,25 @@ + + + + [] + <_summary>Discard notifications by application name + <_description>If an application name is in the filter list, all notifications matching the application name will be discarded. + + + [] + Recent application names to suggest for the filter list + Keeps track of recent application names so we can suggest them in the settings. + + + false + Enable do-not-disturb mode + On supported desktops enables do-not-disturb mode on the notification daemon. + + + + 5 + <_summary>Maximum number of visible items + <_description>The indicator will only display at most the number of notifications indicated by this value. + + + -- cgit v1.2.3