-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathinstall.sh
96 lines (92 loc) · 2.93 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/usr/bin/env sh
temporary=/tmp/mouseless
version=$(curl --silent "https://api.github.com/repos/jbensmann/mouseless/releases/latest" | grep -oP '"tag_name": "\K(.*)(?=")')
echo "=========================================="
echo "Installing latest version of mouseless: $version"
echo "=========================================="
wget -q -P $temporary https://github.com/jbensmann/mouseless/releases/download/$version/mouseless-linux-amd64.tar.gz && \
tar -xf $temporary/mouseless-linux-amd64.tar.gz --directory $temporary && \
sudo mv $temporary/dist/mouseless /usr/local/bin/ && \
echo "Installed to /usr/local/bin/mouseless" || echo "Failed to install mouseless."
# helps the user see what's going on
sleep 2
# create a config file if it does not exist
if [ ! -f ~/.config/mouseless/config.yaml ]; then
echo ""
echo "=========================================="
echo "Creating a config file."
echo "=========================================="
echo "Using device: $keyboard"
mkdir -p ~/.config/mouseless
echo '
# the keyboard devices it reads from, if no devices are specified, it reads from all
devices:
# - "/dev/input/by-id/SOME_KEYBOARD_REPLACE_ME-event-kbd"
# this is executed when mouseless starts
# startCommand: ""
# the default speed for mouse movement
baseMouseSpeed: 750.0
# the default speed for scrolling
baseScrollSpeed: 20.0
layers:
# the first layer is active at start
- name: initial
bindings:
# when tab is held and another key pressed, activate mouse layer
tab: tap-hold-next tab ; toggle-layer mouse ; 500
# when a is held for 300ms, activate mouse layer
a: tap-hold a ; toggle-layer mouse ; 300
# right alt key toggles arrows layer
rightalt: toggle-layer arrows
# switch escape with capslock
esc: capslock
capslock: esc
# a layer for mouse movement
- name: mouse
# when true, keys that are not mapped keep their original meaning
passThrough: true
bindings:
# quit mouse layer
q: layer initial
# keep the mouse layer active
space: layer mouse
r: reload-config
l: move 1 0
j: move -1 0
k: move 0 1
i: move 0 -1
p: scroll up
n: scroll down
leftalt: speed 4.0
e: speed 0.3
capslock: speed 0.1
f: button left
d: button middle
s: button right
# move to the top left corner
k0: "exec xdotool mousemove 0 0"
# another layer for arrows and some other keys
- name: arrows
passThrough: true
bindings:
e: up
s: left
d: down
f: right
q: esc
w: backspace
r: delete
v: enter
' > ~/.config/mouseless/config.yaml
echo "Created ~/.config/mouseless/config.yaml"
else
echo ""
echo "Config file will NOT be created because it already exists."
fi
sleep 2
echo ""
echo "=========================================="
echo "Installation complete."
echo "=========================================="
echo "You can run it with:"
echo "sudo mouseless --debug --config ~/.config/mouseless/config.yaml"