From 66fe9ab87e86baafc8fed2a2ba275431a998c6b3 Mon Sep 17 00:00:00 2001 From: Andrii Barabash Date: Mon, 10 Mar 2025 00:16:14 +0100 Subject: [PATCH 1/3] Added sleep timer script command --- commands/system/sleep-timer.applescript | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 commands/system/sleep-timer.applescript diff --git a/commands/system/sleep-timer.applescript b/commands/system/sleep-timer.applescript new file mode 100755 index 000000000..8cd9ae4ee --- /dev/null +++ b/commands/system/sleep-timer.applescript @@ -0,0 +1,22 @@ +#!/usr/bin/osascript + +# Required parameters: +# @raycast.schemaVersion 1 +# @raycast.title Sleep Timer +# @raycast.mode silent +# @raycast.description Put your Mac to sleep (in X minutes). +# @raycast.packageName System + +# Optional parameters: +# @raycast.icon 😴 +# @raycast.argument1 { "optional": true, "type": "text", "placeholder": "(in) minutes" } + +# Documentation: +# @raycast.author AndriiBarabash +# @raycast.authorURL https://github.com/AndriiBarabash + +on run argv + delay (item 1 of argv) * 60 + tell application "Finder" to sleep +end run + From 975739cda9cf173078e515124aff59a54ebcf782 Mon Sep 17 00:00:00 2001 From: Andrii Barabash Date: Sat, 27 Sep 2025 20:40:28 +0200 Subject: [PATCH 2/3] Added SSH Tunnel SOCKS Proxy script command --- .../toggle_ssh_proxy_tunnel.template.sh | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 commands/developer-utils/toggle_ssh_proxy_tunnel.template.sh diff --git a/commands/developer-utils/toggle_ssh_proxy_tunnel.template.sh b/commands/developer-utils/toggle_ssh_proxy_tunnel.template.sh new file mode 100644 index 000000000..c5fc15793 --- /dev/null +++ b/commands/developer-utils/toggle_ssh_proxy_tunnel.template.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +# Raycast Script Command +# +# Required parameters: +# @raycast.schemaVersion 1 +# @raycast.title Toggle SSH SOCKS Tunnel +# @raycast.mode silent +# +# Optional parameters: +# @raycast.icon 🔒 +# @raycast.packageName developer-utils +# +# Documentation: +# @raycast.description Toggles an SSH SOCKS proxy tunnel on and off. +# @raycast.author Andrii Barabash +# @raycast.authorURL https://github.com/AndriiBarabash + +# --- Configuration --- +# Replace these with your own values +SSH_USER="" +SSH_HOST="" +SSH_PORT="" +INTERFACE="" # e.g., "Wi-Fi" or "Ethernet" +PROXY_PORT="" # e.g., 1080 +# --- End Configuration --- + +if pgrep -f "ssh -D $PROXY_PORT" >/dev/null; then + echo "SSH SOCKS tunnel is running. Turning it off..." + + # Kill the SSH process + pkill -f "ssh -D $PROXY_PORT" + + # Disable the SOCKS proxy + networksetup -setsocksfirewallproxystate "$INTERFACE" off + + echo "Tunnel and proxy disabled." +else + echo "SSH SOCKS tunnel is not running. Turning it on..." + + # Start the SSH tunnel + ssh -D "$PROXY_PORT" -f -C -q -N -p "$SSH_PORT" "$SSH_USER"@"$SSH_HOST" + + # Enable the SOCKS proxy + networksetup -setsocksfirewallproxy "$INTERFACE" 127.0.0.1 "$PROXY_PORT" + networksetup -setsocksfirewallproxystate "$INTERFACE" on + + echo "Tunnel and proxy enabled." +fi From 589b4494970952441558120dbe710751dcab6b9c Mon Sep 17 00:00:00 2001 From: Andrii Barabash Date: Sat, 27 Sep 2025 20:44:06 +0200 Subject: [PATCH 3/3] Added SSH Tunnel SOCKS Proxy script command --- commands/developer-utils/toggle_ssh_proxy_tunnel.template.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/developer-utils/toggle_ssh_proxy_tunnel.template.sh b/commands/developer-utils/toggle_ssh_proxy_tunnel.template.sh index c5fc15793..80f8e054d 100644 --- a/commands/developer-utils/toggle_ssh_proxy_tunnel.template.sh +++ b/commands/developer-utils/toggle_ssh_proxy_tunnel.template.sh @@ -9,7 +9,7 @@ # # Optional parameters: # @raycast.icon 🔒 -# @raycast.packageName developer-utils +# @raycast.packageName Developer Utilities # # Documentation: # @raycast.description Toggles an SSH SOCKS proxy tunnel on and off.