From 4fc054522bae1f37f8ece7200ad52a637be56fd1 Mon Sep 17 00:00:00 2001 From: abearxiong Date: Sat, 16 Aug 2025 21:50:47 +0800 Subject: [PATCH] update --- applescript/close-all-finder.applescript | 17 ++++++++++++++++ applescript/minimize-all-windows.applescript | 18 +++++++++++++++++ applescript/shutdown.applescript | 15 ++++++++++++++ sh/kill-process.sh | 18 +++++++++++++++++ sh/open-image-from-clipboard.sh | 21 ++++++++++++++++++++ sh/restart-dock.sh | 19 ++++++++++++++++++ sh/restart-finder.sh | 19 ++++++++++++++++++ 7 files changed, 127 insertions(+) create mode 100755 applescript/close-all-finder.applescript create mode 100755 applescript/minimize-all-windows.applescript create mode 100755 applescript/shutdown.applescript create mode 100755 sh/kill-process.sh create mode 100755 sh/open-image-from-clipboard.sh create mode 100755 sh/restart-dock.sh create mode 100755 sh/restart-finder.sh diff --git a/applescript/close-all-finder.applescript b/applescript/close-all-finder.applescript new file mode 100755 index 0000000..3543bea --- /dev/null +++ b/applescript/close-all-finder.applescript @@ -0,0 +1,17 @@ +#!/usr/bin/osascript + +# Required parameters: +# @raycast.schemaVersion 1 +# @raycast.title Close All Finder Windows +# @raycast.mode silent +# @raycast.packageName System + +# Optional parameters: +# @raycast.icon 🗂️ + +# Documentation: +# @raycast.description Closes all open Finder windows. + +tell application "Finder" + close every window +end tell diff --git a/applescript/minimize-all-windows.applescript b/applescript/minimize-all-windows.applescript new file mode 100755 index 0000000..ce41f0a --- /dev/null +++ b/applescript/minimize-all-windows.applescript @@ -0,0 +1,18 @@ +#!/usr/bin/osascript + +# Required parameters: +# @raycast.schemaVersion 1 +# @raycast.title Minimize All Windows +# @raycast.mode silent + +# Optional parameters: +# @raycast.icon images/minimize-window.png +# @raycast.packageName System +# Documentation: +# @raycast.author Ernest Ojeh +# @raycast.authorURL https://github.com/namzo +# @raycast.description This script minimizes all windows of currently running apps + +tell application "System Events" + keystroke "hm" using {command down, option down} +end tell \ No newline at end of file diff --git a/applescript/shutdown.applescript b/applescript/shutdown.applescript new file mode 100755 index 0000000..9af697f --- /dev/null +++ b/applescript/shutdown.applescript @@ -0,0 +1,15 @@ +#!/usr/bin/osascript + +# Required parameters: +# @raycast.schemaVersion 1 +# @raycast.title Shut Down +# @raycast.mode silent +# @raycast.packageName System + +# Optional parameters: +# @raycast.icon 🛌 + +# Documentation: +# @raycast.description Shuts down computer. + +tell application "Finder" to shut down diff --git a/sh/kill-process.sh b/sh/kill-process.sh new file mode 100755 index 0000000..49d5dd0 --- /dev/null +++ b/sh/kill-process.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# Required parameters: +# @raycast.schemaVersion 1 +# @raycast.title Kill Running Process +# @raycast.mode silent +# @raycast.packageName System +# +# Optional parameters: +# @raycast.icon ⚠️ +# @raycast.argument1 { "type": "text", "placeholder": "process name" } + +# Documentation: +# @raycast.description Force kill a running process +# @raycast.author Gustavo Santana +# @raycast.authorURL https://github.com/gumadeiras + +pkill -9 "$1" \ No newline at end of file diff --git a/sh/open-image-from-clipboard.sh b/sh/open-image-from-clipboard.sh new file mode 100755 index 0000000..affb7cd --- /dev/null +++ b/sh/open-image-from-clipboard.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Dependency: `brew install pngpaste coreutils` +# pngpaste required to grab image from clipboard +# coreutils required to create temp file with suffix + +# Required parameters: +# @raycast.schemaVersion 1 +# @raycast.title Open Image +# @raycast.mode compact + +# Optional parameters: +# @raycast.icon 📋 +# @raycast.packageName Clipboard + +# Documentation: +# @raycast.description Open Image from Clipboard in Preview for OCR or other purposes. +# @raycast.author xxchan +# @raycast.authorURL https://github.com/xxchan + +tempfile=$(gmktemp --suffix=.png) && pngpaste $tempfile && open $tempfile diff --git a/sh/restart-dock.sh b/sh/restart-dock.sh new file mode 100755 index 0000000..fd75a69 --- /dev/null +++ b/sh/restart-dock.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# Required parameters: +# @raycast.schemaVersion 1 +# @raycast.title Restart the Dock +# @raycast.mode silent +# @raycast.packageName System + +# Optional parameters: +# @raycast.icon 💀 +# @raycast.author Jordi Clement +# @raycast.authorURL https://github.com/jordicl + +# Documentation: +# @raycast.description Restart the Dock + +killall Dock + +echo "Restarted the Dock" diff --git a/sh/restart-finder.sh b/sh/restart-finder.sh new file mode 100755 index 0000000..6987966 --- /dev/null +++ b/sh/restart-finder.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# Required parameters: +# @raycast.schemaVersion 1 +# @raycast.title Restart the Finder +# @raycast.mode silent +# @raycast.packageName System + +# Optional parameters: +# @raycast.icon 💀 +# @raycast.author Jordi Clement +# @raycast.authorURL https://github.com/jordicl + +# Documentation: +# @raycast.description Restart the Finder + +killall Finder + +echo "Restarted the Finder"