# USB Toggled Menu Bar Icon

**URL:** <https://community.folivora.ai/t/usb-toggled-menu-bar-icon/37463>\
**Category:** Configuration Help & General Discussion\
**Tags:** menu-bar-icon, menu-bar\
**Created:** [June 6, 2024, 12:34pm UTC](https://community.folivora.ai/t/usb-toggled-menu-bar-icon/37463 "2024-06-06T12:34:19Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![BaseballBBQ](https://community.folivora.ai/user_avatar/community.folivora.ai/baseballbbq/32/37893_2.png) [@BaseballBBQ](https://community.folivora.ai/u/BaseballBBQ)\
**Post date:** [June 6, 2024, 12:34pm UTC](https://community.folivora.ai/t/usb-toggled-menu-bar-icon/37463/1 "2024-06-06T12:34:19Z")

</div>

I want to display a menu bar button whenever I connect a specific USB device, and want it to disappear when disconnecting the specific USB device. How would I go about achieving this?

---

<div class="post-metadata">

**Author:** ![Frank1](https://community.folivora.ai/letter_avatar_proxy/v4/letter/f/a87d85/32.png) [@Frank1](https://community.folivora.ai/u/Frank1)\
**Post date:** [June 6, 2024, 12:50pm UTC](https://community.folivora.ai/t/usb-toggled-menu-bar-icon/37463/2 "2024-06-06T12:50:23Z")

</div>

Menu bar icon, I don't know. But you can combine the actions connect/disconnect USB device with show/hide a floating menu. At least I think so. 😇

---

<div class="post-metadata">

**Author:** ![Andreas\_Hegenberg](https://community.folivora.ai/user_avatar/community.folivora.ai/andreas_hegenberg/32/39221_2.png) [@Andreas\_Hegenberg](https://community.folivora.ai/u/Andreas_Hegenberg)\
**Post date:** [June 6, 2024, 1:53pm UTC](https://community.folivora.ai/t/usb-toggled-menu-bar-icon/37463/3 "2024-06-06T13:53:45Z")

</div>

This will require the most current version released yesterday:

Define a menubar item in "Automations, Named & Other Triggers". Then right-click it and choose "Copy Selected Item UUID"

 ![image](https://community.folivora.ai/uploads/default/original/3X/2/8/288fce8f515f9909f4012fc290ba5d85218d13b1.jpeg)

Then add a new USB Device Did Connect and a new USB Device Did Disconnect trigger. Use the predefined action "Run Apple Script" and run these scripts:

To show the item:

```auto
tell application "BetterTouchTool" to update_trigger "7093C95A-0AF7-42B3-8680-C7AD2D2BE7AB" json "{BTTEnabled : true, BTTEnabled2 : true}"

```

To hide the item:

```auto
tell application "BetterTouchTool" to update_trigger "7093C95A-0AF7-42B3-8680-C7AD2D2BE7AB" json "{BTTEnabled : false, BTTEnabled2 : false}"

```

(replace the UUID with the one you copied).

One limitation of this approach is, that the item will always be inserted at the very left.

Alternatively you can hide it, but this will leave a little gap:

```auto
	tell application "BetterTouchTool" to update_menubar_item "3EBB16B4-09B9-4120-BBD4-C09535AF8EEE" hidden true

```

---

<div class="post-metadata">

**Author:** ![BaseballBBQ](https://community.folivora.ai/user_avatar/community.folivora.ai/baseballbbq/32/37893_2.png) [@BaseballBBQ](https://community.folivora.ai/u/BaseballBBQ)\
**Post date:** [June 6, 2024, 2:04pm UTC](https://community.folivora.ai/t/usb-toggled-menu-bar-icon/37463/4 "2024-06-06T14:04:10Z")

</div>

This works great for my use case! There is an issue with the disconnect though. The menu bar icon won't disappear unless I manually run the script.

---

<div class="post-metadata">

**Author:** ![Andreas\_Hegenberg](https://community.folivora.ai/user_avatar/community.folivora.ai/andreas_hegenberg/32/39221_2.png) [@Andreas\_Hegenberg](https://community.folivora.ai/u/Andreas_Hegenberg)\
**Post date:** [June 6, 2024, 2:04pm UTC](https://community.folivora.ai/t/usb-toggled-menu-bar-icon/37463/5 "2024-06-06T14:04:50Z")

</div>

Is it a logitech device?

---

<div class="post-metadata">

**Author:** ![BaseballBBQ](https://community.folivora.ai/user_avatar/community.folivora.ai/baseballbbq/32/37893_2.png) [@BaseballBBQ](https://community.folivora.ai/u/BaseballBBQ)\
**Post date:** [June 6, 2024, 2:05pm UTC](https://community.folivora.ai/t/usb-toggled-menu-bar-icon/37463/6 "2024-06-06T14:05:08Z")

</div>

It's an ID Card reader

---

<div class="post-metadata">

**Author:** ![Andreas\_Hegenberg](https://community.folivora.ai/user_avatar/community.folivora.ai/andreas_hegenberg/32/39221_2.png) [@Andreas\_Hegenberg](https://community.folivora.ai/u/Andreas_Hegenberg)\
**Post date:** [June 6, 2024, 2:06pm UTC](https://community.folivora.ai/t/usb-toggled-menu-bar-icon/37463/7 "2024-06-06T14:06:05Z")

</div>

mhh, there have been some issues with some devices not triggering the disconnect notification - so far I know know about Logitech devices. Could you check whether the disconnect trigger is triggering at all? (e.g. check the "Show HUD" option on the trigger)

---

<div class="post-metadata">

**Author:** ![BaseballBBQ](https://community.folivora.ai/user_avatar/community.folivora.ai/baseballbbq/32/37893_2.png) [@BaseballBBQ](https://community.folivora.ai/u/BaseballBBQ)\
**Post date:** [June 6, 2024, 2:07pm UTC](https://community.folivora.ai/t/usb-toggled-menu-bar-icon/37463/8 "2024-06-06T14:07:49Z")

</div>

I just ran the script with the Show HUD option on the trigger and it didn't trigger the HUD.

---

<div class="post-metadata">

**Author:** ![Andreas\_Hegenberg](https://community.folivora.ai/user_avatar/community.folivora.ai/andreas_hegenberg/32/39221_2.png) [@Andreas\_Hegenberg](https://community.folivora.ai/u/Andreas_Hegenberg)\
**Post date:** [June 6, 2024, 2:08pm UTC](https://community.folivora.ai/t/usb-toggled-menu-bar-icon/37463/9 "2024-06-06T14:08:39Z")

</div>

Unfortuantely then there is currently no way to make this work. I'll soon try to figure out why the disconnect is not happening for some devices.

(Make sure all the values of the device are correctly entered, but that you probably did already)

---

<div class="post-metadata">

**Author:** ![BaseballBBQ](https://community.folivora.ai/user_avatar/community.folivora.ai/baseballbbq/32/37893_2.png) [@BaseballBBQ](https://community.folivora.ai/u/BaseballBBQ)\
**Post date:** [June 6, 2024, 3:25pm UTC](https://community.folivora.ai/t/usb-toggled-menu-bar-icon/37463/10 "2024-06-06T15:25:14Z")

</div>

After further inspection, I ended up switching the Product and Vendor IDs in the USB Device Did Disconnect trigger. After switching them back to their correct values, this worked flawlessly. Thanks for your help!

---

<div class="post-metadata">

**Author:** ![sethh](https://community.folivora.ai/user_avatar/community.folivora.ai/sethh/32/18806_2.png) [@sethh](https://community.folivora.ai/u/sethh)\
**Post date:** [June 6, 2024, 10:59pm UTC](https://community.folivora.ai/t/usb-toggled-menu-bar-icon/37463/11 "2024-06-06T22:59:13Z")

</div>

Gah I wanna update so bad but it’s gonna mean another 2 months waiting for IT approval. It was an uphill battle to get approval in the first place. And now that it’s saved in /Applications instead of ~/Applications I don’t have read/write to it. The release notes are up, yeah?

---

<div class="post-metadata">

**Author:** ![Andreas\_Hegenberg](https://community.folivora.ai/user_avatar/community.folivora.ai/andreas_hegenberg/32/39221_2.png) [@Andreas\_Hegenberg](https://community.folivora.ai/u/Andreas_Hegenberg)\
**Post date:** [June 6, 2024, 11:03pm UTC](https://community.folivora.ai/t/usb-toggled-menu-bar-icon/37463/12 "2024-06-06T23:03:16Z")

</div>

can’t you just download the current version manually? [Index of /releases](https://folivora.ai/releases)

---

<div class="post-metadata">

**Author:** ![sethh](https://community.folivora.ai/user_avatar/community.folivora.ai/sethh/32/18806_2.png) [@sethh](https://community.folivora.ai/u/sethh)\
**Post date:** [June 6, 2024, 11:08pm UTC](https://community.folivora.ai/t/usb-toggled-menu-bar-icon/37463/13 "2024-06-06T23:08:07Z")

</div>

I was concerned that a new instance would require new permissions for accessibility, screen sharing, etc

---

<div class="post-metadata">

**Author:** ![Andreas\_Hegenberg](https://community.folivora.ai/user_avatar/community.folivora.ai/andreas_hegenberg/32/39221_2.png) [@Andreas\_Hegenberg](https://community.folivora.ai/u/Andreas_Hegenberg)\
**Post date:** [June 6, 2024, 11:12pm UTC](https://community.folivora.ai/t/usb-toggled-menu-bar-icon/37463/14 "2024-06-06T23:12:31Z")

</div>

mhh I believe it should not, but I’m not quite sure :-/

---

<div class="post-metadata">

**Author:** ![sethh](https://community.folivora.ai/user_avatar/community.folivora.ai/sethh/32/18806_2.png) [@sethh](https://community.folivora.ai/u/sethh)\
**Post date:** [June 6, 2024, 11:31pm UTC](https://community.folivora.ai/t/usb-toggled-menu-bar-icon/37463/15 "2024-06-06T23:31:07Z")

</div>

Ha yep. Exactly where I’m at and very much not worth the risk to have to wait another 3 months and 500 feet of red tape. I’m about to upgrade on my personal machine right now though.

---

<div class="post-metadata">

**Author:** ![sethh](https://community.folivora.ai/user_avatar/community.folivora.ai/sethh/32/18806_2.png) [@sethh](https://community.folivora.ai/u/sethh)\
**Post date:** [June 6, 2024, 11:31pm UTC](https://community.folivora.ai/t/usb-toggled-menu-bar-icon/37463/16 "2024-06-06T23:31:33Z")

</div>

Well shit I guess I could test if it will require permissions on there

---

<div class="post-metadata">

**Author:** ![sethh](https://community.folivora.ai/user_avatar/community.folivora.ai/sethh/32/18806_2.png) [@sethh](https://community.folivora.ai/u/sethh)\
**Post date:** [June 10, 2024, 7:00am UTC](https://community.folivora.ai/t/usb-toggled-menu-bar-icon/37463/17 "2024-06-10T07:00:41Z")

</div>

@Andreas_Hegenberg figured id update you on this. Apparently a new instance of BTT, even in an entirely separate directory (~/Applications vs /Applications) can piggyback on the permissions of the previous instance. So I am now up to date

Caveat: I have not tested what would happen if I delete the original instance

---

<div class="post-metadata">

**Author:** ![Andreas\_Hegenberg](https://community.folivora.ai/user_avatar/community.folivora.ai/andreas_hegenberg/32/39221_2.png) [@Andreas\_Hegenberg](https://community.folivora.ai/u/Andreas_Hegenberg)\
**Post date:** [June 10, 2024, 8:04am UTC](https://community.folivora.ai/t/usb-toggled-menu-bar-icon/37463/18 "2024-06-10T08:04:54Z")

</div>

That's what I had hoped because the signing certificates etc. are the same and the permissions are bound to signing information and not to the location. Deleting the original would probably have broken this as deleting would cause the whitelisting to be removed.

---

<div class="post-metadata">

**Author:** ![sethh](https://community.folivora.ai/user_avatar/community.folivora.ai/sethh/32/18806_2.png) [@sethh](https://community.folivora.ai/u/sethh)\
**Post date:** [June 10, 2024, 12:08pm UTC](https://community.folivora.ai/t/usb-toggled-menu-bar-icon/37463/19 "2024-06-10T12:08:54Z")

</div>

Then I’m very glad I didn’t lol.
