You are not logged in.

#1 2012-07-25 09:17:10

lemanski6
Member
Registered: 2011-05-02
Posts: 15

Detecting active display

Is there a way to detect currently active monitor on a multy-monitor desktop, so i can put it in a script?

Something like:

if $MONITOR1_ACTIVE; then
  do this
elif $MONITOR2_ACTIVE; then
  do that
fi

Offline

#2 2012-07-25 09:24:19

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Detecting active display

Xrandr?

xrandr -q

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2012-07-25 09:29:51

lemanski6
Member
Registered: 2011-05-02
Posts: 15

Re: Detecting active display

 # xrandr -q

xrandr: Failed to get size of gamma for output default
Screen 0: minimum 320 x 175, current 1680 x 1050, maximum 1680 x 1050
default connected 1680x1050+0+0 0mm x 0mm
   1680x1050      50.0* 
   1400x1050      51.0  
   1280x1024      52.0     53.0  
   1280x960       54.0     55.0  
   1152x864       56.0  
   1024x768       57.0     58.0     59.0     60.0     61.0     62.0  
   960x720        63.0     64.0  
   928x696        65.0     66.0  
   896x672        67.0     68.0  
   832x624        69.0  
   800x600        70.0     71.0     72.0     73.0     74.0     75.0     76.0     77.0     78.0     79.0  
   720x400        80.0  
   700x525        81.0     82.0  
   640x512        83.0     84.0     85.0  
   640x480        86.0     87.0     88.0     89.0     90.0     91.0     92.0     93.0  
   640x400        94.0  
   640x350        95.0  
   576x432        96.0  
   512x384        97.0     98.0     99.0    100.0    101.0  
   416x312       102.0  
   400x300       103.0    104.0    105.0    106.0    107.0  
   360x200       108.0  
   320x240       109.0    110.0    111.0    112.0  
   320x200       113.0  
   320x175       114.0

Offline

Board footer

Powered by FluxBB