reenable BT mouse connection from new tab in shell
This commit is contained in:
23
dot_scripts/connectmouse.applescript
Normal file
23
dot_scripts/connectmouse.applescript
Normal file
@ -0,0 +1,23 @@
|
||||
activate application "SystemUIServer"
|
||||
tell application "System Events"
|
||||
tell process "SystemUIServer"
|
||||
-- Working CONNECT Script. Goes through the following:
|
||||
-- Clicks on Bluetooth Menu (OSX Top Menu Bar)
|
||||
-- => Clicks on device Item
|
||||
-- => Clicks on Connect Item
|
||||
set btMenu to (menu bar item 1 of menu bar 1 whose description contains "bluetooth")
|
||||
tell btMenu
|
||||
click
|
||||
tell (menu item "Souris de Morgan" of menu 1)
|
||||
click
|
||||
if exists menu item "Connecter" of menu 1 then
|
||||
click menu item "Connecter" of menu 1
|
||||
return "Connecting..."
|
||||
else
|
||||
key code 53 -- Close main BT drop down if Connect wasn't present
|
||||
return "Connect menu was not found, are you already connected?"
|
||||
end if
|
||||
end tell
|
||||
end tell
|
||||
end tell
|
||||
end tell
|
5
dot_scripts/resume.sh
Executable file
5
dot_scripts/resume.sh
Executable file
@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
scriptfile=./connectmouse.applescript
|
||||
parentdir=$(dirname -- "$0")
|
||||
osascript "${parentdir}/${scriptfile}"
|
||||
|
Reference in New Issue
Block a user