From 8bfa7fc8325f8a6dc55a7dd6607cb528cb67683d Mon Sep 17 00:00:00 2001 From: Karmanyaah Malhotra Date: Wed, 28 Oct 2020 11:16:54 -0400 Subject: [PATCH 1/2] Add directory check --- main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index b9bd7a9..ae71b0e 100644 --- a/main.py +++ b/main.py @@ -8,7 +8,9 @@ domain = "push.example.com" token = "z2Uny92TZBzsukg" home = os.path.expanduser('~') -path = "{}/.cache/gotify-dust".format(home) +path = "{}/.cache/gotify-dunst".format(home) +if not os.path.isdir(path): + os.mkdir(path) def get_picture(appid): imgPath = "{}/{}.jpg".format(path, appid) From 37a30045da557c332c383b2e853f67e7c75cc4dc Mon Sep 17 00:00:00 2001 From: Karmanyaah Malhotra Date: Wed, 28 Oct 2020 11:19:47 -0400 Subject: [PATCH 2/2] Documentation add step --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2f8436a..2026fcc 100644 --- a/README.md +++ b/README.md @@ -14,11 +14,12 @@ This is a simple script for receiving [Gotify](https://github.com/gotify/server) 1. Clone this repo git clone https://github.com/ztpnk/gotify-dunst && cd gotify-dunst -2. Install python requirements +2. Create a python venv `python3 -m venv .env` +3. Install python requirements ./.env/bin/pip install -r requirements.txt -3. Change the domain and token in main.py -4. Test if it runs +4. Change the domain and token in main.py +5. Test if it runs ./.env/bin/python main.py -5. Customize the gotify-dunst.service and copy it to /etc/systemd/system -6. Start and enable the Systemd Unit +6. Customize the gotify-dunst.service and copy it to /etc/systemd/system +7. Start and enable the Systemd Unit sudo systemd start gotify-dunst && sudo systemd enable gotify-dunst