How to enable or disable suspend functionality in gnome?

I am using gnome-shell --version 41.

we can set certain lockdown keys from dconf-editor or with gsettings like below

Once the lockdown keys are turned on, the entrys will also hide from system menu.
this is because, the binding for example

item = new PopupMenu.PopupMenuItem(_("Switch User…"));
item.connect('activate', () => {
    this.menu.itemActivated(BoxPointer.PopupAnimation.NONE);
    this._systemActions.activateSwitchUser();
});
this._sessionSubMenu.menu.addMenuItem(item);
this._loginScreenItem = item;
this._systemActions.bind_property('can-switch-user',
                                  this._loginScreenItem,
                                  'visible',
                                  bindFlags);

this._sessionSubMenu.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());

item = new PopupMenu.PopupMenuItem(_("Suspend"));
item.connect('activate', () => {
    this.menu.itemActivated(BoxPointer.PopupAnimation.NONE);
    this._systemActions.activateSuspend();
});
this._sessionSubMenu.menu.addMenuItem(item);
this._suspendItem = item;
this._systemActions.bind_property('can-suspend',
                                  this._suspendItem,
                                  'visible',
                                  bindFlags);

“switch-user” has option in dconf-editor to control.
like so for “suspend” how is that possible?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.