{"id":13439829,"url":"https://github.com/phuhl/linux_notification_center","last_synced_at":"2025-05-14T21:06:17.447Z","repository":{"id":38427649,"uuid":"88088328","full_name":"phuhl/linux_notification_center","owner":"phuhl","description":"A notification daemon/center for linux","archived":false,"fork":false,"pushed_at":"2025-02-06T11:12:49.000Z","size":235435,"stargazers_count":1033,"open_issues_count":42,"forks_count":40,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-13T17:46:47.703Z","etag":null,"topics":["dbus","deadd","desktop-notifications","gtk","haskell","linux","notification-center","notification-daemon","notifications"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phuhl.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-12T19:24:01.000Z","updated_at":"2025-04-10T08:01:05.000Z","dependencies_parsed_at":"2024-01-04T10:28:55.939Z","dependency_job_id":"1bfd341b-4b80-4e28-b10e-9f991eb8ebab","html_url":"https://github.com/phuhl/linux_notification_center","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phuhl%2Flinux_notification_center","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phuhl%2Flinux_notification_center/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phuhl%2Flinux_notification_center/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phuhl%2Flinux_notification_center/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phuhl","download_url":"https://codeload.github.com/phuhl/linux_notification_center/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254227611,"owners_count":22035669,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dbus","deadd","desktop-notifications","gtk","haskell","linux","notification-center","notification-daemon","notifications"],"created_at":"2024-07-31T03:01:17.445Z","updated_at":"2025-05-14T21:06:12.425Z","avatar_url":"https://github.com/phuhl.png","language":"Haskell","funding_links":["https://paypal.me/phuhl"],"categories":["HarmonyOS","Haskell"],"sub_categories":["Windows Manager"],"readme":"\nDiscalimer: Currently no active development going on.\n\n[[https://github.com/phuhl/linux_notification_center/workflows/CI/badge.svg?branch=master]]\n\n* Linux Notification Center\n\nA haskell-written notification center for users that like a desktop with style...\n\nTake part in the discussion on our [[https://github.com/phuhl/linux_notification_center/discussions][discussion board]]!\n\n#+BEGIN_EXAMPLE\n\n\n\n          ▙              █  █ ████████████  ███▙                  █   ▄██████▄\n          ███▄           █  █ ████        █  ███▙                █    ████    ██\n          ▜█████▄        █  █ ████         █  ███▙              █   █  ████    ▜█\n            ▜██████▄     █  █ ████          █  ███▙      ▙     █     █  ████\n          █▄   ▜██████▄  █  █ ████████████   █  ███▙    ██▙   █       █  ████\n          █ ▜█▄   ▜█████▄█  █ ████            █  ███▙   ███▙ █         █  ████\n          █    ▜█▄   ▜████  █ ████             █  ███▙█  ████           █  ████\n          █       ▜█▄   ▜█  █ ████              █  ███ █  ██       █▙    █  ████\n          █          ▜█▄    █ ████               █  █   █           █▙    █  ████\n          █             ▜▄  █ ████████████        █      █           ▜████▛  ██▛\n\n\n    ▄▇▇▀▀▀▀█▌        ▄▄▄▄▄▀▀██▇█▄▄▀▀▀▀▀    ▄▄▄▄▄▄      ▄▄█▇██▀▀▄▄▄▄▄        ▐█▀▀▀▀▇▇▄\n   ▐██▌   ▀▀    ▄▄▄████████▄▄█▀        ▄█████▀▀▀███▄      ▀█▄▄████████▄▄▄    ▀▀   ▐██▌\n   ████▄  ▄▄▄██████████▀▀   ▀▀▀█▄     ▇████▀    ▀▀██▌   ▄█▀▀▀   ▀▀██████████▄▄▄  ▄████\n    ▀███████████████▀▀         ▐█▌   ██████    ▄ ▐███  ▐█▌         ▀▀███████████████▀\n       ▀▀▀▀██████▀             ▀▀   ▐██▐▇▇     ▀▀▀▀      ▀▀             ▀██████▀▀▀▀\n       ▄▄██████▀                     ██ ██▌         ▄                     ▀██████▄▄\n     ▄███████▀                      █▀██ ▀█▄▄      ▄▄                       ▀███████▄\n    ▄███████                          ▀██▄▄█████████▀                         ███████▄\n    ██████                               ▀▀█████▀▀▀                            ███████\n    ▐████▌                                                                      ▐████▌\n     ███▄▄▄▄▄▌                                                             ▐▄▄▄▄▄███\n      ▀▀▀▀▀▀                                                                 ▀▀▀▀▀▀\n\n\n                                        ╒══════╕\n                                    NEW │ 2023 │ Update:\n                                        ╘══════╛\n\n\n                          For all users of the non-git packages:\n                                  ¨¨¨¨¨        ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨\n\n       Customize all CSS might [probably will] brake your current styling settings.\n             (more information on this in the file updateyourconfig2021.org)\n\n\n                                     New config style\n                                     ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈\n\n                  █▀▄ █▀▄ █▀█ █ █ ▀█▀ █▀█ █▀▀   █▀▀ █ █ █▀█ █▀█ █▀▀ █▀▀\n                  █▀▄ █▀▄ █▀█ █▀▄  █  █ █ █ █   █   █▀█ █▀█ █ █ █ █ █▀▀\n                  ▀▀  ▀ ▀ ▀ ▀ ▀ ▀ ▀▀▀ ▀ ▀ ▀▀▀   ▀▀▀ ▀ ▀ ▀ ▀ ▀ ▀ ▀▀▀ ▀▀▀\n\n            The configuration file is now in YAML format. It's also massively\n                       cleaned up thanks to the input of MyriaCore!\n\n                            The new configuration allows for:\n\n                                  Extended Scriptability\n                                  ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈\n\n             Now any notification can be modified by an external script. This\n            allows for all the logic you could possibly do on a notification.\n\n                     Define special styles for special notifications!\n\n\n                                     Many more fixes\n                                     ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈\n\n                               Additional Features from 2021\n                               ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈\n\n                             New deadd.css configuration file\n                               Style all elements yourself\n\n                              Reload CSS styling on the fly\n\n                    Use CSS transitions when loading a new colortheme\n                               and smoothly change the mood\n\n\n\n                       As always, many thanks to our contributors:\n\n\n        (¯`·.¸¸.·´                                                     `·.¸¸.·´¯)\n       ( \\                                                                     / )\n       ( \\ )          MyriaCore S-NA ahmubashshir mgil2 resolritter          ( / )\n      ( ) (           woutervb avdv TaylanTatli rbowden91 kianmeng            ) ( )\n       ( / )          opalmay balsoft trk9001 CobaltSpace lierdakil          ( \\ )\n       ( /                                                                     \\ )\n        (_.·´¯`·.¸                                                    ¸.·´¯`·.¸_)\n\n\n                                   Thank you very much!\n\n\n            Finally, thank you to everyone who created issues, commented, and\n                             helped to further this project.\n\n                                                                                         ▝\n                                                                                         ▝\n▖                                                                                        ▐\n▖                                                                                        ▐\n▌                                                       Further news in releasenotes.org ▐\n▙▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▟\n\n#+END_EXAMPLE\n\n\n** Features\n\nThe notification center receives notifications via DBUS (like any\nnotification daemon) and shows them in the upper right corner of the\nscreen. The notification (if not specified in the notification\notherwise) will also be shown in the notification center even after\nthe notification disappeared by itself. The notifications can be\nclicked to make them disappear.\n\nNotifications can be replaced by the use of the =replaces-id= feature\nof the notification specification.\n\nThe notification center can (optionally) show user-specified buttons\nin the bottom that can be in two states (highlighted/not highlighted)\nand that can run customizable shell commands.\n\n\n** Screenshots\n\nSome applications, notification:\n[[file:README.org.img/org_20200223_193450_1en7sh.jpg]]\n\nNotification Center opened:\n[[file:README.org.img/org_20200223_193345_VhlbOf.jpg]]\n\nLink, Markup, Progressbar, and Action support:\n[[file:README.org.img/org_20201220_000601_9V037T.jpg]]\n\n\n** Usage\n\nTo start it:\n#+BEGIN_SRC sh\n\u003e deadd-notification-center\n#+END_SRC\n\n\nToggle between hidden and shown state of the notification center:\n#+BEGIN_SRC sh\nkill -s USR1 $(pidof deadd-notification-center)\n#+END_SRC\n\n\nSet the state of a user defined button (in this example the first\nbutton, which has =id= 0):\n#+BEGIN_SRC sh\n  # turn highlighting on\n  notify-send.py a --hint boolean:deadd-notification-center:true \\\n                 int:id:0 boolean:state:true type:string:buttons\n\n  # turn highlighting off\n  notify-send.py a --hint boolean:deadd-notification-center:true \\\n                 int:id:0 boolean:state:false type:string:buttons\n#+END_SRC\nThis snippet uses [[https://github.com/phuhl/notify-send.py][notify-send.py]], an improved version of libnotify\n(notify-send).\n\nClear all notifications\n#+BEGIN_SRC sh\n  # within the notification center\n  notify-send.py a --hint boolean:deadd-notification-center:true \\\n                 string:type:clearInCenter\n\n  # popups\n  notify-send.py a --hint boolean:deadd-notification-center:true \\\n                 string:type:clearPopups\n#+END_SRC\n\nPause/Unpause popup notifications\n#+BEGIN_SRC sh\n  # pause popup notifications\n  notify-send.py a --hint boolean:deadd-notification-center:true \\\n                   string:type:pausePopups\n\n  # unpause popup notifications\n  notify-send.py a --hint boolean:deadd-notification-center:true \\\n                   string:type:unpausePopups\n#+END_SRC\n\n\nReload CSS Styling file\n#+BEGIN_SRC sh\n  notify-send.py a --hint boolean:deadd-notification-center:true \\\n                   string:type:reloadStyle\n#+END_SRC\n\n\nSend notifications that only show up in the notification center but do\nnot produce a popup:\n#+BEGIN_SRC sh\nnotify-send.py \"Does not pop up\" -t 1\n#+END_SRC\n\n*** Supported hints and features\n\nAction buttons with gtk icons\n#+BEGIN_SRC sh\nnotify-send.py \"And buttons\" \"Do you like buttons?\" \\\n               --hint boolean:action-icons:true \\\n               --action yes:face-cool no:face-sick  \n#+END_SRC\n\nNotification images by gtk icon\n#+BEGIN_SRC sh\nnotify-send.py \"Icons are\" \"COOL\" \\\n               --hint string:image-path:face-cool\n#+END_SRC\n\nNotification images by file\n#+BEGIN_SRC sh\nnotify-send.py \"Images are\" \"COOL\" \\\n               --hint string:image-path:file://path/to/image/from/root.png\n#+END_SRC\n\nNotification with progress bar\n#+BEGIN_SRC sh\nnotify-send.py \"This notification has a progressbar\" \"33%\" \\\n                         --hint int:has-percentage:33)\n#or\nnotify-send.py \"This notification has a progressbar\" \"33%\" \\\n                         --hint int:value:33)\n#+END_SRC\n\nNotification with slider\n#+BEGIN_SRC sh\nnotify-send.py \"This notification has a slider\" \"33%\" \\\n                         --hint int:has-percentage:33\n                         --action changeValue:abc)\n#+END_SRC\n\n*** Example: Brightness indicator\n\nThis snippet can be used to produce a brightness-indicator. It requires the \n[[https://github.com/phuhl/notify-send.py][notify-send.py]] script.\n\n#+BEGIN_SRC sh\n#!/bin/bash\n\nif [ \"$1\" == \"inc\" ]; then\n    xbacklight -inc 5\nfi\n\nif [ \"$1\" == \"dec\" ]; then\n    xbacklight -lower 5\nfi\n\nBRIGHTNESS=$(xbacklight -get)\nNOTI_ID=$(notify-send.py \"Bildschirmhelligkeit\" \"$BRIGHTNESS/100\" \\\n                         --hint string:image-path:video-display boolean:transient:true \\\n                                int:has-percentage:$BRIGHTNESS \\\n                         --replaces-process \"brightness-popup\")\n#+END_SRC\n\n*** Example: Volume indicator\n\nThis snippet can be used to produce a volume-indicator. It requires the \n[[https://github.com/phuhl/notify-send.py][notify-send.py]] script.\n\n#+BEGIN_SRC sh\n#!/bin/bash\n\nif [ \"$1\" == \"inc\" ]; then\n   amixer -q sset Master 5%+\nfi\n\nif [ \"$1\" == \"dec\" ]; then\n   amixer -q sset Master 5%-\nfi\n\nif [ \"$1\" == \"mute\" ]; then\n   amixer -q sset Master toggle\nfi\n\n\nAMIXER=$(amixer sget Master)\nVOLUME=$(echo $AMIXER | grep 'Right:' | awk -F'[][]' '{ print $2 }' | tr -d \"%\")\nMUTE=$(echo $AMIXER | grep -o '\\[off\\]' | tail -n 1)\nif [ \"$VOLUME\" -le 20 ]; then\n    ICON=audio-volume-low\nelse if [ \"$VOLUME\" -le 60 ]; then\n         ICON=audio-volume-medium\n     else \n         ICON=audio-volume-high\n     fi\nfi\nif [ \"$MUTE\" == \"[off]\" ]; then\n    ICON=audio-volume-muted\nfi \n\n\n\nNOTI_ID=$(notify-send.py \"Lautstärke\" \"$VOLUME/100\" \\\n                         --hint string:image-path:$ICON boolean:transient:true \\\n                                int:has-percentage:$VOLUME \\\n                         --replaces-process \"volume-popup\")\n#+END_SRC\n\n\n** Install\n\nInstall from the AUR for Arch: [[https://aur.archlinux.org/packages/deadd-notification-center/][deadd-notification-center]].\n\n*OR* \n\nIf you want to spare yourself the hassle of the\nbuild time there is a binary package available:\n[[https://aur.archlinux.org/packages/deadd-notification-center-bin/][deadd-notification-center-bin]].\n\n*OR*\n\nIf you don't want to wait for me to publish the next stable release: Use the new AUR git-package.\n\n[[https://aur.archlinux.org/packages/deadd-notification-center-git/][deadd-notification-center-git]].\n\n*OR*\n\nOn Ubuntu, Debian, everything... Replace 1.7.2 with the current-most release from the \n[[https://github.com/phuhl/linux_notification_center/releases][release section]].\n\nManually install the dependencies (exact names might differ in your distribution):\n- gtk3\n- gobject-introspection-runtime\n\n#+BEGIN_SRC sh\ntar -xvzf linux_notification_center-1.7.2.tar.gz\ncd linux_notification_center-1.7.2\nwget https://github.com/phuhl/linux_notification_center/releases/download/1.7.2/deadd-notification-center\nmkdir -p .out\nmv deadd-notification-center .out\nsudo make install\n#+END_SRC\n\n*OR*\n\nDependencies:\n- [[https://www.archlinux.org/packages/community/x86_64/stack/][stack]]\n- cairo\n- pango\n- gobject-introspection\n- gtk3\n\n#+BEGIN_SRC shell-script\nmake\nsudo make install\n#+END_SRC\n\n** Configuration\n\nNOTE: Some styling config has moved. More infos in this file:\n[[https://github.com/phuhl/linux_notification_center/blob/master/updateyourconfig2021.org][updateyourconfig2021.org]]\n\nNo configuration is necessary, the notification center comes with\nsensible defaults™.\n\nAll colors and sizes are customizable, as well as the default timeout\nfor notifications and the optional buttons in the notification\ncenter. Below are possible configurable options shown. The\nconfiguration file must be located at =~/.config/deadd/deadd.yml= (or,\nif configured differently on your system:\n=${XDG_CONFIG_HOME}/deadd/deadd.yml=).\n\nAdditionally, a =deadd.css= will be loaded from the same folder. It\ncontains the styling of the notification center. You can load changes\nfrom the =deadd.css= file by using the command described in the section\n\"Usage\".\n\n#+BEGIN_SRC yaml\n  ### Margins for notification-center/notifications\n  margin-top: 0\n  margin-right: 0\n\n  ### Margins for notification-center\n  margin-bottom: 0\n\n  ### Width of the notification center/notifications in pixels.\n  width: 500\n\n  ### Command to run at startup. This can be used to setup\n  ### button states.\n  # startup-command: deadd-notification-center-startup\n\n  ### Monitor on which the notification center/notifications will be\n  ### printed. If \"follow-mouse\" is set true, this does nothing.\n  monitor: 0\n\n  ### If true, the notification center/notifications will open on the\n  ### screen, on which the mouse is. Overrides the \"monitor\" setting.\n  follow-mouse: false\n\n  notification-center:\n    ### Margin at the top/right/bottom of the notification center in\n    ### pixels. This can be used to avoid overlap between the notification\n    ### center and bars such as polybar or i3blocks.\n    # margin-top: 0\n    # margin-right: 0\n    # margin-bottom: 0\n\n    ### Width of the notification center in pixels.\n    # width: 500\n\n    ### Monitor on which the notification center will be printed. If\n    ### \"follow-mouse\" is set true, this does nothing.\n    # monitor: 0\n\n    ### If true, the notification center will open on the screen, on which\n    ### the mouse is. Overrides the \"monitor\" setting.\n    # follow-mouse: false\n\n    ### Notification center closes when the mouse leaves it\n    hide-on-mouse-leave: true\n\n    ### If newFirst is set to true, newest notifications appear on the top\n    ### of the notification center. Else, notifications stack, from top to\n    ### bottom.\n    new-first: true\n\n    ### If true, the transient field in notifications will be ignored,\n    ### thus the notification will be persisted in the notification\n    ### center anyways\n    ignore-transient: false\n\n    ### Custom buttons in notification center\n    buttons:\n      ### Numbers of buttons that can be drawn on a row of the notification\n      ### center.\n      # buttons-per-row: 5\n\n      ### Height of buttons in the notification center (in pixels).    \n      # buttons-height: 60\n\n      ### Horizontal and vertical margin between each button in the \n      ### notification center (in pixels).\n      # buttons-margin: 2\n\n      ### Button actions and labels. For each button you must specify a\n      ### label and a command.\n      actions:\n        # - label: VPN\n        #   command: \"sudo vpnToggle\"\n        # - label: Bluetooth\n        #   command: bluetoothToggle\n        # - label: Wifi\n        #   command: wifiToggle\n        # - label: Screensaver\n        #   command: screensaverToggle\n        # - label: Keyboard\n        #   command: keyboardToggle\n\n  notification:\n    ### If true, markup (\u003cu\u003e, \u003ci\u003e, \u003cb\u003e, \u003ca\u003e) will be displayed properly\n    use-markup: true\n\n    ### If true, html entities (\u0026#38; for \u0026, \u0026#37; for %, etc) will be\n    ### parsed properly. This is useful for chromium-based apps, which\n    ### tend to send these in notifications.\n    parse-html-entities: true\n\n    dbus:\n\n      ### If noti-closed messages are enabled, the sending application\n      ### will know that a notification was closed/timed out. This can\n      ### be an issue for certain applications, that overwrite\n      ### notifications on status updates (e.g. Spotify on each\n      ### song). When one of these applications thinks, the notification\n      ### has been closed/timed out, they will not overwrite existing\n      ### notifications but send new ones. This can lead to redundant\n      ### notifications in the notification center, as the close-message\n      ### is send regardless of the notification being persisted.\n      send-noti-closed: false\n\n    app-icon:\n\n      ### If set to true: If no icon is passed by the app_icon parameter\n      ### and no application \"desktop-entry\"-hint is present, deadd will\n      ### try to guess the icon from the application name (if present).\n      guess-icon-from-name: true\n\n      ### The display size of the application icons in the notification \n      ### pop-ups and in the notification center\n      icon-size: 20\n\n    image:\n\n      ### The maximal display size of images that are part of\n      ### notifications for notification pop-ups and in the notification\n      ### center\n      size: 100\n\n      ### The margin around the top, bottom, left, and right of\n      ### notification images.\n      margin-top: 15\n      margin-bottom: 15\n      margin-left: 15\n      margin-right: 0\n\n    ### Apply modifications to certain notifications:\n    ### Each modification rule needs a \"match\" and either a \"modify\" or\n    ### a \"script\" entry.\n    modifications:\n    ### Match:\n    ### Matches the notifications against these rules. If all of the\n    ### values (of one modification rule) match, the \"modify\"/\"script\"\n    ### part is applied.\n    # - match:\n        ### Possible match criteria:\n        # title: \"Notification title\"\n        # body: \"Notification body\"\n        # time: \"12:44\"\n        # app-name: \"App name\"\n        # urgency: \"low\" # \"low\", \"normal\" or \"critical\"\n\n      # modify:\n        ### Possible modifications\n        # title: \"abc\"\n        # body: \"abc\"\n        # app-name: \"abc\"\n        # app-icon: \"file:///abc.png\"\n        ### The timeout has three special values:\n        ### timeout: 0 -\u003e don't time out at all\n        ### timeout: -1 -\u003e use default timeout\n        ### timeout: 1 -\u003e don't show as pop-up\n        ### timeout: \u003e1 -\u003e milliseconds until timeout\n        # timeout: 1\n        # margin-right: 10\n        # margin-top: 10\n        # image: \"file:///abc.png\"\n        # image-size: 10\n        # transient: true\n        # send-noti-closed: false\n        ### Remove action buttons from notifications\n        # remove-actions: true\n        ### Set the action-icons hint to true, action labels will then\n        ### be intergreted as GTK icon names\n        # action-icons: true\n        ### List of actions, where the even elements (0, 2, ...) are the\n        ### action name and the odd elements are the label\n        # actions:\n        #   - previous\n        #   - media-skip-backward\n        #   - play\n        #   - media-playback-start\n        #   - next\n        #   - media-skip-forward\n        ### Action commands, where the keys (e.g. \"play\") is the action\n        ### name and the value is a program call that should be executed\n        ### on action. Prevents sending of the action to the application.\n        # action-commands:\n        #   play: playerctl play-pause\n        #   previous: playerctl previous\n        #   next: playerctl next\n\n        ### Add a class-name to the notification container, that can be\n        ### used for specific styling of notifications using the\n        ### deadd.css file\n        # class-name: \"abc\"\n\n    # - match:\n        # app-name: \"Chromium\"\n\n      ### Instead of modifying a notification directly, a script can be\n      ### run, which will receive the notification as JSON on STDIN. It\n      ### is expected to return JSON/YAML configuration that defines the\n      ### modifications that should be applied. Minimum complete return\n      ### value must be '{\"modify\": {}, \"match\": {}}'. Always leave the \"match\"\n      ### object empty (technical reasons, i.e. I am lazy).\n      # script: \"linux-notification-center-parse-chromium\"\n    - match:\n        app-name: \"Spotify\"\n      modify:\n        image-size: 80\n        timeout: 1\n        send-noti-closed: true\n        class-name: \"Spotify\"\n        action-icons: true\n        actions:\n          - previous\n          - media-skip-backward\n          - play\n          - media-playback-start\n          - next\n          - media-skip-forward\n        action-commands:\n          play: playerctl play-pause\n          previous: playerctl previous\n          next: playerctl next\n\n    # - match:\n    #     title: Bildschirmhelligkeit\n    #   modify:\n    #     image-size: 60\n    popup:\n\n      ### Default timeout used for notifications in milli-seconds.  This can\n      ### be overwritten with the \"-t\" option (or \"--expire-time\") of the\n      ### notify-send command.\n      default-timeout: 10000\n\n      ### Margin above/right/between notifications (in pixels). This can\n      ### be used to avoid overlap between notifications and a bar such as\n      ### polybar or i3blocks.\n      margin-top: 50\n      margin-right: 50\n      margin-between: 20\n\n      ### Defines after how many lines of text the body will be truncated. \n      ### Use 0 if you want to disable truncation.\n      max-lines-in-body: 3\n\n      ### Determines whether the GTK widget that displays the notification body\n      ### in the notification popup will be hidden when empty. This is especially\n      ### useful for transient notifications that display a progress bar.\n      # hide-body-if-empty: false\n\n      ### Monitor on which the notifications will be\n      ### printed. If \"follow-mouse\" is set true, this does nothing.\n      # monitor: 0\n\n      ### If true, the notifications will open on the\n      ### screen, on which the mouse is. Overrides the \"monitor\" setting.\n      # follow-mouse: false\n\n      click-behavior:\n\n        ### The mouse button for dismissing a popup. Must be either \"mouse1\", \n        ### \"mouse2\", \"mouse3\", \"mouse4\", or \"mouse5\"\n        dismiss: mouse1\n\n        ### The mouse button for opening a popup with the default action.\n        ### Must be either \"mouse1\", \"mouse2\", \"mouse3\", \"mouse4\", or \"mouse5\"\n        default-action: mouse3\n#+END_SRC\n\n*** CSS styling\n\nThe default CSS style can be found in =/etc/xdg/deadd/deadd.css=. It is\nadvised to copy this file to =${XDG_CONFIG_HOME}/deadd/deadd.css= (usually\n=.config/deadd/deadd.css=) if you want to make changes.\n\nIn the file you can change CSS styles (GTK3-flavor). Should the\ninstallation not have created a =dead.css=, you can use the content of\n[[https://github.com/phuhl/linux_notification_center/blob/master/style.css][style.css]] as a foundation.\n\nThe following class-names for labels are defined:\n- Notifications:\n  - =label.deadd-noti-center.notification.appname= :: Appname\n  - =label.deadd-noti-center.notification.body= :: Textbody\n  - =label.deadd-noti-center.notification.title= :: Notification title\n  - =image.deadd-noti-center.notification.image= :: Image of a notification\n  - =image.deadd-noti-center.notification.icon= :: Appicon\n  - =button.deadd-noti-center.notification.actionbutton= :: Action buttons\n- Notifications in the notification center:\n  - =label.deadd-noti-center.in-center.appname= :: Appname\n  - =label.deadd-noti-center.in-center.body= :: Textbody\n  - =label.deadd-noti-center.in-center.title= :: Notification title\n  - =label.deadd-noti-center.in-center.time= :: Notification time\n  - =image.deadd-noti-center.in-center.image= :: Image of a notification\n  - =image.deadd-noti-center.in-center.icon= :: Appicon\n  - =button.deadd-noti-center.in-center.button-close= :: Close button on notification\n  - =button.deadd-noti-center.in-center.actionbutton= :: Action buttons\n- Notification-center:\n  - =label.deadd-noti-center.noti-center.time= :: The big time at the top\n  - =label.deadd-noti-center.noti-center.date= :: The date text\n  - =label.deadd-noti-center.noti-center.delete-all= :: \"Delete all\" Button\n  - =button.deadd-noti-center.noti-center.userbutton= :: User buttons\n\nAdditionally, you can specify custom class-names in the\nmodifications-section of your =deadd.yml=. These class names will be\ndefined on the notification container (all notification elements lie\nwithin) of pop-ups and in-center.\n\n**** Examples:\n\n*Remove appname and icon from notifications*\n\n#+BEGIN_SRC css\nimage.deadd-noti-center.notification.icon,\nlabel.deadd-noti-center.notification.appname,\nimage.deadd-noti-center.in-center.icon,\nlabel.deadd-noti-center.in-center.appname {\n    opacity: 0\n}\n#+END_SRC\n\n\n*Change font*\n\n#+BEGIN_SRC css\n.deadd-noti-center {\n    font-family: monospace;\n}\n#+END_SRC\n\n\n\n*Specify special background for one app*\n\n[[file:README.org.img/org_20210119_120536_adyKnd.jpg]]\n\n#+BEGIN_SRC css\n.notificationInCenter.Spotify {\n    background: linear-gradient(130deg, rgba(0, 0, 0, 0.1), rgba(0, 255, 0, 0.3));\n    border-radius: 5px;\n}\n#+END_SRC\n\nThis change requires a modification in your deadd.yml:\n\n#+BEGIN_SRC yaml\nnotification:\n  modifications:\n  - match:\n      app-name: \"Spotify\"\n    modify:\n      class-name: \"Spotify\"\n#+END_SRC\n\n*** Notification-based scripting\n\nYou can modify notifications if they match certain criteria. \n\n_Matching:_\n\nThe criteria you can specify are equality for the following parameters:\n- title\n- body\n- app-name\n- time\n\nThe matching parameters can be specified in the section\n=notification.modifications.match= of your =deadd.yml=.\n\n_Modifying:_\n\nYou can set the following parameters:\n\n- =title=\n- =body=\n- =app-name=\n- =timeout= (specified in milliseconds)\n- =margin-right= (overrides ~distanceRight~ from the configuration)\n- =margin-top= (overrides ~distanceTop~ from the configuration)\n- =icon= (overrides the app-icon, value must be either empty, a path to\n  an image or a gtk-icon-name)\n- =image= (overrides the image of the notification, value must be either\n  empty, a path to an image or a gtk-icon-name)\n- =image-size=\n- =transient= (value has to be =true= or =false=)\n- =send-noti-closed= (value has to be =true= or =false=, if set to true it\n  will prevent that a DBUS =NotificationClosed= message will be send\n  for this notification. Only applies if the configuration parameter\n  =configSendNotiClosedDbusMessage= is set to =true=)\n- =class-name= (adds a CSS-class name to the container of the\n  notification for styling)\n- =remove-actions= (value can be anything, if used, no action buttons\n  will be displayed on the notifications)\n- =action-icons= (=true= or =false=, if set to =true= the action label will be\n  interpreted as an gtk-icon-name and an icon is displayed)\n- =actions= (array where every even element is the action name, every\n  odd element is the action label. Actions are rendered as buttons in\n  a notification. As the action most likely won't be known by the\n  notification sender, you probably want to use this with the\n  =action-commands= modification)\n- =action-commands= (object where the keys are the action name and the\n  value is a program call that should be executed when the action\n  button has been clicked. Prevents sending of the action to the\n  application.)\n\nThe modification parameters can be specified in the section\n=notification.modifications.modify= of your =deadd.yml=.\n\n\n_Running Scripts:_\n\nInstead of modifying a notification directly, a script can be run,\nwhich will receive the notification as JSON on STDIN. The script is\nexpected to return JSON/YAML configuration that defines the\nmodifications that should be applied. Minimum complete return value\nmust be ={\"modify\": {}, \"match\": {}}=. Always leave the \"match\" object\nempty (technical reasons, i.e. I am lazy).\n\n*Example script* to turn a notification from WhatsApp in Chromium into\nsomething sensible:\n\nBefore:\n\n[[file:README.org.img/org_20210119_122628_AUuEu3.jpg]]\n\nAfter:\n\n[[file:README.org.img/org_20210119_122031_BNYKTp.jpg]]\n\nConfiguration:\n\n#+BEGIN_SRC yaml\nnotification:\n  modifications:\n  - match:\n      app-name: \"Chromium\"\n    script: \"linux-notification-center-parse-chromium\"\n\n#+END_SRC\n\n\nScript executed on Chromium notifications:\n\n#+BEGIN_SRC sh\n#!/bin/bash\n\n# Read notification from STDIN\nnoti=\"\"\nwhile read line\ndo\n    noti=${noti}${line}\ndone \u003c \"${1:-/dev/stdin}\"\n\n# Use jq to parse JSON and get the body field of the notification\nbody=$(echo $noti | jq '.body')\nif [[ \"$body\" == \"\\\"\u003ca href=\\\\\\\"https://web.whatsapp.com/\\\\\\\"\u003eweb.whatsapp.com\u003c/a\u003e\"* ]]; then\n      # It's Whatsapp web, lets modify the notification\n      isWhatsapp=1\n      body=$(echo $body | cut -c 64-)\n      img=$(echo $noti | jq '.image')\n      if [[ \"$img\" == \"\\\"NamedIcon \\\\\\\"\"* ]]; then\n          filepath=$(echo $img | cut -c 14- | head -c -4)\n          cp $filepath /tmp/whatsappimg.png\n      fi\nfi\n\nif [[ \"$isWhatsapp\" == \"1\" ]]; then\n    # Returning the modifications to dnc as JSON\n    echo \"{\\\"modify\\\": {\\\"app-icon\\\": \\\"whatsapp-desktop\\\", \\\"app-name\\\": \\\"WhatsApp\\\", \\\"image-size\\\": 50, \\\"image\\\": \\\"file:///tmp/whatsappimg.png\\\", \\\"remove-actions\\\": true, \\\"class-name\\\": \\\"WhatsApp\\\", \\\"body\\\":\\\"${body}}, \\\"match\\\": {}}\"\nelse\n    echo '{\"modify\": {}, \"match\": {}}'\nfi\n#+END_SRC\n\n** Contribute\n\nFirst of all: Contribution is obviously 100% optional.\n\nIf you want to join the development chat, join our *matrix channel: \n#deadd-notification-center:beeper.com* or drop by on the discussion \nboard: https://github.com/phuhl/linux_notification_center/discussions\n\nIf you do not want to contribute with your time, you can buy me a\nbeer. Someone mentioned, they would be willing to donate, so here is\nmy PayPal link: [[https://paypal.me/phuhl]]. Should you consider to\ndonate, please be aware that this does not buy you the right to demand\nanything. This is a hobby and will be. But if you just want to give me\nsome motivation by showing me that you appreciate my work, feel\nfree to do so :)\n\n** See also\n\nAlso take a look at my [[https://github.com/phuhl/notify-send.py][notify-send.py]] which imitates notify-send (libnotify) but also is able to replace notifications.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphuhl%2Flinux_notification_center","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphuhl%2Flinux_notification_center","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphuhl%2Flinux_notification_center/lists"}