Skip to content

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 orel1 force-pushed the locate-config-file branch from 3971a14 to b871fcc Compare May 10, 2021 19:47
@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