Skip to content

Instantly share code, notes, and snippets.

@ret2src
Created August 29, 2022 08:17
Show Gist options
  • Save ret2src/37045f47d977562503986a740cc4d797 to your computer and use it in GitHub Desktop.
Save ret2src/37045f47d977562503986a740cc4d797 to your computer and use it in GitHub Desktop.
One-liner to toggle bluetooth in bash, using `rfkill` (e.g. for window managers)
if [ "$(rfkill list bluetooth | grep -ic yes)" -ge 1 ]; then rfkill unblock bluetooth; else rfkill block bluetooth; fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment