【问题标题】:How to run ranger from a script如何从脚本运行游侠
【发布时间】:2019-07-25 15:32:53
【问题描述】:

我正在编写一个脚本,它允许我在某个 shell 配置文件中打开 ranger FM。我设法通过在我的脚本末尾添加$SHELL 在Xterm 中打开它。我想要的是让我的脚本在某个配置文件中打开一个终端(我在 manjaro 上使用 konsole),写下 ranger 这个词并按 Enter,所以我最终在终端和我选择的配置文件中使用 ranger FM。

我尝试将 ranger 命令通过管道传输到 konsole,但该命令仅打开 konsole

ranger | konsole

我也尝试过将输入命令通过管道传输到 konsole,但这只在 Xterm 中输出并打开 konsole。

konsole | xdotool type ranger

xdotool type rager | konsole

【问题讨论】:

标签: bash shell pipe xdotool


【解决方案1】:

答案在上一个问题中找到:

https://superuser.com/questions/682850/open-new-konsole-from-script-executing-command-and-becoming-interactive-on-conc

通过以下命令达到了预期的效果:

konsole --profile profile_name -e /bin/bash ranger

我假设打开控制台并在同一命令中执行 bash 命令。不需要通过管道输入到 konsole。

konsole 还允许在配置文件设置中添加启动命令:

General --> Command /bin/bash ranger

这样您就可以直接从个人资料中调用游侠

konsole --profile profile_name

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-01
    • 2010-09-26
    • 1970-01-01
    • 2010-09-07
    相关资源
    最近更新 更多