mirror of
https://github.com/tw93/Mole.git
synced 2026-02-05 13:48:48 +00:00
Support the quick use of Raycast, Alfred and Shortcuts
This commit is contained in:
10
README.md
10
README.md
@@ -62,6 +62,16 @@ mo --version # Show installed version
|
||||
- Protect caches with `mo clean --whitelist`; defaults cover Playwright, HuggingFace, and Maven paths.
|
||||
- Use `mo touchid` to approve sudo with Touch ID instead of typing your password.
|
||||
|
||||
## Quick Launchers
|
||||
|
||||
Install Raycast integration with one command:
|
||||
|
||||
```bash
|
||||
curl -fsSL https://raw.githubusercontent.com/tw93/mole/main/integrations/setup-raycast.sh | bash
|
||||
```
|
||||
|
||||
For Alfred and macOS Shortcuts, see [integrations/README.md](integrations/README.md).
|
||||
|
||||
## Features in Detail
|
||||
|
||||
### Deep System Cleanup
|
||||
|
||||
43
integrations/README.md
Normal file
43
integrations/README.md
Normal file
@@ -0,0 +1,43 @@
|
||||
# Mole Integrations
|
||||
|
||||
Quick launcher integrations for Mole.
|
||||
|
||||
## Raycast
|
||||
|
||||
One command install:
|
||||
|
||||
```bash
|
||||
curl -fsSL https://raw.githubusercontent.com/tw93/Mole/main/integrations/setup-raycast.sh | bash
|
||||
```
|
||||
|
||||
Then open Raycast and search "Reload Script Commands".
|
||||
|
||||
Available commands: `clean mac`, `dry run`, `uninstall apps`
|
||||
|
||||
## Alfred
|
||||
|
||||
Add a workflow with keyword `clean` and script:
|
||||
|
||||
```bash
|
||||
mo clean
|
||||
```
|
||||
|
||||
For dry-run: `mo clean --dry-run`
|
||||
|
||||
For uninstall: `mo uninstall`
|
||||
|
||||
## macOS Shortcuts
|
||||
|
||||
Create a shortcut with "Run Shell Script":
|
||||
|
||||
```bash
|
||||
mo clean
|
||||
```
|
||||
|
||||
Then add to Menu Bar or assign a keyboard shortcut.
|
||||
|
||||
## Uninstall
|
||||
|
||||
```bash
|
||||
rm -rf ~/Library/Application\ Support/Raycast/script-commands/mole-*.sh
|
||||
```
|
||||
32
integrations/raycast/mole-clean-dry-run.sh
Executable file
32
integrations/raycast/mole-clean-dry-run.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Required parameters:
|
||||
# @raycast.schemaVersion 1
|
||||
# @raycast.title Clean Mac (Dry Run)
|
||||
# @raycast.mode fullOutput
|
||||
# @raycast.packageName Mole
|
||||
|
||||
# Optional parameters:
|
||||
# @raycast.icon 👀
|
||||
# @raycast.needsConfirmation false
|
||||
|
||||
# Documentation:
|
||||
# @raycast.description Preview what Mole would clean without making changes
|
||||
# @raycast.author tw93
|
||||
# @raycast.authorURL https://github.com/tw93/Mole
|
||||
|
||||
# Detect mo/mole installation
|
||||
if command -v mo >/dev/null 2>&1; then
|
||||
MO_BIN="mo"
|
||||
elif command -v mole >/dev/null 2>&1; then
|
||||
MO_BIN="mole"
|
||||
else
|
||||
echo "❌ Mole not found. Install from:"
|
||||
echo " https://github.com/tw93/Mole"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Run dry-run
|
||||
echo "👀 Previewing cleanup..."
|
||||
echo ""
|
||||
"$MO_BIN" clean --dry-run
|
||||
32
integrations/raycast/mole-clean.sh
Executable file
32
integrations/raycast/mole-clean.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Required parameters:
|
||||
# @raycast.schemaVersion 1
|
||||
# @raycast.title Clean Mac
|
||||
# @raycast.mode fullOutput
|
||||
# @raycast.packageName Mole
|
||||
|
||||
# Optional parameters:
|
||||
# @raycast.icon 🐹
|
||||
# @raycast.needsConfirmation true
|
||||
|
||||
# Documentation:
|
||||
# @raycast.description Deep clean your Mac using Mole
|
||||
# @raycast.author tw93
|
||||
# @raycast.authorURL https://github.com/tw93/Mole
|
||||
|
||||
# Detect mo/mole installation
|
||||
if command -v mo >/dev/null 2>&1; then
|
||||
MO_BIN="mo"
|
||||
elif command -v mole >/dev/null 2>&1; then
|
||||
MO_BIN="mole"
|
||||
else
|
||||
echo "❌ Mole not found. Install from:"
|
||||
echo " https://github.com/tw93/Mole"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Run cleanup
|
||||
echo "🐹 Starting cleanup..."
|
||||
echo ""
|
||||
"$MO_BIN" clean
|
||||
32
integrations/raycast/mole-uninstall.sh
Executable file
32
integrations/raycast/mole-uninstall.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Required parameters:
|
||||
# @raycast.schemaVersion 1
|
||||
# @raycast.title Uninstall Apps
|
||||
# @raycast.mode fullOutput
|
||||
# @raycast.packageName Mole
|
||||
|
||||
# Optional parameters:
|
||||
# @raycast.icon 🗑️
|
||||
# @raycast.needsConfirmation true
|
||||
|
||||
# Documentation:
|
||||
# @raycast.description Completely uninstall apps using Mole
|
||||
# @raycast.author tw93
|
||||
# @raycast.authorURL https://github.com/tw93/Mole
|
||||
|
||||
# Detect mo/mole installation
|
||||
if command -v mo >/dev/null 2>&1; then
|
||||
MO_BIN="mo"
|
||||
elif command -v mole >/dev/null 2>&1; then
|
||||
MO_BIN="mole"
|
||||
else
|
||||
echo "❌ Mole not found. Install from:"
|
||||
echo " https://github.com/tw93/Mole"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Run uninstall
|
||||
echo "🗑️ Starting app uninstaller..."
|
||||
echo ""
|
||||
"$MO_BIN" uninstall
|
||||
31
integrations/setup-raycast.sh
Executable file
31
integrations/setup-raycast.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
# One-line Raycast integration installer
|
||||
# Usage: curl -fsSL https://raw.githubusercontent.com/tw93/Mole/main/integrations/setup-raycast.sh | bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
NC='\033[0m'
|
||||
|
||||
RAYCAST_DIR="$HOME/Library/Application Support/Raycast/script-commands"
|
||||
BASE_URL="https://raw.githubusercontent.com/tw93/Mole/main/integrations/raycast"
|
||||
|
||||
# Check Raycast
|
||||
if [[ ! -d "$HOME/Library/Application Support/Raycast" ]]; then
|
||||
echo -e "${YELLOW}Raycast not found. Install from: https://raycast.com${NC}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Installing Mole commands for Raycast..."
|
||||
mkdir -p "$RAYCAST_DIR"
|
||||
|
||||
# Download scripts
|
||||
for script in mole-clean.sh mole-clean-dry-run.sh mole-uninstall.sh; do
|
||||
curl -fsSL "$BASE_URL/$script" -o "$RAYCAST_DIR/$script"
|
||||
chmod +x "$RAYCAST_DIR/$script"
|
||||
done
|
||||
|
||||
echo -e "${GREEN}✓${NC} Installed! Open Raycast and search: 'Reload Script Commands'"
|
||||
echo ""
|
||||
echo "Then search for: 'Clean Mac'"
|
||||
Reference in New Issue
Block a user