{"id":13646772,"url":"https://github.com/kamek-pf/ntfd","last_synced_at":"2025-04-21T21:31:23.437Z","repository":{"id":41181525,"uuid":"265946790","full_name":"kamek-pf/ntfd","owner":"kamek-pf","description":"A lightweight notification daemon for fancy desktop integrations","archived":false,"fork":false,"pushed_at":"2023-11-30T15:14:12.000Z","size":804,"stargazers_count":120,"open_issues_count":5,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-02T01:26:24.661Z","etag":null,"topics":["github","haskell","mpd","notifications","openweathermap","polybar","rofi"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kamek-pf.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","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}},"created_at":"2020-05-21T20:38:04.000Z","updated_at":"2024-05-29T14:56:29.000Z","dependencies_parsed_at":"2024-01-14T09:59:38.437Z","dependency_job_id":"6a5c9f6b-e133-4e45-b535-8c742424e97b","html_url":"https://github.com/kamek-pf/ntfd","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamek-pf%2Fntfd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamek-pf%2Fntfd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamek-pf%2Fntfd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamek-pf%2Fntfd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kamek-pf","download_url":"https://codeload.github.com/kamek-pf/ntfd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223880277,"owners_count":17219094,"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":["github","haskell","mpd","notifications","openweathermap","polybar","rofi"],"created_at":"2024-08-02T01:03:05.456Z","updated_at":"2024-11-09T20:30:32.572Z","avatar_url":"https://github.com/kamek-pf.png","language":"Haskell","funding_links":[],"categories":["Haskell"],"sub_categories":[],"readme":"# `ntfd` - Notification daemon\n![GitHub](https://img.shields.io/github/license/kamek-pf/ntfd)\n[![GitHub release (latest by date)](https://img.shields.io/github/v/release/kamek-pf/ntfd)](https://github.com/kamek-pf/ntfd)\n\nA lightweight notification daemon for fancy desktop integrations.\n\n`ntfd` synchronizes with different services and offers synchronous APIs for desktop integration via D-Bus. \\\nIt can be used as a data source for [Polybar](https://github.com/polybar/polybar), [Rofi](https://github.com/davatorium/rofi) or any other similar tool.\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"./screenshots/main.png\" /\u003e\n    \u003csub\u003entfd feeding data to Polybar and Dunst\u003c/sub\u003e\n\u003c/p\u003e\n\n## Installation\nArch users can install [`ntfd-bin`](https://aur.archlinux.org/packages/ntfd-bin/) from the AUR. \\\nOther Linux users can either grab a statically linked binary from the [release page](https://github.com/kamek-pf/ntfd/releases) or build from source. \\\nInstructions to build from source can be found at the bottom of the README.\n\n## Configuration\nIf you installed from the AUR, just edit `~/.config/ntfd/config.toml` as you need and enable the modules you're interested in. \\\nKeep scrolling for module specific instructions.\n\nIf you're building from source, copy `config.toml` into your config directory, then edit it to enable what you need:\n```sh\nmkdir -p ~/.config/ntfd\ncp config.toml ~/.config/ntfd\n```\n\n## Usage\nFirst, make sure `ntfd` is running in the background. You can start it at the begining of you session:\n```sh\nntfd \u0026\n```\n\nHere are a few example DBus queries you can use from shell scripts, you'll need [`jq`](https://www.archlinux.org/packages/community/x86_64/jq/) to run the examples:\n\nDBus properties:\n```sh\n# Get the current weather icon\nbusctl --user -j get-property io.ntfd /weather openweathermap.strings CurrentIcon | jq -r .data\n\n# Rendered version of the configured weather template:\nbusctl --user -j get-property io.ntfd /weather openweathermap.strings RenderedTemplate | jq -r .data\n```\n\nDBus methods:\n```sh\n# Supported units are \"celsius\", \"kelvin\" and \"fahrenheit\":\n\n# Current temperature in celsius:\nbusctl --user -j call io.ntfd /weather openweathermap.strings CurrentTemperature s \"celsius\" | jq -r '.data[0]'\n\n# Forecast temperature in fahrenheit:\nbusctl --user -j call io.ntfd /weather openweathermap.strings CurrentTemperature s \"fahrenheit\" | jq -r '.data[0]'\n```\n\nTo explore the DBus API, I recommend [`d-feet`](https://www.archlinux.org/packages/community/any/d-feet/), a graphical tool to explore DBus interfaces. \\\nIn `d-feet`, go to the Session Bus tab from the top bar, and look for `io.ntfd`.\n\nThe [`busctl` documentation](https://www.freedesktop.org/software/systemd/man/busctl.html) might also come in handy, especially for method calls.\n\n## Weather module\n\u003cp align=\"center\"\u003e\n    \u003cimg width=\"38%\" src=\"./screenshots/weather-notification.png\" /\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"./screenshots/weather-polybar.png\" /\u003e\n\u003c/p\u003e\n\nThe weather module sends desktop notifications when weather conditions are degrading. \\\nIt also exposes a D-Bus API with some convenience methods for easier desktop integration.\n\n#### Polybar integration\nIn the screenshot, the first number is the current temperature and the second one is a 3 hour forecast. \\\nThe output is fully configurable via templating, you can also query individual values. \\\nEdit the `~/.config/ntfd/config.toml` and follow the instructions. \\\nFor Polybar integration like in the example, update your Polybar config like so:\n```\n[module/weather]\ntype = custom/script\nexec = busctl --user -j get-property io.ntfd /weather openweathermap.strings RenderedTemplate | jq -r .data\ninterval = 60\nlabel-font = 3\n```\nI recommend a 60 second interval, this way the bar will stay in sync with the notifications. \\\nNote that the Polybar integration depends on both [Weather Icons](https://aur.archlinux.org/packages/ttf-weather-icons) and [Material Icons](https://aur.archlinux.org/packages/ttf-material-design-icons), don't forget to add them to your config or it won't render correctly:\n```\nfont-1 = WeatherIcons:size=17\n...\nfont-3 = MaterialIcons:size=19\n...\n```\n\n## GitHub module\n\u003cp align=\"center\"\u003e\n    \u003cimg width=\"38%\" src=\"./screenshots/github-notification.png\" /\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"./screenshots/github-polybar.png\" /\u003e\n\u003c/p\u003e\n\nThe GitHub module sends desktop notifications when there's activity on GitHub. \\\nIt exposes a D-Bus similar to the weather module.\n\n#### Polybar integration\nThe screenshots shows the number of currently unread notifications. Nothing is rendered unless some notifications are unread. \\\nEdit the `~/.config/ntfd/config.toml` and follow the instructions. \\\nFor Polybar integration like in the example, update your Polybar config like so:\n```\n[module/github]\ntype = custom/script\nexec = busctl --user -j get-property io.ntfd /github github.strings RenderedTemplate | jq -r .data\ninterval = 10\nlabel-font = 3\n```\nI recommend a 10 second interval, this way the bar will stay in sync with the notifications. \\\nThe example in the default config file needs the [Octicons](https://aur.archlinux.org/packages/ttf-octicons/) font to render correctly.\n\n## MPD module\n\u003cp align=\"center\"\u003e\n    \u003cimg width=\"30%\" src=\"./screenshots/mpd-notification.png\" /\u003e\n\u003c/p\u003e\n\nThe MPD module sends desktop notifications when songs start playing. \\\nSee `config.toml` for configuration options.\n\n## Roadmap\nIntegration with the following services is planned:\n- [x] OperweatherMap\n    - [x] Current weather, forecast\n    - [x] Template rendering for Polybar integration\n    - [x] Re-implement [`polybar-forecast`](https://github.com/kamek-pf/polybar-forecast))\n    - [x] Alerts through notifications\n- [x] MPD\n    - [x] Desktop notifications\n- [x] Github\n    - [x] Unread notifications count\n    - [x] Live notifications\n- [ ] Arch\n    - [ ] Pacman updates ? (how ?)\n- [ ] Gmail\n    - [ ] Live notifications\n    - [ ] Unread messages count, multi account support\n- [ ] Facebook (?)\n    - [ ] Live messages (?)\n    - [ ] Unread notifications count (?)\n- [ ] Twitch\n    - [ ] Live streams count (followed by the user)\n    - [ ] Rofi integration with [`mpv`](https://mpv.io/)\n- [ ] Reddit (?)\n\n## Build from source\nYou can setup a Stack toolchain to build the project, or use Docker to build a statically linked executable:\n```sh\ndocker build -t kamek-pf/ntfd .\ndocker run --rm -ti -v $(pwd):/mnt kamek-pf/ntfd /bin/sh -c 'cp ntfd /mnt'\n```\nThe binary will be available as `ntfd` from the project's root.\n\n## Run tests\nThe test suite expects a valid `OWM_API_KEY` and `GITHUB_TOKEN` environment variables. Simply run `stack test`.\n\n## Troubleshooting\n\n##### My Dunst notification icons look tiny\nDunst has [an unreleased](https://github.com/dunst-project/dunst/pull/674) fix for this.\nIn the meantime you can copy the `weather-xyz` icons from \\\n`/usr/share/icons/YourTheme/status/symbolic` somewhere else, resize them and add the new path to `icon_folders` in your `dunstrc`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamek-pf%2Fntfd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkamek-pf%2Fntfd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamek-pf%2Fntfd/lists"}