Like Edie, I was going to comment on the quantity of water, but then I noticed you were adding salt, so that quantity is not as likely to disrupt your electrolytes as plain water would be.
The first thing I’d recommend is to examine your sodium intake. Getting that in the right range will help greatly with the other minerals, since the mechanisms that regulate them in the body are all interlinked. Recent studies suggest that we are healthiest when our sodium intake is in the range of 4-6 g a day (perhaps a bit more for keto/carnivore, since elevated insulin slows sodium excretion). In terms of table salt (sodium chloride), that’s 10-15 g/day. But if your food already contains sodium, you don’t need so much added salt. Too little salt leads to lightheadedness, constipation, and headaches; too much, to loose stools. You can use those symptoms as a guide. If salt stops tasting good, then definitely stop eating it; you’ve gotten enough.
If your sodium is in the right range, then you might not need to supplement your potassium and magnesium intake. But if you think you need to do so, there is plenty of information on these forums, and a forum search will turn up lots of helpful posts.
So you might want to start by examining your salt intake, not supplementing potassium and magnesium, and drinking plain water whenever you feel thirsty (not a specific amount, but just drinking to thirst). See if that helps. It will give you a baseline to work from. If you get muscle cramps or other symptoms of low potassium or magnesium, then you can add them back in.
As far as sodium intake goes, the risk curve for bad health effects rises steeply as intake drops below the sweet spot of the curve. It rises much more slowly as intake increases above the sweet spot. The exception is salt-sensitive hypertensives (who are rare), whose risk curve is equally steep on both sides of the sweet spot. In other words, it pays to get the salt right, before worrying about anything else.