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

Aliases doesn't work #47

Open
janemba opened this issue Jul 2, 2021 · 9 comments
Open

Aliases doesn't work #47

janemba opened this issue Jul 2, 2021 · 9 comments

Comments

@janemba
Copy link

janemba commented Jul 2, 2021

Helllo,

I am using zsh with oh-my-zsh and I'm storing aliases in $HOME/.oh-my-zsh/custom/aliases.zsh. How can I make it work with sway-launcher-desktop ?

@janemba
Copy link
Author

janemba commented Jul 11, 2021

Any thoughts on this ?

@Biont
Copy link
Owner

Biont commented Jul 12, 2021

Sorry, I have zero experience with zsh.

But since the sway-launcher-desktop.sh expects #!/usr/bin/env bash as interpreter, it shouldn make that much of a difference.

What is it that does not work currently?

@janemba
Copy link
Author

janemba commented Jul 12, 2021

I just got an idea reading your reply. So I am using zsh and as sway-launcher-desktop.sh is a bash script, my aliases cannot be read.

So I created a .bash_aliases file with all my aliases:

zsh $ alias -L > .bash_aliases

Then I added the following in .bashrc:

zsh $ cat .bashrc
if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

[ -f ~/.fzf.bash ] && source ~/.fzf.bash

So if I switch shell to bash I got all aliases but still sway-launcher-desktop.sh do not contain any aliases. Do I need a specific step to get aliases as a command in sway-launcher-desktop.sh ?

What is it that does not work currently?

I execute the launcher in terminal and aliases are not in list (even with bash).

@Biont
Copy link
Owner

Biont commented Jul 13, 2021

You can pass a custom TERMINAL_COMMAND to run the resulting command through bash again, which will cause your .bashrc to be read.

For example: TERMINAL_COMMAND="urxvt -e /bin/bash -i -c " sway-launcher-desktop

@janemba
Copy link
Author

janemba commented Jul 13, 2021

I tried the following:

TERMINAL_COMMAND="foot /bin/bash -i -c " .local/share/sway-launcher-desktop/sway-launcher-desktop.sh

The issue is the same no aliases are loaded in sway-launcher-desktop. I have no idea if .bashrc is read or not. When I'm trying the following: foot /bin/bash, I can use my aliases.

@janemba
Copy link
Author

janemba commented Aug 12, 2021

Any update on this ?

@janemba
Copy link
Author

janemba commented Aug 28, 2021

Any update on this ? (x2)

@Biont
Copy link
Owner

Biont commented Sep 14, 2021

Well I don't know what the launcher script itself could do to aid here since it is not concerned with any specific terminal or shell. Whatever the problem is, I really think it must be possible to solve it with the right TERMINAL_COMMAND

@janemba
Copy link
Author

janemba commented Sep 14, 2021

Well ok but how the launcher script read aliases ?

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

2 participants