Skip to content

Commit a0f97e7

Browse files
committed
vglserver_config: Don't modify lightdm.conf
(Create a configuration file under /etc/lightdm/lightdm.conf.d instead.) Closes #278
1 parent 9be3ac2 commit a0f97e7

2 files changed

Lines changed: 17 additions & 27 deletions

File tree

ChangeLog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ attempting to run a GLX application using the EGL back end and `vglrun -nodl`.
1414
3. Fixed an issue whereby the VirtualGL Configuration dialog did not pop up if
1515
the Num Lock key was on.
1616

17+
4. `vglserver_config` now creates a configuration file under
18+
**/etc/lightdm/lightdm.conf.d** rather than modifying
19+
**/etc/lightdm/lightdm.conf**.
20+
1721

1822
3.1.2
1923
=====

server/vglserver_config

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
# Copyright (C)2007 Sun Microsystems, Inc.
4-
# Copyright (C)2009-2014, 2016, 2018-2020, 2022-2023 D. R. Commander
4+
# Copyright (C)2009-2014, 2016, 2018-2020, 2022-2023, 2025 D. R. Commander
55
#
66
# This library is free software and may be redistributed and/or modified under
77
# the terms of the wxWindows Library License, Version 3.1 or (at your option)
@@ -220,23 +220,6 @@ addvglgenkey()
220220
fi
221221
}
222222

223-
addvglgenkey_lightdm()
224-
{
225-
backup $1
226-
if [ "$VGLUSERSONLY" = "1" ]; then
227-
echo ... Adding greeter-setup-script=vglgenkey to $1 ...
228-
else
229-
echo ... Adding greeter-setup-script=xhost \+LOCAL\: to $1 ...
230-
fi
231-
removeline $1 display-setup-script
232-
removeline $1 greeter-setup-script
233-
if [ "$VGLUSERSONLY" = "1" ]; then
234-
addtoconf $1 "Seat:seat*" "Seat:seat\*" greeter-setup-script=$VGLGENKEY
235-
else
236-
addtoconf $1 "Seat:seat*" "Seat:seat\*" "greeter-setup-script=xhost +LOCAL:"
237-
fi
238-
}
239-
240223
disablextest()
241224
{
242225
if [ -z "$1" ]; then
@@ -683,10 +666,9 @@ EOF
683666
delvglgenkey $file
684667
fi
685668
done
686-
if [ -f /etc/lightdm/lightdm.conf ]; then
687-
echo "... Removing X server access from /etc/lightdm/lightdm.conf ..."
688-
removeline /etc/lightdm/lightdm.conf display-setup-script
689-
removeline /etc/lightdm/lightdm.conf greeter-setup-script
669+
if [ -f /etc/lightdm/lightdm.conf.d/99-virtualgl.conf ]; then
670+
echo "... Removing /etc/lightdm/lightdm.conf.d/99-virtualgl.conf ..."
671+
rm /etc/lightdm/lightdm.conf.d/99-virtualgl.conf
690672
fi
691673
for dir in /usr/share/gdm/greeter/autostart \
692674
/usr/local/share/gdm/greeter/autostart; do
@@ -899,11 +881,15 @@ EOF
899881
addvglgenkey $file
900882
fi
901883
done
902-
if [ -f /etc/lightdm/lightdm.conf ]; then
903-
addvglgenkey_lightdm /etc/lightdm/lightdm.conf
904-
elif [ -d /etc/lightdm ]; then
905-
echo [SeatDefaults] >/etc/lightdm/lightdm.conf
906-
addvglgenkey_lightdm /etc/lightdm/lightdm.conf
884+
if [ -d /etc/lightdm/lightdm.conf.d ]; then
885+
echo ... Creating /etc/lightdm/lightdm.conf.d/99-virtualgl.conf ...
886+
echo "[Seat:seat*]" >/etc/lightdm/lightdm.conf.d/99-virtualgl.conf
887+
if [ "$VGLUSERSONLY" = "1" ]; then
888+
echo "greeter-setup-script=$VGLGENKEY" >>/etc/lightdm/lightdm.conf.d/99-virtualgl.conf
889+
else
890+
echo "greeter-setup-script=xhost +LOCAL:" >>/etc/lightdm/lightdm.conf.d/99-virtualgl.conf
891+
fi
892+
chmod 644 /etc/lightdm/lightdm.conf.d/99-virtualgl.conf
907893
fi
908894
for dir in /usr/share/gdm/greeter/autostart \
909895
/usr/local/share/gdm/greeter/autostart; do

0 commit comments

Comments
 (0)