Skip to content

Commit

Permalink
Merge branch 'release/1.4.8140'
Browse files Browse the repository at this point in the history
* release/1.4.8140:
  Changelog update
  add focus modes note
  Add bartender tip
  add focus modes note
  Add bartender tip
  • Loading branch information
ttscoff committed Mar 22, 2022
2 parents be40b9f + 9be7874 commit 2343397
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 27 deletions.
3 changes: 3 additions & 0 deletions bunch-files/commands/do-not-disturb.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ tags: [do not disturb, dnd, command]

Toggle notifications. The commands can be abbreviated as `(dnd on)` and `(dnd off)`. Actually, `(dnd on)` can just be `(dnd)`, too. I like to make things intuitive by over complicating them sometimes.

If you want to control Focus Modes, you'll need to do a [little extra setup]({{ site.baseurl }}/docs/integration/focus-modes/).

## Examples

```bunch
(dnd on) // or just (dnd)
(dnd off)
```

36 changes: 18 additions & 18 deletions bunch-files/keystrokes.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,41 +119,41 @@ TextEdit

(You can also combine these two lines now, [see the next section](#combined).)

You can use "escape" codes (letters preceded by a double backslash, e.g. `\\\\n`) in a typed string to press some "special" keys:
You can use "escape" codes (letters preceded by a double backslash, e.g. `\\n`) in a typed string to press some "special" keys:

| Code | Key | Mnemonic |
| --------: | --------------- | -------------------- |
| `\\\\\\n` | Return | newline |
| `\\\\\\t` | Tab | tab |
| `\\\\\\s` | Space (force) | space |
| `\\\\\\b` | Left Arrow | back |
| `\\\\\\f` | Right Arrow | forward |
| `\\\\\\u` | Up Arrow | up |
| `\\\\\\d` | Down Arrow | down |
| `\\\\\\a` | Home | ask Emacs |
| `\\\\\\e` | End | end |
| `\\\\\\h` | Backspace | ask UNIX... |
| `\\\\\\x` | Escape | e was already used |
| `\\\\\\!X`| Pause for X seconds ||

Example: `- [\\\\n\\\\n\\\\tThis has two newlines and a tab indent before it\\\\n]`
| `\\n` | Return | newline |
| `\\t` | Tab | tab |
| `\\s` | Space (force) | space |
| `\\b` | Left Arrow | back |
| `\\f` | Right Arrow | forward |
| `\\u` | Up Arrow | up |
| `\\d` | Down Arrow | down |
| `\\a` | Home | ask Emacs |
| `\\e` | End | end |
| `\\h` | Backspace | ask UNIX... |
| `\\x` | Escape | e was already used |
| `\\!X`| Pause for X seconds ||

Example: `- [\\n\\n\\tThis has two newlines and a tab indent before it\\n]`

> Tip: If you want to send a lot of special characters while typing, it's often better to use the bracket syntax and quote the typed strings, e.g. `{(tab)3 "my text" return @s}`.
{:.tip}

### Adding Pauses to Typed Strings {#typedpause}

You can pause typing for any number of seconds using `\\\\!` followed by a number within a typed string (this works in interpolated strings as well):
You can pause typing for any number of seconds using `\\!` followed by a number within a typed string (this works in interpolated strings as well):

```bunch
- [This is a dramatic \\\\!5pause]
- [This is a dramatic \\!5pause]
```

The delay must be a positive integer representing a number of seconds, with no decimals.

### Using Variables in Typed Strings

If you want to insert the contents of a variable in a typed string, you should use the `/typed` transform to ensure that newlines are converted to `\\\\n` when typing it out.
If you want to insert the contents of a variable in a typed string, you should use the `/typed` [transform]({{ site.baseurl }}/docs/bunch-files/variables/#transforms) to ensure that newlines are converted to `\\n` when typing it out.

```bunch
TextEdit
Expand Down
1 change: 1 addition & 0 deletions bunch-files/quick-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ Bunch Lines should be a single line, but can be split by ending the line with a
|`!!!AppName`|_Quit app when closing bunch ([triple negative]({{ site.baseurl }}/docs/bunch-files/run-on-close/#triplenegative))_|
|`@AppName`|_[Focus app]({{ site.baseurl }}/docs/bunch-files/apps/#focus) (run at end of bunch to hide all other apps)_|
|`AppName_`|_[Hide an app]({{ site.baseurl }}/docs/bunch-files/apps/#hidingapps)_|
|`AppName^`|_[Force app to activate]({{ site.baseurl }}/docs/bunch-files/apps/#activatingapps)_|
| __Snippets__ ||
|`< my.snippet`|_[An external file to be included in the bunch]({{ site.baseurl }}/docs/bunch-files/snippets/)_|
|`- KEY=value`|_A variable to define for use in the snippet as `${KEY}`_|
Expand Down
35 changes: 27 additions & 8 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,39 @@ page_id: changelog

{% docdiff %}

{% available 136 %}
{% available 140 %}

---
1.4.6 (136)
: {% icon new %} (quit everything except ...) command to quit all running Dock apps (with an optional exception list)

1.4.8 (140)
: {% icon fix %} Variable keys passed from URL handler were running into case sensitivity issues
: {% icon fix %} When launching or quitting a tag, %\tag was not ignoring the action on close
: {% icon fix %} Don't inherit tags when nesting Bunches
{% endavailable %}

---

1.4.7 (139)
: {% icon fix %} Variable keys passed from URL handler were running into case sensitivity issues


---

1.4.7 (139)
: {% icon fix %} Variable keys passed from URL handler were running into case sensitivity issues


{% available 136 %}

---
1.4.6
: {% icon new %} (quit everything except ...) command to quit all running Dock apps (with an optional exception list) ([documentation]({{ site.baseurl }}/docs/bunch-files/commands/quit-everything/))
: {% icon new %} "file PATH contains" logic condition to check file contents for text string
: {% icon new %} "file PATH exists" logic condition
: {% icon new %} "title prefix" frontmatter applies a string before the Bunch, or all affected Bunches if used in @tag/folder.frontmatter
: {% icon new %} "ignore if/unless" frontmatter can control whether a Bunch displays in the menu. Accepts UUID or any logic condition recognized by Bunch
: {% icon new %} "menu prefix" frontmatter applies a string before the Bunch, or all affected Bunches if used in @tag/folder.frontmatter
: {% icon imp %} "schedule if/unless" now accepts any logic condition. Instead of a trigger file like it had, use `file TRIGGER_FILE exists`.
: {% icon fix %} Apps launched by bundle identifier couldn't open files
: {% icon fix %} Apps not launched by bundle id couldn't open files
: {% icon fix %} Fix an error with opening files in apps _not_ called by bundle identifier (doh)
: {% icon fix %} Apps launched by bundle identifier couldn't open files
: {% icon fix %} Fix an error with opening files in apps called by bundle identifier
: {% icon fix %} Long directory names breaking preference window layout (#148)
: {% icon fix %} Calling "toggle" via URL handler not respecting single bunch mode (#149)
: {% icon fix %} Crash when completing script with error on Bunch close (#152)
Expand Down
11 changes: 11 additions & 0 deletions integration/focus-modes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
layout: default
title: Focus Modes
parent: Integration
tags: [integration]
---
# macOS Focus Modes

One Bunch feature request I've received a few times is support for macOS Monterey's Focus Modes. Bunch does a good job with enabling and disabling Do Not Disturb, but the process is a hack that involves nested settings in PLIST data and toggling system daemons. I don't love that I have to do that, but Apple provides no API for such settings. And I haven't found a way (yet) to extend that hack to work with Focus Modes. So here's the solution I'm using.

You can turn Focus Modes on and off using Shortcuts. Create two shortcuts for each focus mode you want to control from Bunch, one for turning on, and one for turning off. Then, in a Bunch, you can use `$ /usr/bin/shortcuts run "SHORTCUT_ON_NAME"` (replacing `SHORTCUT_ON_NAME` with the name of the shortcut that turns the focus mode on), and `!$ /usr/bin/shortcuts run "SHORTCUT_OFF_NAME"`. The combination of these two will turn the focus mode on when the Bunch opens, and off when it closes. You can, of course, reverse these as needed.
14 changes: 13 additions & 1 deletion troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Also see the [`(log)` command]({{ site.baseurl }}/docs/bunch-files/commands/log/

If you know which line is problematic and it doesn't make sense, post about it [in the forum]({{ site.forum }}). If it seems like a bug in Bunch, please [let me know here]({{ site.bugs }}).

## Debugging Scripts
## Debugging Scripts {#scripts}

See [Debugging Scripts]({{ site.baseurl }}/docs/integration/advanced-scripting/debugging/) in the Advanced Scripting section for tips on tracking down issues with shell scripts.

Expand Down Expand Up @@ -124,3 +124,15 @@ If you make a change to a Bunch and __suddenly your menu is empty__, it means th
On rare occasions something really screwy happens and Bunch just stops reading files in the chosen directory. The solution is to change your Bunch Folder using __Bunch Folder->Add__ button in Preferences, then change it right back (it will be in the dropdown).

If these steps don't fix the issue, or the issue you're having is not mentioned here, [see the support page]({{ site.baseurl }}/support) to get in touch.

## Hiding Bunch With Bartender {#bartender}

If you use [Bartender](https://www.macbartender.com/) to hide the Bunch menu item, you may get weird results when triggering Bunch using the [global hotkey]({{ site.baseurl }}/docs/using-bunch/preferences/#application-settings) (menu appearing off-screen, on secondary displays, etc.). To resolve this, disable the global hotkey in Bunch and add a hotkey for the menu item in Bartender settings (Bartender 4+)

1. Disable Bunch's global shortcut in Preferences
1. Open Bartender Preferences and select the Hot Keys pane
2. Click the "Add menu bar item hot key" button at the bottom of the window
3. Select Bunch from the list of menu items
4. Press your desired shortcut key and ensure that the action is set to Left Click.

Now when you hit your shortcut key, the Bunch menu item should be made visible momentarily before displaying the menu. Shortcuts for individual Bunches should work as expected once the menu is displayed.

0 comments on commit 2343397

Please sign in to comment.