[BUG] Custom Window rules not restored during update
Describe the bug
When I run ml4w-hyperland-setup to update. There is a section called 'Restore' where it says 'The script will try to restore existing configurations.' I choose to restore my .config/hypr/conf/windowrule.conf file but it doesn't work. I lose my changes in the update and I just have the default file.
To Reproduce Steps to reproduce the behavior:
- Change or add some new some window rules.
- Run
ml4w-hyprland-setup - When you get to the 'Restore' section opt to restore your windowrule.conf file.
- After the update you will have lost any changes you made to this file.
Expected behavior I expected my windowrule.conf changes to remain in the updated dotfiles.
Screenshots If applicable, add screenshots to help explain your problem.
Distribution (please complete the following information):
- EndeavourOS
Additional context I love ML4W!
I think it is much saver to do customization using the custom.conf or just create a .config/hypr/conf/custom_windowrule.conf file then saving it somewhere else. what I know for sure is the custom.conf files I created get restored but the files that the ML4W update script just updates everything.
Also if I remember correctly, the script also creates a backup before updating so you might be able to see your previous setup there and just copy it. it should be in ~/.ml4w-hyprland/backup/dotfiles/.config/hypr/conf
Did you have to change the update script to have your custom.conf files restored? Even if this is the case the install script and procedure could be changed to reflect the fact this functionality (of restoring various configurations) does not work as expected.
I was also very confused at the script first because it is not really clear what it's doing and what it restores and overrides... But all of the files that I create named custom.conf or custom-xxx.conf are always restored. It's only the configurations that I changed directly on the generated config files of ml4w that are overwritten because of the updates.
That is why I just keep a backup of every configuration I make so if something breaks, I have a fallback... Here are my backup dotfiles btw if you want to see my custom.conf. I have here all my custom configs and files that I overwritten that are part of the ML4W installation.
I'm just confirming that the restore function during ml4w-hyprland-setup does not work for ~/.config/hypr/conf/windowrule.conf. Thank you kindly mrjxtr for the workaround which I will copy.
I can also confirm that you can restore your window rules by adding it to the hook.sh script:
_protect .config/hypr/conf/windowrules
This does mean you will lose any changes here from ML4W; I will just watch for that specifically until I can think of something better. Sorry mrjxtr I couldn't figure out how your system worked. Where do you put the new .conf files?
It should be at ~/dotfiles/.config/hypr/conf/windowrules/custom.conf just create the file if it does not exist and just add custom configurations there.
Then just to make sure, save a copy of that file and you other custom conf on a private Github repo or something before updating or when making changes. 👍🏼
- Then source it.... edit
/dotfiles/.config/hypr/conf/windowrule.conf. - Change this
source = ~/.config/hypr/conf/windowrules/default.conftosource = ~/.config/hypr/conf/windowrules/custom.conf - Or just change it in the settings app.
If you do this, every time you update ml4w, your custom.conf will remain. At least in my experience so far