I was considering that. Would it be better to just keep a glock 17 near the bed?
I think first you should put down the guns and do a couple of actual walk through, deep thinking, home assessments of your property. From both points of view. Bad guy(s) and home defender (you). Walk those paths with eyes wide open thinking about how things look from both sides, where are you protected, where does the bad guy have protection, how easily can you move from room to room or cover to cover, floor to floor, same from his side.
You have to walk the lanes and get eyes and brain keyed in on everything and anything that will help or hinder your defenses, and then improve those areas or mark them as noted and keep going.
Paying attention to the avenues of approach that would be the most likely points of entry for an intruder(s), ease of those entry points and trying to harden them (make them more secure).
Recognize and designate the best place to try and gather your family (or yourself if you live alone), making sure that FRP (family rally point) can be secured, defended and also allows an emergency exit point in case of fire or other mitigating circumstances (if they can’t get to you without being shot but then try to burn you out instead). Equip that room (that rally point) with some basics in case those are needed (fire extinguishers, emergency rope ladder, phone, large canisters of pepper spray to flood the approaching staircase or hallways and slow or deter the assault, a basic trauma kit, spare mags or ammo in a drawer for whatever firearm you end up choosing, couple water bottles, etc etc. even a secondary small safe secured in that room with another pistol or rifle.
There are a lot of basic things you can do (this is only a short list) to prepare physically and mentally beforehand, with the mindset of securing your family first. Some of these things require money, time, racking your brain a little and some basic handiwork, but will pay off in dividends if they’re ever needed.
Point being having a firearm is really only a small part of the larger equation. It’s the mental and physical prep that will make yours a formidable place for anyone to try and force entry without immediate regret.