vegardinho / alfred_bluetooth_controller

Alfred workflow for managing bluetooth settings and -connections
MIT License
95 stars 7 forks source link

Add a warning dialogue before turning off bluetooth at iMacs and Mac Minis #6

Closed chrisgrieser closed 3 years ago

chrisgrieser commented 3 years ago

When you try to turn off bluetooth at an Mac which does not have its build-in keyboard or Trackpad (e.g. the iMac), Mac OS shows you a warning. It is actually useful to have this, as accidentally turning off bluetooth on those devices would be a hassle as need to connect a mouse to the via cable to turn it on again (which you cannot use the Magic Mouse for :P ).

Therefore, I think it would be useful to add such a warning box also to this workflow. (However, I have no idea how to do that, otherwise I would make a suggested implementation myself.)

Screen Shot 2021-05-12 at 18 09 43
vegardinho commented 3 years ago

I see the benefit, however this will be a frustration for those who do not risk losing their keyboard and mouse, and want the quickest way to turn on/off bluetooth. My main goal in making this workflow is enabling bluetooth management as easily and handily as possible, and prompting users every time is somewhat in opposition to that principle. An acceptable solution might be something like checking wether mouse and/or keyboard is connected via bluetooth, and then prompting user if necessary. That introduces a whole lot of time to get working, though, and I'm not sure it would be worth it.

As an attempt to satisfy the need, however, I have now introduced two new commands in the new release: btts (toggle safely) and btos (turn off safely). That way you can use those instead off the standard ones, and be sure to get a warning. It's a bit tricky to implement confirmation in Alfred, so the solution is not ideal, but I think it works well enough.

Let me know what you think!

chrisgrieser commented 3 years ago

oh no, what I meant was to implement it like Apple did, meaning the prompt only shows up when you are on an iMac or Mac Mini. In those cases you would want to have the prompt.

Alternatively, you could add an workflow environment variable "safety_prompt" and then every user can decide for themselves.

adding more commands is actually not a very good solution, as you had 8 commands already and now would have 10. Other than being a bit much, Alfred only shows 9 hits maximum, meaning you will always have one command not displayed in Alfred's search result. And if thats the one you want to use, you have to scroll aaaaaall the way down... ;(

chrisgrieser commented 3 years ago

just checked the new version, the btts and btos command seem buggy, I think because the Large Type interrupts Alfred. If you remove the two Large Type actions, it works.

vegardinho commented 3 years ago

All righty, doing the environment thing turned out to be pretty easy. Can remove Large Type and release new version with environment variable on existing commands shortly.