SkillAgentSearch skills...

Screenhook

Background app to make up for BetterTouchTool's limitations. (eg: Run applescript on click (w/o modifier keys) or when connecting a display)

Install / Use

/learn @steventheworker/Screenhook
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

screenhook

originally made to make up for features BTT lacks like:

  • running applescript when monitor is attached/detached

  • running applescript when you click on a corner

  • running applescript for any click (without modifiers keys held)

  • lets you use 3 fingers to open exposé/mission control/switch spaces w/ 3 finger drag

  • Firefox (new  --vertical tabs support) (my config)

    • cmd+shift+T to reopen tabs AND windows (requires BTT bindings)
    • left-edge of window = sidebar peak
    • twoFingerSwipeFromLeftEdge of trackpad = sidebar peak_
    • top-edge of window = more consistent window dragging (compensate for userChrome.css w/ auto-reveal location bar (prevent drag))

*Note:* best if used w/ the BetterTouchTool triggers included in "steviaOS" (but not required for all features)

"steviaOS" exclusive features:

  • make sure afterBTTLaunched.applescript (steviaOS script) ran, launch DockAltTab after
  • "Spotlight Search.app" will only work with screenhook (dock app to toggle Spotlight / Alfred)

planned features:

  • awareness of spaces
  • applescript definitions - to share space awareness
  • change middle mouse button behavior

startup:

  • waits to run some startup apps (7-14 seconds) that depend on programs that take a bit startup (eg: BetterTouchTool, AltTab & DockAltTab (opens on startup))
  • KeyCastr - set overlay position to {0, 820} (currently hardcoded for m1 air's dimensions (bottom left))
  • QuickShade - uncheck "Enable Shade"

 

using screenhook (for <u>Firefox</u> vertical tabs) without BTT:

<details> <summary>put in (~/.config/karabiner/assets/complex_modifications) </summary>

 

<details> <summary>as toggle-firefox-sidebar.json</summary>
{
	"title": "Rules for Karabiner-Elements | Tested Version: 11.6.0",
	"rules": [
		{
			"description": "Firefox cmd+s => (applescript) toggle the sidebar and tell screenhook it's visiblity",
			"manipulators": [
				{
					"conditions": [
						{
							"bundle_identifiers": ["^org\\.mozilla\\.firefox$"],
							"type": "frontmost_application_if"
						}
					],
					"from": {
						"key_code": "s",
						"modifiers": {
							"mandatory": ["command"]
						}
					},
					"to": [
						{
							"shell_command":
                            "osascript -e 'run script \"'/Users/YOUR_USER_NAME/Desktop/firefox-sidebar-toggle.scpt'\"'"
						}
					],
					"type": "basic"
				}
			]
		}
	]
}
</details> <details> <summary>as toggle-firefox-dev-sidebar.json</summary>
{
	"title": "Rules for Karabiner-Elements | Tested Version: 11.6.0",
	"rules": [
		{
			"description": "Firefox (dev) cmd+s => (applescript) toggle the sidebar and tell screenhook it's visiblity",
			"manipulators": [
				{
					"conditions": [
						{
							"bundle_identifiers": ["^org\\.mozilla\\.firefoxdeveloperedition$"],
							"type": "frontmost_application_if"
						}
					],
					"from": {
						"key_code": "s",
						"modifiers": {
							"mandatory": ["command"]
						}
					},
					"to": [
						{
							"shell_command":
                            "osascript -e 'run script \"'/Users/YOUR_USER_NAME/Desktop/firefox-dev-sidebar-toggle.scpt'\"'"
						}
					],
					"type": "basic"
				}
			]
		}
	]
}
</details>

 

Fix the path in "shell_command" to point at the .scpt

or, if it's on the desktop, just replace "YOUR_USERNAME" in the example string

 

</details>

... then enable in Karabiner-Elements in order to bind Command+S to firefox-sidebar-toggle.scpt / firefox-dev-sidebar-toggle.scpt (save as .scpt w/ Script Editor)

Related Skills

View on GitHub
GitHub Stars11
CategoryDevelopment
Updated4mo ago
Forks1

Languages

Objective-C

Security Score

77/100

Audited on Nov 12, 2025

No findings