Re: [STUMP] Dim inactive monitor in dual head configuration

Dimitri Minaev <[email protected]>
Newsgroups gmane.comp.window-managers.stumpwm.devel
Message-ID <[email protected]>

On 06/03/2016 09:28 AM, Dimitri Minaev wrote:
>
>> There is also the problem that there is absolutely no guarantee that
>> xrandr and StumpWM will list heads in the same order. In fact, for me,
>> it's the other way around right now.
>
> But Stumpwm gets the list of head from `xdpyinfo -ext XINERAMA', right?
> I could replace `xrandr' with the `xdpyinfo', too.

I'm wise as king Solomon. And in my wisdom, I proclaim: render unto the 
user the thing that is user's. May he provides the list of heads in the 
correct order:

(setf *xrandr-heads* '("HDMI1" "VGA1"))

(defun dim-inactive-head (arg1 arg2)
   (let* ((brighthead (slot-value (current-head) 'number))
	 (dimhead (if (eql brighthead 0) 1 0)))
     (run-shell-command
      (format nil "/usr/bin/xrandr --output ~d --brightness 1.0" (nth 
brighthead *xrandr-heads*)))
     (run-shell-command
      (format nil "/usr/bin/xrandr --output ~d --brightness 0.7" (nth 
dimhead *xrandr-heads*)))))

That'll "fix" the problem of the stuck xrandr, too ;)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.