You are not logged in.

#1 2021-07-07 23:42:55

u0
Member
Registered: 2021-07-07
Posts: 20

Starting vifm not from terminal

When I start vifm not from terminal it freazes.
I want to start it in Qtile with command promptand and autocomplete.

If i create script in ~/.scripts. And add it to $PATH

#!/bin/bash
alacritty -e vifm &

Prompt can still run binary but not script.

Or in case I want to run vifm from terminal with parameters
it can ignore it and run only script instead.

Is there an elegant way to make script run from prompt but run binary from terminal?
Or other solution?

Offline

#2 2021-07-08 00:25:47

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,500
Website

Re: Starting vifm not from terminal

You'll need to be a lot more specific.

u0 wrote:

Prompt can still run binary but not script.

What does this mean?  Do you mean you can run /usr/bin/vifm from a shell prompt, but you cannot run the script?  Why not?  Please post the complete command and output of attempting to run the script.

u0 wrote:

Or in case I want to run vifm from terminal with parameters
it can ignore it and run only script instead.

What does each "it" referr to here?  Do you mean you've named the script "vifm"?  If you want to call the script "vifm" you should pass on any command line parameters:

#!/bin/sh
alacritty -e vifm "$@" &
u0 wrote:

Is there an elegant way to make script run from prompt but run binary from terminal?

What is "prompt" if not a shell session in the terminal?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2021-08-18 15:00:17

u0
Member
Registered: 2021-07-07
Posts: 20

Re: Starting vifm not from terminal

By prompt I mean when you press [mod] and [r] in qtile. Appears a line where you can enter name of a program and run it.

I put the file named vifm in
~/.scripts/

it containes

#!/bin/sh
alacritty -e vifm "$@" &

Exporting dir to $PATH

export PATH=~/.scripts:$PATH

Now when I type vifm in alacritty it blinks and nothing happens.


I think it is better to solve one task at a time.
I want to be able to start vifm from [mod] and [r].
But it freezes all processes at tty1

Last edited by u0 (2021-08-18 15:41:25)

Offline

#4 2021-08-18 17:45:43

willemw
Member
Registered: 2013-02-19
Posts: 116

Re: Starting vifm not from terminal

Try changing the script to:

alacritty -e /usr/bin/vifm "$@" &

i.e. prepend the full path to vifm.

Last edited by willemw (2021-08-18 17:51:11)

Offline

#5 2021-08-19 00:01:39

u0
Member
Registered: 2021-07-07
Posts: 20

Re: Starting vifm not from terminal

Yes script pointed to itself.

vifm still freezes when started from prompt/launcher

Offline

#6 2021-08-19 01:37:01

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,465

Re: Starting vifm not from terminal

Try running with --no-config

alacrity -e /usr/bin/vifm --no-config "$@" &

If it still fails, please try running same command from another terminal instead of qtile shortcut,  and let's see the error output.

Last edited by Docbroke (2021-08-19 01:39:27)

Offline

#7 2021-08-19 05:58:44

willemw
Member
Registered: 2013-02-19
Posts: 116

Re: Starting vifm not from terminal

You can remove the & at the end.

To see what goes wrong, catch all output and save it to a file:

#!/bin/sh

(
  alacritty --command /usr/bin/vifm "$@"

) > /tmp/vifm.log 2>&1

Offline

#8 2021-08-19 21:11:20

u0
Member
Registered: 2021-07-07
Posts: 20

Re: Starting vifm not from terminal

vifm works OK from alacritty and xterm.

$PATH points to  ~/.scripts/vifm
So now when I type vifm in terminal it starts NEW alacritty with vifm.

But it freezes from qtile/awesome/ command prompt.
By command pronpt I mean those thing when you press [mod] [r] to run name of the program. In qtile it corresponds to lazy.spawncmd


It could be qtile command prompt widget uses another path to run program so it starts without alacritty.
https://docs.qtile.org/en/v0.18.0/_modu … rompt.html

Last edited by u0 (2021-08-19 21:59:25)

Offline

#9 2021-08-20 04:12:14

thiagowfx
Member
Registered: 2013-07-09
Posts: 586

Re: Starting vifm not from terminal

u0 wrote:

But it freezes from qtile/awesome/ command prompt.
By command pronpt I mean those thing when you press [mod] [r] to run name of the program. In qtile it corresponds to lazy.spawncmd

Is that prompt something akin to rofi or dmenu_run?

Does it support auto completion for other applications at all?

Offline

#10 2021-08-20 14:15:50

u0
Member
Registered: 2021-07-07
Posts: 20

Re: Starting vifm not from terminal

thiagowfx wrote:

Is that prompt something akin to rofi or dmenu_run?

Does it support auto completion for other applications at all?

Yes it is like rofi and dmenu_run. It supports autocompletion.

I use default built in options of qtile for now.

Offline

Board footer

Powered by FluxBB