Rofi only launches app on terminal

I have created a small entry for rofi to launch a program(Modelsim) that’s not on path, but i don’t know why it’s not working, the entry works if it’s called directly from a terminal or with shift+enter on rofi

#!/bin/sh

/path/to/modelsim_ase/linuxaloem/./vsim

I have a similar entry for vivado on the same folder which runs properly on all cases

#!/bin/sh

/path/to/Vivado/2020.1/bin/./vivado

To clarify, the scripts are included on PATH but the applications are not, in both cases.

I’d appreciate any suggestions, thanks

This appears to be unnecessary as a dot (.) in the path is just referring itself.

For you real issue - an idea is:

The one application that don’t work is expecting to be launched from a specific folder/path to be able to load internal dependency scripts.

You script does not cd to the folder/path where those scripts reside and the app is therefore using the script parent folder as the start of it’s internal search path - which of course will yield error and the script terminates.

I’ve tried with cd and it did not change the beehaviour, in both cases the app still works if i run out of a terminal, or with shift+enter (where rofi launches the app on a terminal) it’s just the standard rofi launch that does not work and I don’t know why

How do you launch rofi - I mean what modi?

exec “rofi -show run”

:man_shrugging:

If you are using exec - something tells me you need to look at the other script responsible for the exec command

that’s from the i3 config line

bindsym --release $mod+space exec "rofi -show run"

I use rofi uncountable times daily - there is something wrong with your script - I can’t say what but I am fairly sure the reason is something hidden by the exec command.

Try executing rofi -show run - then select the command - check the terminal response.

I am fairly certain you will get something that will lead you on track

As an example - I have a check-network script

  • if I use exec rofi -show run - then select my script - the result disaapears.
  • if I use rofi -show run - then select my script - it prints the output as expected.

It stays stuck on a blinking cursor for some time, but the app does not start

~ >>> rofi -show run                                        
~ >>> Reading pref.tcl                                      

# 2020.1

# 
# <EOF>

When called directly from the terminal (Modelsim is the name of the script) and exiting normally:

~ >>> Modelsim                                              
Reading pref.tcl
~ >>>