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.

ElTitoFranki
  • 133
  • 4
  • 3
    Is your `.xinitrc` a bash script, or a sh script? the `[[ ... ]]` extended test syntax may not be supported in the latter – steeldriver May 02 '22 at 11:36
  • That was it!! In fact my .xinitr runs as a shell script, many thanks!! – ElTitoFranki May 02 '22 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. – Simon Richter May 02 '22 at 18:59

1 Answers1

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

ElTitoFranki
  • 133
  • 4