Skip to content

Instantly share code, notes, and snippets.

@jney
Created August 13, 2012 12:55
Show Gist options
  • Select an option

  • Save jney/3340401 to your computer and use it in GitHub Desktop.

Select an option

Save jney/3340401 to your computer and use it in GitHub Desktop.

Revisions

  1. jney created this gist Aug 13, 2012.
    8 changes: 8 additions & 0 deletions toggle-touchpad.pl
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    #!/usr/bin/perl

    my $device_id = $ARGV[0];
    `xinput list-props ${device_id}` =~ /Synaptics Off \((\d+)\).*(\d)/;
    my $param_id = $1;
    my $param_status = abs($2 - 1);

    system("xinput", "set-prop", $device_id, $param_id, $param_status);