1

For the life of me I'm trying to find a way, to system-wide REMOVE the lock 'icon' from the system tray (ie under the top left dropdown)... I've tried everything under the sun to either: stop it from doing anything, find a way to re-map what it actually DOES (ie change the command it runs - this would be the best solution). and also to simply remove it from the UI

I have tried all the various ways I have found from dconf settings, to editing the polkit-1/actions/org.freedesktop.login1.policy file.

My aim is to stop users from locking the desktop via THAT method... reason being it screws up x11vnc (when remoted in) when clicking it. I have an implementation of i3lock I want to set as the 'default' way of locking the desktop as that plays nice with said x11vnc.

Is there a way to fully remove it, or change its behaviour to run my i3lock-colour script?

I'm sure I've missed a simple solution, but I feel I've tried everything.

location of Lock icon within system tray

EDIT:

Additional: Something I've noticed that is 'odd' is if I manually run the command gnome-screensaver-command -l to lock immediately, I can happily - via a remote x11vnc - see the lock screen and unlock the machine. likewise if the vnc session is left open but no user input for a long time, I can see the same lock screen (and the same occurs if the vnc session is closed and left). Why does it do something different when pressing the GUI lock button? I'm led to believe locking via the gui button opens a new X display hence why x11vnc which is bound to :0 goes blank. again what command is causing this and can it be changed?

Edit2:

Just in case anyone was wondering... the machines HAVE to use 18.04 due to other driver/software that is only qualified for this version and a move to 20.04 (next qualified version) would require significant updates to other systems out of this scope and is a highly complex job. Kind of frustrating for me as I've seen numerous gnome extensions that are perfect, but incompatible with gnome 3.28.

Owen Morgan
  • 111
  • 2
  • This is not the "lock" icon, but a "system" icon. It is the shortcut to reach the most important settings of your system. Why do you want to delete a system eminent icon? – kanehekili May 24 '22 at 22:58
  • @kanehekili you raise a fair point. But equally unless I can change the behaviour of the system icon (ie make it not lock using the standard gnome lock but via a different process like i3lock or other 'screensaver/lock' - whatever terminology you fits - or disabling it) pressing it can have fundamental impacts to user productivity when remotely connected via the X11VNC connection as the only 'sane' way I've seen to recover is to reboot the machine, which is undesirable because that will stop key, long running, processes that the user was undertaking, causing big hits to productivity. – Owen Morgan May 25 '22 at 00:13
  • Sorry didn't mean that to sound 'forceful' apologise if thats how it comes across.... just frustration that something that I thought was customisable is much much more annoying to 'fix' than I hoped. TL;DR using x11vnc (because its important for users to access the same session remotely that was started locally) causes issues if That lock button is pressed in a remote session. its easy to say 'don't press it' but equally not user friendly to have it tempting them if they have a lapse and click it.... and recovering that has a major impact to the user and others... – Owen Morgan May 25 '22 at 01:05
  • @OwenMorgan is it ok for you to use a extension? Removing the lock icon from that menu is possible. Would you like to stick to removing lock icon or do you want to run custom command? I can help you creating extension for that, but x11vnc is a new topic for me. Can you try your custom command from below post in x11vnc or what ever way you like, if it works I can help you writing extension for you. – PRATAP May 27 '22 at 15:58
  • https://askubuntu.com/a/1289464/739431 – PRATAP May 27 '22 at 16:05
  • might you mention some of the extensions that are perfect but work on newer versions? Someone [here](https://askubuntu.com/questions/1412990/remove-lock-option-from-top-panel?noredirect=1#comment2456248_1412990) has more or less the same question, but for newer Gnome – Esther Jun 08 '22 at 20:38

1 Answers1

0

I've had almost similar issue, but with GNOME42 instead. I've found the fix after lot of hassle. You can either do it from terminal by using this command to remove it

gsettings set org.gnome.desktop.lockdown disable-lock-screen true

And using this command to re enable it again

gsettings reset org.gnome.desktop.lockdown disable-lock-screen

Alternatively you can also use dconf editor from GNOME store to navigate to /org/gnome/desktop/lockdown and change disable-lock-screen toggle for the same outcomes.

Although GNOME42 has text instead of icon, I'm pretty sure this will work for you too as it is changing dconf/gsettings itself.

Fair warning though not to mess with random options on dconf editor without understanding it as it can break your system.