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

Waypaper is still trying to write to the configuraiton file, even if use_xdg_state = True #98

Open
diegoroccia opened this issue Nov 17, 2024 · 2 comments

Comments

@diegoroccia
Copy link

diegoroccia commented Nov 17, 2024

I have the following configuration

[Settings]
language = en
folder = ~/Pictures/wallpapers
backend = hyprpaper
monitors = All
fill = Fill
sort = name
color = #ffffff
subfolders = True
number_of_columns = 3
post_command = 
show_hidden = False
show_gifs_only = False
use_xdg_state = True

So I would expect that the config.ini file doesn't need to be touched by the app. I am using home-manager on Ubuntu and this file is set as immutable/readonly. When I try to change wallpaper, though, this is what happens:

> ~/.local/pipx/venvs/waypaper/bin/waypaper --random
We got: en
True # <- This is just me testing that the use_xdg_state was currently set
Traceback (most recent call last):
  File "~/.local/pipx/venvs/waypaper/bin/waypaper", line 8, in <module>
    sys.exit(run())
             ^^^^^
  File "~/.local/pipx/venvs/waypaper/lib/python3.12/site-packages/waypaper/__main__.py", line 67, in run
    cf.save()
  File "~/.local/pipx/venvs/waypaper/lib/python3.12/site-packages/waypaper/config.py", line 214, in save
    with open(self.config_file, "w") as configfile:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '~/.config/waypaper/config.ini'
@anufrievroman
Copy link
Owner

I see. Yes, it tries to overwrite the config even if you use state file. To be honest, I never used the immutable systems like that, so I'm not sure what's the expected behavior is. Currently, state file only stores information about monitors and wallpaper (according to previous discussions). But all the other settings are still stored in the config (and overwritten when changed). So, for you, the expected behavior would be that everything is stored in the state file, or just that it does not crash if permission denied? Or all the things that can be changed via GUI should be stored in the state file (which is almost all things)?

anufrievroman added a commit that referenced this issue Nov 19, 2024
@darth62969
Copy link
Contributor

I think that using state files in general might be the better option. Especially if you are using them in the first place. otherwise we should use the config file.

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

No branches or pull requests

3 participants