Skip to content

Commit

Permalink
Read ANYBAR_INIT from environment
Browse files Browse the repository at this point in the history
  • Loading branch information
Dima-369 authored and tonsky committed Nov 3, 2020
1 parent fce27d9 commit 44896cb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion AnyBar/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ @implementation AppDelegate

-(void)applicationDidFinishLaunching:(NSNotification *)aNotification {
_udpPort = -1;
_imageName = @"white";
_imageName = [self readStringFromEnvironmentVariable:@"ANYBAR_INIT" usingDefault:@"white"];
self.statusItem = [self initializeStatusBarItem];
[self refreshDarkMode];

Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,22 @@ ANYBAR_PORT=1739 open -na AnyBar
ANYBAR_PORT=1740 open -na AnyBar
```

You can specify title to distinguish dots in the menubar:
## Environment variables to specify a title and the initial color of the dot

A title can be set to distinguish dots in the menubar:

```sh
ANYBAR_PORT=1738 ANYBAR_TITLE=First open -na AnyBar
ANYBAR_PORT=1739 ANYBAR_TITLE=Second open -na AnyBar
ANYBAR_PORT=1740 ANYBAR_TITLE=Third open -na AnyBar
```

And the initial color of the dot can also be set:

```sh
ANYBAR_INIT=blue open -na AnyBar
```

## Custom images

AnyBar can detect and use local custom images stored in the `~/.AnyBar` directory. For example, if you have a `~/.AnyBar/[email protected]` image, send `square` to port 1738 and it will be displayed. Images should be 19×19 pixels for standard resolution, and 38x38 pixels for retina (@2x).
Expand Down

0 comments on commit 44896cb

Please sign in to comment.