<commit_before>#!/usr/bin/env perl
# -*- mode: perl -*-

use strict;
use warnings;

my ( $dpi ) = ( grep { $_ > 0 }
                map  { if( m/resolution:\s+(\d+)x/ ){ $1 } } `xdpyinfo` );

my $minspeed = sprintf( "%.2f", ( $dpi / 100 ) * 1.00 * 1 );
my $maxspeed = sprintf( "%.2f", ( $dpi / 100 ) * 1.75 * 2 );
my $coasting = sprintf( "%.2f", ( $dpi / 100 ) * 20 * 2  );

if( $minspeed > 0 && $maxspeed > 0 )
{
    print STDOUT "New speeds: $minspeed, $maxspeed, $coasting\n";

    system("synclient MinSpeed=$minspeed");
    system("synclient MaxSpeed=$maxspeed");
    system("synclient CoastingSpeed=$coasting");

    system( "synclient TapButton1=1" );
    system( "synclient TapButton2=2" );
    system( "synclient TapButton3=3" );
    system( "synclient VertTwoFingerScroll=on" );
    system( "synclient HorizTwoFingerScroll=on" );
    system( "synclient PalmDetect=1" );
}
<commit_msg>Fix synaptics.pl<commit_after>#!/usr/bin/env perl
# -*- mode: perl -*-

use strict;
use warnings;

my ( $dpi ) = ( grep { $_ > 0 }
                map  { if( m/resolution:\s+(\d+)x/ ){ $1 } } `xdpyinfo` );

my $minspeed = sprintf( "%.2f", ( $dpi / 100 ) * 1.00 * 1 );
my $maxspeed = sprintf( "%.2f", ( $dpi / 100 ) * 1.75 * 2 );
my $coasting = sprintf( "%.2f", ( $dpi / 100 ) * 20 * 2  );

if( $minspeed > 0 && $maxspeed > 0 )
{
    print STDOUT "New speeds: $minspeed, $maxspeed, $coasting\n";

    system("synclient MinSpeed=$minspeed");
    system("synclient MaxSpeed=$maxspeed");
    system("synclient CoastingSpeed=$coasting");

    system( "synclient TapButton1=1" );
    system( "synclient TapButton2=2" );
    system( "synclient TapButton3=3" );
    system( "synclient VertTwoFingerScroll=1" );
    system( "synclient HorizTwoFingerScroll=1" );
    system( "synclient PalmDetect=1" );
}

{'fraction_non_alphanumeric': 0.19508105086640581, 'fraction_numerical': 0.03912800447177194, 'mean_word_length': 3.231678486997636, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4730278', 'n_tokens_mistral': 738, 'n_tokens_neox': 687, 'n_words': 155}