From 9fa15a26a5b4399b36264cf0969b35460daa5ac9 Mon Sep 17 00:00:00 2001 From: Sam Al-Sapti Date: Mon, 4 Jul 2022 17:14:15 +0200 Subject: [PATCH] Add bt() --- zsh/.config/zsh/functions.zsh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/zsh/.config/zsh/functions.zsh b/zsh/.config/zsh/functions.zsh index 37abaf3..c5f7166 100644 --- a/zsh/.config/zsh/functions.zsh +++ b/zsh/.config/zsh/functions.zsh @@ -1,3 +1,15 @@ +bt() { + (( ${+commands[bluetoothctl]} )) || return 1 + + if [[ $1 == on ]]; then + connmanctl enable bluetooth + elif [[ $1 == off ]]; then + connmanctl disable bluetooth + else + bluetoothctl "$@" + fi +} + doasedit() { (( ${+commands[doas]} )) || return 1