Last active
June 24, 2023 21:49
-
-
Save miraculixx/b32d0fc9f5df2fbcb94e39212f6cef14 to your computer and use it in GitHub Desktop.
CloudFlare WARP toggle and desktop notification
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# cloudflare warp | |
# https://developers.cloudflare.com/warp-client/get-started/linux/ | |
# see https://1.1.1.1/ | |
# Panel Icon: /bin/bash -ic ".$HOME/.bashrc.ext;warp toggle" | |
warp() { | |
case $1 in | |
on) | |
warp-cli connect | |
;; | |
off) | |
warp-cli disconnect | |
;; | |
trace) | |
google-chrome https://cloudflare.com/cdn-cgi/trace | |
;; | |
toggle) | |
warp-cli status | grep Connected && warp-cli disconnect || warp-cli connect | |
;; | |
*) | |
echo "Usage: warp on|off" | |
;; | |
esac | |
status=$(warp-cli status) | |
echo "Status: $status" | |
notify-send "warp $status" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment