EasonJim

说明:不一定每次都准确打开,80%的机会是行的。

原理:使用xdotool模拟键盘按键,打开的文件夹管理界面,然后通过Ctrl+L获取地址栏地址,然后传递到终端上。

安装:

1、安装xdotool

sudo apt-get install xdotool 

2、设置脚本

sudo vim /usr/bin/openterminal.sh

写入以下内容并保存

#!/bin/bash

xclip_tmp=$(xclip -o)
xdotool key Ctrl+l
xdotool key Ctrl+c
currnet_dir_path=$(xclip -o)
xdotool key Escape
gnome-terminal --working-directory="$currnet_dir_path"

设置可执行权限

sudo chmod  +x /usr/bin/openterminal.sh

在键盘上设置快捷键,如下:

3、使用

打开所在文件夹,按【Ctrl】+【G】

 

参考:

http://forum.ubuntu.org.cn/viewtopic.php?t=476365(脚本转自此篇文章)

分类:

技术点:

相关文章:

  • 2021-04-05
  • 2021-11-17
  • 2021-11-27
  • 2021-11-17
  • 2021-09-19
  • 2021-07-06
  • 2021-12-03
猜你喜欢
  • 2022-01-13
  • 2021-06-08
  • 2021-10-25
  • 2021-10-18
  • 2021-10-26
  • 2021-12-05
相关资源
相似解决方案