Skip to content

Commit

Permalink
fix bluetooth toggle issue
Browse files Browse the repository at this point in the history
  • Loading branch information
nate-parrott committed Mar 26, 2015
1 parent 2d906f8 commit 76a1bbe
Showing 1 changed file with 24 additions and 23 deletions.
47 changes: 24 additions & 23 deletions PluginDirectories/1/wireless-toggles.bundle/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,32 @@
import i18n

def run(cmd):
os.system(cmd)
os.system(cmd)

def results(parsed, original_query):
#Wi-Fi
if ("wifi_on" in parsed):
return {
"title": i18n.localstr('Turn Wi-Fi On'),
"run_args": ["networksetup -setairportpower en0 on"]
}
#Wi-Fi
if ("wifi_on" in parsed):
return {
"title": i18n.localstr('Turn Wi-Fi On'),
"run_args": ["networksetup -setairportpower en0 on"]
}

if ("wifi_off" in parsed):
return {
"title": i18n.localstr('Turn Wi-Fi Off'),
"run_args": ["networksetup -setairportpower en0 off"]
}
if ("wifi_off" in parsed):
return {
"title": i18n.localstr('Turn Wi-Fi Off'),
"run_args": ["networksetup -setairportpower en0 off"]
}

#Bluetooth
if ("bluetooth_on" in parsed):
return {
"title": i18n.localstr('Turn Bluetooth On'),
"run_args": ["./blueutil on"]
}
#Bluetooth
if ("bluetooth_on" in parsed):
os.system("chmod +x blueutil") # it'll be un-executable after unzipping
return {
"title": i18n.localstr('Turn Bluetooth On'),
"run_args": ["./blueutil on"]
}

if ("bluetooth_off" in parsed):
return {
"title": i18n.localstr('Turn Bluetooth Off'),
"run_args": ["./blueutil off"]
}
if ("bluetooth_off" in parsed):
return {
"title": i18n.localstr('Turn Bluetooth Off'),
"run_args": ["./blueutil off"]
}

0 comments on commit 76a1bbe

Please sign in to comment.