5

For testing displays, I need to show a single color fullscreen, and quickly switch from one to the next color. Can this be done from the terminal?

Something like this:

DISPLAY=:0 color #ff0000
1
  • 1
    you can use xsetroot for this purpose, for example: xsetroot -solid "#ffffff". However, it would not show a color in a new window but would change the background screen color and this is probably not what you want. But you can always use Xephyr. Apr 13, 2015 at 11:57

1 Answer 1

6

My first thought was xsetroot but I think that the following Python snippet will do it better:

import gtk
import sys

def create_window():
    window = gtk.Window()
    window.set_default_size(200, 200)
    window.connect('destroy', gtk.main_quit)
    color = gtk.gdk.color_parse(str(sys.argv[1]))
    window.modify_bg(gtk.STATE_NORMAL, color)

    window.maximize()
    window.show()

create_window()
gtk.main()

Usage:

$ python window.py '#01fffa'
3
  • great idea, but no gtk and py on the device... I should do it with the available basic Linux stuff. xsetroot as Arkadiusz proposed, is a great idea, but only works on one of the two devices I have under test. Will check with my OS colleague if xsetroot can be easily added
    – Frank
    Apr 14, 2015 at 6:54
  • 1
    @Frank: what exactly doesn't work with xsetroot? Apr 14, 2015 at 9:16
  • 1
    xsetroot is not installed...
    – Frank
    Apr 14, 2015 at 14:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .