mirror of
https://github.com/nikdoof/dotfiles.git
synced 2025-12-13 09:42:27 +00:00
Add raycast scripts
This commit is contained in:
27
raycast/Documents/Raycast Scripts/wifi.applescript
Executable file
27
raycast/Documents/Raycast Scripts/wifi.applescript
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/osascript
|
||||
|
||||
# @raycast.title Toggle Wi-Fi
|
||||
# @raycast.author Vincent Dörig
|
||||
# @raycast.authorURL https://github.com/vincentdoerig
|
||||
# @raycast.description Toggle your Wi-Fi connection.
|
||||
|
||||
# @raycast.icon images/wifi-dark.png
|
||||
# @raycast.iconDark images/wifi.png
|
||||
# @raycast.mode silent
|
||||
# @raycast.packageName System
|
||||
# @raycast.schemaVersion 1
|
||||
|
||||
# Wi-Fi interface, should normally be either `en0` or `en1`
|
||||
# ⌥ + click the wifi icon in your menu bar to display the Wi-Fi interface name
|
||||
set Interface to "en0"
|
||||
|
||||
set NetworkStatus to (do shell script "networksetup -getairportnetwork " & Interface)
|
||||
if (NetworkStatus contains "off") then
|
||||
# turn Wi-Fi on
|
||||
do shell script "networksetup -setairportpower Interface on"
|
||||
do shell script "echo Wi-Fi turned on"
|
||||
else
|
||||
# turn Wi-Fi off
|
||||
do shell script "networksetup -setairportpower Interface off"
|
||||
do shell script "echo Wi-Fi turned off"
|
||||
end if
|
||||
Reference in New Issue
Block a user