File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env sh
2
+
3
+ # Note: /etc/lighdm/users.conf has a setting to hide a user via this line:
4
+ # hidden-users=nobody user2 user3
5
+ # HOWEVER this doesn't work if an AccountService has been installed, and it has on Ubuntu incl. BorgerPC.
6
+ # Hence we change it in the AccountService config instead.
7
+
8
+ # Reboot or run "systemctl restart lightdm" (which logs you out immediately) for it to take effect.
9
+
10
+ HIDE_SUPERUSER=$1
11
+ SHOW_CUSTOM_LOGIN_FIELD=$2
12
+
13
+ CHOSEN_USER=" superuser"
14
+ ACCOUNT_SERVICE_SUPERUSER=" /var/lib/AccountsService/users/$CHOSEN_USER "
15
+ LIGHTDM_CONFIG=" /etc/lightdm/lightdm.conf"
16
+
17
+ if [ " $HIDE_SUPERUSER " = " True" ]; then
18
+ FROM=" false"
19
+ TO=" true"
20
+ else
21
+ FROM=" true"
22
+ TO=" false"
23
+ fi
24
+
25
+ sed --in-place " s/SystemAccount=$FROM /SystemAccount=$TO /" $ACCOUNT_SERVICE_SUPERUSER
26
+
27
+ if [ " $SHOW_CUSTOM_LOGIN_FIELD " = " True" ]; then
28
+
29
+ # Idempotency: Don't add it if it's already there
30
+ if ! grep -q -- " greeter-show-manual-login" " $LIGHTDM_CONFIG " ; then
31
+ sed -i ' $ a greeter-show-manual-login=true' $LIGHTDM_CONFIG
32
+ fi
33
+ else
34
+ sed -i ' /greeter-show-manual-login/d' $LIGHTDM_CONFIG
35
+ fi
You can’t perform that action at this time.
0 commit comments