Guest User

lightspeed blocker

a guest
Sep 10th, 2025
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. # Function to show a pop-up message requiring manual dismissal
  4. show_popup() {
  5. osascript <<EOF
  6. tell application "System Events"
  7. display dialog "$1" with title "Faster Than Light" buttons {"OK"} default button "OK"
  8. end tell
  9. EOF
  10. }
  11.  
  12. # Function to show a macOS notification
  13. show_notification() {
  14. osascript -e "display notification \"$1\" with title \"Faster Than Light\""
  15. }
  16.  
  17. # Function to display a dialog box and capture user selection
  18. show_menu() {
  19. osascript <<EOF
  20. tell application "System Events"
  21. set userChoice to button returned of (display dialog "What would you like to do?" with title "Faster Than Light" buttons {"Disable Lightspeed", "Enable Lightspeed", "Exit"} default button "Disable Lightspeed")
  22. end tell
  23. return userChoice
  24. EOF
  25. }
  26.  
  27. # Show the main menu and capture the response
  28. response=$(show_menu)
  29.  
  30. # Handle user selection
  31. case $response in
  32. "Disable Lightspeed")
  33. show_notification "Disabling Lightspeed services..."
  34. /Applications/Lightspeed\ Agent.app/Contents/MacOS/Lightspeed\ Agent -h
  35. sleep 2
  36. show_notification "Stopping Lightspeed services..."
  37. launchctl unload /Library/LaunchDaemons/com.lightspeedsystems.*
  38. sleep 2
  39. show_popup "🔔✓ Lightspeed has been successfully disabled."
  40. ;;
  41. "Enable Lightspeed")
  42. show_notification "Starting Lightspeed services..."
  43. /Applications/Lightspeed\ Agent.app/Contents/MacOS/Lightspeed\ Agent & agent_pid="$!"
  44. sleep 3
  45. show_notification "Configuring Lightspeed services..."
  46. kill -9 $agent_pid
  47. launchctl start /Library/LaunchDaemons/com.lightspeedsystems.*
  48. sleep 2
  49. show_popup "🔔✓ Lightspeed has been enabled. Please restart for full effect."
  50. ;;
  51. "Exit")
  52. show_notification "Exiting program..."
  53. show_popup "Exiting program. No changes made."
  54. exit 0
  55. ;;
  56. *)
  57. show_notification "Invalid option selected. Exiting."
  58. exit 1
  59. ;;
  60. esac
  61.  
Advertisement
Add Comment
Please, Sign In to add comment