{"id":51,"date":"2020-04-26T11:13:25","date_gmt":"2020-04-26T03:13:25","guid":{"rendered":"https:\/\/blog.linsakura.com\/?p=51"},"modified":"2020-04-26T11:20:35","modified_gmt":"2020-04-26T03:20:35","slug":"ubuntu-open-terminal-in-the-current-folder","status":"publish","type":"post","link":"https:\/\/blog.linsakura.com\/index.php\/2020\/04\/26\/ubuntu-open-terminal-in-the-current-folder\/","title":{"rendered":"Ubuntu\u7528\u5feb\u6377\u952e\u65b9\u5f0f\uff0c\u5728\u5f53\u524d\u6587\u4ef6\u5939\u6253\u5f00\u7ec8\u7aef"},"content":{"rendered":"<p>[title]\u5b89\u88c5xclip\u548cxdotool[\/title]<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">sudo apt install xclip\r\nsudo apt install xdotool\r\n<\/pre>\n<p>[title]\u7f16\u5199\u6267\u884c\u811a\u672c[\/title]<br \/>\n\u547d\u540d\u968f\u610f\uff0c\u8fd9\u91cc\u4f7f\u7528<code>openterminal.sh<\/code><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">#!\/bin\/bash\r\nxclip_tmp=$(xclip -o)\r\nxdotool key Ctrl+l\r\nsleep 0.1\r\ncurrnet_dir_path=$(xclip -o)\r\nxdotool key Escape\r\ngnome-terminal --working-directory=$currnet_dir_path\r\necho $xclip_tmp | xclip -i\r\nsleep 0.1\r\nxdotool type \"\u8bf7\u5f00\u59cb\u4f60\u7684\u8868\u6f14\uff01\"\r\nxdotool key Ctrl+c\r\n<\/pre>\n<p>[title]\u590d\u5236\u5230\/usr\/bin[\/title]<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">sudo cp openterminal.sh \/usr\/bin\r\n<\/pre>\n<p>[title]\u8bbe\u7f6e\u5feb\u6377\u952e[\/title]<br \/>\n\u8fd9\u91cc\u4f7f\u7528\u5feb\u6377\u952e<code>Ctrl+G<\/code><br \/>\n\u7cfb\u7edf\u8bbe\u7f6e => \u952e\u76d8 => \u5feb\u6377\u952e => \u81ea\u5b9a\u4e49\u5feb\u6377\u952e => +<br \/>\n\u540d\u79f0: <code>OpenTerminal<\/code>   \/\/\u81ea\u5b9a\u4e49<br \/>\n\u547d\u4ee4: <code>\/usr\/bin\/openterminal.sh<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>[title]\u5b89\u88c5xclip\u548cxdotool[\/title] sudo apt install xclip sudo apt install xdotool [title]\u7f16\u5199\u6267\u884c\u811a\u672c[\/title] \u547d\u540d\u968f\u610f\uff0c\u8fd9\u91cc\u4f7f\u7528openterminal.sh #!\/bin\/bash xclip_tmp=$(xclip -o) xdotool key Ctrl+l sleep 0.1 currnet_dir [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,6],"tags":[18,19],"class_list":["post-51","post","type-post","status-publish","format-standard","hentry","category-dev","category-linux","tag-linux","tag-ubuntu"],"_links":{"self":[{"href":"https:\/\/blog.linsakura.com\/index.php\/wp-json\/wp\/v2\/posts\/51","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.linsakura.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.linsakura.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.linsakura.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.linsakura.com\/index.php\/wp-json\/wp\/v2\/comments?post=51"}],"version-history":[{"count":0,"href":"https:\/\/blog.linsakura.com\/index.php\/wp-json\/wp\/v2\/posts\/51\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.linsakura.com\/index.php\/wp-json\/wp\/v2\/media?parent=51"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.linsakura.com\/index.php\/wp-json\/wp\/v2\/categories?post=51"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.linsakura.com\/index.php\/wp-json\/wp\/v2\/tags?post=51"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}