Skip to content

Instantly share code, notes, and snippets.

@miraculixx
Last active June 24, 2023 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miraculixx/b32d0fc9f5df2fbcb94e39212f6cef14 to your computer and use it in GitHub Desktop.
Save miraculixx/b32d0fc9f5df2fbcb94e39212f6cef14 to your computer and use it in GitHub Desktop.
CloudFlare WARP toggle and desktop notification
#!/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