Sleep AND lock when lid is closed?

10 months ago by Fuck u/spez to c/linux4noobs

The Cinnamon power management settings on Mint have options to suspend OR lock my ThinkPad when the lid is closed but I can't seem to find a way to make it do both.

Update: fixed

Fuck_u_spez_ 5 points 10 months ago

Something is actually preventing the system from being locked at all. If I click the lock icon in the menu above the log out button, nothing happens.

path: 0 20917977, hotness: undefined, score: 5, children: 4
ulterno 1 point 10 months ago

Do you have a screenlocker program installed and setup?
A quick search tells me that cinnamon-screensaver is its name for Cinnamon.

Perhaps you can also run journalctl -f in a terminal and then click the lock button in the menu, to see if there is any error related to that at that moment.

path: 0 20917977 20918227, hotness: undefined, score: 1, children: 2
Fuck_u_spez_ 3 points 10 months ago

cinnamon-screensaver/zara,now 6.4.1+zara amd64 [installed]

I don't see any errors at all.

Dec 08 23:17:01 Mint-Yoga CRON[10491]: (root) CMD (cd / && run-parts --report /etc/cron.hourly)

Dec 08 23:17:01 Mint-Yoga CRON[10490]: pam_unix(cron:session): session closed for user root

Dec 08 23:17:18 Mint-Yoga dbus-daemon[780]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' requested by ':1.190' (uid=1000 pid=10482 comm="/usr/bin/gnome-screenshot --gapplication-service" label="unconfined")

Dec 08 23:17:18 Mint-Yoga systemd[1]: Starting systemd-hostnamed.service - Hostname Service...

Dec 08 23:17:18 Mint-Yoga dbus-daemon[780]: [system] Successfully activated service 'org.freedesktop.hostname1'

Dec 08 23:17:18 Mint-Yoga systemd[1]: Started systemd-hostnamed.service - Hostname Service.

Dec 08 23:17:51 Mint-Yoga systemd-resolved[723]: Clock change detected. Flushing caches.

Dec 08 23:17:51 Mint-Yoga systemd-timesyncd[733]: Contacted time server 185.125.190.57:123 (ntp.ubuntu.com).

Dec 08 23:17:51 Mint-Yoga systemd[1]: apt-daily.service - Daily apt download activities was skipped because of an unmet condition check (ConditionACPower=true).

Dec 08 23:18:09 Mint-Yoga systemd[1]: systemd-hostnamed.service: Deactivated successfully.

path: 0 20917977 20918227 20918902, hotness: undefined, score: 3, children: 1
ulterno -1 points 10 months ago

Yeah, nothing seems related to locking the screen.
Perhaps try some cinnamon related place and they might know how to get the related info (I haven't used cinnamon).

path: 0 20917977 20918227 20918902 20936715, hotness: undefined, score: -1, children: 0
Fuck_u_spez_ 1 point 10 months ago

Update: I installed xfce, which is also broken in its own way, but it allowed me to reinstall Cinnamon which now allows me to lock the laptop, manually or automatically.

path: 0 20917977 21018357, hotness: undefined, score: 1, children: 0
anon5621 3 points 10 months ago

Because when it suspending it will already be locked after waking

path: 0 20917668, hotness: undefined, score: 3, children: 3
Fuck_u_spez_ 3 points 10 months ago

You would think so, wouldn't you? But no, it lets me pick right back up where I left off without a password prompt. I thought maybe I had forgotten to set a password altogether, but I hadn't.

path: 0 20917668 20917881, hotness: undefined, score: 3, children: 2
fuckwit_mcbumcrumble 1 point 10 months ago

Are you immediately opening the screen, or does it still do it after sitting in sleep for like 5 minutes?

path: 0 20917668 20917881 20919627, hotness: undefined, score: 1, children: 1
Fuck_u_spez_ 2 points 10 months ago

5 minutes, 5 hours, doesn't matter. And it does actually go to sleep when closed.

path: 0 20917668 20917881 20919627 20919706, hotness: undefined, score: 2, children: 0
gtrcoi 1 point 10 months ago

I assume cinnamon uses the kind of methods talked about here: https://www.freedesktop.org/...

I don't know anything about freedesktop and I refuse to learn, but give it a read and see if you can use it for anything.

The systemd-suspend.service also runs any scripts it finds in /usr/lib/systemd/system-sleep/, which might also be respected by whatever cinnamon is doing, or not. You can read more about it here https://man7.org/...

For that you'd basically put a shell script in that directory that checks if the $1 variable that is passed to it is either "pre" or "post" for suspending or waking up respectively and running whatever command you want. Again, this is hacky and might not work in all environments.

path: 0 20941248, hotness: undefined, score: 1, children: 0
linux4noobs
linux4noobs

@programming.dev

login for more options
4500
307
83

linux4noobs


Noob Friendly, Expert Enabling

Whether you're a seasoned pro or the noobiest of noobs, you've found the right place for Linux support and information. With a dedication to supporting free and open source software, this community aims to ensure Linux fits your needs and works for you. From troubleshooting to tutorials, practical tips, news and more, all aspects of Linux are warmly welcomed. Join a community of like-minded enthusiasts and professionals driving Linux's ongoing evolution.


Seeking Support?
  • Mention your Linux distro and relevant system details.
  • Describe what you've tried so far.
  • Share your solution even if you found it yourself.
  • Do not delete your post. This allows other people to see possible solutions if they have a similar problem.
  • Properly format any scripts, code, logs, or error messages.
  • Be mindful to omit any sensitive information such as usernames, passwords, IP addresses, etc.

Community Rules

  • Keep discussions respectful and amiable. This community is a space where individuals may freely inquire, exchange thoughts, express viewpoints, and extend help without encountering belittlement. We were all a noob at one point. Differing opinions and ideas is a normal part of discourse, but it must remain civil. Offenders will be warned and/or removed.
  • Posts must be Linux oriented
  • Spam or affiliate links will not be tolerated.

go to feed...