This is a Rust application that sends push notifications via multiple providers, including Pushover and ntfy. It can be used from the command line to send messages with optional priority and image attachments.
- Rust and Cargo installed on your system (for building from source)
- Accounts with supported push notification services (e.g., Pushover, ntfy)
- Clone this repository
- Navigate to the project directory
- Set up your configuration file (see Configuration section below)
PlingDing uses a YAML configuration file. You can place your configuration file in one of the following locations:
~/.plingding.yaml
~/.config/plingding/plingding.yaml
./plingding.yaml
(in the current working directory)
Create a file named plingding.yaml
in one of these locations with the following content:
providers:
- name: "pushover_personal"
provider_type: "pushover"
api_key: "your_pushover_api_key_here"
user_key: "your_pushover_user_key_here"
default: true
- name: "ntfy_work"
provider_type: "ntfy"
api_key: "your_ntfy_api_key_here"
base_url: "https://ntfy.sh/your_topic"
default: true
# Add more providers as needed
Replace the placeholder values with your actual API keys and other required information.
-
Pushover:
- Required fields:
name
,provider_type
(set to "pushover"),api_key
,user_key
- Optional fields:
default
(set to true if you want this provider to be used by default)
- Required fields:
-
ntfy:
- Required fields:
name
,provider_type
(set to "ntfy"),api_key
,base_url
- Optional fields:
default
(set to true if you want this provider to be used by default)
- Required fields:
You can add multiple providers of the same type with different configurations.
To build the application for your current platform, run:
cargo build --release
The compiled binary will be available in target/release/plingding
.
For an optimized and smaller binary, you can use the strip
command after building:
strip target/release/plingding
This will remove debug symbols from the binary, significantly reducing its size.
PlingDing supports cross-platform compilation for Linux and Windows from a Linux host. To build for these platforms, follow these steps:
-
Install the
cross
tool:cargo install cross
-
Install the required target:
rustup target add x86_64-pc-windows-gnu
-
Run the build script:
chmod +x build.sh ./build.sh
This will create binaries for Linux and Windows in the releases
directory.
Follow these steps:
- Update the version number in
Cargo.toml
andPKGBUILD
. - Commit all changes and push to the repository.
- Create a new git tag for the release:
git tag -a v0.x.x -m "Release v0.x.x"
- Push the tag:
git push origin v0.x.x
- Run the build script on a Linux system to create binaries for Linux and Windows:
./build.sh
- Build the macOS version on a macOS system as described in the "Building for macOS" section.
- Create a new release on GitHub, upload the binaries for all three platforms, and publish the release.
If you're using an Arch-based Linux distribution, you can install PlingDing from the AUR using one of the following methods:
-
Make sure you have an AUR helper installed (e.g., yay, paru)
-
Run the following command:
yay -S plingding
Replace
yay
with your preferred AUR helper if different. -
Follow the prompts to install the package
If you prefer not to use an AUR helper, you can manually install plingding from the AUR:
-
Make sure you have the necessary tools installed:
sudo pacman -S --needed base-devel git
-
Clone the AUR package repository:
git clone https://aur.archlinux.org/plingding.git cd plingding
-
Build and install the package:
makepkg -si
This command will download the source, build the package, and install it. The
-si
flags mean it will install any needed dependencies and then install the built package. -
If you want to review the PKGBUILD before building, you can open it in a text editor and then run
makepkg -si
when you're ready to proceed.
After installation using either method, the plingding
command will be available system-wide.
plingding [OPTIONS] --message <MESSAGE>
Options:
-m, --message <MESSAGE>
: The message to send (required)-p, --priority <PRIORITY>
: The priority of the message (-2 to 2, default: 0)-i, --image <IMAGE>
: The path to an image to attach (optional)--providers <PROVIDERS>
: Comma-separated list of provider names to use (optional, uses default providers if not specified)
-
Send a simple message using default providers:
plingding -m "Hello, World!"
-
Send a message with high priority to specific providers:
plingding -m "Urgent message" -p 2 --providers pushover_personal,ntfy_work
-
Send a message with an attached image:
plingding -m "Check out this image" -i /path/to/image.jpg
Make sure to set up your configuration file as described in the Configuration section before running the application. If the configuration file is not found or is invalid, the application will return an error message.
- Linux: The application should work out of the box on most Linux distributions.
- Windows: When using the Windows binary, make sure to place your configuration file in one of the specified locations.
- macOS: The macOS binary should work similarly to the Linux version. Ensure you've built it on a macOS system as described in the "Building for macOS" section.