Wikia

Vim Tips Wiki

Changes: Adjust display brightness in Mac OS X

Edit

Back to page

m (moved Adjust Brightness Automatically on Focus to Adjust display brightness in Mac OS X: Simpler title is adequate, it's for Mac, and might be more than "on focus")
(Clean.)
 
Line 8: Line 8:
 
|version=7.0
 
|version=7.0
 
|subpage=/201203
 
|subpage=/201203
|category1=
+
|category1=Mac OS X
 
|category2=
 
|category2=
 
}}
 
}}
This tip sets the brightness of the display, and is not related to the brightness of the colorscheme. The procedure here applies to Mac OS X, although it may be possible to do something similar in other systems.
+
This tip adjusts the brightness of the display when Vim gains or loses focus on Mac OS X systems. This is not related to the brightness of the colorscheme.
   
==What's this about?==
+
==Procedure==
I like my display on full brightness with a dark colorsheme when I'm coding, even late at night. Some people may like other brightness adjustments. Either way, when switching between full screen Vim and browser windows/terminals my retinas would get burnt and I needed to constantly adjust brightness.
+
I like my display on full brightness with a dark colorscheme when coding. When switching from full screen Vim to a browser window or a terminal, the display settings make the screen far too bright. To avoid that, the following procedure sets the screen brightness to full when Vim gains focus, then sets the screen to half brightness when Vim loses focus.
   
 
Download the command line brightness tool from [http://mattdanger.net/2008/12/adjust-mac-os-x-display-brightness-from-the-terminal/ here].
 
Download the command line brightness tool from [http://mattdanger.net/2008/12/adjust-mac-os-x-display-brightness-from-the-terminal/ here].
   
Then add the following two commands in your [[vimrc]].
+
Then add the following commands to your [[vimrc]].
 
<pre>
 
<pre>
 
:au FocusGained * :!brightness 1
 
:au FocusGained * :!brightness 1
 
:au FocusLost * :!brightness 0.5
 
:au FocusLost * :!brightness 0.5
 
</pre>
 
</pre>
 
Tip can be improved if the tool is improved to report current brightness setting so it could restore it. Also you probably only want this to happen if in fullscreen mode, so could possibly be improved there (if there is a way for Vim to detect it is full screened).
 
   
 
==Comments==
 
==Comments==
  +
Tip could be improved if the tool were improved to report the current brightness setting so it can be restored. Also you probably only want this to happen if in fullscreen mode, so could possibly be improved there (if there is a way for Vim to detect it is full screened).

Latest revision as of 08:51, April 26, 2012

Proposed tip Please edit this page to improve it, or add your comments below (do not use the discussion page).

Please use new tips to discuss whether this page should be a permanent tip, or whether it should be merged to an existing tip.
created March 8, 2012 · complexity basic · version 7.0

This tip adjusts the brightness of the display when Vim gains or loses focus on Mac OS X systems. This is not related to the brightness of the colorscheme.

ProcedureEdit

I like my display on full brightness with a dark colorscheme when coding. When switching from full screen Vim to a browser window or a terminal, the display settings make the screen far too bright. To avoid that, the following procedure sets the screen brightness to full when Vim gains focus, then sets the screen to half brightness when Vim loses focus.

Download the command line brightness tool from here.

Then add the following commands to your vimrc.

:au FocusGained * :!brightness 1
:au FocusLost * :!brightness 0.5

CommentsEdit

Tip could be improved if the tool were improved to report the current brightness setting so it can be restored. Also you probably only want this to happen if in fullscreen mode, so could possibly be improved there (if there is a way for Vim to detect it is full screened).

Around Wikia's network

Random Wiki