我可以使用什么终端命令来终止MacOSX上的光标/鼠标过程? [英] What terminal command can I use to terminate the cursor/mouse process on a MacOSX?

查看:52
本文介绍了我可以使用什么终端命令来终止MacOSX上的光标/鼠标过程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用什么终端命令来终止MacOSX上的光标/鼠标过程?

What terminal command can I use to terminate the cursor/mouse process on a MacOSX?

我正在终端中使用另一个命令来更改鼠标的大小,现在我需要重新启动显示光标的过程.我已经搜索了几个小时,寻找一个类似的主题,但是找不到一个主题.

I'm changing the size of the mouse using another command in the terminal and now I need to restart the process that displays the cursor. I have searched for hours for a similar topic, but couldn't find one.

有人知道如何实现这一目标吗?

Does anybody know how to achieve this?

推荐答案

如果通过使用终端中的另一个命令更改鼠标的大小",则表示您设置了系统偏好设置值(即使用默认值"命令)),那么您可以注销然后重新登录,或者可能有点乏味-请参阅以下答案:

If by "changing the size of the mouse using another command in the terminal", you mean that you set the System Preferences value (i.e. using 'defaults' command), then you could either log out and log back in, or it may be a bit tedious -- see this answer: How to programatically change the cursor size on a Mac

如果您要做的只是在系统范围内更改鼠标光标的大小,则可以使用UI脚本(如我所链接的答案中所建议).要执行的命令是:

If all you need to do is to change a mouse cursor size system-wide, you can use UI scripting (as suggested in the answer I linked). The command to execute would be:

osascript -e '
tell application "System Preferences"
    reveal anchor "Seeing_Display" of pane id "com.apple.preference.universalaccess"
end tell
tell application "System Events"
    set theSlider to slider "Cursor size:" of group 1 of window 1 of application process "System Preferences"
    set stash to value of theSlider
    set value of theSlider to SIZE_OF_THE_CURSOR
    stash
end tell'

请注意,您需要启用辅助访问"到osascript:

Note that you need to "enable assistive access" to osascript:

不允许用于辅助访问"从Java运行AppleScript时出错

这篇关于我可以使用什么终端命令来终止MacOSX上的光标/鼠标过程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆