Let xrandr set display number? [SOLVED]

I have a laptop running Arch-x86_64 with openbox, and I am using xrandr and a custom script to connect two external displays to my laptop, one VGA and one DVI. Since the graphics card (ATi Mobility Radeon HD2400XT) only supports two screens simultaneously, I turn LVDS off before turning the external monitors on. My problem is, that whenever starting the laptop with external monitors connected at boot, the DVI screen is set as display one, and the VGA as display two. When I connect the screens after logging in and starting openbox, the VGA screen is set as display one, and the DVI screen as display two. Is there any way to explicitly set which monitor to use as display one/primary in xrandr?
The shell script is the exact same in both cases, and looks like this:
xrandr --output LVDS --off
xrandr --output DVI-0 --auto
xrandr --output VGA-0 --auto --right-of DVI-0
Last edited by MFserver (2012-03-01 16:16:33)

I sat down today and merged 4 script files into one, and noticed a certain behaviour of xrandr. The code:
xrandr --output VGA-0 --off
xrandr --output LVDS --auto --primary
xrandr --output DVI-0 --off
Turns my external monitors off, and sets my display resolution correctly. Though, invoking the following:
xrandr --output VGA-0 --off --output LVDS --auto --primary --output DVI-0 --off
Does absolutely nothing. Here's my now working script:
#/bin/sh
usage="This script is used to set monitor configuration. Usage: monitor {laptop|workstation|presentation|check}"
DVI=$(xrandr | grep "DVI-0 connected");
VGA=$(xrandr | grep "VGA-0 connected");
echo $usage
echo $1$VGA$DVI
function restart
killall conky
conky &
openbox --restart &
nitrogen --restore &
function laptop
xrandr --output VGA-0 --off
xrandr --output LVDS --auto --primary
xrandr --output DVI-0 --off
xcalib /usr/share/color/icc/LVDS.icc
killall terminator
terminator -b --title=background-terminal-laptop --geometry=899x800+48+0 &
notify-send -i notification-display-screen 'Monitor profile: Laptop' 'The monitor profile is set to \"Laptop\"'
restart
beep
function workstation
xcalib -c
xrandr --output DVI-0 --auto --primary
xrandr --output LVDS --off
xrandr --output VGA-0 --auto --right-of DVI-0
xcalib -c -screen-1 -screen-2
killall terminator
terminator -b -T background-terminal-workstation --geometry=1200x1200+1920+0 &
notify-send -i notification-display-screen 'Monitor profile: Workstation' 'The monitor profile is set to \"Workstation\"'
restart
beep -r 2
function presentation
echo 'This function is not yet implemented'
notify-send -i notification-display-screen 'Monitor profile: Presentation' 'This monitor profile is yet to be implemented'
beep -r 3
if [ $1 = laptop ];
then
laptop
fi
if [ $1 = workstation ];
then
if [ -n "$DVI" ];
then
if [ -n "$VGA" ];
then
workstation
else
notify-send -i notification-display-screen 'Monitor profile: Workstation' 'Failed to set monitor profile, the VGA monitor is not connected.'
beep -l 1000 -r 2
fi
else
if [ -n "$VGA" ];
then
notify-send -i notification-display-screen 'Monitor profile: Workstation' 'Failed to set monitor profile, the DVI monitor is not connected.'
beep -l 1000 -r 2
else
notify-send -i notification-display-screen 'Monitor profile: Workstation' 'Failed to set monitor profile, no external monitors connected.'
beep -l 1000 -r 2
fi
fi
fi
if [ $1 = presentation ];
then
if [ -n "$DVI" ];
then
presentation
else
if [ -n "$VGA" ];
then
presentation
else
notify-send -i notification-display-screen 'Monitor profile: Presentation' 'Failed to set monitor profile, no external monitors connected.'
beep -l 1000 -r 2
fi
fi
fi
if [ $1 = check ];
then
if [ -n "$DVI" ];
then
if [ -n "$VGA" ];
then
workstation
else
presentation
fi
else
if [ -n "$VGA" ];
then
presentation
else
laptop
fi
fi
fi
I have experimented with the -s parameter of xcalib, and found that I don't know how to manually load icc profiles for the external monitors. That will have to be discussed in another thread, though. This can be marked as solved now, thanks for the help guys!
Last edited by MFserver (2012-02-26 11:32:56)

Similar Messages

  • How to set the number of rows that an awt.Choice can display

    Dear Sir,
    I want to ask how an awt.Choice  can set the number of rows that it can display, like the method setMaximumRowCount in JCombobox. Since I want to set more row can be displayed, but choice no any method can set. And I have tried to add Jcombobox into awt.frame, then, the handling event function cannot receive event for the right-top cornet button(minimize, maximum, close).
    Best Regards,

    please post a Short, Self Contained, Correct Example showing your problem.
    bye
    TPD

  • How to set the number of records displayed at run time

    Is it possible to set the number of records displayed block property at run time? The built-in 'GET_BLOCK_PROPERTY' can retrieve the number of RECORDS_DISPLAYED. But I can't find SET_BLOCK_PROPERTY to set this property. Is there anyway I can set this property programmatically? Thanks for any suggestions!

    Bookmark Go to End
    goal: How to vary the number of records displayed in a block
    programmatically
    fact: Oracle Forms Developer
    fix:
    Block property 'Number of Records Displayed' can not be changed during runtime
    using SET_BLOCK_PROPERTY. However, it is still possible programmatically change
    the visual appearance of the form so that it creates effect of changing this
    property. To achieve such an effect follow these steps:
    1. in Forms Builder, in the multirecord block define the new set of items.
    The simplest way is to copy/paste the original item and rename created item.
    2. set properties of these new items so that they are the same as the properties
    of the original items. If these new items were copied from original items
    then properties are already the same. Modify following properties
    'Database item' on new items to value 'No'
    'Synchronize with item' to the value of the original item
    'Number of Items Displayed' to desired value.
    'Visible' to 'No'
    In other words, these new items are mirrors of original items.
    3. code event, which is meant to trigger the change in block appearance.
    This code should use SET_ITEM_PROPERTY built-in to set properties
    like 'VISIBLE', 'ENABLED', 'NAVIGABLE', 'UPDATE_ALLOWED' and others
    to desired value for items which are about to be displayed, then
    move cursor to one of these just displayed items with GO_ITEM built-in
    and then hide the previously displayed items.
    Example:
    Assume that the block is built on SCOTT.DEPT schema. Following will
    change the set of displayed items
    set_item_property('dept.mdeptno',visible,property_true);
    set_item_property('dept.mdname',visible,property_true);
    set_item_property('dept.mloc',visible,property_true);
    set_item_property('dept.mdeptno',enabled,property_true);
    set_item_property('dept.mdname',enabled,property_true);
    set_item_property('dept.mloc',enabled,property_true);
    set_item_property('dept.mdeptno',update_allowed,property_true);
    set_item_property('dept.mdname',update_allowed,property_true);
    set_item_property('dept.mloc',update_allowed,property_true);
    set_item_property('dept.mdeptno',navigable,property_true);
    set_item_property('dept.mdname',navigable,property_true);
    set_item_property('dept.mloc',navigable,property_true);
    go_item('dept.mdeptno');
    set_item_property('dept.deptno',visible,property_false);
    set_item_property('dept.dname',visible,property_false);
    set_item_property('dept.loc',visible,property_false);
    Regards,
    Monica

  • How to set the number of seconds (or time) a photo is displayed on a slideshow (ATV2)

    Can I set the number of seconds a photo stays on the TV screen when I  do a slideshow from my ATV2?   Can't seem to find a setting on the Apple TV to do that.   For the slideshow on the ATV2 I am choosing an Event from my iPhoto library and then choosing "slideshow" after adjusting the ATV2 settings for music and theme.

    You can only set the time of slides with certain types of slideshows (i.e. classic and ken burns)

  • Illustrator won't run: "unable to set maximum number of files to be opened"

    I have an intel macbook pro (core duo with 2GB ram) and a copy of purchased adobe creative suite 2. Other applications in the suite like photoshop, acrobat, etc can run on my mac without any problem. But when I try to run illustrator, it just shows an error message "Unable to set maximum number of files to be opened" and quits. I also installed a trial version of illustrator cs3 and got the same problem. Can anyone help? Thanks.
    CC

    Hi, I realize this is an old thread but it was unanswered and the issue has come up again in a newer thread:
    http://forums.adobe.com/message/2534652
    If the original poster sees this, can you reply tin the new thread and let us know if you were ever to solve this problem?
    Thanks!

  • 8330 Call Forwarding​...How do I set the number of rings before calls are forwarded?

    8330 Call Forwarding...How do I set the number of rings before calls are forwarded? Right now it instantly forwards my calls but I don't want that. I want to change it so that let's say that if after 5 rings I don't answer the call is forwarded. I've looked everywhere for an answer but have had no luck. Any help would be appreciated. I am with Virgin Mobile if this makes a difference.
    Thank you 
    Message Edited by 8WDDdotcom on 08-01-2009 02:39 PM
    Message Edited by 8WDDdotcom on 08-01-2009 02:44 PM

    Well, call forwarding is a feature provided by your carrier -- it is not a function of the device. However it works for your carrier is how it works. Actually, from what I understand about call forwarding, it normally is an all-or-nothing circumstance...calls forward to the number you've asked them to be forwarded to, keeping you in a DND status. Regardless, though, if your carrier tells you how it works on their system, there's nothing that the device can do to override that. Unless there is some kind of 3rd party app that would do it, bypassing (somehow) the carrier network CF feature...but I've never heard of such a thing.
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • How to set the number of seconds a servlet is allowed to run

    I use JSP to generate a report, but it will take about 10 minutes to search.
    IE Client screen displays an error message what is "Cannot find out your page" after 8 minutes. How to set the number of seconds a servlet is allowed to run.

    It's not a matter of how long the servlet is running... it's the browser timing out because the servlet hasn't responded to its request.
    You have several options:
    1) "Browser Pinging"
    Your servlet sends some small data which can be either seen or unseen (html comments, hidden chars, etc) by the user at short intervals while your report is running. When the report is finished, the browser will not have timed out because it has been "snacking" on those small bits of data which tell the browser its original request was both heard and being handled. I don't think there is any timeout in IE as long as it receives data continually (or at least before its own timeout mark over and over again...)
    2) Multithreaded processing
    This would probably be a better approach. Have the report run in a separate thread running on the server. You'd want to store a reference to this executing report in the user's session. Instead of making the browser wait for the report to be finished, have the servlet check the user's session to see if a report exists and is running. If one does not exist, create one and start its execution. If one does exist, and is still running, print a "please wait" type of message OR an animation, etc... along with some javascript which will reload the page every few seconds. If the page reloads and the servlet sees that the report is finished, it can then display it to the user.
    Hope this helps,
    -Scott

  • How to set the number of sockets for batch processing at runtime?

    Hello all,
    I need to change the execution model at runtime. I have achieved this by setting the 'ModelPath' property of the sequence file at runtime. When I set the sequence file model as batchmodel, i need to set the number of test sockets also dynamically. How can this be done? Once i set the number of sockets, i would also have to set the UUT serial number for each socket. Please help me out in solving this.
    Thanks and Regards
    Madhu Srinivasan.

    Hi Madhu,
        You can do this by inserting a sequence file callback into your main sequence and choose the ModelOptions callback. You can then use the expression step to set the "Parameters.ModelOptions.NumTestSockets" value to whatever you want. If you then use the Test UUTs execution entry point you will be prompted for serial numbers automatically. You could also use this same procedure but alter the ModelOptions callback in the process model directly, either way works just as well but I think that using a sequence file callback gives a bit more flexibility in the system.
    Hope this helps,
       Nick

  • How do you set the number of visible items in the popup box of a JComboBox?

    Hi,
    Do you know how to set the number of items that shall be visible in the popup box of a JComboBox?
    I have produced an implementation of an autocomplete JComboBox such that following each character typed in the text field, the popup box is repopulated with items. Normally 8 items are visible when showing the popup box. Sometimes even though the list of items is > 8 the popup box shrinks in height so that 8 items are not visible.
    Thanks,
    Simon

    Below is my JComboBox autocomplete implementation.
    The problem seems to occur when the list of items is reduced in number, the button selected and then the list size increased, the popup box does not automatically increase in size. I have tried setMaximumRowCount � but does not resolve the problem.
    To see how it works:
    1)     click in text field.
    2)     Type 1 � the full list of items are shown.
    3)     Type 0 � the list has been narrowed down � the popup box is greyed out for remaining items.
    4)     Type Backspace � the full list of items is redisplayed.
    5)     Type 0 � to narrow down the list.
    6)     Select button � the popup box is invisible.
    7)     Select button � the popup box is displayed with 2 items.
    8)     Select Backspace � here is the problem � the combo box list contains all items but the popup box has been shrunk so that only 2 are visible.
    9)     Select button � popup box is invisible.
    10)     Select button � popup box is as expected.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.tree.*;
    import java.util.Enumeration;
    import java.util.Vector;
    import javax.swing.plaf.basic.*;
    class Test
    private JComboBox jCB = null;
    private JTextField jTF=null;
    private String typed="";
    private Vector vector=new Vector();
    public Test()
    JFrame fr=new JFrame("TEST ComboBox");
    JPanel p = new JPanel();
    p.setLayout( new BorderLayout() );
    ComboBoxEditor anEditor = new BasicComboBoxEditor();
    String[] s = new String[30];
    for (int i=0; i<30; i++) {
    s[i] = (new Integer(i+10)).toString();
    jTF=(JTextField)anEditor.getEditorComponent();
    jTF.addKeyListener(new KeyAdapter()
    public void keyReleased( KeyEvent ev )
    char key=ev.getKeyChar();
    if (! (Character.isLetterOrDigit(key)
    ||Character.isSpaceChar(key)
    || key == KeyEvent.VK_BACK_SPACE )) return;
    typed="";
    typed=jTF.getText();
    fillCB(vector);
    jCB.showPopup();
    jCB = new JComboBox();
    jCB.setEditor(anEditor);
    jCB.setEditable(true);
    boolean ins;
    for (int x=0; x<30; x++)
    ins = vector.add( new String(s[x]) );
    fillCB(vector);
    jCB.setSelectedIndex(-1);
    fr.getContentPane().add(p);
    p.add("South",jCB);
    p.add("Center",new JButton("test combo box"));
    fr.pack();
    fr.show();
    public void fillCB(Vector vector)
    typed = typed.trim();
    String typedUp = typed.toUpperCase();
    jCB.removeAllItems();
    jCB.addItem("Please select");
    for(Enumeration enu = vector.elements(); enu.hasMoreElements();) {
    String s = (String)enu.nextElement();
    if (s.toUpperCase().startsWith(typedUp)) {
    jCB.addItem(s);
    jTF.setText(typed);
    public static void main( String[] args )
    Test test=new Test();
    Many thanks,
    Simon

  • Setting display

    Hallo friends.
    Today I bought new iPhone 5S. Please can you give me an advise how to set display ( background ) on this phone. I had an old iPhone 3G, but that's another phone. The problem with display is, that three quarters of the display is in normal color, and the rest of the display is as if under a cloud.
    Please let me know how to set this.
    Thank you so much.
    Bye Svata

    Hallo kb1951
    The gray part of the display is every time at the bottom of the screen. When you look to the task bar down, there are icons of iPhone, Mail, Safari and Music. And these icons are as if under a cloud. But the task bar is OK.
    The gray color ( cloud or shadow ) strikes to the icons Compass and Settings.
    I don't know how it explain better. When you look on a original packet of the iPhone 5S you can see it. But the gray bar strikes to the next icons, and the "shadow" is still on a display. You can turn anything you want, and the shadow is still visible

  • Set DISPLAY environment variable -- in DBCA not working at AIX OS

    Hi,
    I want to create new database in AIX OS and database is oracle 10g:-
    When i say DBCA it is giving below error, what should i do?
    $ dbca
    DISPLAY not set.
    Set DISPLAY environment variable, then re-run.
    Please help...

    Pravin wrote:
    How to set the DISPLAY environment variable in AIX?Usual format is:
    +<host>:<display-number>+
    E.g.
    export DISPLAY=192.168.0.235:1
    Where the host is the hostname or IP address of the client platform running a X-Server. If the X-Server is running locally, then this entry can be omitted.
    The display-number is the display number of the X-Server to use. A single X-Server can have multiple displays. E.g. Unix server running a X-Server can have 10 users connected via X-Terminals and will this have 10 displays.
    Judging from X-Windows questions asked on OTN, it seems to be a tad complex to grasp for some - especially those from a MS Windows background as X-Windows is very different and also reverses the client-server concept, requiring the X-Server component to be running on the client platform (where the server platform runs the program that is the X-client).
    So it is a lot easier to rather use something like VNC instead - supported on most Unix platforms, Linux, Windows and Apple's OS/X.
    Simply run the VNC server on the server platform to create a virtual container for running the X-server display. Connect from a client using a VNC client.
    As it uses the RFB (Remote Frame Buffer) protocol, it is a lot faster than running the slower and larger X11 protocol required for X-Windows connectivity over TCP/IP.

  • How to set request number of info package using start routine

    Hi All,
    I have a specific requirement in which I need to upload only selective request nos from PSA to DSO.
    Any one can suggest how to set request number of info package using start routine or any other mode so that only selective request should proceed using DTP?
    Thanks
    Sangita

    You'll probably want to do this in a start routine.  It is probably not advisable to hard-code the technical name of the InfoPak.  They seem to remain the same upon transport, unlike DTP technical names which are locally generated.
    I would do a SQL select like this in a start routine, and then filter based on the results of the SQL.  You'll probably want to sort the results by date and time, both descending.  Or do a MAX in the SQL.
    Please let me know if this isn't clear.
    select q~rnr q~logdpid q~tdatum q~tuzeit
    from rsreqdone as q
      inner join rsldpio as p
        on p~logdpid = q~logdpid
    where p~objvers = 'A'
    and p~logdpid like 'ZPAK%'
    and p~source = 'your data source'

  • Is it possible to let Labview create displays himself dynamically?

    the number of displays can´t be fixed right now.
    i want to create a huge number of display by using a menu "create a new display". everyone should show another value from a global variable (Array).
    So i don´t want to use static elements - if i would do so, i had to create about 80 digital displays, 20 analog display and a few graphs. But i don´t need them every time - sometimes i need 3 digital and 15 analog displays, another time i need 60 digital an no analog displays. i only want to create 3 foundamental dislays and use them very often with different properties and pointers to the global variable!
    Is this possible?
    Thanks a lot...

    I have in many applications done this by using the picture control. Jean-Pierre first suggested an excellent approach to this in this link.
    http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=506500000008000000A33B0000&UCATEGORY_0=_49_%24_6_&UCATEGORY_S=0&USEARCHCONTEXT_INCLUDE_0=Ben+picture&USEARCHCONTEXT_INCLUDE_S=0&UPostedFromTimeSearchArg_0=8&UPostedFromTimeSearchArg_1=3&UPostedFromTimeSearchArg_2=2000&UPostedFromTimeSearchArg_S=4&UPostedToTimeSearchArg_0=4&UPostedToTimeSearchArg_1=9&UPostedToTimeSearchArg_2=2004&UPostedToTimeSearchArg_S=4&USEARCHCONTEXT_TIER_0=2&USEARCHCONTEXT_TIER_S=0
    You can use the "Invoke Node" to get the image of a control. If you combine this method with events configured for the picture control, you can simul
    ate normal LV objects.
    This method takes a bit bit of work, but it does allow the GUI to be taylored as your end user requires.
    You do not have to re-code all of the normal behaviour of your control elements. When a clcik is detected on a simulated device, a real LV FP object can be made visable and moved from its off-screen location to where the user clicked, and key-focus transfered. The user then interacts with the LV object that is on top of the the picture if it.
    It is not easy, but it works great!
    So as to:
    "Is it possible to let Labview create displays himself dynamically?"
    YES!
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Setting version number to column

    Hello,
    Having a table consisting of 3 columns :
    1. doc_no
    2. item_id
    3. item_name
    And displaying these columns into a submit form, making doc_no as read only.
    Question:
    I want to generate doc_no automatically in the page (like adf.currentDate in date column).So i did need the help of version number in edit attribute coulmn section for a particular doc_no column.*But though it is a primary key ,i 'm unable to set version number from history column*.
    So if anyone h've idea in regarding this (or) any idea to automatically generate doc_no, plz share with me.
    With Regards
    Jyoti
    Edited by: 824290 on Jan 24, 2011 2:35 AM

    Well, you've been given proper guidance - the Fusion Developer's Guide explains it all in great detail (it's the document from which I gave you the link). The technique works fine.
    If you don't believe the guidance is proper, then explain to us what doesn't work properly or why it won't work for your business case and then we can help.
    John

  • Adobe Captivate how to display number of attempts in Drag Drop Interaction slide

    Adobe Captivate how to display number of attempts in Drag Drop Interaction slide
    i have set attempts to 3
    on each failure i want to show on slide how many attempts used
    and how many correct answers

    Hi Sreekanth,
    You understanding is correct.  But,it is not even necessary to show the correct sources on correct targets along with the feedback... the correct option numbers in  incorrect feedback will do.
    reg point number 3, if I revisit the slide, the feedback are still displayed. For example, in this case, I added a correct feedback, but when I revisit the slide, the feedback was still appearing. So I added this action "On Enter"  to "Hide" this success caption. So that is why i told specifically that none of the feed backs should be there when i revisit the slide.
    Sorry Srikanth - I am not familiar with the advanced actions or variables. I have just used some from referring the examples from net. that's all

Maybe you are looking for