i spent way too many hours trying to fiddle with /etc/X11/xorg.conf trying to hook up various external projectors. too bad i didn't know this would solve all my problems.
You'll need to make sure your xorg.conf permits a virtual screen size this big. If it doesn't then xrandr should return a suitable error message that tells you the required size.
-s must be a valid resolution. You can get a list of valid (and supported) resolutions via `xrandr`.
Not sure if it works the same on any shell. Show Sample Output
[UPDATE: Now works for multiple connected outputs]
I woke up around midnight with an urge to do some late night hacking, but I didn't want a bright monitor screwing up my body's circadian rhythm. I've heard that at night blue (short wavelength) lights are particularly bad for your diurnal clock. That may be a bunch of hooey, but it is true that redder (longer wavelength) colors are easier on my eyes at night.
This command makes the screen dimmer and adjusts the gamma curves to improve contrast, particularly darkening blues and greens (Rɣ=2, Gɣ=3, Bɣ=4). To reset your screen to normal, you can run this command:
xrandr | sed -n 's/ connected.*//p' | xargs -n1 -tri xrandr --output {} --brightness 1 --gamma 1:1:1
or, more briefly,
xgamma -g 1
Note: The sed part is fragile and wrong. I'm doing it this way because of a misfeature in xrandr(1), which requires an output be specified but has no programmatic way of querying available outputs. Someone needs to patch up xrandr to be shell script friendly or at least add virtual outputs named "PRIMARY" and "ALL".
.
Todo: Screen should dim (gradually) at sunset and brighten at sunrise. I think this could be done with a self-resubmitting at job, but I'm running into the commandlinefu 127 character limit just getting the sunrise time:
wget http://aa.usno.navy.mil/cgi-bin/aa_pap.pl --post-data=$(date "+xxy=%Y&xxm=%m&xxd=%d")"&st=WA&place=Seattle" -q -O- | sed -rn 's/\W*Sunrise\W*(.*)/\1/p'
I hope some clever hacker comes up with a command line interface to Google's "OneBox", since the correct time shows up as the first hit when googling for "sunrise:cityname".
.
[Thank you to @flatcap for the sed improvement, which is much better than the head|tail|cut silliness I had before. And thank you to @braunmagrin for pointing out that the "connected" output may not be on the second line.]
Show Sample Output
This forces X back to its maximum resolution configured. To get a list, type `xrandr'.
Requires xrandr, grep and, sed. Show Sample Output
HDMI-1 is the interface in the example, which can be obtained just by typing xrandr and surfing through the output. There are a hell lot of configurations that can be done but I prefer auto because it works in most cases.
Lifesaver
Show Sample Output
This command first determines whether a second screen is connected. If this is the case, it sets the screen's RGB gamma via xrandr. Useful for cheap or slightly defective monitors with a tint. In this example a yellowing/champagne color deviation is compensated for by decreasing the red and the green portion of the image.
You need the RANDR support enable, to enable it with an ATI card run:
aticonfig --set-pcs-str="DDX,EnableRandr12,TRUE"
To show your available output run:
xrandr -q -d [yourdisplay]
To show your current resolution on your desktop Show Sample Output
Log scaled histogram so that you can see large files even if there is a single HUGE file in the directory. Also makes sure the histogram is fullscreen for best chance of readable file names.
xrandr --output <outputname> --brightness <value>
If the driver of your graphics card supports it, then you can use xrandr.
The following command lists the current configuration:
xrandr --current --verbose
If you want to change the configuration of an output, then you need the name of the output. This name is part of the output of xrandr --current, for example LVDS1.
The brightness can be changed like this:
xrandr --output <outputname> --brightness 0.8
Gamma:
xrandr --output <outputname> --gamma 0.5:1.0:1.0
Run a xrandr -q to get resolutions of displays. Put top resolution after --fb Divide top resolution by each display's resolution to get scale. Works for projectors, for instance.
Refactored the original. Cuts out the unnecessary grep and echo. Sample output shows that you get multiple results if you have multiple displays, each presented as 'landscape' whether the display is in fact in landscape or portrait orientation. In the sample case, 1920x1200 is misleading, since it's really in portrait mode, 1200x1920. Show Sample Output
if there are multiple monitors, this command uses multiple lines Show Sample Output
to view on another box:
nc <server address> <port> | ffplay -
use -r to adjust FPS and -q to adjust compression. use on trusted network only as nc is unencrypted.
see summary. if you want to set dpi right away try this: xrandr --query | sed -n 's@\([A-Z0-1-]*\).* \(.*\)x\(.*\)+.*+.* \([0-9]\+\)mm x \([0-9]\+\)mm@"--output \1 --dpi ";(\2/\4+\3/\5)*12.7@p;'|bc -l|xargs -L1 xrandr all syntax should be POSIX compliant. Show Sample Output
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: