3

is there a way to disable the eye icon in the login screen to prevent from someone "accidentally" turning it on and thus showing their password in plain sight? Thank you!

Leandro
  • 1,045

1 Answers1

3

Assuming you have a fresh install of Ubuntu 20.04, The workaround is to set the eye-icon size to 1px so that it is not visible and not reactive..

To use the workaround

Download the script from github with below command..

wget -qO - https://github.com/PRATAP-KUMAR/focalgdm3/archive/remove-eye-icon.tar.gz | tar zx --strip-components=1 focalgdm3-remove-eye-icon/focalgdm3

Run the command

sudo ./focalgdm3 \#4f194c

Optionally you may change the color #4f194c in above command with any color or you may replace the color \#4f194c with an absolute path of the Image if you wish an Image as background.

enter image description here

For reverting back to normal

Run the command

sudo ./focalgdm3 --reset

The above works only for login screen.. and not for lock screen, to use the same theme file for lock screen, we need to configure it separately.


Configuring the same file for lockscreen

copy the gresource file used for login screen with below command to system default folder

sudo cp /usr/local/share/gnome-shell/theme/custom/custom-gnome-shell-theme.gresource /usr/share/gnome-shell/theme/Yaru/

enter image description here

$ ls /usr/share/gnome-shell/theme/Yaru/
custom-gnome-shell-theme.gresource  gnome-shell-theme.gresource
$ 

Now to get away the changes we are doing from system upgrades.. make a local copy of the file /usr/share/gnome-shell/modes/ubuntu.json

sudo mkdir -p /usr/local/share/gnome-shell/modes
cp /usr/share/gnome-shell/modes/ubuntu.json /usr/local/share/gnome-shell/modes

Open the file ubuntu.json

sudo -H gedit /usr/local/share/gnome-shell/modes/ubuntu.json

Now edit the ubuntu.json file to use our login screen gdm3.css file with below content..

{
    "parentMode": "user",
    "stylesheetName": "gdm3.css",
    "themeResourceName": "theme/Yaru/custom-gnome-shell-theme.gresource",
    "debugFlags": ["backtrace-crashes-all"],
    "enabledExtensions": ["ubuntu-dock@ubuntu.com", "ubuntu-appindicators@ubuntu.com", "desktop-icons@csoriano"]
}

Now reboot to see the changes..

enter image description here

To revert back to normal, remove the two files we created for lock screen purpose..

sudo rm /usr/local/share/gnome-shell/modes/ubuntu.json /usr/share/gnome-shell/theme/Yaru/custom-gnome-shell-theme.gresource

References:
How do I change login screen theme or background in Ubuntu 20.04?
How to customize Lock Screen theme in Ubuntu 20.04

PRATAP
  • 22,460
  • Thank you for this answer. It tackles the problem, though, it's a very weird workaround. Isn't there a better way? – Pedro Rolo Feb 18 '21 at 13:56
  • Better way would be to compile the gnome-shell which may require programming language or atleast a grip on java scripts.. In that way programmer can remove the concept of eye icon. – PRATAP Feb 18 '21 at 14:34