From nobody Tue Mar 17 23:49:05 2026 X-Original-To: freebsd-desktop@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4fb7wP2wdsz6VpQM for ; Tue, 17 Mar 2026 23:49:25 +0000 (UTC) (envelope-from ben@benhutton.com.au) Received: from mail.myuniquemail.com (mail.myuniquemail.com [115.70.107.139]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4fb7wM63Q2z3Rj9 for ; Tue, 17 Mar 2026 23:49:23 +0000 (UTC) (envelope-from ben@benhutton.com.au) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=pass (policy=reject) header.from=benhutton.com.au; spf=pass (mx1.freebsd.org: domain of ben@benhutton.com.au designates 115.70.107.139 as permitted sender) smtp.mailfrom=ben@benhutton.com.au Received: from [10.241.166.96] (KD106130044236.au-net.ne.jp [106.130.44.236]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.myuniquemail.com (Postfix) with ESMTPSA id 4D2591DD080 for ; Wed, 18 Mar 2026 07:49:10 +0800 (AWST) Content-Type: multipart/alternative; boundary="------------73Cyciq5QyvFxqQqnRnFVrXJ" Message-ID: Date: Wed, 18 Mar 2026 07:49:05 +0800 List-Id: Using and improving FreeBSD on the desktop List-Archive: https://lists.freebsd.org/archives/freebsd-desktop List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-desktop@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Resume from Suspend when triggered by Lid To: freebsd-desktop@freebsd.org References: <7fab23a7-723b-4857-a732-10238bf46d1f@benhutton.com.au> <609dbdd3-0d6c-463d-86a0-3c238acea213@shurik.kiev.ua> <31566b59-107d-42e6-8cc9-a4f93238534d@benhutton.com.au> <33814e2c-4ad9-4221-b40d-af2cecef0aec@shurik.kiev.ua> <2ea2c801-012b-445e-8605-4bab65a2471d@benhutton.com.au> Content-Language: en-AU From: Ben Hutton In-Reply-To: X-Spamd-Result: default: False [-3.75 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.99)[-0.995]; NEURAL_HAM_MEDIUM(-0.95)[-0.953]; DMARC_POLICY_ALLOW(-0.50)[benhutton.com.au,reject]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:10143, ipnet:115.70.104.0/21, country:AU]; FREEFALL_USER(0.00)[ben]; R_DKIM_NA(0.00)[]; ARC_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-desktop@freebsd.org]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MLMMJ_DEST(0.00)[freebsd-desktop@freebsd.org]; RCVD_TLS_ALL(0.00)[] X-Rspamd-Queue-Id: 4fb7wM63Q2z3Rj9 X-Spamd-Bar: --- This is a multi-part message in MIME format. --------------73Cyciq5QyvFxqQqnRnFVrXJ Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit That works. Thank you again. I ended up writing a shell script since I've found in some cases the session may not be Session1. In the case currently on my laptop it's Session2. #!/bin/sh session=$(/usr/local/bin/ck-unlock-session) /usr/local/bin/qdbus6 --system org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/$session org.freedesktop.ConsoleKit.Session.Lock On 3/17/26 23:53, Oleksandr Kryvulia wrote: > 17.03.26 08:22, Ben Hutton: >> Fair enough, I can live with that. That's what I have been doing, I >> did try a few hacky ways to initiating a lock but so far nothing has >> worked. >> >> Anyway thank you for the help. >> >> On 3/17/26 13:32, Oleksandr Kryvulia wrote: >>> 17.03.26 01:25, Ben Hutton: >>>> That fixes the issue. New issue is how do you get the system to >>>> lock the screen automatically on resume/suspend? >>> >>> I didn't solve this problem because I have a habit of locking the >>> screen myself (by pressing Meta+L in KDE). >>> >> > > This works for me from root console: > > /usr/local/bin/qdbus6 --system org.freedesktop.ConsoleKit > /org/freedesktop/ConsoleKit/Session1 > org.freedesktop.ConsoleKit.Session.Lock > > Try to place it into /etc/rc.suspend --------------73Cyciq5QyvFxqQqnRnFVrXJ Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

That works. Thank you again.

I ended up writing a shell script since I've found in some cases the session may not be Session1. In the case currently on my laptop it's Session2.

#!/bin/sh
session=$(/usr/local/bin/ck-unlock-session)

/usr/local/bin/qdbus6 --system org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/$session org.freedesktop.ConsoleKit.Session.Lock


On 3/17/26 23:53, Oleksandr Kryvulia wrote:
17.03.26 08:22, Ben Hutton:
Fair enough, I can live with that. That's what I have been doing, I did try a few hacky ways to initiating a lock but so far nothing has worked.

Anyway thank you for the help.

On 3/17/26 13:32, Oleksandr Kryvulia wrote:
17.03.26 01:25, Ben Hutton:
That fixes the issue. New issue is how do you get the system to lock the screen automatically on resume/suspend?

I didn't solve this problem because I have a habit of locking the screen myself (by pressing Meta+L in KDE).



This works for me from root console:

/usr/local/bin/qdbus6 --system org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Session1 org.freedesktop.ConsoleKit.Session.Lock

Try to place it into /etc/rc.suspend
--------------73Cyciq5QyvFxqQqnRnFVrXJ--