Skip to content

Commit 44896cb

Browse files
Dima-369tonsky
authored andcommitted
Read ANYBAR_INIT from environment
1 parent fce27d9 commit 44896cb

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

AnyBar/AppDelegate.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ @implementation AppDelegate
2424

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

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,14 +156,22 @@ ANYBAR_PORT=1739 open -na AnyBar
156156
ANYBAR_PORT=1740 open -na AnyBar
157157
```
158158

159-
You can specify title to distinguish dots in the menubar:
159+
## Environment variables to specify a title and the initial color of the dot
160+
161+
A title can be set to distinguish dots in the menubar:
160162

161163
```sh
162164
ANYBAR_PORT=1738 ANYBAR_TITLE=First open -na AnyBar
163165
ANYBAR_PORT=1739 ANYBAR_TITLE=Second open -na AnyBar
164166
ANYBAR_PORT=1740 ANYBAR_TITLE=Third open -na AnyBar
165167
```
166168

169+
And the initial color of the dot can also be set:
170+
171+
```sh
172+
ANYBAR_INIT=blue open -na AnyBar
173+
```
174+
167175
## Custom images
168176

169177
AnyBar can detect and use local custom images stored in the `~/.AnyBar` directory. For example, if you have a `~/.AnyBar/square@2x.png` 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).

0 commit comments

Comments
 (0)