运行 fish shell 通过 i3 键绑定运行

Run fish shell functions via i3 keybinding

我编写了一个简单的 fish 函数,它列出了 rofi 中定位命令的输出,并将所选选项提供给 vim。

function myfunction
    vim ( locate ~/str/Dotfiles | rofi -dmenu )
end

在 i3 配置文件中,我有:

bindsym $mod+c exec myfunction

好吧,当我按下 mod+c 时什么也没有发生,但是函数 运行 在里面没问题一个终端。在终端外 运行 用户定义的 fish 函数根本不可能吗?

Is it simply impossible to run a user defined fish function outside of a terminal?

当然有可能。

我最好的猜测是这里的 i3 正在启动一个不同的 shell(例如 /bin/sh 或您通过 chsh 设置为用户默认 shell 的任何内容) .

尝试通过以下方式明确指定鱼:

bindsym $mod+c exec fish -c myfunction