快捷键切换特定「活动」

心之所在 | 2011/05/23

除了鼠标点来点去外,能找到方便的是Win+Tab循环切换活动,指定Win+F1切换「活动1」,Win+F2切换「活动2」,方法也是有的,需要点折腾。

1.先找到「活动」id

http://ow9msq.bay.livefilestore.com/y1pJB0PzvLymn10dWF2Jxho9adIBnZ2EWqFSA7Gy6LmxOc_2dLnBIt_aKYRNqCyh8I4Tzh6uj-kB7emOOBSNPWc8W1uj4VRkZ-_/kssa.jpeg?psid=1

每个「活动」都是有全局唯一标示符(GUID)的,需要命令:

qdbus org.kde.kactivitymanagerd /ActivityManager CurrentActivity

列出所有标示符

qdbus org.kde.kactivitymanagerd /ActivityManager ListActivities

排序跟「活动管理器」的是一样的。

2.创建快捷键

http://ow9msq.bay.livefilestore.com/y1pV9h8YwbaG0p06ZvabTcDciyJIeTx7w8FksxkhlIXa46q0_bBqZ7H-MV0KLlnOGh21r9VGoWOmANuz0Bu1uk8Or_n03-Kr66u/kssa1.jpeg?psid=1

1.系统设置-公共外观和行为-快捷键方式和手势-自定义快捷键。
2.编辑-新建-全局快捷键-D-Bus命令。
3.触发器里设定快捷键(比如Win+F1,Win和Meta是同一个按键)
4.动作标签填入:

  • 远程应用程序: org.kde.kactivitymanagerd
  • 远程对象 /ActivityManager
  • 函数: SetCurrentActivity
  • 参数: 第一步中拿到的GUID字段 比如 81f9a28b-1d62-4b35-a422-68a8d022bbfb

重复上面的操作把另外的「活动」也绑上快捷键。

其实整条dbus命令是(替换其中的GUID):

qdbus org.kde.kactivitymanagerd /ActivityManager SetCurrentActivity "GUID"

然后按键盘玩吧,骚年。

via hanschen

    泰达希尔-德鲁伊
    Tags: ,

    4 FEEDBACKS

    Leave a Reply to csslayer Cancel reply

    Your email address will not be published. Required fields are marked *

    Note: Commenter is allowed to use '@User+blank' to automatically notify your reply to other commenter. e.g, if ABC is one of commenter of this post, then write '@ABC '(exclude ') will automatically send your comment to ABC. Using '@all ' to notify all previous commenters. Be sure that the value of User should exactly match with commenter's name (case sensitive).

    This site uses Akismet to reduce spam. Learn how your comment data is processed.