Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] rofi doesn't open mimetypes with a cli applications setted as the default one #1861

Closed
2 tasks done
thealio opened this issue Jun 25, 2023 · 12 comments
Closed
2 tasks done
Labels

Comments

@thealio
Copy link

thealio commented Jun 25, 2023

Rofi version (rofi -v)

1.7.5

Configuration

https://gist.github.com/thealio/be5da24c362ccfc5906e75d06ad5a7f2

Theme

https://gist.github.com/thealio/6feea66fe41172b21d4fc2b709fcbf15

Timing report

No response

Launch command

find ~ | rofi -dmenu -i | xargs -r -0 xdg-open

Step to reproduce

Hi
I have an issue with a script I wrote

#!/bin/sh
#
find ~ | rofi -dmenu -i | xargs -r -0  xdg-open

I have setted vifm (cli file manager) as default on my ~/.config/mimeapp.list

inode/directory=vifm.desktop
inode/mount-point=vifm.desktop

if I launch find ~ | rofi -dmenu -i | xargs -r -0 xdg-open from a terminal, the folders are correctly opened using vifm

But, if I launch my sh script with a keybind shortcut , it doesn't work , even using Shift+Enter

Expected behavior

I expected that, when I launch this simple script using a key combination (not from a terminal) and I press Enter on a folder, the folder were opened in vifm

Actual behavior

vifm didn't be opened

Additional information

OS: Arch Linux

Additional infos:

The folder was opened in firefox

if I uninstall firefox , nothing happens

Running the command via terminal, it works as expected

Using wayland display server protocol

  • No, I don't use the wayland display server protocol

I've checked if the issue exists in the latest stable release

  • Yes, I have checked the problem exists in the latest stable version
@thealio thealio added the bug label Jun 25, 2023
@DaveDavenport
Copy link
Collaborator

rofi does not open any application in the pasted script. I do not see how this is a rofi issue?

@thealio
Copy link
Author

thealio commented Jun 25, 2023

The script opens files and folders setted in the mimeapps.list file using xdg-open

It doesn't launch applications

@DaveDavenport
Copy link
Collaborator

1.) xdg-open does the launching of application/folder/file. rofi in this situation only selects an entry. It has 0 involvement in the issue.
2.) If there is a different between launching from terminal and keybinding. It is most likely an issue with the environment. Check if the environment passed to the script when launched for the keybinding is correct for xdg-open to function.

@DaveDavenport
Copy link
Collaborator

DaveDavenport commented Jun 25, 2023

The script opens files and folders setted in the mimeapps.list file using xdg-open

It doesn't launch applications

it does (via xdg-open) launches an application to open the file or folder.

@DaveDavenport DaveDavenport added invalid and removed bug labels Jun 25, 2023
@thealio
Copy link
Author

thealio commented Jul 4, 2023

Hi
It seems an old xdg-open unresolved bug

https://q2a.vifm.info/1455/vifm-as-default-filemanager-using-xargs?show=1463#c1463

https://unix.stackexchange.com/questions/177976/set-default-xdg-open-application-to-terminal-program/590093#590093

This suggest me a feature request: specify a terminal command for applications declared by the user.
Example: let's suppose I want to start vifm using run mode in rofi.
The binary won't start, of course, because it's a terminal application.
So, i n this case, I need an option that permits me to declare a terminal where the application have to be launched, ex. alacritty -e.
So in the confg file I need to set

  • the default terminal
  • if I want to open in a terminal all the binariries in run mode, or only someone specifically declared by the user

@DaveDavenport
Copy link
Collaborator

this already exists.

@thealio
Copy link
Author

thealio commented Jul 4, 2023

Nice
How can I do that?
I read the manpage, but it's unclear to me

I meant, I'd like to open all the binaries in the terminal just pressing Enter

@DaveDavenport
Copy link
Collaborator

change run-command or the binding for running in terminal.

@thealio
Copy link
Author

thealio commented Jul 4, 2023

I

change run-command or the binding for running in terminal.

How it can be done?
Sorry, I haven't findvhow to do that

@DaveDavenport
Copy link
Collaborator

Change run-command in your rofi configuration file or commandline.

rofi -run-command '{terminal} -e {cmd}' -show run -modi run

This is all in manpage

@thealio
Copy link
Author

thealio commented Jul 4, 2023

Thank you!
I'll try it this evening

@github-actions
Copy link

github-actions bot commented Aug 5, 2023

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants