From 83abef8540b4ed52a2d978524562d8ded56c788f Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Mon, 16 Mar 2020 16:01:04 -0400 Subject: [PATCH] ENH don't use the togglebt script --- bin/xmonad.hs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/xmonad.hs b/bin/xmonad.hs index db3305f..6916cbb 100644 --- a/bin/xmonad.hs +++ b/bin/xmonad.hs @@ -436,9 +436,14 @@ runVolumeUp = void (raiseVolume 2) runVolumeMute :: X () runVolumeMute = void toggleMute --- TODO write this in haskell +-- TODO make a formatter for the notify command runToggleBluetooth :: X () -runToggleBluetooth = spawn "togglebt" +runToggleBluetooth = spawn + $ "bluetoothctl show | grep -q \"Powered: no\"" + #!&& "a=on" + #!|| "a=off" + #!>> formatCmd "bluetoothctl" ["power", "$a", ">", "/dev/null"] + #!&& formatCmd "notify-send" ["\"bluetooth powered $a\""] -- TODO write these in haskell runIncBacklight :: X ()