{"id":217895,"date":"2021-05-18T10:24:36","date_gmt":"2021-05-18T02:24:36","guid":{"rendered":"https:\/\/gulass.cn\/?p=217895"},"modified":"2021-05-04T10:22:00","modified_gmt":"2021-05-04T02:22:00","slug":"use-linux-automation","status":"publish","type":"post","link":"https:\/\/gulass.cn\/use-linux-automation.html","title":{"rendered":"\u4f7f\u7528 Linux \u81ea\u52a8\u5316\u5de5\u5177 AutoKey\u63d0\u9ad8\u751f\u4ea7\u7387"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u7528 AutoKey \u914d\u7f6e\u4f60\u7684\u952e\u76d8\uff0c\u7ea0\u6b63\u5e38\u89c1\u7684\u9519\u522b\u5b57\uff0c\u8f93\u5165\u5e38\u7528\u7684\u77ed\u8bed\u7b49\u7b49\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"<\/p>\n

AutoKey \u662f\u4e00\u4e2a\u5f00\u6e90\u7684 Linux \u684c\u9762\u81ea\u52a8\u5316\u5de5\u5177\uff0c\u4e00\u65e6\u5b83\u6210\u4e3a\u4f60\u5de5\u4f5c\u6d41\u7a0b\u7684\u4e00\u90e8\u5206\uff0c\u4f60\u5c31\u4f1a\u60f3\uff0c\u5982\u4f55\u6ca1\u6709\u5b83\uff0c\u90a3\u8be5\u600e\u4e48\u529e\u3002\u5b83\u53ef\u4ee5\u6210\u4e3a\u4e00\u79cd\u63d0\u9ad8\u751f\u4ea7\u7387\u7684\u53d8\u9769\u6027\u5de5\u5177\uff0c\u6216\u8005\u4ec5\u4ec5\u662f\u51cf\u5c11\u4e0e\u6253\u5b57\u6709\u5173\u7684\u8eab\u4f53\u538b\u529b\u7684\u4e00\u79cd\u65b9\u5f0f\u3002<\/p>\n

\u672c\u6587\u5c06\u7814\u7a76\u5982\u4f55\u5b89\u88c5\u548c\u5f00\u59cb\u4f7f\u7528 AutoKey \uff0c\u4ecb\u7ecd\u4e00\u4e9b\u53ef\u4ee5\u7acb\u5373\u5728\u5de5\u4f5c\u6d41\u7a0b\u4e2d\u4f7f\u7528\u7684\u7b80\u5355\u65b9\u6cd5\uff0c\u5e76\u63a2\u8ba8 AutoKey \u9ad8\u7ea7\u7528\u6237\u53ef\u80fd\u4f1a\u611f\u5174\u8da3\u7684\u4e00\u4e9b\u9ad8\u7ea7\u529f\u80fd\u3002<\/p>\n

\u5b89\u88c5\u5e76\u8bbe\u7f6e AutoKey<\/strong><\/div>\n

AutoKey \u5728\u8bb8\u591a Linux \u53d1\u884c\u7248\u4e2d\u90fd\u662f\u73b0\u6210\u7684\u8f6f\u4ef6\u5305\u3002\u8be5\u9879\u76ee\u7684 \u5b89\u88c5\u6307\u5357 \u5305\u542b\u8bb8\u591a\u5e73\u53f0\u7684\u8bf4\u660e\uff0c\u4e5f\u5305\u62ec\u4e86\u4ece\u6e90\u4ee3\u7801\u8fdb\u884c\u6784\u5efa\u7684\u6307\u5bfc\u3002\u672c\u6587\u4f7f\u7528 Fedora \u4f5c\u4e3a\u64cd\u4f5c\u5e73\u53f0\u3002<\/p>\n

AutoKey \u6709\u4e24\u4e2a\u53d8\u4f53\uff1a\u4e3a\u50cf GNOME \u7b49\u57fa\u4e8e GTK \u73af\u5883\u800c\u8bbe\u8ba1\u7684 autokey-gtk \u548c\u57fa\u4e8e QT \u7684 autokey-qt\u3002<\/p>\n

\u4f60\u53ef\u4ee5\u4ece\u547d\u4ee4\u884c\u5b89\u88c5\u4efb\u4e00\u53d8\u4f53\uff1a<\/p>\n

sudo dnf install autokey-gtk<\/pre>\n

\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u4f7f\u7528 autokey-gtk<\/span>\uff08\u6216 autokey-qt<\/span>\uff09\u8fd0\u884c\u5b83\u3002<\/p>\n

\u63a2\u7a76\u754c\u9762<\/strong><\/div>\n

\u5728\u5c06 AutoKey \u8bbe\u7f6e\u4e3a\u5728\u540e\u53f0\u8fd0\u884c\u5e76\u81ea\u52a8\u6267\u884c\u64cd\u4f5c\u4e4b\u524d\uff0c\u4f60\u9996\u5148\u9700\u8981\u5bf9\u5176\u8fdb\u884c\u914d\u7f6e\u3002\u8c03\u51fa\u7528\u6237\u754c\u9762\uff08UI\uff09\u914d\u7f6e\uff1a<\/p>\n

autokey-gtk -c<\/pre>\n

AutoKey \u63d0\u4f9b\u4e86\u4e00\u4e9b\u9884\u8bbe\u914d\u7f6e\u7684\u793a\u4f8b\u3002\u4f60\u53ef\u80fd\u5e0c\u671b\u5728\u719f\u6089 UI \u65f6\u5c06\u4ed6\u4eec\u7559\u4f5c\u5907\u7528\uff0c\u4f46\u662f\u53ef\u4ee5\u6839\u636e\u9700\u8981\u5220\u9664\u5b83\u4eec\u3002<\/p>\n

\"\"<\/p>\n

\u5de6\u4fa7\u7a97\u683c\u5305\u542b\u4e00\u4e2a\u6587\u4ef6\u5939\u5f0f\u7684\u77ed\u8bed\u548c\u811a\u672c\u7684\u5c42\u6b21\u7ed3\u6784\u3002\u201c\u77ed\u8bed\u201d \u4ee3\u8868\u8981\u8ba9 AutoKey \u8f93\u5165\u7684\u6587\u672c\u3002\u201c\u811a\u672c\u201d \u662f\u52a8\u6001\u7684\u3001\u7a0b\u5e8f\u5316\u7684\u7b49\u6548\u9879\uff0c\u53ef\u4ee5\u4f7f\u7528 Python \u7f16\u5199\uff0c\u5e76\u4e14\u83b7\u5f97\u4e0e\u952e\u76d8\u51fb\u952e\u53d1\u9001\u5230\u6d3b\u52a8\u7a97\u53e3\u57fa\u672c\u76f8\u540c\u7684\u7ed3\u679c\u3002<\/p>\n

\u53f3\u4fa7\u7a97\u683c\u6784\u5efa\u548c\u914d\u7f6e\u77ed\u8bed\u548c\u811a\u672c\u3002<\/p>\n

\u5bf9\u914d\u7f6e\u6ee1\u610f\u540e\uff0c\u4f60\u53ef\u80fd\u5e0c\u671b\u5728\u767b\u5f55\u65f6\u81ea\u52a8\u8fd0\u884c AutoKey\uff0c\u8fd9\u6837\u5c31\u4e0d\u5fc5\u6bcf\u6b21\u90fd\u542f\u52a8\u5b83\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u5728 \u201c\u9996\u9009\u9879\u201d\u83dc\u5355\uff08\u201c\u7f16\u8f91 -> \u9996\u9009\u9879\u201d\uff09\u4e2d\u52fe\u9009 \u201c\u767b\u5f55\u65f6\u81ea\u52a8\u542f\u52a8 \u201d\u8fdb\u884c\u914d\u7f6e\u3002<\/p>\n

\"\"<\/p>\n

\u4f7f\u7528 AutoKey \u7ea0\u6b63\u5e38\u89c1\u7684\u6253\u5b57\u6392\u7248\u9519\u8bef<\/strong><\/div>\n

\u4fee\u590d\u5e38\u89c1\u7684\u6253\u5b57\u6392\u7248\u9519\u8bef\u5bf9\u4e8e AutoKey \u6765\u8bf4\u662f\u4e00\u4e2a\u5bb9\u6613\u89e3\u51b3\u7684\u95ee\u9898\u3002\u4f8b\u5982\uff0c\u6211\u59cb\u7ec8\u952e\u5165 \u201cgerp\u201d \u6765\u4ee3\u66ff \u201cgrep\u201d\u3002\u8fd9\u91cc\u662f\u5982\u4f55\u914d\u7f6e AutoKey \u4e3a\u4f60\u89e3\u51b3\u8fd9\u4e9b\u7c7b\u578b\u95ee\u9898\u3002<\/p>\n

\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5b50\u6587\u4ef6\u5939\uff0c\u53ef\u4ee5\u5728\u5176\u4e2d\u5c06\u6240\u6709\u201c\u6253\u5b57\u6392\u7248\u9519\u8bef\u6821\u6b63\u201d\u914d\u7f6e\u5206\u7ec4\u3002\u5728\u5de6\u4fa7\u7a97\u683c\u4e2d\u9009\u62e9 \u201cMy Phrases\u201d \uff0c\u7136\u540e\u9009\u62e9 \u201c\u6587\u4ef6 -> \u65b0\u5efa -> \u5b50\u6587\u4ef6\u5939\u201d\u3002\u5c06\u5b50\u6587\u4ef6\u5939\u547d\u540d\u4e3a \u201cTypos\u201d\u3002<\/p>\n

\u5728 \u201c\u6587\u4ef6 -> \u65b0\u5efa -> \u77ed\u8bed\u201d \u4e2d\u521b\u5efa\u4e00\u4e2a\u65b0\u77ed\u8bed\u3002\u5e76\u5c06\u5176\u79f0\u4e3a \u201cgrep\u201d\u3002<\/p>\n

\u901a\u8fc7\u9ad8\u4eae\u9009\u62e9\u77ed\u8bed \u201cgrep\u201d\uff0c\u7136\u540e\u5728 \u8f93\u5165\u77ed\u8bed\u5185\u5bb9\u90e8\u5206\uff08\u66ff\u6362\u9ed8\u8ba4\u7684 \u201cEnter phrase contents\u201d \u6587\u672c\uff09\u4e2d\u8f93\u5165 \u201cgrep\u201d \uff0c\u914d\u7f6e AutoKey \u63d2\u5165\u6b63\u786e\u7684\u5173\u952e\u8bcd\u3002<\/p>\n

\u63a5\u4e0b\u6765\uff0c\u901a\u8fc7\u5b9a\u4e49\u7f29\u5199\u6765\u8bbe\u7f6e AutoKey \u5982\u4f55\u89e6\u53d1\u6b64\u77ed\u8bed\u3002\u70b9\u51fb\u7528\u6237\u754c\u9762\u5e95\u90e8\u7d27\u90bb \u201c\u7f29\u5199\u201d \u7684 \u201c\u8bbe\u7f6eSet\u201d\u6309\u94ae\u3002<\/p>\n

\u5728\u5f39\u51fa\u7684\u5bf9\u8bdd\u6846\u4e2d\uff0c\u5355\u51fb \u201c\u6dfb\u52a0\u201d \u6309\u94ae\uff0c\u7136\u540e\u5c06 \u201cgerp\u201d \u6dfb\u52a0\u4e3a\u65b0\u7684\u7f29\u5199\u3002\u52fe\u9009 \u201c\u5220\u9664\u952e\u5165\u7684\u7f29\u5199\u201d\uff1b\u6b64\u9009\u9879\u8ba9 AutoKey \u5c06\u4efb\u4f55\u952e\u5165 \u201cgerp\u201d \u4e00\u8bcd\u7684\u66ff\u6362\u4e3a \u201cgrep\u201d\u3002\u8bf7\u4e0d\u8981\u52fe\u9009\u201c\u5728\u952e\u5165\u5355\u8bcd\u7684\u4e00\u90e8\u5206\u65f6\u89e6\u53d1\u201d\uff0c\u8fd9\u6837\uff0c\u5982\u679c\u4f60\u952e\u5165\u5305\u542b \u201cgrep\u201d\u7684\u5355\u8bcd\uff08\u4f8b\u5982 \u201cfingerprint\u201d\uff09\uff0c\u5c31\u4e0d\u4f1a\u5c1d\u8bd5\u5c06\u5176\u8f6c\u6362\u4e3a \u201cfingreprint\u201d\u3002\u4ec5\u5f53\u5c06 \u201cgrep\u201d \u4f5c\u4e3a\u72ec\u7acb\u7684\u5355\u8bcd\u952e\u5165\u65f6\uff0c\u6b64\u529f\u80fd\u624d\u6709\u6548\u3002<\/p>\n

\"\"<\/p>\n

\u9650\u5236\u5bf9\u7279\u5b9a\u5e94\u7528\u7a0b\u5e8f\u7684\u66f4\u6b63<\/strong><\/div>\n

\u4f60\u53ef\u80fd\u5e0c\u671b\u4ec5\u5728\u67d0\u4e9b\u5e94\u7528\u7a0b\u5e8f\uff08\u4f8b\u5982\u7ec8\u7aef\u7a97\u53e3\uff09\u4e2d\u6253\u5b57\u6392\u7248\u9519\u8bef\u65f6\u624d\u5e94\u7528\u6821\u6b63\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6e \u7a97\u53e3\u8fc7\u6ee4\u5668\u8fdb\u884c\u914d\u7f6e\u3002\u5355\u51fb \u201c\u8bbe\u7f6eSet\u201d \u6309\u94ae\u6765\u5b9a\u4e49\u3002<\/p>\n

\u8bbe\u7f6e\u7a97\u53e3\u8fc7\u6ee4\u5668\u7684\u6700\u7b80\u5355\u65b9\u6cd5\u662f\u8ba9 AutoKey \u4e3a\u4f60\u68c0\u6d4b\u7a97\u53e3\u7c7b\u578b\uff1a<\/p>\n

\u542f\u52a8\u4e00\u4e2a\u65b0\u7684\u7ec8\u7aef\u7a97\u53e3\u3002
\n\u8fd4\u56de AutoKey\uff0c\u5355\u51fb \u201c\u68c0\u6d4b\u7a97\u53e3\u5c5e\u6027\u201d\u6309\u94ae\u3002
\n\u5355\u51fb\u7ec8\u7aef\u7a97\u53e3\u3002
\n\u8fd9\u5c06\u81ea\u52a8\u586b\u5145\u7a97\u53e3\u8fc7\u6ee4\u5668\uff0c\u53ef\u80fd\u7684\u7a97\u53e3\u7c7b\u503c\u4e3a gnome-terminal-server.Gnome-terminal<\/span>\u3002\u8fd9\u8db3\u591f\u4e86\uff0c\u56e0\u6b64\u5355\u51fb \u201cOK\u201d\u3002<\/p>\n

\"\"<\/p>\n

\u4fdd\u5b58\u5e76\u6d4b\u8bd5<\/strong><\/div>\n

\u5bf9\u65b0\u914d\u7f6e\u6ee1\u610f\u540e\uff0c\u8bf7\u786e\u4fdd\u5c06\u5176\u4fdd\u5b58\u3002 \u5355\u51fb \u201c\u6587\u4ef6\u201d \uff0c\u7136\u540e\u9009\u62e9 \u201c\u4fdd\u5b58\u201d \u4ee5\u4f7f\u66f4\u6539\u751f\u6548\u3002<\/p>\n

\u73b0\u5728\u8fdb\u884c\u91cd\u8981\u7684\u6d4b\u8bd5\uff01\u5728\u4f60\u7684\u7ec8\u7aef\u7a97\u53e3\u4e2d\uff0c\u952e\u5165 \u201cgerp\u201d \u7d27\u8ddf\u4e00\u4e2a\u7a7a\u683c\uff0c\u5b83\u5c06\u81ea\u52a8\u66f4\u6b63\u4e3a \u201cgrep\u201d\u3002\u8981\u9a8c\u8bc1\u7a97\u53e3\u8fc7\u6ee4\u5668\u662f\u5426\u6b63\u5728\u8fd0\u884c\uff0c\u8bf7\u5c1d\u8bd5\u5728\u6d4f\u89c8\u5668 URL \u680f\u6216\u5176\u4ed6\u5e94\u7528\u7a0b\u5e8f\u4e2d\u952e\u5165\u5355\u8bcd \u201cgerp\u201d\u3002\u5b83\u5e76\u6ca1\u6709\u53d8\u5316\u3002<\/p>\n

\u4f60\u53ef\u80fd\u4f1a\u8ba4\u4e3a\uff0c\u4f7f\u7528 shell \u522b\u540d \u53ef\u4ee5\u8f7b\u677e\u89e3\u51b3\u6b64\u95ee\u9898\uff0c\u6211\u5b8c\u5168\u8d5e\u6210\uff01\u4e0e\u522b\u540d\u4e0d\u540c\uff0c\u53ea\u8981\u662f\u9762\u5411\u547d\u4ee4\u884c\uff0c\u65e0\u8bba\u4f60\u4f7f\u7528\u4ec0\u4e48\u5e94\u7528\u7a0b\u5e8f\uff0cAutoKey \u90fd\u53ef\u4ee5\u6309\u89c4\u5219\u7ea0\u6b63\u9519\u8bef\u3002<\/p>\n

\u4f8b\u5982\uff0c\u6211\u5728\u6d4f\u89c8\u5668\uff0c\u96c6\u6210\u5f00\u53d1\u73af\u5883\u548c\u7ec8\u7aef\u4e2d\u8f93\u5165\u7684\u53e6\u4e00\u4e2a\u5e38\u89c1\u6253\u5b57\u9519\u8bef \u201copenshfit\u201d \u66ff\u4ee3\u4e3a \u201copenshift\u201d\u3002\u522b\u540d\u4e0d\u80fd\u5b8c\u5168\u89e3\u51b3\u6b64\u95ee\u9898\uff0c\u800c AutoKey \u53ef\u4ee5\u5728\u4efb\u4f55\u60c5\u51b5\u4e0b\u7ea0\u6b63\u5b83\u3002<\/p>\n

\u952e\u5165\u5e38\u7528\u77ed\u8bed<\/strong><\/div>\n

\u4f60\u53ef\u4ee5\u901a\u8fc7\u8bb8\u591a\u5176\u4ed6\u65b9\u6cd5\u6765\u8c03\u7528 AutoKey \u7684\u77ed\u8bed\u6765\u5e2e\u52a9\u4f60\u3002\u4f8b\u5982\uff0c\u4f5c\u4e3a\u4ece\u4e8b OpenShift \u7684\u7ad9\u70b9\u53ef\u9760\u6027\u5de5\u7a0b\u5e08\uff08SRE\uff09\uff0c\u6211\u7ecf\u5e38\u5728\u547d\u4ee4\u884c\u4e0a\u8f93\u5165 Kubernetes \u547d\u540d\u7a7a\u95f4\u540d\u79f0\uff1a<\/p>\n

oc get pods -n openshift-managed-upgrade-operator<\/pre>\n

\u8fd9\u4e9b\u540d\u79f0\u7a7a\u95f4\u662f\u9759\u6001\u7684\uff0c\u56e0\u6b64\u5b83\u4eec\u662f\u952e\u5165\u7279\u5b9a\u547d\u4ee4\u65f6 AutoKey \u53ef\u4ee5\u4e3a\u6211\u63d2\u5165\u7684\u7406\u60f3\u77ed\u8bed\u3002<\/p>\n

\u4e3a\u6b64\uff0c\u6211\u521b\u5efa\u4e86\u4e00\u4e2a\u540d\u4e3a \u201cNamespaces\u201d \u7684\u77ed\u8bed\u5b50\u6587\u4ef6\u5939\uff0c\u5e76\u4e3a\u6211\u7ecf\u5e38\u952e\u5165\u7684\u6bcf\u4e2a\u547d\u540d\u7a7a\u95f4\u6dfb\u52a0\u4e86\u4e00\u4e2a\u77ed\u8bed\u6761\u76ee\u3002<\/p>\n

\u5206\u914d\u70ed\u952e<\/strong><\/div>\n

\u63a5\u4e0b\u6765\uff0c\u4e5f\u662f\u6700\u5173\u952e\u7684\u4e00\u70b9\uff0c\u6211\u4e3a\u5b50\u6587\u4ef6\u5939\u5206\u914d\u4e86\u4e00\u4e2a \u201c\u70ed\u952e\u201d\u3002\u6bcf\u5f53\u6211\u6309\u4e0b\u8be5\u70ed\u952e\u65f6\uff0c\u5b83\u90fd\u4f1a\u6253\u5f00\u4e00\u4e2a\u83dc\u5355\uff0c\u6211\u53ef\u4ee5\u5728\u5176\u4e2d\u9009\u62e9\uff08\u8981\u4e48\u4f7f\u7528 \u201c\u65b9\u5411\u952e\u201d+\u56de\u8f66\u952e\u8981\u4e48\u4f7f\u7528\u6570\u5b57\uff09\u8981\u63d2\u5165\u7684\u77ed\u8bed\u3002\u8fd9\u51cf\u5c11\u4e86\u6211\u4ec5\u9700\u51e0\u6b21\u51fb\u952e\u5c31\u53ef\u4ee5\u8f93\u5165\u8fd9\u4e9b\u547d\u4ee4\u7684\u51fb\u952e\u6b21\u6570\u3002<\/p>\n

\u201cMy Phrases\u201d \u6587\u4ef6\u5939\u4e2d AutoKey \u7684\u9884\u914d\u7f6e\u793a\u4f8b\u4f7f\u7528 Ctrl+F7<\/span> \u70ed\u952e\u8fdb\u884c\u914d\u7f6e\u3002\u5982\u679c\u4f60\u5c06\u793a\u4f8b\u4fdd\u7559\u5728 AutoKey \u7684\u9ed8\u8ba4\u914d\u7f6e\u4e2d\uff0c\u8bf7\u5c1d\u8bd5\u4e00\u4e0b\u3002\u4f60\u5e94\u8be5\u5728\u6b64\u5904\u770b\u5230\u6240\u6709\u53ef\u7528\u77ed\u8bed\u7684\u83dc\u5355\u3002\u4f7f\u7528\u6570\u5b57\u6216\u7bad\u5934\u952e\u9009\u62e9\u6240\u9700\u7684\u9879\u76ee\u3002<\/p>\n

\u9ad8\u7ea7\u81ea\u52a8\u952e\u5165<\/strong><\/div>\n

AutoKey \u7684 \u811a\u672c\u5f15\u64ce \u5141\u8bb8\u7528\u6237\u8fd0\u884c\u53ef\u4ee5\u901a\u8fc7\u76f8\u540c\u7684\u7f29\u5199\u548c\u70ed\u952e\u7cfb\u7edf\u8c03\u7528\u7684 Python \u811a\u672c\u3002\u8fd9\u4e9b\u811a\u672c\u53ef\u4ee5\u901a\u8fc7\u652f\u6301\u7684 API \u7684\u51fd\u6570\u6765\u5b8c\u6210\u8bf8\u5982\u5207\u6362\u7a97\u53e3\u3001\u53d1\u9001\u6309\u952e\u6216\u6267\u884c\u9f20\u6807\u5355\u51fb\u4e4b\u7c7b\u7684\u64cd\u4f5c\u3002<\/p>\n

AutoKey \u7528\u6237\u975e\u5e38\u6b22\u8fce\u8fd9\u9879\u529f\u80fd\uff0c\u53d1\u5e03\u4e86\u81ea\u5b9a\u4e49\u811a\u672c\u4f9b\u5176\u4ed6\u7528\u6237\u91c7\u7528\u3002\u4f8b\u5982\uff0cNumpadIME<\/span> \u811a\u672c \u5c06\u6570\u5b57\u952e\u76d8\u8f6c\u6362\u4e3a\u65e7\u7684\u624b\u673a\u6837\u5f0f\u7684\u6587\u672c\u8f93\u5165\u65b9\u6cd5\uff0cEmojis-AutoKey <\/span>\u53ef\u4ee5\u901a\u8fc7\u5c06\u8bf8\u5982: :smile: \u4e4b\u7c7b\u7684\u77ed\u8bed\u8f6c\u6362\u4e3a\u5b83\u4eec\u7b49\u4ef7\u7684\u8868\u60c5\u7b26\u53f7\u6765\u8f7b\u677e\u63d2\u5165\u3002<\/p>\n

\u8fd9\u662f\u6211\u8bbe\u7f6e\u7684\u4e00\u4e2a\u5c0f\u811a\u672c\uff0c\u8be5\u811a\u672c\u8fdb\u5165 Tmux \u7684\u590d\u5236\u6a21\u5f0f\uff0c\u4ee5\u5c06\u524d\u4e00\u884c\u4e2d\u7684\u7b2c\u4e00\u4e2a\u5355\u8bcd\u590d\u5236\u5230\u7c98\u8d34\u7f13\u51b2\u533a\u4e2d\uff1a<\/p>\n

from time import sleep\r\n# \u53d1\u9001 Tmux \u547d\u4ee4\u524d\u7f00\uff08b \u66f4\u6539\u4e3a s\uff09\r\nkeyboard.send_keys(\"+s\")\r\n# Enter copy mode\r\nkeyboard.send_key(\"[\")\r\nsleep(0.01)\r\n# Move cursor up one line\r\nkeyboard.send_keys(\"k\")\r\nsleep(0.01)\r\n# Move cursor to start of line\r\nkeyboard.send_keys(\"0\")\r\nsleep(0.01)\r\n# Start mark\r\nkeyboard.send_keys(\" \")\r\nsleep(0.01)\r\n# Move cursor to end of word\r\nkeyboard.send_keys(\"e\")\r\nsleep(0.01)\r\n# Add to copy buffer\r\nkeyboard.send_keys(\"+m\")<\/ctrl><\/ctr><\/pre>\n

\u4e4b\u6240\u4ee5\u6709 sleep <\/span>\u51fd\u6570\uff0c\u662f\u56e0\u4e3a Tmux \u6709\u65f6\u65e0\u6cd5\u8ddf\u4e0a AutoKey \u53d1\u9001\u51fb\u952e\u7684\u901f\u5ea6\uff0c\u5e76\u4e14\u5b83\u4eec\u5bf9\u6574\u4f53\u6267\u884c\u65f6\u95f4\u7684\u5f71\u54cd\u53ef\u5ffd\u7565\u4e0d\u8ba1\u3002<\/p>\n

\u4f7f\u7528 AutoKey \u81ea\u52a8\u5316<\/strong><\/div>\n

\u6211\u5e0c\u671b\u4f60\u559c\u6b22\u8fd9\u7bc7\u4f7f\u7528 AutoKey \u8fdb\u884c\u952e\u76d8\u81ea\u52a8\u5316\u7684\u63a2\u7d22\uff0c\u5b83\u4e3a\u4f60\u63d0\u4f9b\u4e86\u6709\u5173\u5982\u4f55\u6539\u5584\u5de5\u4f5c\u6d41\u7a0b\u7684\u4e00\u4e9b\u597d\u4e3b\u610f\u3002\u5982\u679c\u4f60\u5728\u4f7f\u7528 AutoKey \u65f6\u6709\u4ec0\u4e48\u6709\u7528\u7684\u6216\u65b0\u9896\u7684\u65b9\u6cd5\uff0c\u4e00\u5b9a\u8981\u5728\u4e0b\u9762\u7684\u8bc4\u8bba\u4e2d\u5206\u4eab\u3002<\/p>\n


\n

via: https:\/\/opensource.com\/article\/21\/2\/linux-autokey<\/a><\/p>\n

\u4f5c\u8005\uff1aMatt Bargenquast \u8bd1\u8005\uff1astevenzdg988 \u6821\u5bf9\uff1awxy<\/p>\n

\u672c\u6587\u7531 LCTT<\/a> \u539f\u521b\u7ffb\u8bd1\uff0cLinux\u4e2d\u56fd<\/a> \u8363\u8a89\u63a8\u51fa<\/p>\n","protected":false},"excerpt":{"rendered":"

AutoKey \u662f\u4e00\u4e2a\u5f00\u6e90\u7684 Linux \u684c\u9762\u81ea\u52a8\u5316\u5de5\u5177\uff0c\u4e00\u65e6\u5b83\u6210\u4e3a\u4f60\u5de5\u4f5c\u6d41\u7a0b\u7684\u4e00\u90e8\u5206\uff0c\u4f60\u5c31\u4f1a\u60f3\uff0c\u5982\u4f55\u6ca1\u6709\u5b83\uff0c […]<\/p>\n","protected":false},"author":310,"featured_media":217917,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-217895","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/217895","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/users\/310"}],"replies":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/comments?post=217895"}],"version-history":[{"count":19,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/217895\/revisions"}],"predecessor-version":[{"id":218100,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/217895\/revisions\/218100"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media\/217917"}],"wp:attachment":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media?parent=217895"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/categories?post=217895"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/tags?post=217895"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}