Skip to content

Conversation

@SeerLite
Copy link
Contributor

I only now realized we don't have to check if sxhkd is running before starting, if we use the feature from a54ab70.

It also works as an example so more people notice the feature.

@emanuele6
Copy link
Contributor

emanuele6 commented Sep 30, 2020

I generally suggest using = instead of -eq to check the run level since we can't know if "$1" is an integer.

If one tries to run bspwmrc without arguments from the command line (e.g. ~/config/bspwm/bspwmrc), this error will be printed:

  • dash: dash: 1: [: Illegal number:;
  • bash: bash: [: : integer expression expected.

If you use = instead of -eq, this error is avoided because [ "" = 0 ] is just false (while [ "" -eq 0 ] will cause the error) and sxhkd still won't run because the check is false.


But why do this change? What's the benefit?

pgrep -x sxhkd > /dev/null || sxhkd & will automatically relaunch sxhkd if you reaload bspwm after sxhkd crashed.
Wanting bspwm to launch sxhkd only on run level 0 is just personal preference in my opinion, what's the point of this change?

@SeerLite
Copy link
Contributor Author

SeerLite commented Sep 30, 2020

what's the point of this change?

The reason I came up with this in the first place is because I noticed there wasn't any example of the run level feature anywhere (or at least I couldn't find it, correct me if I'm wrong!)
I thought making sxhkd use it was a good idea, since it was already in the bspwmrc example.

Thanks for the = vs -eq warning! I'm changing it now!

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

Successfully merging this pull request may close these issues.

2 participants