How to keep wifi on when I close my lid

Hello Fedora Community,
My name is Joseph Knapp. I am using Fedora 37 workstation on my HP 15 with an i3-1115g4. When I close my laptop’s lid my wifi turns off, I want it to stay on. When I used the XFCE spin of Fedora the wifi card stayed on when I closed my lid, so why does GNOME turn it off. I have trouble using XFCE because it is not as feature rich or integrated as I would like it to be. I want to use apps like IPFS desktop and I2P+, but this gets in the way of being able to do that. How do I keep the wifi on when I close the lid of my laptop?

P.S. I do not want to disable auto suspend, which the wifi seems to be tied to. I still want it to demand a password while the wifi stays on.

Make systemd-logind ignore lid switch events:

sudo mkdir -p /etc/systemd/logind.conf.d
sudo tee /etc/systemd/logind.conf.d/00-custom.conf << EOF > /dev/null
sudo systemctl restart systemd-logind.service

The last command will close currently open sessions to apply changes.

See also: logind.conf

1 Like

Will your solution disable the password protection when I open my lid?

If you want to lock the screen when closing the lid, change ignore to lock in the above reply.

Why are you using tee if you’re sending the second output to /dev/null? Just use cat! HTH, HAND.

This is a well known issue, that sudo cat cannot redirect to a privileged file.