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

Config via Configuration file? #17

Closed
breuerfelix opened this issue Nov 16, 2023 · 13 comments
Closed

Config via Configuration file? #17

breuerfelix opened this issue Nov 16, 2023 · 13 comments
Labels

Comments

@breuerfelix
Copy link

Is there a way to configure the binary via file?
If i want to start it via brew services, i don't know how to pass configuration to the binary.

Of if this is possible, maybe you could says something about it in the readme?

Cheers
Felix

@FelixKratz
Copy link
Owner

The idea is that you can change the properties at any time with a new invocation of the borders command, i.e. while the brew service is running:

borders width=6.0 active_color=0xff00ff00

But I guess having a file which is executed at launch would help with ease of use.

@FelixKratz FelixKratz added the enhancement New feature or request label Nov 16, 2023
@breuerfelix

This comment was marked as off-topic.

@FelixKratz

This comment was marked as off-topic.

@breuerfelix

This comment was marked as off-topic.

@FelixKratz

This comment was marked as off-topic.

@breuerfelix

This comment was marked as off-topic.

@FelixKratz

This comment was marked as off-topic.

FelixKratz added a commit that referenced this issue Nov 26, 2023
If the borders command is run without any arguments, we now search for a file in ~/.config/borders/bordersrc or ~/.bordersrc and execute it if it exists
@FelixKratz
Copy link
Owner

A config file is now invoked if started without any arguments (e.g. when brew starts the process) at ~/.config/borders/bordersrc

@acicovic
Copy link

acicovic commented Dec 2, 2023

Hello there, I'm using a brew service and my attempts to load settings from a ~/.config/borders/bordersrc file have failed.

First, I tried to paste the arguments in the file as we would pass them to the executable. This didn't work, so my second attempt was to copy homebrew.mxcl.borders.plist's contents into it. In both cases, I verified that there was execute permission. None of this worked for me.

This might seem like a basic question, but could we have some documentation that explains how that file should look with a simple couple of options?

Thank you for your work. I absolutely love borders 🙂

@FelixKratz
Copy link
Owner

FelixKratz commented Dec 2, 2023

No worries, the file should look like this:
https://github.com/FelixKratz/dotfiles/blob/master/.config/borders/bordersrc
the file is simply executed via fork->exec and then interpreted as a shell script by bash. In the script we call the borders process again to update the properties on launch. I decided to use a bash array to make the options easier to configure.
I will add an example to the documentation.

@breuerfelix
Copy link
Author

And the file needs to have executeable permissions :)

@acicovic
Copy link

Thank you both! My first attempts to make this work didn't work out, but it's OK. I may try again at a later time.

@acicovic
Copy link

OK, so I was using a gradient and this wasn't working:

active_color=gradient(top_left=0xff00ff00,bottom_right=0xff0000ff)

Adding the value into double quotes made it work:

active_color="gradient(top_left=0xff00ff00,bottom_right=0xff0000ff)"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants