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

Tilde (~) not interpreted when given as an argument to command #6

Open
roomcays opened this issue Apr 10, 2024 · 5 comments
Open

Tilde (~) not interpreted when given as an argument to command #6

roomcays opened this issue Apr 10, 2024 · 5 comments

Comments

@roomcays
Copy link

Consider following blezz content action:

act(t,The test,zenity --text-info --filename=~/foobar.txt)

Executing this action with rofi-blezz gives an error of... Zenity:

(zenity:1860728): Zenity-WARNING **: 19:07:09.220: Cannot open file '~/foobar.txt': No such file or directory

However, running the same command (zenity --text-info --filename=~/foobar.txt) on terminal works well.

Zenity is just an example, tried also with Geany and then realized that this is rather connected with rofi-blezz.

Note: original blezz behaves the same.

@roomcays
Copy link
Author

Oh, maybe it is worth mentioning: action for Geany....

act(t,The test,geany ~/test.txt)

...opens empty file at current/working directory with the ~/test.txt appended, for example: /home/user/Downloads/~/test.txt (I was debugging by running rofi from CLI, and not by keybinding).

@roomcays
Copy link
Author

And... running rofi-blezz via keybinding (by sxhkd) opens file at location: /home/user/~/test.txt, which is not the same as ~/test.txt or, equivalently, /home/user/test.txt.

So, no work-around by cd ~ && rofi -show blezz -modi blezz -auto-select -matching normal is possible here.

@DaveDavenport
Copy link
Contributor

DaveDavenport commented Apr 10, 2024

try

bash -c 'zenity --text-info --filename=~/foobar.txt'

as command?

@roomcays
Copy link
Author

Things get complicated.

The command you have suggested does not work with Zenity:

(zenity:1931820): Zenity-WARNING **: 11:45:23.152: Cannot open file '~/foobar.txt': No such file or directory

but opening Geany this way surprisingly works:

bash -c 'geany ~/foobar.txt'

@roomcays
Copy link
Author

Some workaround is to use $HOME instead of ~:

bash -c 'zenity --text-info --filename="$HOME/foobar.txt"'

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