Skip to content

Instantly share code, notes, and snippets.

@parties
Last active August 23, 2021 18:36

Revisions

  1. parties revised this gist Aug 23, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion toggle_bluetooth.scpt
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@
    -- blueutil v2.9.0+ (brew install blueutil); may work with earlier versions, haven't tested

    -- save this under ~/Library/Scripts and refresh your user scripts in Quicksilver for this to appear
    -- you can create a trigger in Quicksilver to run this script on a keyboard shortcut, such as: ⌘⌥^ + B
    -- you can create a trigger to run this script on a keyboard shortcut, such as: ⌘⌥^ + B

    -- save local path to blueutil executable
    set blueutil to "/usr/local/bin/blueutil"
  2. parties revised this gist Aug 23, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion toggle_bluetooth.scpt
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@
    -- blueutil v2.9.0+ (brew install blueutil); may work with earlier versions, haven't tested

    -- save this under ~/Library/Scripts and refresh your user scripts in Quicksilver for this to appear
    -- you can create a trigger in Quicksilver to run this script when I press: ⌘⌥^ + B
    -- you can create a trigger in Quicksilver to run this script on a keyboard shortcut, such as: ⌘⌥^ + B

    -- save local path to blueutil executable
    set blueutil to "/usr/local/bin/blueutil"
  3. parties created this gist Aug 23, 2021.
    18 changes: 18 additions & 0 deletions toggle_bluetooth.scpt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    -- Requirements:
    -- blueutil v2.9.0+ (brew install blueutil); may work with earlier versions, haven't tested

    -- save this under ~/Library/Scripts and refresh your user scripts in Quicksilver for this to appear
    -- you can create a trigger in Quicksilver to run this script when I press: ⌘⌥^ + B

    -- save local path to blueutil executable
    set blueutil to "/usr/local/bin/blueutil"

    -- get current power status and save it to variable
    set statusResult to do shell script blueutil & " -p"

    -- toggle power status
    if statusResult is "1" then
    do shell script blueutil & " -p 0"
    else if statusResult is "0" then
    do shell script blueutil & " -p 1"
    end if