Existing users, log in.  New users, create a free account.  Lost password?

Mac OS X  |    |  Design / Graphics  |  CAD / Technical  |  cscreen

cscreen

cscreen - 1.3

command line app to switch screen resolution/depth

All Time: (4.6)
This Version: Not rated (0.0)
Current Version: 1.3
Release Date: 2004-08-25
License: Freeware
Downloads (this version): 2,424
Downloads (all versions): 13,861

Feedback Summary:

This Version:
Overall Rating: Not rated (0.0) Features: Not rated (0.0) Support: Not rated (0.0)
Ease of Use: Not rated (0.0) Quality / Stability: Not rated (0.0) Price: Not rated (0.0)
Add Your Feedback

Key to Types of Feedback:

ReviewsReviews   TroubleshootingTroubleshooting   Usage TipsUsage Tips   Developer NotesDeveloper Notes   CommentaryCommentary   Featured ReviewsFeatured Reviews

All Feedback: 1 - 8 of 8



cscreen Developer NoteMirroring problem and testing - Version: 1.3, 10/28/2004 10:35AM PST

lpye
Well, I've ordered a nice shiny new PowerMac as well as a display. Before the tower gets here, I'll have my PB and an extra display and so should have a chance to play with the second display problem.
Post a commentAlert Admin

cscreen Reviewvery useful product and easy to use - Version: 1.3, 10/19/2004 12:46AM PST

veshman
this product is great. it totally helped me out with my Samsung DLP connection to my G4 Mac. While the 1280 x 720 via DVI looked great, once i turned off the TV and turned it back on, all I would get was a black screen.

i used cscreen and applescript to have it change the resolution to something, and then back again, and that would send a new video signal to the tv. worked great.

it does seem to have that mirroring issue, though.
Post a commentAlert Admin

cscreen Troubleshooting Reportmirrored displays - Version: 1.3, 10/14/2004 04:11AM PST

AUsher
Cscreen doesn't seem to be able to detect the presence of a second monitor when mirroring is switched on - is this a known problem? (G4 PB 500MHz, OSX.3.5, Mitsubishi diamond pro 700E second display)

Otherwise works as advertised.
Post a commentAlert Admin

cscreen Developer Notefuy: question... - Version: 1.2, 6/17/2004 01:30PM PST

(1 of 1 users found this comment useful)

lpye
I assume you used -f? If not, give it a try. Particularly if you know it was a supported configuration. Please contact me if you wish to pursue this: lynn @AT@ pyehouse .DOT. com.

Thanks,
Lynn
Post a commentAlert Admin

cscreen ReviewUnable to configure display (1000) - Version: 1.2, 6/17/2004 10:55AM PST

fuy
I tried using cscreen to force my outboard CRT to 1152x864. It used to support this resolution but lost it in one of the OS upgrades. cscreen replied:

Using closest match
Unable to configure display (1000)

and nothing happened.

cscreen works fine for supported resolutions though.
Post a commentAlert Admin

Most Recent Replies: View All 1 Replies

cscreen Commentarythis is not a new thing guys... - Version: 1.2, 6/15/2004 08:07AM PST

MonJab
here's proof...
source code to do the same thing...

----START----

/*
gcc -o setdisplay main.c -framework Cocoa
*/

/*

main.c

This tool sets the display resolution. This tool exists so that we
can set the display to a setting when the display manager says it can't,
mainly, when a Mac starts up and the monitor is off, or if the Mac is on
a KVM.

Copyright (c) 2002 University of Utah Student Computing Labs.
All Rights Reserved.

Permission to use, copy, modify, and distribute this software and
its documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appears in all copies and
that both that copyright notice and this permission notice appear
in supporting documentation, and that the name of The University
of Utah not be used in advertising or publicity pertaining to
distribution of the software without specific, written prior
permission. This software is supplied as is without expressed or
implied warranties of any kind.

USAGE:
You can give it arguments or not. If you don't give it arguments, it will use:

1024 x 768, 32 bits per pixel, and 75 htz

If you give it 4 arguments, they should be: width, height, bits per pixel, and refresh rate.

Like so:

SetDisplay 1024 768 32 75

WARNING:
In testing garbage values, I did get this to tool to change the display so that absolutely
nothing displayed. I don't remember what I did to get that. And I can't duplicate it anymore.
I could remotely control it, so I could fix it. But beware, if you can't remotely control the
machine and fix bad display settings, well, you might have to resort to drastic measures to fix
a mac with bad display settings (like boot off of a different disk and delete the display
preferences.

In other words, this tool will change the display settings regardless of what the display
manager says is possible. So be careful!!!

*/


#include <ApplicationServices/ApplicationServices.h>
#include <CoreFoundation/CoreFoundation.h>
#include <IOKit/IOKitLib.h>
#include <stdlib.h>
#include <unistd.h>

struct myMode
{
size_t width;
size_t height;
size_t bitsPerPixel;
CGRefreshRate refresh;
};

struct myMode myMode;

static void setdisplay( CGDirectDisplayID dspy)
{
CFDictionaryRef mode;
CFDictionaryRef originalMode;
boolean_t exactMatch;
CGDisplayErr err; // or is this suppose to be CGError???

CGDisplayConfigRef configRef;

originalMode = CGDisplayCurrentMode( dspy );
if ( originalMode == NULL )
{
printf( "Display is invalid\n" );
return;
}

printf( "Display 0x%x: Looking for %ld x %ld, %ld Bits Per Pixel\n", (unsigned int)dspy, myMode.width, myMode.height, myMode.bitsPerPixel );


mode = CGDisplayBestModeForParametersAndRefreshRate(dspy, myMode.bitsPerPixel, myMode.width, myMode.height, myMode.refresh, &exactMatch);

// mode = CGDisplayBestModeForParametersAndRefreshRateWithProperty(dspy, myMode.bitsPerPixel, myMode.width, myMode.height, myMode.refresh, kCGDisplayModeIsSafeForHardware, &exactMatch);

CGBeginDisplayConfiguration(&configRef);

err = CGConfigureDisplayMode(configRef, dspy, mode);

CGCompleteDisplayConfiguration( configRef, kCGConfigurePermanently );

if ( err != CGDisplayNoErr )
{
printf( "Oops! Mode switch failed?!?? (%d)\n", err );
}
}

#define kMaxDisplays 16

int
main(int argc, const char *argv[])
{
CGDirectDisplayID display[kMaxDisplays];
CGDisplayCount numDisplays;
CGDisplayCount i;
CGDisplayErr err;

if ( argc == 5 ) {
myMode.width = atoi(argv[1]);
myMode.height = atoi(argv[2]);
myMode.bitsPerPixel = atoi(argv[3]);
myMode.refresh = atoi(argv[4]);
} else {
myMode.width = 1024;
myMode.height = 768;
myMode.bitsPerPixel = 32;
myMode.refresh = 60;
}

printf( "Width: %d Height: %d BitsPerPixel: %d Refresh rate: %d\n", (int)myMode.width, (int)myMode.height, (int)myMode.bitsPerPixel, (int)myMode.refresh );

err = CGGetActiveDisplayList(kMaxDisplays,
display,
&numDisplays);
if ( err != CGDisplayNoErr )
{
printf("Cannot get displays (%d)\n", err);
exit( 1 );
}
printf( "%d displays found\n", (int)numDisplays );
for ( i = 0; i < numDisplays; ++i )
{
setdisplay(display[i]);
}
printf( "Done.\n" );

exit(0);
}





static int numberForKey( CFDictionaryRef desc, CFStringRef key )
{
CFNumberRef value;
int num = 0;

if ( (value = CFDictionaryGetValue(desc, key)) == NULL )
return 0;
CFNumberGetValue(value, kCFNumberIntType, &num);
return num;
}

static void printDesc( CFDictionaryRef desc )
{
char * msg;
if ( CFDictionaryGetValue(desc, kCGDisplayModeUsableForDesktopGUI) == kCFBooleanTrue )
msg = "Supports Aqua GUI";
else
msg = "Not for Aqua GUI";

printf( "\t%d x %d,\t%d BPP,\t%d Hz\t(%s)\n",
numberForKey(desc, kCGDisplayWidth),
numberForKey(desc, kCGDisplayHeight),
numberForKey(desc, kCGDisplayBitsPerPixel),
numberForKey(desc, kCGDisplayRefreshRate),
msg );
}

----END----

Cheers...
Post a commentAlert Admin

Most Recent Replies: View All 2 Replies

cscreen ReviewGREAT! :D - Version: 1.1, 4/5/2004 09:22AM PST

(1 of 1 users found this comment useful)

Fuchal
This allowed me to change the resolution on a lab computer that I didnt have permissions to change in System Prefs.... great since it was stuck on 800x600 or lower X-P

YAY!
Post a commentAlert Admin

cscreen ReviewThis is great. Thanks - Version: 1.0, 12/9/2003 10:10AM PST

(2 of 2 users found this comment useful)

smorourke
I've been trying to figure out how to do this for years. Thanks. This is fantastic for anyone who, for example, is plagued with an infestation of children's software on their computers.

I've already incorporated this into a simple reset script to be run whenever a game terminates.

This is also quite helpful for avoiding manual screen resets when starting some more recalcitrant (ancient) OS 9 applications in classic.

I'm convinced there are a lot of people out there who would love this if they knew about it. A friend tipped me off or I would have never spotted it.

Thanks for writing it.!!! Is source code available? I am just curious to see how it works...
Post a commentAlert Admin

Most Recent Replies: View All 1 Replies