gotify-firefox

Send push notifications to your Gotify server from Firefox
git clone git://fossdaily.xyz/gotify-firefox
Log | Files | Refs | README | LICENSE

commit 33cc3386a6247883f0ebff3f6f891bb1442ffd29
parent d4fbc5d74fd9c5a158297a1f117466a4b4a42fb4
Author: caltlgin <caltlgin@fossdaily.xyz>
Date:   Wed,  4 Dec 2019 17:31:01 +1300

remove old termux scripts

Diffstat:
MREADME.md | 73-------------------------------------------------------------------------
Dgotify_text_message | 32--------------------------------
Dsetup-termux.sh | 46----------------------------------------------
3 files changed, 0 insertions(+), 151 deletions(-)

diff --git a/README.md b/README.md @@ -44,79 +44,6 @@ _This is an evolving project of mine to replicate the functionality of Pushbulle * Gotify for Android is available on [F-Droid](https://f-droid.org/en/packages/com.github.gotify/), [APK download](https://github.com/gotify/android/releases/latest) or you can get it from [Google Play](https://play.google.com/store/apps/details?id=com.github.gotify). -> Gotify for Android is great for viewing messages, but currently there is no way to send messages from within the app. Hence the workaround below. - -### Use [Termux](https://termux.com) to create a text message or send a link from the Android share menu to your Gotify server - -1. Install [Termux](https://termux.com), [Termux: API](https://wiki.termux.com/wiki/Termux:API) and [Termux:Widget](https://wiki.termux.com/wiki/Termux:Widget). ([Source-code](https://github.com/termux)) ([Documentation](https://wiki.termux.com/wiki/Main_Page)) -2. Setup `termux-url-opener` and `Text-Message` widget: - -> In the example script below, I have created the ability to send a link or message to one or more Gotify apps. This somewhat replicates the functionality of Pushbullet. - -* **OPTION 1:** Open Termux and input the following commands: - -> Make sure to change `server.host` to your Gotify server host name and `app-token-x` to your Gotify app token. - -```sh -pkg up -y && \ -pkg install curl jq termux-api -y && \ -mkdir -p ~/bin && \ -cat <<\EOF >>~/bin/termux-url-opener -#!/bin/bash -URL=$1 -CHOICE=$(termux-dialog radio -t "Send link to..." -v "Gotify App 1,Gotify App 2,All Gotify Apps" | jq -r ".text") -case $CHOICE in - "Gotify App 1") - curl -X POST "https://server.host/message?token=app-token-1" -F "title=Message from Android" -F "message=$URL" -F "priority=5" - ;; - "Gotify App 2") - curl -X POST "https://server.host/message?token=app-token-2" -F "title=Message from Android" -F "message=$URL" -F "priority=5" - ;; - "All Gotify Apps") - curl -X POST "https://server.host/message?token=app-token-1" -F "title=Message from Android" -F "message=$URL" -F "priority=5" - curl -X POST "https://server.host/message?token=app-token-2" -F "title=Message from Android" -F "message=$URL" -F "priority=5" - ;; -esac -EOF -chmod +x ~/bin/termux-url-opener && \ -mkdir -p ~/.shortcuts/tasks && \ -cat <<\EOF >>~/.shortcuts/tasks/Text-Message -#!/bin/bash -TXT=$(termux-dialog text -t "Enter message..." -m | jq -r ".text") -CHOICE=$(termux-dialog radio -t "Send link to..." -v "Gotify App 1,Gotify App 2,All Gotify Apps" | jq -r ".text") -case $CHOICE in - "Gotify App 1") - curl -X POST "https://server.host/message?token=app-token-1" -F "title=Message from Android" -F "message=$TXT" -F "priority=5" - ;; - "Gotify App 2") - curl -X POST "https://server.host/message?token=app-token-2" -F "title=Message from Android" -F "message=$TXT" -F "priority=5" - ;; - "All Gotify Apps") - curl -X POST "https://server.host/message?token=app-token-1" -F "title=Message from Android" -F "message=$TXT" -F "priority=5" - curl -X POST "https://server.host/message?token=app-token-2" -F "title=Message from Android" -F "message=$TXT" -F "priority=5" - ;; -esac -EOF -chmod +x ~/.shortcuts/tasks/Text-Message -``` - -* **OPTION 2:** Open Termux and input the following **one-liner** command: - -> Make sure to change `server.host` to your Gotify server host name and `app-token-x` to your Gotify app token, by editing `~/bin/termux-url-opener` and `~/.shortcuts/Text-Message` - -[Source-code](setup-termux.sh) ([License](LICENSE-GPL3)) - -```sh -pkg install curl && bash <(curl -sL https://fossdaily.xyz/got) -``` - -3. You should now be able to send a link to your Gotify server, by using the Android share menu from within certain apps. **Simply choose Termux as the share option**. -4. Finally to be able to send Text messages to your Gotify server, simply add the **Termux shortcut widget** to your home screen. - -## Gotify for Linux 💻 - -* Get the bash script for linux [here](gotify_text_message) ([License](LICENSE-GPL3)). The script works well with [Scripts Menu](https://cinnamon-spices.linuxmint.com/applets/view/185) for Linux Cinnamon Mint Cinnamon. - ## Notes 📃 * Your welcome to leave a feature request or an issue report, but please keep in mind that this is a fun little project that I will work on in my spare time. Contributions can be made by creating a Pull Request. If you would like to donate, please consider donating to the [Free Software Foundation](https://my.fsf.org/donate). diff --git a/gotify_text_message b/gotify_text_message @@ -1,32 +0,0 @@ -#!/bin/bash - -# Dependency checks: -if which zenity > /dev/null 2> /dev/null; then - : -else - xmessage -nearmouse zenity is required but not installed. - exit 1 -fi - -# Main routine: -MESSAGE=$((while ! wmctrl -F -a "Gotify Text Messenger" -b add,above;do sleep 1;done) & (zenity --text-info --editable --title="Gotify Text Messenger" --width=800 --height=800)) - -if [ -z "$MESSAGE" ]; then - exit -fi - -APP=$((while ! wmctrl -F -a "Gotify Text Messenger" -b add,above;do sleep 1;done) & (zenity --list --title="Gotify Text Messenger" --text "Send message to:" --radiolist --column "Pick" --column "Option" TRUE "App1" FALSE "App2" FALSE "All" --width=800 --height=800)) - -if [ -n "$APP" ]; then - case $APP in - App1) - curl -X POST "https://server.host/message?token=app-token-1" -F "title=Text message from Linux" -F "message=$MESSAGE" -F "priority=5" - ;; - App2) - curl -X POST "https://server.host/message?token=app-token-2" -F "title=Text message from Linux" -F "message=$MESSAGE" -F "priority=5" - ;; - All) - curl -X POST "https://server.host/message?token=app-token-1" -F "title=Text message from Linux" -F "message=$MESSAGE" -F "priority=5" - curl -X POST "https://server.host/message?token=app-token-2" -F "title=Text message from Linux" -F "message=$MESSAGE" -F "priority=5" - esac -fi diff --git a/setup-termux.sh b/setup-termux.sh @@ -1,46 +0,0 @@ -#!/bin/bash -echo "Updating packages..." -pkg up -y -echo "Installing dependencies..." -pkg install jq termux-api -y -echo "Setting up termux-url-opener..." -mkdir -p ~/bin -cat <<\EOF >>~/bin/termux-url-opener -#!/bin/bash -URL=$1 -CHOICE=$(termux-dialog radio -t "Send link to..." -v "Gotify App 1,Gotify App 2,All Gotify Apps" | jq -r ".text") -case $CHOICE in - "Gotify App 1") - curl -X POST "https://server.host/message?token=app-token-1" -F "title=Message from Android" -F "message=$URL" -F "priority=5" - ;; - "Gotify App 2") - curl -X POST "https://server.host/message?token=app-token-2" -F "title=Message from Android" -F "message=$URL" -F "priority=5" - ;; - "All Gotify Apps") - curl -X POST "https://server.host/message?token=app-token-1" -F "title=Message from Android" -F "message=$URL" -F "priority=5" - curl -X POST "https://server.host/message?token=app-token-2" -F "title=Message from Android" -F "message=$URL" -F "priority=5" - ;; -esac -EOF -chmod +x ~/bin/termux-url-opener -echo "Setting up Text-Message..." -mkdir -p ~/.shortcuts/tasks -cat <<\EOF >>~/.shortcuts/tasks/Text-Message -#!/bin/bash -TXT=$(termux-dialog text -t "Enter message..." -m | jq -r ".text") -CHOICE=$(termux-dialog radio -t "Send link to..." -v "Gotify App 1,Gotify App 2,All Gotify Apps" | jq -r ".text") -case $CHOICE in - "Gotify App 1") - curl -X POST "https://server.host/message?token=app-token-1" -F "title=Message from Android" -F "message=$TXT" -F "priority=5" - ;; - "Gotify App 2") - curl -X POST "https://server.host/message?token=app-token-2" -F "title=Message from Android" -F "message=$TXT" -F "priority=5" - ;; - "All Gotify Apps") - curl -X POST "https://server.host/message?token=app-token-1" -F "title=Message from Android" -F "message=$TXT" -F "priority=5" - curl -X POST "https://server.host/message?token=app-token-2" -F "title=Message from Android" -F "message=$TXT" -F "priority=5" - ;; -esac -EOF -chmod +x ~/.shortcuts/tasks/Text-Message -echo "🏁 COMPLETE"