eromatiya / rofi-spotlight

Spotlight-like Rofi
MIT License
201 stars 7 forks source link

opening files to edit them only opens the terminal #2

Closed joe23rep closed 4 years ago

joe23rep commented 4 years ago

the issue i have is that when im opening files to edit them via your rofi config it only opens my terminal emulator (tilix- changed it from kitty to tilix in the script). i looked threw the code and saw that the editor is not defined in it like the search maschine or the terminal is. i assume it pulls the editor from the enviromental function in my zshrc, right?

nvim is definied as editor in my zshrc file. do i need to add it to the rofi-spotlight.sh itself somewhere?

eromatiya commented 4 years ago

i assume it pulls the editor from the enviromental function in my zshrc, right?

yep. that's right.

do i need to add it to the rofi-spotlight.sh itself somewhere?

Currently, the command to open the editor is:

coproc ( eval "${TERM_EMU} ${EDITOR} $(cat "${CURRENT_FILE}")" & > /dev/null 2>&1 )

The only thing you can change right now in the script is the $TERM_EMU variable. But yeah, I should let the user set his/her $EDITOR in the script.

eromatiya commented 4 years ago

Done https://github.com/manilarome/rofi-spotlight/commit/74e87bb4eacffae468328ae8297871a899c41622. You can now set your text editor manually by changing the $TEXT_EDITOR variable.

joe23rep commented 4 years ago

Ill chec kit out when im back home.

Thank you for your super fast response

edit: just checked it. didnt work. it does the same when i click open location in terminal. it just opens the terminal but not in that location.

tried it with alacritty and konsole too but didnt work. then i remembered that i once had an issue with a script because i used zsh. so i changed to bash and tried it with bash as shell. still the same. i run an arch system with kde as DE. any ideas what else to try?

if not dont stress it. ill be fine with just web search and open location in dolphin (which functions just fine)

eromatiya commented 4 years ago

didnt work. it does the same when i click open location in terminal. it just opens the terminal but not in that location.

Weird. It's working fine here. Can you please check the tmp file? The script writes the current file and location in there, check if it exists and its content. The location is /tmp/rofi/${USER}/rofi_fb_current_file

joe23rep commented 4 years ago

weird. there it is (shows the directory string where the file is saved at). i wonder why it wont be opened in the terminals tho. any ideas?

i know it has nothing to do with your script now but rather the issue is on my side but maybe u have an idea what might be the issue here. i set up nvim as default application to open my files out of dolphin. to do that i had to create a .desktop file which executes tilix with nvim opened. do u think this could interfere with your script somehow?

eromatiya commented 4 years ago

Uhm the script doesn't use .desktop but rather the binary of the program. Try to change the $TEXT_EDITOR to a GUI editor like gedit or sublime-text3.

joe23rep commented 4 years ago

doesnt work. still opens the terminal

nevermind tho. i know the issue isnt on your side but on mine. ill see around if i can find an answer and f not ill use it mostly for google