From 0de6ed1f7f79caceb5903862e296eedbe700f7a1 Mon Sep 17 00:00:00 2001 From: slazor33 <38534338+slazor33@users.noreply.github.com> Date: Wed, 15 Jan 2025 18:01:35 -0500 Subject: [PATCH] Add Switch User... Option to Menu If the user has showPowerOptions set to true then there should also be an option to just switch users (IE go to the GDM Greeter without logging the current user out). I added the menu item and a function to do that. --- extension.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/extension.js b/extension.js index ec30d6e..761066b 100644 --- a/extension.js +++ b/extension.js @@ -105,6 +105,7 @@ class LogoMenuMenuButton extends PanelMenu.Button { this._addItem(new MenuItem(_('Lock Screen'), () => this._lockScreen())); this._addItem(new MenuItem(_('Log Out...'), () => this._logOut())); + this._addItem(new MenuItem(_('Switch User...'), () => this._switchUser())); } else if (!showPowerOptions && showLockScreen) { this._addItem(new PopupMenu.PopupSeparatorMenuItem()); this._addItem(new MenuItem(_('Lock Screen'), () => this._lockScreen())); @@ -157,6 +158,10 @@ class LogoMenuMenuButton extends PanelMenu.Button { Util.spawn(['gnome-session-quit', '--logout']); } + _switchUser() { + Util.trySpawnCommandLine('/usr/bin/gdmflexiserver'); + } + _showAppGrid() { // Code snippet from - https://github.com/G-dH/custom-hot-corners-extended/blob/gdh/actions.js // Pressing the apps btn before overview activation avoids icons animation in GS 3.36/3.38