On Sun, Mar 19, 2017 at 04:37:53PM +0000, arnaud gaboury wrote: > I am trying with no success to have one background terminal color for the > host and another one for the container. > > Some settings: > - on host: > window manager : i3 > terminal : urxvt-256 > > -on container: > no X, it is a server. > > Until now, I have tried to write a wrapper script to urxvt on host. This > script is to test value of $HOST or $TERM, then fire urxvt with background > color as option. This does not work. > > I have to figure out that when i log my container, I am first on an urxvt > terminal which become, once I am logged as user on container, a xterm. > I am totally lost where to write instruction as the terminal color > background: on host or container? and what app shall be tested to set the > environment and decide the bg color (agetty?) ?
Are you starting the container manually using systemd-nspawn in a terminal emulator window? If yes, then the following works (tested with gnome-terminal, but I think urxvt supports the same sequences): [Unit] DefaultDependencies=no Conflicts=shutdown.target [Service] StandardOutput=tty ExecStart=/usr/bin/printf '\033]11;darkgreen\007' ExecStop=/usr/bin/printf '\033]11;black\007' Type=oneshot RemainAfterExit=true [Install] WantedBy=basic.target (It would be nicer to undo the setting and return to whatever the old background was, but I don't know how to do this.) If you are logging into an existing container using machinectl shell or ssh, you can just the equivalent printfs to your ~/.profile. Zbyszek _______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/systemd-devel