summaryrefslogtreecommitdiffstats
path: root/tools/mousedrake
diff options
context:
space:
mode:
Diffstat (limited to 'tools/mousedrake')
-rwxr-xr-xtools/mousedrake39
1 files changed, 39 insertions, 0 deletions
diff --git a/tools/mousedrake b/tools/mousedrake
new file mode 100755
index 0000000..1cf7568
--- /dev/null
+++ b/tools/mousedrake
@@ -0,0 +1,39 @@
+#!/usr/bin/perl
+
+use lib qw(/usr/lib/libDrakX);
+
+# i18n: IMPORTANT: to get correct namespace (drakx-kbd-mouse-x11 instead of libDrakX)
+BEGIN { unshift @::textdomains, 'drakx-kbd-mouse-x11' }
+
+use standalone; #- warning, standalone must be loaded very first, for 'explanations'
+
+use common;
+use interactive;
+use modules;
+use mouse;
+use c;
+
+
+$ugtk2::wm_icon = "/usr/share/mcc/themes/default/mousedrake-mdk.png";
+my $in = 'interactive'->vnew('su');
+
+my $modules_conf = modules::any_conf->read;
+
+my $mouse = mouse::read();
+my %old = %$mouse;
+
+if (!$::noauto) {
+ my $probed_mouse = mouse::detect($modules_conf);
+ $mouse = $probed_mouse if !$mouse->{Protocol} || !$probed_mouse->{unsafe};
+}
+
+if (!$mouse || !$::auto) {
+ $mouse ||= mouse::fullname2mouse('Universal|Any PS/2 & USB mice');
+ mouse::select($in, $mouse) or $in->exit(0);
+}
+
+mouse::write_conf($in->do_pkgs, $modules_conf, $mouse, 1);
+
+system('service', 'gpm', 'restart') if -e '/var/lock/subsys/gpm';
+
+$in->exit(0);