Config option to send xrandr options

Ask for new features here.

Moderator: Pablo

Post Reply
brown_m_k
Member
Posts: 45
Joined: Fri May 08, 2009 2:00 am

Config option to send xrandr options

Post by brown_m_k » Sat Feb 12, 2011 6:21 pm

Hi Pablo!

Would it be possible for you to add a config option to send xrandr options once X has started? I'm needing to pass an option to set underscan off on my hdmi output to the TV, as it's under-scanning (and creating black bars around the output). I''ll likely workaround it for now by pulling in some init scripts to run after x, but I'm thinking that I may not be the only one who suffers from this or other xrandr issues, so it might be helpful to have a properly supported solution for everyone.

Maybe an option like MM_X_XRANDR_OPTS or something?

Thanks!

/Mike

brown_m_k
Member
Posts: 45
Joined: Fri May 08, 2009 2:00 am

Re: Config option to send xrandr options

Post by brown_m_k » Sun Feb 13, 2011 4:32 am

Just as an FYI, here's the quick and dirty hack I've done to apply the xrandr options.

minimyth.pm

Code: Select all

    # Radeon xrandr support for AMD graphics
    $minimyth->confro_get('xrandr.pm', '/etc/rc.d/init/xrandr.pm');
    chmod(0644, '/etc/rc.d/init/xrandr.pm');
    symlink(q(/etc/rc.d/init/xrandr.pm), q(/etc/rc.d/rc/S83xrandr));

Code: Select all

################################################################################
# XRANDR - xrandr.pm
################################################################################
package init::xrandr;

use strict;
use warnings;

use MiniMyth ();

sub start
{   
    my $self     = shift;
    my $minimyth = shift;

    if ($minimyth->var_get('MM_X_XRANDR_OPTS') eq 'yes' )
    {
    system(qq(/bin/sleep 10 && /bin/su -c "xrandr -d :0 --output DVI-0 --set underscan off" - minimyth));
    }

    return 1;
}

1;
If I were to do this properly, I'd pass the options from the minimyth.conf file directly, rather than a 'yes'. But I'm not sure if shouldn't be better put into the 'x' startup, rather than as a 'hack' after x has started up. The sleep 10 is to ensure that x has started before the xrandr command is executed.

Hope that helps!

/Mike

Post Reply