Skip to content

Commit 52ea570

Browse files
committed
init notify
1 parent c3de222 commit 52ea570

40 files changed

+13837
-544
lines changed

Cargo.lock

Lines changed: 3165 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,26 @@ edition = "2021"
77
[profile.release]
88
lto = true
99

10+
[workspace]
11+
members = [
12+
"ntfy-daemon"
13+
]
14+
1015
[dependencies]
16+
ntfy-daemon = { path = "./ntfy-daemon" }
1117
gettext-rs = { version = "0.7", features = ["gettext-system"] }
12-
gtk = { version = "0.6", package = "gtk4", features = ["v4_8"] }
18+
gtk = { version = "0.7", package = "gtk4", features = ["v4_12", "blueprint"] }
1319
once_cell = "1.14"
1420
tracing = "0.1.37"
1521
tracing-subscriber = "0.3"
16-
adw = { version = "0.4", package = "libadwaita", features = ["v1_4"] }
22+
adw = { version = "0.5", package = "libadwaita", features = ["v1_4"] }
23+
serde = { version = "1.0", features = ["derive"] }
24+
serde_json = "1.0"
25+
capnp = "0.17.2"
26+
capnp-rpc = "0.17.0"
27+
anyhow = "1.0.71"
28+
chrono = "0.4.26"
29+
rand = "0.8.5"
30+
ureq = "2.7.1"
31+
futures = "0.3.0"
32+
ashpd = "0.6.0"

README.md

Lines changed: 4 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,8 @@
1-
# GTK + Libadwaita + Blueprint + Rust + Meson + Flatpak = <3
1+
# Notify
22

3-
A boilerplate template to get started with GTK, Libadwaita, Blueprint, Rust, Meson, Flatpak made for GNOME.
3+
https://ntfy.sh client application to receive everyday's notifications.
44

5-
![Main window](data/resources/screenshots/screenshot1.png "Main window")
5+
## Architecture
66

7-
## What does it contains?
7+
The code is split between the GUI and the underlying ntfy-daemon.
88

9-
- A simple window with a headerbar
10-
- Bunch of useful files that you SHOULD ship with your application on Linux:
11-
- Metainfo: describe your application for the different application stores out there;
12-
- Desktop: the application launcher;
13-
- Icons: This repo contains three icons, a normal, a nightly & monochromatic icon (symbolic) per the GNOME HIG, exported using [App Icon Preview](https://flathub.org/apps/details/org.gnome.design.AppIconPreview).
14-
- Flatpak Manifest for nightly builds
15-
- Dual installation support
16-
- Uses Meson for building the application
17-
- Bundles the UI files & the CSS using gresources
18-
- A pre-commit hook to run rustfmt on your code
19-
- Tests to validate your Metainfo, Schemas & Desktop files
20-
- Gsettings to store the window state, more settings could be added
21-
- Gitlab CI to produce flatpak nightlies
22-
- i18n support
23-
24-
## How to init a project ?
25-
26-
The template ships a simple python script to init a project easily. It asks you a few questions and replaces & renames all the necessary files.
27-
28-
The script requires having `git` installed on your system.
29-
30-
You can run it with,
31-
32-
```shell
33-
python3 create-project.py
34-
```
35-
36-
```shell
37-
➜ python3 create-project.py
38-
Welcome to GTK Rust Template
39-
Name: Contrast
40-
Project Name: contrast
41-
Application ID (e.g. org.domain.MyAwesomeApp, see: https://developer.gnome.org/ChooseApplicationID/): org.gnome.design.Contrast
42-
Author: Bilal Elmoussaoui
43-
44-
```
45-
46-
A new directory named `contrast` containing the generated project
47-
48-
## Building the project
49-
50-
Make sure you have `flatpak` and `flatpak-builder` installed. Then run the commands below. Replace `<application_id>` with the value you entered during project creation. Please note that these commands are just for demonstration purposes. Normally this would be handled by your IDE, such as GNOME Builder or VS Code with the Flatpak extension.
51-
52-
```
53-
flatpak install --user org.gnome.Sdk//master org.freedesktop.Sdk.Extension.rust-stable org.gnome.Platform//master org.freedesktop.Sdk.Extension.llvm16
54-
flatpak-builder --user flatpak_app build-aux/<application_id>.Devel.json
55-
```
56-
57-
## Running the project
58-
59-
Once the project is build, run the command below. Replace Replace `<application_id>` and `<project_name>` with the values you entered during project creation. Please note that these commands are just for demonstration purposes. Normally this would be handled by your IDE, such as GNOME Builder or VS Code with the Flatpak extension.
60-
61-
```
62-
flatpak-builder --run flatpak_app build-aux/<application_id>.Devel.json <project_name>
63-
```
64-
65-
## Community
66-
67-
Join the GNOME and gtk-rs community!
68-
- [Matrix chat](https://matrix.to/#/#rust:gnome.org): chat with other developers using gtk-rs
69-
- [Discourse forum](https://discourse.gnome.org/tag/rust): topics tagged with `rust` on the GNOME forum.
70-
- [GNOME circle](https://circle.gnome.org/): take inspiration from applications and libraries already extending the GNOME ecosystem.
71-
72-
## Credits
73-
74-
- [Podcasts](https://gitlab.gnome.org/World/podcasts)
75-
- [Shortwave](https://gitlab.gnome.org/World/Shortwave)
76-
- [gtk-rust-template without libadwaita and blueprint](https://gitlab.gnome.org/World/Rust/gtk-rust-template)

build-aux/com.ranfdev.Notify.Devel.json

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,15 @@
1010
"command": "notify",
1111
"finish-args": [
1212
"--share=ipc",
13+
"--share=network",
1314
"--socket=fallback-x11",
1415
"--socket=wayland",
16+
"--socket=session-bus",
1517
"--device=dri",
16-
"--env=RUST_LOG=notify=debug",
18+
"--env=RUST_LOG=notify=debug,ntfy_daemon=debug",
1719
"--env=G_MESSAGES_DEBUG=none",
18-
"--env=RUST_BACKTRACE=1"
20+
"--env=RUST_BACKTRACE=1",
21+
"--talk-name=org.freedesktop.Notifications"
1922
],
2023
"build-options": {
2124
"append-path": "/usr/lib/sdk/rust-stable/bin:/usr/lib/sdk/llvm16/bin",
@@ -35,6 +38,17 @@
3538
]
3639
},
3740
"modules": [
41+
{
42+
"name": "capnp",
43+
"buildsystem": "cmake",
44+
"sources": [
45+
{
46+
"type": "archive",
47+
"url": "https://capnproto.org/capnproto-c++-0.10.4.tar.gz",
48+
"sha256": "981e7ef6dbe3ac745907e55a78870fbb491c5d23abd4ebc04e20ec235af4458c"
49+
}
50+
]
51+
},
3852
{
3953
"name": "notify",
4054
"buildsystem": "meson",
Lines changed: 8 additions & 57 deletions
Loading

0 commit comments

Comments
 (0)