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] run mode does not update with new files in $PATH when run from a keybind (e.g. from sxhkd) #1978

Closed
2 tasks done
promitheas17j opened this issue Apr 20, 2024 · 4 comments
Labels

Comments

@promitheas17j
Copy link

promitheas17j commented Apr 20, 2024

Rofi version (rofi -v)

Version: 1.7.5

Configuration

https://gist.github.com/promitheas17j/7274aa19c3c82a9f357144d7c6586b28

Theme

https://gist.github.com/promitheas17j/597010c6920330d26eb982aae2cb673a

Timing report

No response

Launch command

rofi -fuzzy -m 1 -show run

Step to reproduce

  1. Create a new script in $HOME/.bin and make it executable. $HOME/.bin is in $PATH and I have verified this.
  2. Hit the keybind to run the launch command above from sxhkd
# Relevant section of my sxhkdrc:
super   r
    rofi -fuzzy -m 1 -show run
  1. When the rofi window pops up, search for the script created in step 1. It will not show up.
  2. Note: Some scripts in $HOME/.bin can be found. Running any one of the scripts which can be found from rofi in the $HOME/.bin directory gives the following error:
Failed to execute: 'script-name' 
Error: 'Failed to execute child process "script-name" (No such file or directory)'

After closing the error and closing the rofi window, the next time I run the command by using my keybind the script which could be searched for and found earlier is not present anymore. I need to run the rofi command directly from the terminal, search for and run the script, and then the next time I use the keybind to run it the script shows up (will give the error above if I try to run it though).

If I run the command rofi -fuzzy -m 1 -show run in a terminal directly I get all scripts that i created and they run correctly.

If I try to run a script or command which is not in the $PATH directory I created (i.e. something like bash) it will not give the error and not disappear from the list.

Expected behavior

I expect to be able to find any newly created scripts if they have been created in a directory which is in the $PATH variable, and run scripts which can be found without getting an error that they do not exist.

Actual behavior

  • Running a script that I created give the error above and then disappears from the list until I run the command rofi -show run manually from a terminal.
  • Scripts that can be searched for and found will not run but give an error and then disappear from the list the next time rofi -show run is ran from a keybinding. Running directly in the terminal doesn't present this issue.

Additional information

I've searched in the issues for anything related to this but couldn't find anything in either the open or closed issues.

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
@yusufaktepe
Copy link

If this is where you're setting PATH, it won't be seen by programs outside the interactive shell. You should set it globally/by user.

@DaveDavenport
Copy link
Collaborator

rofi run rescans $PATH on every launch.. It is impossible to 'not update' as it does not store state for it to 'not update'. -> closing bug as there is no update process to be broken.

To debug your issue:

99 % of these bugs are environment bugs. If it works on terminal and not from keybinding, you are most likely not setting the environment in the right place.
Rofi inherits the environment from the application that launched it.

Create a new script in $HOME/.bin and make it executable. $HOME/.bin is in $PATH and I have verified this.

How did you verify this.

@DaveDavenport DaveDavenport closed this as not planned Won't fix, can't repro, duplicate, stale Apr 20, 2024
@DaveDavenport
Copy link
Collaborator

See also: #1281

Copy link

This pull request 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 May 22, 2024
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

3 participants