KoleksiMu6 Juni 2026
Kode

── 6. Register the service ───────────────────────────────────────────────────

Script bash untuk mengatur Ghostty sebagai default handler file .command dan menginstal Finder Quick Action di macOS untuk membuka Claude Code.

6 Juni 2026
done</string>
          <key>CheckedForUserDefaultShell</key>
          <true/>
          <key>inputMethod</key>
          <integer>1</integer>
          <key>shell</key>
          <string>/bin/bash</string>
          <key>source</key>
          <string></string>
        </dict>
        <key>BundleIdentifier</key>
        <string>com.apple.RunShellScript</string>
        <key>CFBundleVersion</key>
        <string>2.0.3</string>
        <key>CanShowSelectedItemsWhenRun</key>
        <false/>
        <key>CanShowWhenRun</key>
        <true/>
        <key>Category</key>
        <array>
          <string>AMCategoryUtilities</string>
        </array>
        <key>Class Name</key>
        <string>RunShellScriptAction</string>
        <key>InputUUID</key>
        <string>A1B2C3D4-E5F6-7890-ABCD-EF1234567890</string>
        <key>Keywords</key>
        <array>
          <string>Shell</string>
          <string>Script</string>
          <string>Command</string>
          <string>Run</string>
          <string>Unix</string>
        </array>
        <key>OutputUUID</key>
        <string>B2C3D4E5-F6A7-8901-BCDE-F12345678901</string>
        <key>UUID</key>
        <string>C3D4E5F6-A7B8-9012-CDEF-123456789012</string>
        <key>UnlockPlugin</key>
        <false/>
        <key>arguments</key>
        <dict/>
        <key>isViewVisible</key>
        <integer>1</integer>
        <key>location</key>
        <string>309.500000:253.000000</string>
        <key>nibPath</key>
        <string>/System/Library/Automator/Run Shell Script.action/Contents/Resources/English.lproj/main.nib</string>
      </dict>
      <key>isViewVisible</key>
      <integer>1</integer>
    </dict>
  </array>
  <key>connectors</key>
  <dict/>
  <key>workflowMetaData</key>
  <dict>
    <key>serviceApplicationBundleID</key>
    <string>com.apple.finder</string>
    <key>serviceApplicationPath</key>
    <string>/System/Library/CoreServices/Finder.app</string>
    <key>serviceInputTypeIdentifier</key>
    <string>com.apple.Automator.fileSystemObject.folder</string>
    <key>serviceOutputTypeIdentifier</key>
    <string>com.apple.Automator.nothing</string>
    <key>serviceProcessesInput</key>
    <integer>0</integer>
    <key>workflowTypeIdentifier</key>
    <string>com.apple.Automator.servicesMenu</string>
  </dict>
</dict>
</plist>
WFLOW

# ── 6. Register the service ───────────────────────────────────────────────────
/System/Library/CoreServices/pbs -update || true
automator "${SERVICE_PATH}" >/dev/null 2>&1 || true
killall Finder >/dev/null 2>&1 || true

echo ""
echo "Done."
echo ""
echo "Ghostty is now the default handler for .command files."
echo ""
echo "Finder Quick Action installed:"
echo "  Right-click any folder → Quick Actions → Launch Claude Code here"
echo ""
echo "The Quick Action:"
echo "  - opens Ghostty in the selected folder"
echo "  - runs Claude Code"
echo "  - wraps Claude Code with caffeinate so macOS does not sleep mid-session"
echo ""
echo "VS Code setting:"
echo '  "terminal.external.osxExec": "Ghostty.app"'
echo ""
echo "Uninstall Quick Action:"
echo "  rm -rf \"${SERVICE_PATH}\""
echo "  /System/Library/CoreServices/pbs -update"
echo "  killall Finder"
EOF

chmod +x ~/ghostty-set-default.sh
~/ghostty-set-default.sh
#bash#macos#automator#ghostty#quick-action