From ab6eb0e17c7c3a98066a7755d10a6652dbbf2997 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Sat, 30 Jan 2021 15:30:03 +0000 Subject: [PATCH] Add raycast scripts --- .../Documents/Raycast Scripts/busylight.sh | 26 ++++++++++++++++++ .../move-downloads-to-trash.applescript | 19 +++++++++++++ .../Raycast Scripts/wifi.applescript | 27 +++++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100755 raycast/Documents/Raycast Scripts/busylight.sh create mode 100755 raycast/Documents/Raycast Scripts/move-downloads-to-trash.applescript create mode 100755 raycast/Documents/Raycast Scripts/wifi.applescript diff --git a/raycast/Documents/Raycast Scripts/busylight.sh b/raycast/Documents/Raycast Scripts/busylight.sh new file mode 100755 index 0000000..30a0797 --- /dev/null +++ b/raycast/Documents/Raycast Scripts/busylight.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# Required parameters: +# @raycast.schemaVersion 1 +# @raycast.title Set busylight status +# @raycast.mode silent +# @raycast.packageName Browsing + +# Optional parameters: +# @raycast.icon 🚦 + +# Documentation: +# @raycast.author Andrew Williams +# @raycast.authorURL https://github.com/nikdoof +# @raycast.description Sets your busylight status + +# @raycast.argument1 { "type": "text", "placeholder": "available" } + +status=$1 + +curl -s "http://10.101.2.167/${status}" > /dev/null +if [[ $? -ne 0 ]]; then + echo "Something went wrong!" +else + echo "Done!" +fi \ No newline at end of file diff --git a/raycast/Documents/Raycast Scripts/move-downloads-to-trash.applescript b/raycast/Documents/Raycast Scripts/move-downloads-to-trash.applescript new file mode 100755 index 0000000..ef66d24 --- /dev/null +++ b/raycast/Documents/Raycast Scripts/move-downloads-to-trash.applescript @@ -0,0 +1,19 @@ +#!/usr/bin/osascript + +# Required parameters: +# @raycast.author Jax0rz +# @authorURL https://github.com/Jax0rz +# @raycast.schemaVersion 1 +# @raycast.title Move Downloads to Trash +# @raycast.mode silent +# @raycast.packageName System +# @raycast.needsConfirmation true + +# Optional parameters: +# @raycast.icon images/move-downloads-to-trash.png + +tell application "Finder" + set allDownloads to every item of folder (path to downloads folder as text) + move allDownloads to trash + log "" +end tell diff --git a/raycast/Documents/Raycast Scripts/wifi.applescript b/raycast/Documents/Raycast Scripts/wifi.applescript new file mode 100755 index 0000000..a713c94 --- /dev/null +++ b/raycast/Documents/Raycast Scripts/wifi.applescript @@ -0,0 +1,27 @@ +#!/usr/bin/osascript + +# @raycast.title Toggle Wi-Fi +# @raycast.author Vincent Dörig +# @raycast.authorURL https://github.com/vincentdoerig +# @raycast.description Toggle your Wi-Fi connection. + +# @raycast.icon images/wifi-dark.png +# @raycast.iconDark images/wifi.png +# @raycast.mode silent +# @raycast.packageName System +# @raycast.schemaVersion 1 + +# Wi-Fi interface, should normally be either `en0` or `en1` +# ⌥ + click the wifi icon in your menu bar to display the Wi-Fi interface name +set Interface to "en0" + +set NetworkStatus to (do shell script "networksetup -getairportnetwork " & Interface) +if (NetworkStatus contains "off") then + # turn Wi-Fi on + do shell script "networksetup -setairportpower Interface on" + do shell script "echo Wi-Fi turned on" +else + # turn Wi-Fi off + do shell script "networksetup -setairportpower Interface off" + do shell script "echo Wi-Fi turned off" +end if