From owner-freebsd-questions@freebsd.org Sun Feb 16 19:35:30 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1EF1B23FCC6 for ; Sun, 16 Feb 2020 19:35:30 +0000 (UTC) (envelope-from noahpalmerversion1@gmail.com) Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48LHQT0bzfz3yXd for ; Sun, 16 Feb 2020 19:35:28 +0000 (UTC) (envelope-from noahpalmerversion1@gmail.com) Received: by mail-lj1-x22d.google.com with SMTP id h23so16349668ljc.8 for ; Sun, 16 Feb 2020 11:35:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MOpbo9FnLn86ziOSS7LwmcUs1TiaJWjBwcxBH8UetcY=; b=S5RH1lJDgigGE6sTnCUvvjJdgGtWAbLIMm4od7rAmzdRAVneJWfPfTi6KBlI3dsazo VSMKxt9JR3bka2woFsf+NtUO3jW0HyGM4VKBE8wOlRiOvJFg1dQ/IPA40apdTpneaxC1 p6VLTPHWoyn2VsFpwq3JWNLO7kTwuGF+/2Qv2IPUfzeKxfoU9McLbKL6XmWVqSkqsG98 5Ihzez0v3VIiQMfj9QPQRMa/IXQnKxjhsvcgtiUI3C2+zYW/XmljIAK9LmJsUvxK6Vqn +GN2fYjRpEMMScnpOISwNAVf1IdmxB+pqhW7KPoJLcTn/VM4I7F4wqzUtA3SEYXMNSMH WMzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MOpbo9FnLn86ziOSS7LwmcUs1TiaJWjBwcxBH8UetcY=; b=JpSoxBAHFjCZnGPOs5Dbte7iOhBtLDKLO7ycKKwpUKgVV/ucFvkPXGJ26wIU2SUQ/c y9ZTyhPcl65WsLLF8PWeZRvaL3Vvy2tJOJxBybQbbdsOM1eZMY3iqALWEIcR28sdAi3G ceIohDE6omWLzsZdhPKnKd2x/uuvJlzzwFSVmCCT0xFImvrCUCTiOm/PWnzck9WgB5oh +NWIb06I/SVJRx+UoAPK7UzqvROGx99YjTCLy28tQ2z2eK8VmB1C68+KyPQNEF4XMsKE XkmXqPf7X9YMSfGpEz4Dnk/lVFMXSpvJgyyOeJRgpuzqWdaUPcg7r+mU41wN8uJpU/YZ 6zkA== X-Gm-Message-State: APjAAAU9ldEjsxWs+kP/0eHrslfSKYQgDu4kCdKlyQRSzaVF2uBrNJ5T vZR+IhnkEdwnNJKRJWb+2muUrTxHERCG8sOuGQtZEw== X-Google-Smtp-Source: APXvYqwUwHKsba6KSfHqImjdKiknjlYntfB6t5WgnW9cVFghwd7iPHeFhsheE9ttnMqpCgxi+XjqiiH6GZriDykVZns= X-Received: by 2002:a2e:981a:: with SMTP id a26mr8043301ljj.82.1581881726198; Sun, 16 Feb 2020 11:35:26 -0800 (PST) MIME-Version: 1.0 References: <2061301f-4f78-e50a-1864-f9a608b7c504@yuripv.me> <5fe7c2f2-9645-0c13-1878-7bbfa8f33487@yuripv.me> In-Reply-To: <5fe7c2f2-9645-0c13-1878-7bbfa8f33487@yuripv.me> From: Noah Palmer Date: Sun, 16 Feb 2020 14:35:15 -0500 Message-ID: Subject: Re: Update X when laptop lip is closed To: Yuri Pankov Cc: freebsd-questions@freebsd.org X-Rspamd-Queue-Id: 48LHQT0bzfz3yXd X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=S5RH1lJD; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of noahpalmerversion1@gmail.com designates 2a00:1450:4864:20::22d as permitted sender) smtp.mailfrom=noahpalmerversion1@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[d.2.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; IP_SCORE(0.00)[ip: (-9.07), ipnet: 2a00:1450::/32(-2.42), asn: 15169(-1.68), country: US(-0.05)]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Feb 2020 19:35:30 -0000 On Sun, Feb 16, 2020 at 4:00 AM Yuri Pankov wrote: > Noah Palmer wrote: > > On Sat, Feb 15, 2020 at 11:08 PM Yuri Pankov wrote: > > > >> Noah Palmer wrote: > >>> is there a way to automatically remove or add the display to X when the > >>> laptop lid is opened or closed. I have been using a script to read > >>> dev.acpi_lid.0.state, but is there better way? > >> > >> If you are polling the dev.acpi_lid.0.state value, see /etc/devd.conf > >> for examples of ACPI events notification, so you could invoke the need > >> actions when lid is open/closed. > >> > > Okay that seems to be the solution. I also have an issue that > > dev.acpi_lid.0.state is incorrect if the lid was open at boot. you have > to > > close and open the lid for the value to be correct. > > Interesting, I'm seeing the same on my lenovo laptop, something to look > into. BTW, there's somewhat related PR filed: > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240881. > Okay, I can use devd to run commands when the lid is opened and closed, but they don't trigger if the laptop starts open or closed, there has to be a change in state when the laptop is running. -- Noah Palmer