unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Attila Lendvai <attila@lendvai.name>
To: Attila Lendvai <attila@lendvai.name>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: [RFC] refactoring extra-special-file; an /etc/tmpfiles/ equivalent
Date: Fri, 10 Feb 2023 12:05:37 +0000	[thread overview]
Message-ID: <hpUqi4h3P9vblzMwwWrayWYOOtSzWDpaA7JZHX5mxxgNYcHT9KGwfswvGXcRPmpAmO2Yg7jYIzD_ckAEphSI3IQ8EVjsd_oLUa8Gly9Pfb0=@lendvai.name> (raw)
In-Reply-To: <bnkFpeHl43kNvaDPIHgLNSRTi22q-vRS5Bp-2-fX3BuOXtYQYqRLYFicv8Pk6qRvMP7EORKlNxcIFNUHYIyK0J5U-Qe8b1Iy8TJn1mlHvus=@lendvai.name>

> i want to write a string into a file at boot to disable wake-up by
> my keyboard (so that it doesn't immediately wake up my laptop after
> i suspend it). it requires doing this once per boot:
>
> echo XHC >/proc/acpi/wakeup
> 
> the standard solution on systemd distros is to use a
> /etc/tmpfiles.d/disable-usb-wake.conf file, which systemd interprets
> (see e.g. https://forums.linuxmint.com/viewtopic.php?f=42&t=312953).

FTR, the "guixy way" currently is to add a service like this:

(simple-service 'disable-keyboard-wakeup activation-service-type
  #~(begin
      (use-modules (ice-9 regex))
      (use-modules (ice-9 textual-ports))
      (when (string-match "XHC\t  S3\t\\*enabled"
                          (call-with-input-file "/proc/acpi/wakeup"
                            get-string-all))
        (display "Turning off usb wakeup\n")
        (with-output-to-file "/proc/acpi/wakeup"
          (lambda _
            (display "XHC"))))))

-- 
• attila lendvai
• PGP: 963F 5D5F 45C7 DFCD 0A39
--
Censorship is telling a man he can't have a steak just because a baby can't chew it.



  reply	other threads:[~2023-02-10 12:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-21 15:29 [RFC] refactoring extra-special-file; an /etc/tmpfiles/ equivalent Attila Lendvai
2023-02-10 12:05 ` Attila Lendvai [this message]
2023-02-10 13:38   ` Attila Lendvai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='hpUqi4h3P9vblzMwwWrayWYOOtSzWDpaA7JZHX5mxxgNYcHT9KGwfswvGXcRPmpAmO2Yg7jYIzD_ckAEphSI3IQ8EVjsd_oLUa8Gly9Pfb0=@lendvai.name' \
    --to=attila@lendvai.name \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).