RandR segments¶
-
powerline.segments.randr.output(interval=2, auto_shrink=True, hide_if_single_output=True, status_icons={'on': 'on', 'off': 'off'}, short_format="{mirror_icon} {output_count}", output_format="{output} {status_icon}", mirror_icons={'mirror': 'M', 'extend': 'E'}, mirror_format="{mirror_icon}", redraw_hook=None, auto_update=False)¶ Manage connected outputs, optionally detect newly (dis-)connected outputs automatically.
Requires
python-xlib.Parameters: - mirror_format (string) – Format used to display the mirror mode (extend/mirror) part of the segment.
Valid fields are
mirror_stateandmirror_icon. - mirror_icons (dict) – Icons used in the
mirror_iconfield ofmirror_format. Needs the entriesextendandmirror. - output_format (string) – Format used to display outputs and information about their status.
Valid fields are
outputandstatus_icon. - status_icons (dict) – Icons used in the
status_iconfield ofoutput_format. Needs the entriesoffandon. - hide_if_single_output (bool) – Hide the segment if only a single output is connected. (Enabling this will still show
the segment if there is more than one output connected, of whom only one is not turned
off.) - auto_update (bool) – If set to true, this segment will automatically enable newly connected outputs or disable newly disconnected outputs according to the current mode. Also restarts bars appropriately.
Highlight groups used:
output:mirrororoutput:extendoroutput:mirror_stateoroutput(for the mirror mode part) andoutput:offoroutput:onoroutput:statusoroutput(for the outputs).Click values supplied:
mirror_state(string) for the mirror mode part andoutput_name(string),output_status(string) in the remaining part.Interaction: This segment supports interaction via bar commands in the following way. (Note that parameters given to the bar may be combined with click values.)
Bar command Description #bar;pass_oneshot:mode:<mode/toggle> Set the mirror mode to <mode> or <toggle> it. #bar;pass_oneshot:output:<output>:<on/off/toggle> Turn output <output> <on/off> or <toggle> its status. Restarts bars. - mirror_format (string) – Format used to display the mirror mode (extend/mirror) part of the segment.
Valid fields are
-
powerline.segments.randr.srot(output, interval=2, additional_controls=[], icons={'left': 'l', 'right': 'r', 'normal': 'n', 'inverted': 'i', 'locked': 'l', 'auto': 'a'}, format="{icon}", name="rotation", show_on_all_outputs=True, sensor_max_value=None, sensor_is_unsigned=False, hide_controls=True, rotation_hook=None, touchpad_states=None, touchpads=[], mapped_inputs=[], gravity_triggers=None, states=['normal', 'inverted', 'left', 'right'])¶ Manage screen rotation and optionally display some information. Optionally disables Touchpads in rotated states. (Note that rotating to the
leftandrightstates does not currently work if there is another output connected whose displayed content is not mirrored to the screen to be rotated.)Requires
xinputandpython-xliband an accelerometer.Parameters: - output (string) – The initial output to be rotated and to which touchscreen and stylus inputs are mapped. (Note that this can be changed at runtime via interaction with the segment.)
- show_on_all_outputs (bool) – If set to false, this segment is only visible on the specified output.
- name (string) – Possible values are
rotationandmode. This value is used to determine which highlight groups to use and how to populate theiconfield in the format string in the returned segment. If set to any other value, this segment will produce no output. - format (string) – Format string. Possible fields are
rotation(the current rotation state of the screen),mode(eitherautoorlocked, depending on whether auto-rotation on the screen is enabled or not), andicon(an icon depicting either the rotation status or the auto-rotation status, depending on the segment’s name). - icons (dict) – Dictionary mapping rotation states (
normal,inverted,left,right) and auto-rotation states (locked,auto) to strings to use to display them. Depending on the given name parameter, not all of these fields must be populated. - list states (string) – Allowed rotation states. Possible entries are
normal,inverted,left, andright. Per default, all of them are enabled. - gravity_triggers (dict) – Sensor values that trigger rotation as a dictionary mapping rotation states
(
normal,inverted,left,right) to numbers. Defaults to{'normal': -8, 'inverted': 8, 'left': 8, 'right': -8}, meaning that a (scaled) reading of thein_accel_x_rawreading greater than 8 triggers a rotation to stateleftand a reading less than -8 triggers a rotation to stateright. Readings ofin_accel_y_rawgreater and less than 8 and -8 respectively will yield a rotation to theinvertedandnormalstates respectively. - mapped_inputs (string_list) – List of substrings of device names that should be mapped to the specified output.
The entries in the specified list should be only substrings of devices listed as
Virtual core pointer, not of devices listed asVirtual core keyboard. - touchpads (string_list) – List of substrings of device names of touchpads to be managed.
The entries in the specified list should be only substrings of devices listed as
Virtual core pointer, not of devices listed asVirtual core keyboard. - touchpad_states (dict) – Dictionary mapping a rotation state (
normal,inverted,left,right) to eitherenabledordisabled, depending on whether the touchpads shall be enabled or disabled if the output is currently in the corresponding state. - rotation_hook (string) – A string to be run by a shell after a rotation that changes the screen ratio
(e.g. from
normaltoleft). It will be executed after the rotation takes place, but before the inputs are mapped to the output and before the bar resizes itself. - additional_controls ((string,string_list)_list) – A list of (contents, highlight_groups) pairs. For each entry, an additional
segment with the given contents and highlight groups is omitted. These segments
obtain the same click values and may also be used to control the segment behavior.
Also, all segments additionally use the
srothighlight group and the contents may be a format string with all fields (excepticon) available. - hide_controls (bool) – Hide the extra control segments. They may be shown via segment interaction.
Highlight groups used:
srot:normalorsrot:invertedorsrot:rightorsrot:leftorsrot:rotationorsrot(if the name parameter isrotation) orsrot:autoorsrot:lockedorsrot:modeorsrot(if the name parameter ismode) or None (if the name is set to something else).Click values supplied:
mode(string),rotation(string),output(string, the output this segment is rendered to),managed_output(string, the screen currently managed),touch_output(string, the screen where touch inputs are mapped to).Interaction: This segment supports interaction via bar commands in the following way. (Note that parameters given to the bar may be combined with click values.)
Bar command Description #bar;pass_oneshot:capture_input:<output> Map all specified input devices to <output> (experimental) #bar;pass_oneshot:capture:<output> Rotate the screen <output> instead (experimental) #bar;pass_oneshot:toggle_rot Toggle auto rotation if used on the screen that is currently managed; otherwise ignored. #bar;pass_oneshot:toggle_controls:<outpt> Toggles the visibility of additional control segments on output <output>