git stash -S # stash staging changes only

This is because Debian 11/Debian 12 with Gnome does not ship with the packages to display tray icons. To install and enable the correct packages to display tray icons, run the following command:
sudo apt install gnome-shell-extension-appindicator
Then either reboot or log out and back in to Gnome, and run the following command:
gnome-extensions enable [email protected]
answer:
In short,
sudo vim /etc/systemd/logind.conf
Find and uncomment the following lines, and change the values
HandleLidSwitch=lock
HandleLidSwitchExternalPower=lock
HandleLidSwitchDocked=ignore
Save and exit, and
sudo systemctl restart systemd-logind