-
-
Notifications
You must be signed in to change notification settings - Fork 921
Shortcuts Integration Workaround
Peter Schwier edited this page Jul 9, 2023
·
2 revisions
While iSH doesn't have direct integration with Apple's Shortcuts, you can get very close using a few tools.
- The Files app integration so that Shortcuts can write files into the iSH file system. https://github.com/ish-app/ish/wiki/View-iSH-files-in-Files-App
- The instructions for running an SSH server. https://github.com/ish-app/ish/wiki/Running-an-SSH-server
- Create a
~/.profile
file that launches the SSH server. - Create a Shortcut that puts together the following steps.
- The Scripting "Open App" step to launch iSH.
- The Scripting "Wait" step to give the SSH server enough time to start.
- The Scripting "Run Script Over SSH" step to execute code in the iSH instance.
- A step to switch away from the iSH app. (Since iSH is no longer in front, the SSH server stops.
Also, if you want an iSH service to continue running the background, you can use location tracking to get iSH to continue running. https://github.com/ish-app/ish/wiki/Running-in-background
Create a script with the name ~/.ish-background
with the following contents and then launch the script using . ~/.ish-background
using the Scripting "Run Script Over SSH". When you are doing using the background process, you can just delete the file and wait a minute for the location tracking to time out.
# Launch a command to track the GPS location
cat /dev/location > /dev/null &
# Save the Process ID so you can kill it later
export BACKGROUND_PID=$!
# Use ( ... ) & to start a subshell in the background
(
# For the numbers 1 to 60, repeat checking for the current file
for i in $(seq 1 60); do
# If the file still exists
if [[ -f ~/.ish-background ]]; then
# Then wait for the next minute.
sleep 60
fi
done
# After one hour (60 minutes/hour * 60 seconds/minute),
# or after the file stop existing. Then kill the process,
# that is checking for location.
kill $BACKGROUND_PID
) &
- Contributing to iSH Development
- How to add a new Character Device to iSH
- How to add a new entry to /proc/ish
- Fixing hostname localhost
- Running nmap
- Running Ruby Programs
- Installing PHP with a TLS certificate and a PHP filemanager
- Installing R and any package from the CRAN
- iSH Alpine Release Issues
- Using Alpine Linux repositories
- Upgrading to a new release
- Install & Activate Alternate Filesystems