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

Wrapper scripts in $PATH don't appear in bemenu-run #114

Closed
hendersonreed opened this issue Apr 29, 2020 · 11 comments
Closed

Wrapper scripts in $PATH don't appear in bemenu-run #114

hendersonreed opened this issue Apr 29, 2020 · 11 comments

Comments

@hendersonreed
Copy link

I have a few wrapper scripts for FlatPak applications in ~/bin (which is exported as part of my $PATH in my .profile file), but they aren't showing up in the dialog for bemenu-run.

Am I just exporting that path in the wrong place, or is there something more complex going on? I'm running Fedora 31 with Sway, and launching bemenu-run without any arguments.

@Earnestly
Copy link
Contributor

It honours $PATH just fine. You may be exporting it incorrectly. That it's not working in dialog either should indicate this.

@Cloudef
Copy link
Owner

Cloudef commented Apr 30, 2020

Make sure your custom PATH is loaded into sway's environment. How the environment is derived depends on how and when you launch sway. You could test running bemenu-run from terminal for example, and confirm that your custom PATH works there (this would confirm that your PATH doesn't get into sway process)

@hendersonreed
Copy link
Author

Ah, that's got to be the solution - running bemenu-run from the terminal totally works. I am using GDM for my display manager, and different sources say different things about where it gets the $PATH variable from. I have exported my path in .pam_environment, which didn't seem to solve it, unfortunately.

Any ideas on where I might be able to configure $PATH so that GDM sources it when starting sway?

@hendersonreed
Copy link
Author

update: I have now also set $PATH using systemd, by using a config file in .config/environment.d/envvars.conf as described in this Archwiki page: https://wiki.archlinux.org/index.php/Environment_variables#Per_user

Unfortunately, whilesystemctl --user show-environment now lists the path correctly, that still doesn't seem to have taken hold in Sway's environment, meaning that my scripts are still not available through bemenu.

@Cloudef
Copy link
Owner

Cloudef commented May 1, 2020

Hmm, maybe sway resets or modifies PATH maybe you could ask their irc channel or open issue there and mention this issue.

@hendersonreed
Copy link
Author

I've asked on their irc channel, will post the solution here, if I find one.

@Cloudef
Copy link
Owner

Cloudef commented May 2, 2020

This most likely is GDM issue and not sway. There is related issue here: https://gitlab.gnome.org/GNOME/gdm/issues/385

@Cloudef
Copy link
Owner

Cloudef commented May 2, 2020

swaywm/sway#3109 There's workaround here, by running sway inside a shell. Not pretty, but not sure if there's better way with gdm.

@hendersonreed
Copy link
Author

Yes, that's essentially the solution I was suggested in the sway irc channel!

I ended up editing /usr/share/wayland-sessions/sway.desktop to run a script I placed in /opt that sources ~/.profile. The contents of the .desktop file are pasted below:

[Desktop Entry]
Name=Sway
Comment=An i3-compatible Wayland compositor
Exec=/opt/sway-launch
Type=Application

Thanks everyone for their comments and suggestions, closing this issue now.

@AdrienLemaire
Copy link

@hendersonreed can you share your script? I'm quite confused.

$ cat /usr/share/wayland-sessions/sway.desktop
[Desktop Entry]
Name=Sway
Comment=An i3-compatible Wayland compositor
Exec=/usr/bin/zsh -l -c sway
Type=Application
$ cat ~/.zprofile
export PATH=$PATH:/home/dori/.local/bin
touch /tmp/zprofile_got_sourced
$ swaymsg exit

After relog-in through GDM

$ ls /tmp/zprofile_got_sourced
/tmp/zprofile_got_sourced

sway config

set $menu bemenu -b -i -n \
    --nb "#282a2e" \
    --nf "#de935f" \
    --fn "pango:Noto Sans Mono 12" \
    --hb "#373b41" \
    --tb "#373b41" \
    --hf "#f0c674" \
    --tf "#f0c674"

bindsym $mod+d exec j4-dmenu-desktop --dmenu='$menu' --term='alacritty'

bemenu from $mod+d doesn't list .local/bin scripts, but bemenu-run from the shell does.

@Cloudef
Copy link
Owner

Cloudef commented May 21, 2020

@AdrienLemaire note that you are using j4-dmenu-desktop instead of bemenu-run. In this case bemenu will act simply as a interface and won't search any PATH at all. Your issue would be with j4-dmenu-desktop instead of bemenu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants