Быстрое переключение пользователей / Apple Menu?

17761
cust0s

Мне нравится быстрое переключение пользователей, но я не заинтересован в нем в строке меню, мне интересно, можно ли поместить его в меню Apple? Или как-то изменить параметр «Выход» в меню Apple, чтобы переключать пользователей?

25

2 ответа на вопрос

36
Arjan

If adding a keyboard shortcut would be acceptable, then one can invoke CGSession -suspend to show the fast user switching. (You can use CGSession -switchToUserID `id -g bob`, for example, to switch to a specific user.)

Searching for that word CGSession will reveal many options, like Equivalent of Win-L on Mac or Create a keyboard shortcut for fast user switching in Mac OS X.

And rather than adding it to the Apple menu, in 10.6 Snow Leopard it's quite easy to add it to the Services menu of each application:

  • Start Applications » Automator
  • Select "Service" for the template of the new Automator workflow
  • In the top of the right pane, select "Service receives no input in any application"
  • Drag action "Run Shell Script" from the left pane into the workflow on the right pane
  • Leave Shell at its default "/bin/bash", and replace the default command cat with the following, without any line breaks:

    /System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend

  • Optional: click the Run button to test
  • Hit Cmd-S to save. The name you type will be the name in the Services menu. The workflow will be saved in ~/Library/Services.

Fast User Switching in Automator

To assign a keyboard shortcut, in 10.6:

  • Open System Preferences » Keyboard » pane Keyboard Shortcuts
  • Select "Services" in the left pane
  • Scroll down to General in the right pane
  • Double-click to the right of the Automator workflow you just created
  • Press the keys you want to use, and switch panes to ensure the new shortcut is saved
    • Please note that in 10.6 there is a bug that might prevent you from assigning services to function keys.
Это очень хороший урок. Milhous 12 лет назад 0
Я попытался назначить Cmd-L в качестве ярлыка, чтобы сделать его похожим на Windows-Win-L, но это не сработало, потому что некоторые приложения, такие как веб-браузеры, также используют ярлык Cmd-L. Поэтому я в итоге назначил Cmd-Shift-L. Gurjeet Singh 9 лет назад 0
Я попытался назначить Cmd-L в качестве ярлыка, чтобы сделать его похожим на Windows-Win-L, но это не сработало, потому что некоторые приложения, такие как веб-браузеры, также используют ярлык Cmd-L. Я пробовал некоторые другие комбинации, но ни одна из них не работала в _все_ приложениях, которые я регулярно использую. Поэтому я в итоге назначил Cmd-Shift-2. Gurjeet Singh 9 лет назад 1
Просто чтобы сделать это более современным: я могу подтвердить, что это все еще работает на Yosemite 10.10.5. Arc676 8 лет назад 1
0
Daniel Beck

Если вы используете один из популярных средств запуска приложений, таких как Quicksilver или LaunchBar, проверьте, могут ли они привести вас к окну входа в систему.

В панели запуска эта команда является Login Windowчастью индекса учетных записей пользователей .

Похожие вопросы