Recently Written · git

xinput-persistence

xinput for mouse or keyboard configurations that work when disconnected or on boot.

git clone https://github.com/equwal/xinput-persistence

Log | Files | Refs


commit 09a64361858bcfcb238c9a9c06651ada28bffe41
Spenser Truex <spensertruexonline@gmail.com>
2019-04-22 16:21:41 -0700

Install script bug fixed.

 README.org    |  6 +++---
 commands.conf |  3 +--
 forking.pl    |  3 ++-
 install.pl    | 10 ++++++++++
 install.sh    |  3 ---
 monitor       |  3 +++
 6 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/README.org b/README.org
index 55fd89c..c796e76 100644
--- a/README.org
+++ b/README.org
@@ -47,8 +47,8 @@ Finally, install it
 #+BEGIN_SRC sh
 ~/xinput-persistence# ./install.sh
 #+END_SRC
-You can have as many devices as required, just add a new monitor.pl command to the file. 
-
-The program will fork each one.
+You can have as many devices as required, just add a new monitor.pl command to
+the file.  The program will fork each one. There is no need to reinstall when
+adding new lines.
 
 Make sure to add =/usr/bin/monitor= to your startup scripts.
diff --git a/commands.conf b/commands.conf
index b5ba875..7659f34 100644
--- a/commands.conf
+++ b/commands.conf
@@ -1,3 +1,2 @@
-monitor.pl -a 'add' -n 'DeathAdder Elite' -d 'usb' -c1 'xinput set-prop ' -c2 ' 153 0.114285, 0.000000, 0.000000, 0.000000, 0.114285, 0.000000, 0.000000, 0.000000, 1.000000 && xinput --disable "ETPS/2 Elantech Touchpad"'
+monitor.pl -a 'add' -n 'DeathAdder Elite' -d 'usb' -c1 'xinput set-prop ' -c2 ' 153 0.114285, 0.000000, 0.000000, 0.000000, 0.114285, 0.000000, 0.000000, 0.000000, 1.000000 && sleep 4 && xinput --disable "ETPS/2 Elantech Touchpad"'
 monitor.pl -a 'add' -n 'Rosewell' -d 'usb' -c1 '/usr/bin/desired-keymap'
-monitor.pl -a 'remove' -n 'DeathAdder Elite' -d 'usb' -c1 'xinput --enable "ETPS/2 Elantech Touchpad"'
diff --git a/forking.pl b/forking.pl
index 1cbd257..325d3c3 100755
--- a/forking.pl
+++ b/forking.pl
@@ -1,7 +1,8 @@
 #!/usr/bin/perl
 use strict;
 use warnings;
-open my $com, '<', 'commands.conf';
+my $pwd = $ARGV[0];
+open my $com, '<', "$pwd/commands.conf";
 for(<$com>) {
     my $f = fork();
     if (defined $f) {
diff --git a/install.pl b/install.pl
new file mode 100755
index 0000000..1b13bc5
--- /dev/null
+++ b/install.pl
@@ -0,0 +1,10 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+
+`cp monitor.pl /usr/bin/monitor.pl`;
+`cp forking.pl /usr/bin/forking.pl`;
+open my $monitor, '>', 'monitor';
+my $pwd = `pwd`;
+print $monitor "#!/bin/bash\nforking.pl $pwd\n";
+`cp monitor /usr/bin/monitor`;
diff --git a/install.sh b/install.sh
deleted file mode 100755
index b67725d..0000000
--- a/install.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-cp monitor.pl /usr/bin/monitor.pl
-cp forking.pl /usr/bin/monitor
diff --git a/monitor b/monitor
new file mode 100644
index 0000000..86c04f0
--- /dev/null
+++ b/monitor
@@ -0,0 +1,3 @@
+#!/bin/bash
+forking.pl /home/jose/xinput-persistence
+