Comment 143 for bug 1568604

Revision history for this message
Kevin Brubeck Unhammer (unhammer) wrote :

Argh, missed a “”→"" (I stupidly copy-pasted my script from another place I'd posted it instead of from the actual file …). Trying again:

sudo mkdir -p /usr/local/bin

echo '#!/bin/sh
n="$(fgconsole)" || exit 1
case "$n" in
[0-9]) /bin/chvt 1; /bin/chvt "$n";sleep 1;;
*) echo "error from $0; fgconsole gave $n" >/tmp/VTswitch.log
esac
' | sudo tee /usr/local/bin/VTswitch

sudo chmod +x /usr/local/bin/VTswitch

sudo mkdir -p /etc/lightdm/lightdm.conf.d

echo '[Seat:*]
session-cleanup-script=/usr/local/bin/VTswitch
' | sudo tee /etc/lightdm/lightdm.conf.d/50-vtswitch.conf

sudo systemctl restart lightdm