From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: * X-Spam-Status: No, score=1.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,FROM_LOCAL_NOVOWEL,HK_RANDOM_FROM autolearn=no autolearn_force=no version=3.4.4 Received: (qmail 884 invoked from network); 5 Jun 2021 12:34:17 -0000 Received: from 1ess.inri.net (216.126.196.35) by inbox.vuxu.org with ESMTPUTF8; 5 Jun 2021 12:34:17 -0000 Received: from mail-lj1-f181.google.com ([209.85.208.181]) by 1ess; Fri Jun 4 16:02:26 -0400 2021 Received: by mail-lj1-f181.google.com with SMTP id e2so13082530ljk.4 for <9front@9front.org>; Fri, 04 Jun 2021 13:02:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:to:subject:from:date:in-reply-to:mime-version :content-transfer-encoding; bh=vaxB7Uc1i0f9k4EQ2/GzKHGbqIwdCzEFlJ3MVeS/wqw=; b=k7rgjt4uelBGvKpxGGNo0Hb+1rLao+KV8oAMXQKeZ1dSTEN4rcZeG38taVhawzTT21 PD+zOAvKvu19RcqYSZphZjk9h3qUuePih6EfxIEOzv7spZp1XDh+VckjfnZraCVKV3c7 SOvv0pkJOROWfmsXZ3HTZ5lZhJJ8MQ3HN9xLihzVCQ7DXAM9KJ8Dd9ksvdhOJ/HIIOFY CJI0HDlnDHdVq5tsu/9Dmeut5csgCEP9VP63aYJuga3jdCamQvJA+Xadm85MUYpr4fGC AmzJepqI9BPiX9UIgivdRdZTnAUUsCEQ5wXe5xic34msFxhHMZQgxGoCdJMuuQ5e822L SPmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:to:subject:from:date:in-reply-to :mime-version:content-transfer-encoding; bh=vaxB7Uc1i0f9k4EQ2/GzKHGbqIwdCzEFlJ3MVeS/wqw=; b=A6iwdkyq1TwgkSo1BBkq44i5OAzEdTA3OuQsou1xtc7as4ZT4F1PCI0uJ3jz/Irh/7 OYbqUdPe8PCR2ttfNYXPG9qrFlWUHAoLzUdMir8P1obVXkRt2u+BIUCTqLxcFLT+AO5G Emj4rTaoGbaKvPaIRspbZs/rkfBsk70TwfRPTFxlROPIo6WbVlSA3xCVgx/LaLzVUb0c luE/y91G/QDWhFqarED20+nEJS1eltC8pFQKGDPlmi3SRejPGSpcJ4uD5LP3m2IkYiAV p9hAXNBJDzLgfLtH/iuxsLMTTtV2k6v6VV9OaZGwu7ya19XTaczMSAMiacgaTfBpT7Aa 1UhA== X-Gm-Message-State: AOAM530G9jNgswxmlP1UY9yLHdUTNi/yK0evr2garGm2IAQ1f+UdYaig EGq8C6TKeKiwGUHJvVwCI9SAtpLciO8= X-Google-Smtp-Source: ABdhPJzn8UehbImaMrjstYmI3ITLuWriQx/mB3ChqWuntg5h+mP+3sSiKeHKYPBj5ycj6NBCT17YwQ== X-Received: by 2002:a05:651c:324:: with SMTP id b4mr4686447ljp.166.1622836941114; Fri, 04 Jun 2021 13:02:21 -0700 (PDT) Return-Path: Received: from fukken.lan (c-adc9e655.027-406-73746f40.bbcust.telenor.se. [85.230.201.173]) by smtp.gmail.com with ESMTPSA id a13sm568935ljb.47.2021.06.04.13.02.19 for <9front@9front.org> (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Jun 2021 13:02:20 -0700 (PDT) Message-ID: <4B3D0310DCDE3856ED8C43B7828EB4F0@gmail.com> To: 9front@9front.org From: "Sigrid Solveig Haflínudóttir" Date: Fri, 04 Jun 2021 22:02:19 +0200 In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: method reduce/map optimizer Subject: Re: [9front] program to bind/rebind keys Reply-To: 9front@9front.org Precedence: bulk Quoth binary cat : > The program would operate by opening /dev/kbd, then binding its output > to /dev/kbd. > It would read a list of keybindings (from a file and/or command line options), > then operate in a loop of reading a key from (the old) /dev/kbd, checking if it > matches any of the bindings given to it. If it finds a match, it executes the > action associated with it. Otherwise, it passes the keypress on. > > This could be used for global keyboard shortcuts by wrapping around rio, > or for per-program keyboard shortcuts. > > `awk` is surprisingly close to working for this, but it has a few problems, > both with reading input delimited by NUL instead of LF, and with > non-printable characters in regular expressions. > > I'm up to provide a bounty for this, although first I'd like to have a rough > idea of how difficult it would be to either write such a program, or to > fix the problems with `awk`, so I know how much a reasonable bounty > would be. > > -- binarycat One of the easy approaches used in riow[1] is to catch all keyboard events that involve a specific modifier, Mod4 in this case, export it via fs, and convert to plain text form in another small program. Those then are used to do window management. [1] https://git.sr.ht/~ft/riow