This commit is contained in:
+109
@@ -0,0 +1,109 @@
|
||||
## Mouse Pointer Acceleration on Linux.
|
||||
|
||||
### Why?
|
||||
|
||||
Many gamers, specifically those whom enjoy first person shooters, know that you should disable the mouse pointer acceleration
|
||||
that windows has enabled by default. You disable it so that you get a 1:1 correlation between how you mouse physically and how
|
||||
the pointer moves.
|
||||
|
||||
Some of us, however, know that mouse acceleration, if done right, can be very useful and that windows just does it very poorly.
|
||||
I became convinced of this after some youtube videos on the subject, mainly this [video](https://www.youtube.com/watch?v=SBXv0xi-wyQ) by [pinguefy](https://www.youtube.com/@Pinguefy).
|
||||
We also know that [Raw Accel](https://github.com/a1xd/rawaccel/blob/master/doc/Guide.md), a mouse pointer acceleration driver for **windows**, does it right.
|
||||
|
||||
### Linux
|
||||
|
||||
We want rawaccel on **linux** too, but we won't get it.
|
||||
So we're relegated to projects like [leetmouse](https://github.com/Skyl3r/leetmouse) that I found difficult to install,
|
||||
and user unfriendly; or [libinput](https://wiki.archlinux.org/title/Libinput) with a [custom acceleration profile](https://wayland.freedesktop.org/libinput/doc/latest/pointer-acceleration.html#the-custom-acceleration-profile).
|
||||
|
||||
Now, my gripe with `leetmouse` comes down to, mostly, skill issue. I eventually got it working, but it was still hard to change
|
||||
parameters since I had to recompile the source code to do so.
|
||||
|
||||
My gripe with `libinput` is that while having a terrible user experience on par `leetmouse`, it is also impossible to express
|
||||
certain curves. I even built a [cli tool](https://github.com/Gnarus-G/libinput-custom-points-gen) to generate the configuration that will approximate the curve I want.
|
||||
|
||||
Accel=0.3; Offset=2; CAP=2;
|
||||
|
||||
```sh
|
||||
libinput-points 0.3 2 2 -x
|
||||
```
|
||||
|
||||
```
|
||||
Section "InputClass"
|
||||
Identifier "My Mouse"
|
||||
Driver "libinput"
|
||||
MatchIsPointer "yes"
|
||||
|
||||
Option "AccelProfile" "custom"
|
||||
Option "AccelStepMotion" "1"
|
||||
Option "AccelPointsMotion" "0 1 2 3.3 5.2 7.699999999999999 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 106 108 110 112 114 116 118 120 122 124"
|
||||
EndSection
|
||||
|
||||
```
|
||||
|
||||
If you need more context on this, refer to [libinput xorg configuration](https://wiki.archlinux.org/title/Libinput#Via_Xorg_configuration_file), and [libinput properties](https://man.archlinux.org/man/libinput.4#SUPPORTED_PROPERTIES).
|
||||
I don't recommend using `libinput-points` to mimic Rawaccel's linear acceleration because, when I built it, I understood much less than I do now
|
||||
about how the math works.
|
||||
|
||||
Note then, that my main goal, and only goal for the moment, is to replicate the linear type acceleration option from `Rawaccel`
|
||||
|
||||
### Solution: Home-made driver
|
||||
|
||||
So we need an easy install story, and a very easy configuration story.
|
||||
|
||||
I made my own driver, [maccel](https://github.com/Gnarus-G/maccel). It's easy enough for me to install. Sometimes a system might be missing some
|
||||
dependencies and it can be a chore getting them; But past that hurdle is a decent enough cli tool with a user friendly Terminal UI.
|
||||
|
||||
```sh
|
||||
maccel tui
|
||||
```
|
||||
|
||||

|
||||
|
||||
## Install Dependencies
|
||||
|
||||
Make sure to have these dependencies installed on your machine:
|
||||
`curl`, `git`, `make`, `gcc`, and the linux headers in `/lib/modules/`
|
||||
|
||||
### gcc
|
||||
|
||||
The version matters, it must match the version with which the kernel was built.
|
||||
|
||||
For example you might encounter such an error:
|
||||
|
||||

|
||||
|
||||
And you'll have to find a version of `gcc` that matches. This will be more or less annoying
|
||||
depending on your distro and/or how familiar you are with it.
|
||||
|
||||
### linux headers
|
||||
|
||||
You want to make sure that `/lib/modules/` is not empty. For example mine looks like this:
|
||||
|
||||
```
|
||||
total 0
|
||||
drwxr-xr-x 1 root root 114 Jan 29 17:59 .
|
||||
drwxr-xr-x 1 root root 159552 Jan 29 22:39 ..
|
||||
drwxr-xr-x 1 root root 10 Jan 29 17:59 6.6.14-1-lts
|
||||
drwxr-xr-x 1 root root 12 Jan 29 17:59 6.7.0-zen3-1-zen
|
||||
drwxr-xr-x 1 root root 494 Jan 29 17:59 6.7.2-arch1-1
|
||||
drwxr-xr-x 1 root root 494 Jan 31 21:54 6.7.2-zen1-1-zen
|
||||
```
|
||||
|
||||
You want to find headers that match your kernel as represented by
|
||||
|
||||
```
|
||||
uname -r
|
||||
```
|
||||
|
||||
On an arch based distro you list the available headers with
|
||||
|
||||
```
|
||||
sudo pacman -Ss linux headers
|
||||
```
|
||||
|
||||
## Uninstall
|
||||
|
||||
```sh
|
||||
sudo sh /opt/maccel/uninstall.sh
|
||||
```
|
||||
@@ -0,0 +1,42 @@
|
||||
<script>
|
||||
const copyButtons = document.querySelectorAll("code > [data-copy-button]")
|
||||
|
||||
copyButtons.forEach(button => {
|
||||
const content = button.parentElement?.textContent?.trim();
|
||||
if (content) {
|
||||
button.addEventListener("click", async () => {
|
||||
await navigator.clipboard.writeText(content)
|
||||
|
||||
button.setAttribute("data-copied", "");
|
||||
|
||||
setTimeout(() => {
|
||||
button.removeAttribute("data-copied");
|
||||
}, 2000)
|
||||
})
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<button class="absolute right-0 group" data-copy-button>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"
|
||||
fill="currentColor"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
class="h-6 w-6 group-data-[copied]:hidden"
|
||||
>
|
||||
<path d="M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360Zm0-80h360v-480H360v480ZM200-80q-33 0-56.5-23.5T120-160v-560h80v560h440v80H200Zm160-240v-480 480Z"/>
|
||||
</svg>
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"
|
||||
fill="currentColor"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
class="h-6 w-6 hidden group-data-[copied]:inline"
|
||||
>
|
||||
<path d="M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z"/>
|
||||
</svg>
|
||||
</button>
|
||||
@@ -0,0 +1,21 @@
|
||||
---
|
||||
const today = new Date();
|
||||
---
|
||||
|
||||
<footer class="flex flex-col gap-5 items-center p-5 text-slate-100">
|
||||
<p>
|
||||
© {today.getFullYear()} Gnarus G. Powered by <a href="https://astro.build" target="_blank">Astro</a>. All rights reserved.
|
||||
</p>
|
||||
<div class="flex justify-center">
|
||||
<a class="hover:text-slate-500" href="https://github.com/Gnarus-G" target="_blank">
|
||||
<span class="sr-only">Go to my github</span>
|
||||
<svg viewBox="0 0 16 16" aria-hidden="true" width="32" height="32" astro-icon="social/github"
|
||||
><path
|
||||
fill="currentColor"
|
||||
d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"
|
||||
></path></svg
|
||||
>
|
||||
</a>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
/// <reference path="../.astro/types.d.ts" />
|
||||
/// <reference types="astro/client" />
|
||||
@@ -0,0 +1,42 @@
|
||||
---
|
||||
import Footer from "../components/Footer.astro"
|
||||
interface Props {
|
||||
title: string;
|
||||
description: string;
|
||||
}
|
||||
|
||||
const { title, description } = Astro.props;
|
||||
---
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="description" content={description}/>
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<link rel="icon" type="image/png" href="/favicon.png" />
|
||||
<meta name="generator" content={Astro.generator} />
|
||||
<title>{title}</title>
|
||||
<meta name="og:image" content={new URL("/logo.png", Astro.url)}/>
|
||||
</head>
|
||||
<body class="bg-slate-800">
|
||||
<slot />
|
||||
<Footer/>
|
||||
</body>
|
||||
</html>
|
||||
<style is:global>
|
||||
html {
|
||||
font-family: system-ui, sans-serif;
|
||||
}
|
||||
code {
|
||||
font-family:
|
||||
Menlo,
|
||||
Monaco,
|
||||
Lucida Console,
|
||||
Liberation Mono,
|
||||
DejaVu Sans Mono,
|
||||
Bitstream Vera Sans Mono,
|
||||
Courier New,
|
||||
monospace;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,76 @@
|
||||
---
|
||||
import Layout from '../layouts/Layout.astro';
|
||||
import CopyButton from '../components/CopyButton.astro';
|
||||
import Why from "../WHY.md"
|
||||
|
||||
const installUrl = new URL("install.sh", Astro.site);
|
||||
---
|
||||
|
||||
<Layout title="maccel" description="Maccel is a mouse pointer acceleration driver with a CLI and TUI to customize acceleration curves (Linear, Natural, Synchronous) and their parameters.">
|
||||
<header class="flex justify-between items-center p-5 bg-gray-900">
|
||||
<img class="object-cover rounded-full" width="32" src="/logo.png" alt=""/>
|
||||
<section id="links" class="flex justify-center">
|
||||
<a class="text-slate-100 hover:text-slate-500" href="https://github.com/Gnarus-G/maccel" target="_blank">
|
||||
<span class="sr-only">Go see the project on github</span>
|
||||
<svg viewBox="0 0 16 16" aria-hidden="true" width="32" height="32" astro-icon="social/github"
|
||||
><path
|
||||
fill="currentColor"
|
||||
d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"
|
||||
></path>
|
||||
</svg>
|
||||
</a>
|
||||
</section>
|
||||
</header>
|
||||
<main>
|
||||
<div>
|
||||
<section id="cta" class="w-full px-3 py-12 md:py-24 lg:py-32 bg-gray-900">
|
||||
<div class="container mx-auto max-w-[65ch] space-y-4">
|
||||
<div class="space-y-2">
|
||||
<h1 class="text-gray-100 text-3xl font-bold tracking-tighter sm:text-4xl md:text-5xl lg:text-6xl/none">
|
||||
maccel
|
||||
</h1>
|
||||
<p class="max-w-lg text-gray-300 md:text-xl">
|
||||
A mouse pointer <strong>acceleration</strong> driver with a <strong>CLI</strong> and <strong>TUI</strong> to easily customize acceleration curves and their <strong>parameters</strong>.
|
||||
Install now and enhance your aim.
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<div class="w-full p-4 bg-gray-950 text-gray-50 rounded-md border border-solid border-amber-800">
|
||||
<code class="relative flex items-center gap-5 text-sm text-gray-400">
|
||||
<a title="Make sure your system has some things installed." href="#install-dependencies">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
class="h-5 w-5 text-yellow-500"
|
||||
>
|
||||
<path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"></path>
|
||||
<path d="M12 9v4"></path>
|
||||
<path d="M12 17h.01"></path>
|
||||
</svg>
|
||||
</a>
|
||||
curl -fsSL {installUrl} | sudo sh
|
||||
<CopyButton />
|
||||
</code>
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
<a class="text-slate-500" href="/install.sh">View source</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section id="why" class="w-full px-3 py-12 md:py-24 lg:py-32">
|
||||
<div class="container mx-auto prose lg:prose-xl prose-invert">
|
||||
<Why/>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</main>
|
||||
</Layout>
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
import fs from "node:fs/promises";
|
||||
|
||||
const url = new URL("../../../install.sh", import.meta.url);
|
||||
const script = await fs.readFile(url, "utf-8");
|
||||
|
||||
export async function GET() {
|
||||
return new Response(script);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import fs from "node:fs/promises";
|
||||
|
||||
const url = new URL("../../../uninstall.sh", import.meta.url);
|
||||
const script = await fs.readFile(url, "utf-8");
|
||||
|
||||
export async function GET() {
|
||||
return new Response(script);
|
||||
}
|
||||
Reference in New Issue
Block a user