i3-resurrect icon indicating copy to clipboard operation
i3-resurrect copied to clipboard

directory config not respected

Open laur89 opened this issue 3 months ago • 5 comments

Describe the bug config.json.directory is not respected - data is still saved into the default location of ~/.i3/i3-resurrect/

To Reproduce Steps to reproduce the behavior:

$ cat ~/.config/i3-resurrect/config.json 
{
  "directory": "/tmp/test/",
  "window_command_mappings": [
    {
      "class": "Gnome-terminal",
      "command": "gnome-terminal"
    }
  ],
  "window_swallow_criteria": {},
  "terminals": [
    "Gnome-terminal",
    "Alacritty"
  ]
}
$ mkdir /tmp/test
$ i3-resurrect save -w 1
$ ls -lA /tmp/test
total 0

Expected behavior Saved profiles should be written into /tmp/test

System information

  • Linux distribution: debian testing
  • i3-resurrect version: 1.4.5 (from pypi)
  • i3 version: 4.24-non-git
  • Python version: 3.13.7

laur89 avatar Sep 19 '25 19:09 laur89

I'm unable to reproduce this at all I'm afraid.

In case it helps:

❯ i3-resurrect --version          
i3-resurrect, version 1.4.5
❯ python --version
Python 3.12.11

JonnyHaystack avatar Sep 20 '25 09:09 JonnyHaystack

I find it hard to believe. My installed version has following header in main.py:

import sys
from pathlib import Path

import click
import i3ipc
from natsort import natsorted

from . import layout
from . import programs
from . import util


@click.group(context_settings=dict(help_option_names=['-h', '--help'],

Note the lack of config module import and DEFAULT_DIRECTORY definition. I suspect you've reinstalled either locally or from github, but the version has remained at 1.4.5

Although it sure is odd given those changes are from ~5y ago. Maybe some mistakes were made with the pypi release, who knows. Easier to fix forward anyway -- perhaps it's time for a 1.4.6 tag & release to pypi?


Just fyi I installed it with pipx install i3-resurrect

laur89 avatar Sep 20 '25 09:09 laur89

I'm using the NixOS package, version 1.4.5, and you can clearly see the changes are included in tag 1.4.5: https://github.com/JonnyHaystack/i3-resurrect/blob/1.4.5/i3_resurrect/main.py#L13

However I have just installed it with pipx to check and I see the source in the version pipx installs is missing those lines, so it looks the PyPI package version 1.4.5 is not in fact 1.4.5...

I have some changes in enhanced_config_rules that I want to release anyway, I just need to rewrite the CI in GitHub Actions (which was barely even a thing when I first wrote this project) and make workflows to upload the PyPI and AUR packages.

JonnyHaystack avatar Sep 20 '25 11:09 JonnyHaystack

Unrelated, but perhaps it'd be good idea not to require users to have all the configuration in their .config, and merge user-defined stuff with a default config object? Been using py_.merge() for that myself.

laur89 avatar Sep 20 '25 18:09 laur89

In my opinion it's better to not hide these things from the user, and some users may not want some of the stuff in the default config. And I'd say it's easier to see how to disable it if the way to disable it is simply removing it from your config.

JonnyHaystack avatar Sep 20 '25 19:09 JonnyHaystack