![如何在Xubuntu中設定「切換使用者」的鍵盤快速鍵?](https://rvso.com/image/1114975/%E5%A6%82%E4%BD%95%E5%9C%A8Xubuntu%E4%B8%AD%E8%A8%AD%E5%AE%9A%E3%80%8C%E5%88%87%E6%8F%9B%E4%BD%BF%E7%94%A8%E8%80%85%E3%80%8D%E7%9A%84%E9%8D%B5%E7%9B%A4%E5%BF%AB%E9%80%9F%E9%8D%B5%EF%BC%9F.png)
我正在嘗試在 Xubuntu (13.04) 中建立鍵盤快捷鍵,但我不知道該命令要輸入什麼。調用切換用戶的命令是什麼?
答案1
我檢查了 xfce4-panel 中內建的「操作按鈕」插件的原始程式碼,並且切換使用者機制使用gdmflexiserver
,而大多數其他操作使用參數xfce4-session-logout
。
源是透過apt-get source xfce4-panel
;獲取的該資訊位於 ~/xfce4-panel-4.10.0/plugins/actions/actions.c:
case ACTION_TYPE_SWITCH_USER:
succeed = g_spawn_command_line_async ("gdmflexiserver", &error);
break;
您將在 處找到可執行文件/usr/lib/lightdm/lightdm/gdmflexiserver
,它實際上只是一個腳本:
#!/bin/sh
#
# Copyright (C) 2011 Canonical Ltd
# Author: Michael Terry <[email protected]>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation, version 3 of the License.
#
# See http://www.gnu.org/copyleft/gpl.html for the full text of the license.
if [ -z "$XDG_SEAT_PATH" ]; then
# something went wrong
exit 1
fi
dbus-send --system --type=method_call --print-reply --dest=org.freedesktop.DisplayManager $XDG_SEAT_PATH org.freedesktop.DisplayManager.Seat.SwitchToGreeter
它不在 中$PATH
,因此如果您在腳本中使用它,則需要指定絕對路徑。我不確定是否需要任何其他開關,但如果需要,我會添加一些進一步的資訊。
有用的腳本命令也可以在 的線上說明頁中找到xfce4-session-logout
,儘管其中沒有提到切換使用者操作,因為它使用了名為 的不同實用程式gdmflexiserver
。