-
-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
6 changed files
with
63 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
xcuserdata | ||
*.xcuserdatad | ||
*.xcuserdata | ||
build | ||
*.zip |
8 changes: 8 additions & 0 deletions
8
AnyBar.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>IDEDidComputeMac32BitWarning</key> | ||
<true/> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ @interface AppDelegate() | |
@property (strong, nonatomic) NSString *imageName; | ||
@property (assign, nonatomic) BOOL dark; | ||
@property (assign, nonatomic) int udpPort; | ||
@property (assign, nonatomic) NSString *appDesc; | ||
@property (assign, nonatomic) NSString *appTitle; | ||
|
||
@end | ||
|
||
|
@@ -31,24 +31,23 @@ -(void)applicationDidFinishLaunching:(NSNotification *)aNotification { | |
@try { | ||
_udpPort = [self getUdpPort]; | ||
_udpSocket = [self initializeUdpSocket: _udpPort]; | ||
_appDesc = [self getAppDesc]; | ||
_statusItem.toolTip = _appDesc; | ||
_appTitle = [self readStringFromEnvironmentVariable:@"ANYBAR_TITLE" usingDefault:nil]; | ||
_statusItem.toolTip = _appTitle == nil ? [NSString stringWithFormat:@"AnyBar @ %d", _udpPort] : _appTitle; | ||
} | ||
@catch(NSException *ex) { | ||
NSLog(@"Error: %@: %@", ex.name, ex.reason); | ||
_statusItem.image = [NSImage imageNamed:@"[email protected]"]; | ||
} | ||
@finally { | ||
NSString *appTitle = _appDesc; | ||
NSString *portTitle = [NSString stringWithFormat:@"UDP port: %@", | ||
_udpPort >= 0 ? [NSNumber numberWithInt:_udpPort] : @"unavailable"]; | ||
NSString *quitTitle = @"Quit"; | ||
NSString *portTitle = [NSString stringWithFormat:@"UDP port: %@", _udpPort >= 0 ? [NSNumber numberWithInt:_udpPort] : @"unavailable"]; | ||
NSMenu *menu = [[NSMenu alloc] init]; | ||
|
||
_statusItem.menu = [self initializeStatusBarMenu:@{ | ||
portTitle: [NSValue valueWithPointer:nil], | ||
quitTitle: [NSValue valueWithPointer:@selector(terminate:)], | ||
appTitle: [NSValue valueWithPointer:nil] | ||
}]; | ||
if (_appTitle != nil) | ||
[menu addItemWithTitle:_appTitle action:nil keyEquivalent:@""]; | ||
[menu addItemWithTitle:portTitle action:nil keyEquivalent:@""]; | ||
[menu addItemWithTitle:@"Quit" action:@selector(terminate:) keyEquivalent:@""]; | ||
|
||
_statusItem.menu = menu; | ||
} | ||
|
||
NSDistributedNotificationCenter *center = [NSDistributedNotificationCenter defaultCenter]; | ||
|
@@ -79,10 +78,6 @@ -(int) getUdpPort { | |
return port; | ||
} | ||
|
||
-(NSString*) getAppDesc { | ||
return [self readStringFromEnvironmentVariable:@"ANYBAR_DESC" usingDefault:@"AnyBar"]; | ||
} | ||
|
||
- (void)refreshDarkMode { | ||
NSString *osxMode = [[NSUserDefaults standardUserDefaults] stringForKey:@"AppleInterfaceStyle"]; | ||
if ([osxMode isEqualToString:@"Dark"]) | ||
|
@@ -187,18 +182,6 @@ -(NSStatusItem*) initializeStatusBarItem { | |
return statusItem; | ||
} | ||
|
||
-(NSMenu*) initializeStatusBarMenu:(NSDictionary*)menuDictionary { | ||
NSMenu *menu = [[NSMenu alloc] init]; | ||
|
||
[menuDictionary enumerateKeysAndObjectsUsingBlock:^(NSString* key, NSValue* val, BOOL *stop) { | ||
SEL action = nil; | ||
[val getValue:&action]; | ||
[menu addItemWithTitle:key action:action keyEquivalent:@""]; | ||
}]; | ||
|
||
return menu; | ||
} | ||
|
||
-(int) readIntFromEnvironmentVariable:(NSString*) envVariable usingDefault:(NSString*) defStr { | ||
int intVal = -1; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
### 0.2.0 / Aug 26, 2020 | ||
|
||
- Specify app tooltip via `ANYBAR_TITLE` #59 #64 thx @mynameismiek @andrewsjg | ||
|
||
### 0.1.4 | ||
|
||
- Bigger dots | ||
- Render “black” on dark menubar as empty circle and “white” on dark as filled circle (#55) | ||
- Compiled for OS X 10.11 | ||
|
||
### 0.1.3 | ||
|
||
- AppleScript support (PR #8, thx [Oleg Kertanov](https://github.com/okertanov)) | ||
|
||
### 0.1.2 | ||
|
||
- Dark mode support. In dark mode AnyBar will first check for `<image>[email protected]` or `<image>_alt.png` image first, then falls back to `<image>.png` | ||
- Support for Mavericks actually works | ||
|
||
### 0.1.1 | ||
|
||
- Support for Mavericks (PR #2, thx [Oleg Kertanov](https://github.com/okertanov)) | ||
- Support for custom images via ~/.AnyBar (PR #1, thx [Paul Boschmann](https://github.com/pboschmann)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,9 +6,9 @@ AnyBar is a small indicator for your menubar that does one simple thing: it disp | |
|
||
## Download | ||
|
||
Version 0.1.4: | ||
Version 0.2.0: | ||
|
||
<a href="https://github.com/tonsky/AnyBar/releases/download/0.1.4/AnyBar-0.1.4.zip"><img src="AnyBar/Images.xcassets/AppIcon.appiconset/[email protected]?raw=true" style="width: 128px;" width=128/></a> | ||
<a href="https://github.com/tonsky/AnyBar/releases/download/0.2.0/AnyBar-0.2.0.zip"><img src="AnyBar/Images.xcassets/AppIcon.appiconset/[email protected]?raw=true" style="width: 128px;" width=128/></a> | ||
|
||
Or using [Homebrew Cask](https://github.com/Homebrew/homebrew-cask): | ||
|
||
|
@@ -156,6 +156,14 @@ ANYBAR_PORT=1739 open -na AnyBar | |
ANYBAR_PORT=1740 open -na AnyBar | ||
``` | ||
|
||
You can specify title 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 | ||
``` | ||
|
||
## 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). | ||
|
@@ -167,28 +175,6 @@ AnyBar can detect and use local custom images stored in the `~/.AnyBar` director | |
- Windows 10 [PavelStefanov/NoteBar](https://github.com/PavelStefanov/NoteBar) | ||
- Emacs [plexus/.../emybar.el](https://github.com/plexus/plexmacs/blob/master/emybar/emybar.el) | ||
|
||
## Changelog | ||
|
||
### 0.1.4 | ||
|
||
- Bigger dots | ||
- Render “black” on dark menubar as empty circle and “white” on dark as filled circle (#55) | ||
- Compiled for OS X 10.11 | ||
|
||
### 0.1.3 | ||
|
||
- AppleScript support (PR #8, thx [Oleg Kertanov](https://github.com/okertanov)) | ||
|
||
### 0.1.2 | ||
|
||
- Dark mode support. In dark mode AnyBar will first check for `<image>[email protected]` or `<image>_alt.png` image first, then falls back to `<image>.png` | ||
- Support for Mavericks actually works | ||
|
||
### 0.1.1 | ||
|
||
- Support for Mavericks (PR #2, thx [Oleg Kertanov](https://github.com/okertanov)) | ||
- Support for custom images via ~/.AnyBar (PR #1, thx [Paul Boschmann](https://github.com/pboschmann)) | ||
|
||
## License | ||
|
||
Copyright © 2015 Nikita Prokopov | ||
|