您尚未登录。

#1 2020-05-08 07:44:12

loyalpartner
会员
注册时间: 2013-06-04
帖子: 7

如何快速打开指定程序

我用 mac 和 windows 的时候,喜欢指定一个快捷键,用于打开特定的程序,如果这个程序已经打开了,则切换到这个程序,要是没有打开,就新开一个程序,请问 linux 里面要如何实现这个功能呢。

离线

#2 2020-05-08 11:36:26

xtricman
エクス·トリクマン
注册时间: 2012-12-26
帖子: 1,267

Re: 如何快速打开指定程序

too broad and not precisely enough defined


反社会,精神极其不稳定,随时可能炸碎身边所有人

离线

#3 2020-05-08 11:54:37

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,459
个人网站

Re: 如何快速打开指定程序

离线

#4 2020-05-30 15:26:59

loyalpartner
会员
注册时间: 2013-06-04
帖子: 7

Re: 如何快速打开指定程序

目前找到一种方案:
sxhkd + xdotool
配置方式:
switcher.sh

wid=$(xdotool search --class $1 | tail -1)
[[ -z "$wid" ]] && nohup $1 || xdotool windowactivate $wid 

sxhkd

ctrl + alt + {h, t, n}
  ~/.config/sxhkd/switcher.sh {emacs,chromium,konsole}

离线

页脚