Skip to content

Commit 5123d63

Browse files
committed
Initial commit
0 parents  commit 5123d63

37 files changed

Lines changed: 1207 additions & 0 deletions

.gitignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# OS X
2+
.DS_Store
3+
4+
# Xcode
5+
build/
6+
*.pbxuser
7+
!default.pbxuser
8+
*.mode1v3
9+
!default.mode1v3
10+
*.mode2v3
11+
!default.mode2v3
12+
*.perspectivev3
13+
!default.perspectivev3
14+
*.xcworkspace
15+
!default.xcworkspace
16+
xcuserdata
17+
profile
18+
*.moved-aside
19+
DerivedData/

Graphics/AppIcon.psd

1.13 MB
Binary file not shown.

Graphics/MenuIcon.psd

40.4 KB
Binary file not shown.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License
2+
3+
Copyright (c) 2013 Robbert Klarenbeek
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Resolution Menu
2+
3+
Simple OS X status bar menu app to switch display modes / resolutions, with support for HiDPI (retina) modes.
4+
5+
* For quick access, if you have 1 display only, the display modes can be found at the top level of the menu. For 2 or more displays, each display will have its own submenu.
6+
7+
* The list of attached devices / supported display modes is refreshed each time the menu is opened; no need to ever refresh manually.
8+
9+
* No color depth information is shown; if a resolution is available with different color depths, only the display mode with the highest color depth will be used.
10+
11+
* `CoreGraphics` private APIs are used to access the HiDPI display modes; this might not get this app accepted into the Mac App Store. Also note that `CGDisplayIOServicePort()`, which is used to get to get the (localized) name of the displays, has been deprecated as of Mac OS X 10.9 (Mavericks).
12+
13+
* To facilitate "Start at Login", the `ServiceManagement.framework` is used together with a helper app, which should work in a sandboxed environment as well (as long as the app lives in /Applications).
14+
15+
## Enabling HiDPI display modes
16+
17+
To enable HiDPI modes on a non-retina device, execute this in the Terminal app:
18+
19+
```
20+
sudo defaults write /Library/Preferences/com.apple.windowserver.plist DisplayResolutionEnabled -bool true
21+
```
22+
23+
Then, for the change to take effect, either log out and back in or restart your system.
24+
25+
## Installation
26+
27+
Just fetch a DMG from the [release section](https://github.com/robbertkl/ResolutionMenu/releases) section and drag the application bundle to your Applications folder.
28+
29+
You might need to disable OS X Gatekeeper first: System Preferences > Security & Privacy > General tab > Allow apps downloaded from: Anywhere.
30+
31+
## Authors
32+
33+
* Robbert Klarenbeek, <robbertkl@renbeek.nl>
34+
35+
## Credits
36+
37+
* Thanks to [Alex Zielenski](https://twitter.com/#!/alexzielenski) for [StartAtLoginController](https://github.com/alexzielenski/StartAtLoginController), which ties together the ServiceManagement stuff without even a single line of code (gotta love KVO).
38+
39+
* Thanks to [ExitMothership](http://exitmothership.deviantart.com) for his [LED Cinema Display Icon](http://exitmothership.deviantart.com/art/LED-Cinema-Display-Icon-331815542), which is used for the app icon.
40+
41+
## License
42+
43+
Resolution Menu is published under the [MIT License](http://www.opensource.org/licenses/mit-license.php).
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//
2+
// AppDelegate.h
3+
// Resolution Menu Helper
4+
//
5+
// Created by Robbert Klarenbeek on 23-12-13.
6+
// Copyright (c) 2013 Robbert Klarenbeek. All rights reserved.
7+
//
8+
9+
#import <Cocoa/Cocoa.h>
10+
11+
@interface AppDelegate : NSObject <NSApplicationDelegate>
12+
13+
@property (assign) IBOutlet NSWindow *window;
14+
15+
@end
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
//
2+
// AppDelegate.m
3+
// Resolution Menu Helper
4+
//
5+
// Created by Robbert Klarenbeek on 23-12-13.
6+
// Copyright (c) 2013 Robbert Klarenbeek. All rights reserved.
7+
//
8+
9+
#import "AppDelegate.h"
10+
11+
@implementation AppDelegate
12+
13+
- (void)applicationWillFinishLaunching:(NSNotification *)aNotification
14+
{
15+
// Start with the helper app's bundle path
16+
NSString *path = [[NSBundle mainBundle] bundlePath];
17+
18+
// Move up 4 times (since the helper app is in <main>.app/Contents/Library/LoginItems/<helper>.app/
19+
for (int i = 0; i < 4; i++) {
20+
path = [path stringByDeletingLastPathComponent];
21+
}
22+
23+
// Then get the executable path of the main app
24+
path = [[NSBundle bundleWithPath:path] executablePath];
25+
26+
// Launch our main app
27+
[[NSWorkspace sharedWorkspace] launchApplication:path];
28+
29+
// And we're done already!
30+
[NSApp terminate:nil];
31+
}
32+
33+
@end

Resolution Menu Helper/Info.plist

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>en</string>
7+
<key>CFBundleExecutable</key>
8+
<string>${EXECUTABLE_NAME}</string>
9+
<key>CFBundleIconFile</key>
10+
<string></string>
11+
<key>CFBundleIdentifier</key>
12+
<string>nl.lapulapu.${PRODUCT_NAME:rfc1034identifier}</string>
13+
<key>CFBundleInfoDictionaryVersion</key>
14+
<string>6.0</string>
15+
<key>CFBundleName</key>
16+
<string>${PRODUCT_NAME}</string>
17+
<key>CFBundlePackageType</key>
18+
<string>APPL</string>
19+
<key>CFBundleShortVersionString</key>
20+
<string>1.0.0</string>
21+
<key>CFBundleSignature</key>
22+
<string>????</string>
23+
<key>LSMinimumSystemVersion</key>
24+
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
25+
<key>LSUIElement</key>
26+
<true/>
27+
<key>NSHumanReadableCopyright</key>
28+
<string>Copyright © 2013 Robbert Klarenbeek. All rights reserved.</string>
29+
<key>NSPrincipalClass</key>
30+
<string>NSApplication</string>
31+
</dict>
32+
</plist>

Resolution Menu Helper/main.m

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//
2+
// main.m
3+
// Resolution Menu Helper
4+
//
5+
// Created by Robbert Klarenbeek on 23-12-13.
6+
// Copyright (c) 2013 Robbert Klarenbeek. All rights reserved.
7+
//
8+
9+
#import <Cocoa/Cocoa.h>
10+
#import "AppDelegate.h"
11+
12+
int main(int argc, const char * argv[])
13+
{
14+
AppDelegate *delegate = [[AppDelegate alloc] init];
15+
[[NSApplication sharedApplication] setDelegate:delegate];
16+
[NSApp run];
17+
}

0 commit comments

Comments
 (0)