I tried this and had too many issues with other devices. I finally just bought a Brother laser printer with built in AirPrint that worked fine for many years but lately it seems to disconnect once in awhile. Current fix for that has been a smart switch that I programmed to just power cycle the printer twice a day.
Eventually I’ll just upgrade to a newer one with color and hopefully better AirPort support, but I’m glad cups and AirPrint works alright since I haven’t tried it in a few years. The issues your wife is experiencing though are likely the same ones that led me to just get a printer that supports it and from what I read at the time Brother has the best AirPrint support (purely anecdotal)
It continues to work while the Mac is sleeping as long as you have an Apple TV, HomePod, or AirPort Express (as those devices run the bonjour sleep proxy).
I’m working on making the script run seamlessly on Linux as well. The only benefit to Linux is that one probably has an always on server or raspberry pi running 24/7.
The macOS version is good for those that have a Mac that’s plugged in at home even if it’s sleeping. Also resource utilization is 0.0% so not too shabby.
However, if this could be installed on my linux server, that would be make this really useful.
reply