0

I have a condition in .xinitrc that is not met, and I don't understand why:

I have the .Xresources file in my ~ (with read permissions), and my ~/.xinitrc contains a line with

[[ -f ~/.Xresources ]] && xrdb -load ~/.Xresources &

However the condition between double brackets is not met. Why is that? The file exists and is located in my home! If I change the line to this,

xrdb -load ~/.Xresources &

Then it works, and also works if I run [[ -f ~/.Xresources ]] && xrdb -load ~/.Xresources from bash.

Why is not working in .xinitrc?

My solution for the moment was to put directly the second line, however I don't understand why the condition is not met.

3
  • 3
    Is your .xinitrc a bash script, or a sh script? the [[ ... ]] extended test syntax may not be supported in the latter Commented May 2, 2022 at 11:36
  • That was it!! In fact my .xinitr runs as a shell script, many thanks!! Commented May 2, 2022 at 17:02
  • 1
    No need to put the xrdb command in the background, that one does not block -- and you want the resources to be loaded before the window manager starts. Commented May 2, 2022 at 18:59

1 Answer 1

1

The solution is in the comment from @steeldriver:

Is your .xinitrc a bash script, or a sh script? the [[ ... ]] extended test syntax may not be supported in the latter

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .