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

Use '$HOME/.config/i3workspaceconfig' as an alternate config file #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

orel1
Copy link
Contributor

@orel1 orel1 commented May 1, 2021

'$HOME/.i3workspaceconfig' remains the default configuration file, but
if '$HOME/.config/i3workspaceconfig exists', it takes precedence

It is still possible to define another configuration file via the '-c'
option

my $filename = "i3workspaceconfig";
my $filepath = "";

if ( defined( $ENV{'XDG_CONFIG_HOME'} ) ) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you create a list of possible candidate locations, and then loop through them, taking the first one that exists and eventually fall back to i3workspaceconfig?

'$HOME/.i3workspaceconfig' remains the default configuration file, but
if '$HOME/.config/i3workspaceconfig' or
'$HOME/.config/i3-renameworkspaces/config' exists, the first one found
has priority.

It is still possible to define another configuration file via the '-c'
option
@orel1
Copy link
Contributor Author

orel1 commented May 10, 2021

I modified my first version. Now, we check if the following files exist ($HOME/.config/i3workspaceconfig,'$HOME/.config/i3-renameworkspaces/config in this order) and the first found wins.

By default, $HOME/.i3workspaceconfig is used

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