Với bản Update mới cho extension thì code có chút thay đổi nên để làm được điều này.

Bật tùy chọn
Sau đó, sử dụng lệnh từ câu trả lời @UnKNOWn
Mở tệp tiện ích mở rộng extension.js bằng lệnh bên dưới
gedit $HOME/.local/share/gnome-Shell/extensions/BringOutSubmenuOfPowerOffLogoutButton@pratap.fastmail.fm/extension.js
Sắp xếp lại menu theo ý muốn từ chức năng _createMenu() chẳng hạn
_createMenu() {
để bindFlags = GObject.BindingFlags.DEFAULT | GObject.BindingFlags.SYNC_CREATE;
hãy để forceLockDown = this._settings.get_boolean('force-lock-down');
để boolean;
// Dấu phân cách1
boolean = this._settings.get_boolean('remove-separator-1');
if (!boolean) { SystemMenu.addMenuItem(dấu phân cách1); };
// Đình chỉ
tạm dừng = new PopupMenu.PopupImageMenuItem(_('Tạm dừng'), 'media-playback-pause-symbolic');
đình chỉ.connect('kích hoạt', () => {
DefaultActions.activateSuspend();
});
if(!forceLockDown) {
SystemMenu.addMenuItem(đình chỉ);
DefaultActions.bind_property('có thể tạm dừng', tạm dừng, 'hiển thị', bindFlags);
} khác {
boolean = this._settings.get_boolean('remove-suspend-button');
nếu (!boolean) {
SystemMenu.addMenuItem(đình chỉ);
// DefaultActions.bind_property('can-tạm dừng', tạm dừng, 'hiển thị', bindFlags);
}
}
// Khởi động lại
khởi động lại = new PopupMenu.PopupImageMenuItem(_('Restartâ¦'), 'system-reboot-symbolic');
khởi động lại.connect('kích hoạt', () => {
SHELL_MAJOR_VERSION >= 40 ? DefaultActions.activateRestart() : SessionManager.RebootRemote();
});
if(!forceLockDown) {
SystemMenu.addMenuItem(khởi động lại);
SHELL_MAJOR_VERSION >= 40 ? DefaultActions.bind_property('có thể khởi động lại', khởi động lại, 'hiển thị', bindFlags):
DefaultActions.bind_property('có thể tắt nguồn', khởi động lại, 'hiển thị', bindFlags);
} khác {
boolean = this._settings.get_boolean('remove-restart-button');
nếu (!boolean) {
SystemMenu.addMenuItem(khởi động lại);
// SHELL_MAJOR_VERSION >= 40 ? DefaultActions.bind_property('can-restart', this._restartButton, 'visible', bindFlags) :
// DefaultActions.bind_property('can-tắt nguồn', this._restartButton, 'visible', bindFlags);
}
}
// Đăng xuất
đăng xuất = new PopupMenu.PopupImageMenuItem(_('Đăng xuất'), 'đăng xuất hệ thống-biểu tượng');
logout.connect('kích hoạt', () => { DefaultActions.activateLogout(); });
if(!forceLockDown) {
SystemMenu.addMenuItem(đăng xuất);
DefaultActions.bind_property('có thể đăng xuất', đăng xuất, 'hiển thị', bindFlags);
} khác {
boolean = this._settings.get_boolean('remove-logout-button');
nếu (!boolean) {
SystemMenu.addMenuItem(đăng xuất);
// DefaultActions.bind_property('có thể đăng xuất', đăng xuất, 'hiển thị', bindFlags);
}
}
// Dấu phân cách2
boolean = this._settings.get_boolean('remove-separator-2');
if (!boolean) { SystemMenu.addMenuItem(dấu phân cách2); };
// Quyền lực
power = new PopupMenu.PopupImageMenuItem(_('Power Offâ¦'), 'system-shutdown-symbolic');
power.connect('kích hoạt', () => { DefaultActions.activatePowerOff(); });
if(!forceLockDown) {
SystemMenu.addMenuItem(sức mạnh);
DefaultActions.bind_property('có thể tắt nguồn', nguồn, 'hiển thị', bindFlags);
} khác {
boolean = this._settings.get_boolean('remove-power-button');
nếu (!boolean) {
SystemMenu.addMenuItem(sức mạnh);
// DefaultActions.bind_property('can-tạm dừng', tạm dừng, 'hiển thị', bindFlags);
}
}
// Chuyển người dùng
switchUser = new PopupMenu.PopupImageMenuItem(_('Switch Userâ¦'), 'system-switch-user-symbolic');
SystemMenu.addMenuItem(switchUser)
switchUser.connect('kích hoạt', () => { DefaultActions.activatSwitchUser(); });
DefaultActions.bind_property('can-switch-user', switchUser, 'visible', bindFlags);
DefaultActions.forceUpdate();
}
Bạn sẽ nhận được một menu trông như thế này:
