Tilde (~) not interpreted when given as an argument to command
Opened this issue · 5 comments
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.
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).
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.
try
bash -c 'zenity --text-info --filename=~/foobar.txt'
as command?
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'
Some workaround is to use $HOME
instead of ~
:
bash -c 'zenity --text-info --filename="$HOME/foobar.txt"'