![“关闭 Nautilus 并在同一目录中打开终端”?](https://linux22.com/image/860337/%E2%80%9C%E5%85%B3%E9%97%AD%20Nautilus%20%E5%B9%B6%E5%9C%A8%E5%90%8C%E4%B8%80%E7%9B%AE%E5%BD%95%E4%B8%AD%E6%89%93%E5%BC%80%E7%BB%88%E7%AB%AF%E2%80%9D%EF%BC%9F.png)
有办法吗?通过键盘快捷键、上下文菜单项或其他方式?
注意:我具体指的是“关闭 Nautilus”——这无需关闭 Nautilus 即可打开终端。
答案1
您可以使用 Nautilus 脚本来实现这一点:
#!/bin/bash
# Simple Nautilus script that closes current Nautilus view and opens terminal in
# working directory
#
# Dependencies: xdotool
#
# See here for installation instructions:
# https://askubuntu.com/q/236414/81372
# Store working directory
WorkingDir="$(python -c 'import gio,sys; print(gio.File(sys.argv[1]).get_path())'\
"$NAUTILUS_SCRIPT_CURRENT_URI")"
# Close Nautilus window
xdotool key --clearmodifiers "alt+F4"
# Open terminal
gnome-terminal --working-directory="$WorkingDir"
可以找到 Nautilus 脚本的安装说明和设置热键这里。
唯一的依赖是xdotool
,您可以轻松安装:
sudo apt-get install xdotool