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
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 bin/VTswitch
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/
sudo chmod +x /usr/local/ bin/VTswitch
sudo mkdir -p /etc/lightdm/ lightdm. conf.d
echo '[Seat:*] cleanup- script= /usr/local/ bin/VTswitch lightdm. conf.d/ 50-vtswitch. conf
session-
' | sudo tee /etc/lightdm/
sudo systemctl restart lightdm