Skip to content

Instantly share code, notes, and snippets.

@ewauq
ewauq / logitech-bind-f13-f24.lua
Last active November 29, 2023 06:23
How to: Bind F13 to F24 keys on the G-keys (Logitech Gaming Keyboards)
-- How to use this script:
-- 1. Install the Logitech Gaming Software: http://support.logitech.com/en_us/software/lgs
-- 2. Launch it, and right click on your profile (the gear icon) and then click on "Scripts".
-- 3. Add the following code into the Script window, save it, and close it. Enjoy.
-- Now G1 is bound to F13, G2 to G14, ... G12 to F24.
function OnEvent(event, arg)
-- OutputLogMessage("event = %s, arg = %s\n", event, arg)
#!/usr/bin/perl
use strict;
sub deswappify {
my $pid = shift;
my $fh = undef;
my $start_addr, $end_addr;
if(open F, "/proc/$pid/smaps") {