4 ms·
I'm very curious if anyone knows of any software that does the opposite, i.e. running an arbitrary command on my computer when I tap a button on my phone.
by vladharbuz 5y ago
I'm very curious if anyone knows of any software that does the opposite, i.e. running an arbitrary command on my computer when I tap a button on my phone.
- rwky 5y agoKDE Connect can do that if you happen to be using KDE as a desktop environment and an android phone https://userbase.kde.org/KDE_Connect/Tutorials/Useful_commands https://userbase.kde.org/KDE_Connect/Tutorials/Useful_comman...
- makeworld 5y agoYou don't need to be using KDE. Just have KDE Connect installed.
- Debug_Overload 5y agoKDE isn't mandatory. Some distros (like ZorinOS) also have this functionality by default.
- binwiederhier 5y agoYou can do this with a combination of ntfy and MacroDroid [1] or Tasker. With those apps, you can do things like "if I shake my phone, publish this message to this HTTP endpoint". And then you can subscribe to a ntfy topic via the ntfy CLI and execute a command. Here's how you do it: 1. Install MacroDroid [1] on your phone 2. Set up an action in MacroDroid to publish a message to a ntfy topic via a HTTP GET (see [2]) 3. On your computer, install the ntfy CLI and set up the ntfy-client systemd service (or use `ntfy subscribe mytopic 'echo $m'` or something similar); see instructions here: [3] Here are some screenshots/videos of how to integrate MacroDroid and Tasker with ntfy [4]. Please note that the MacroDroid notes are a little out of date, since you can now use HTTP GET to publish messages, so you don't need to use the "Send intent" thing anymore, which means you don't need the ntfy app on your phone. If you need more help, you can find me on Discord [4] and I'll help out. [1] https://play.google.com/store/apps/details?id=com.arlosoft.macrodroid https://play.google.com/store/apps/details?id=com.arlosoft.m... [2] https://ntfy.sh/docs/publish/#webhooks-send-via-get https://ntfy.sh/docs/publish/#webhooks-send-via-get [3] https://ntfy.sh/docs/subscribe/cli/#subscribe-to-multiple-topics https://ntfy.sh/docs/subscribe/cli/#subscribe-to-multiple-to... [4] https://ntfy.sh/docs/subscribe/phone/#integrations https://ntfy.sh/docs/subscribe/phone/#integrations [5] https://discord.gg/cT7ECsZj9w https://discord.gg/cT7ECsZj9w
- vladharbuz 5y agoThank you for the detailed suggestion! I feel like this is a good path, I'll look into it this week. :)
- alphabettsy 5y agoNot sure what your other requirements are but you could do this with a script via SSH. Another option is to use Caddy with the Exec module with a Webhook (https://caddyserver.com/docs/modules/exec https://caddyserver.com/docs/modules/exec), but you’d need to use an auth plugin as well.
- teeray 5y agoAlfred on macOS had a similar functionality at one point with Alfred Remote. I don’t know if they still do Update: yes, still exists
- zogomoox 5y agoI needed something similar, a reverse 'wake-on-lan' command that shuts down or reboots systems (but could be any kind of action), so I created a telegram bot that presents the list of commands over telegram chat app. I liked that I did not have to open any ports or serve http pages, the bot is really just a script that's long polling the telegram servers via https/json.
- binwiederhier 5y ago> long polling the telegram servers via https/json. That's literally what the ntfy API is, too. Long polling over https, either as JSON or SSE or RAW. Dead simple: https://ntfy.sh/docs/subscribe/api/ https://ntfy.sh/docs/subscribe/api/
- yjftsjthsd-h 5y agoTermux with a shortcut or widget to run a script that runs SSH will do that easily if you can ssh from your phone to computer (so, same LAN or VPNed or such).
- maccard 5y agoIt's not an out of the box solution, and only if you don't mind third party solutions, but firebase has really solid bindings on both android and in python. In less than a day I had an android app that would trigger routines via a python app listening to firebase on my workstation, and send push notifications in response when it was done.