Py3status: [Module > Xrandr] Can't manage to make the "<OUTPUT_pos>" function work

Created on 29 Mar 2017  路  6Comments  路  Source: ultrabug/py3status

When I click on eDP-1+DP-1 on my i3bar generated by py3status, my 2 screens get mirrored instead of displaying side by side.

If I just run xrandr --output eDP-1 --right-of DP-1 in my term, it works well.

I think that for some reason, the module doesn't understand/read the DP-1_pos line in the config, considering the command which is run by py3status when I click on my bar (see log below).

Any idea?

Thanks a lot,

Flo


py3status version: 3.4

i3status.conf

xrandr {
        fallback = "eDP-1"
        force_on_start = "eDP-1+DP-1"
        DP-1_pos = "left-of eDP-1"
}

$ xrandr

Screen 0: minimum 320 x 200, current 2560 x 1440, maximum 8192 x 8192
eDP-1 connected primary (normal left inverted right x axis y axis)
 (...)
DP-1 connected 2560x1440+0+0 (normal left inverted right x axis y axis) 708mm x 398mm
   (...)
HDMI-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
HDMI-2 disconnected (normal left inverted right x axis y axis)

/var/log/messages

Mar 29 20:22:18 localhost py3status: Module `xrandr`: command "xrandr --output eDP-1 --auto --pos 0x0 --rotate normal --output DP-1 --auto --pos 0x0 --rotate normal --output HDMI-1 --off --output DP-2 --off --output HDMI-2 --off" exit code 0

All 6 comments

Thanks for this report

I think that for some reason, the module doesn't understand/read the DP-1_pos line in the config,

I think you are on to something. The issue is here https://github.com/ultrabug/py3status/blob/master/py3status/parse_config.py#L105

we only accept certain chars in a token you can get around this by quoting

xrandr {
        fallback = "eDP-1"
        force_on_start = "eDP-1+DP-1"
        "DP-1_pos" = "left-of eDP-1"
}

@ultrabug what do you think, should we allow the - in tokens, or just better document the quote thing?

Thanks A LOT @tobes, it works perfectly now :)

I second your comment to Ultrabug!

@tobes I think we should allow the - in the tokens yep

For my personal knowledge: I didn't have this bug a couple of weeks before, because my outputs were named eDP1 and DP1: what entity changed their names (to eDP-1 and DP-1), how, why? What defines the name of an output?

Graphic drivers, I think... nvidia, nouveau, xorg, etc. You should be able to control the device names better using something like udev... only if you're invested in doing that.

In master, quotes no longer needed. Thanks again for bringing this issue to light

Was this page helpful?
0 / 5 - 0 ratings

Related issues

IgnisDa picture IgnisDa  路  5Comments

lasers picture lasers  路  7Comments

mxmilkiib picture mxmilkiib  路  8Comments

CorruptCommit picture CorruptCommit  路  5Comments

maximbaz picture maximbaz  路  8Comments