-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·94 lines (78 loc) · 2.31 KB
/
setup.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
#!/bin/bash
#title : setup.sh
#description : This script sets up a xbindkeys configuration file by appending a
# set of bindings to the ~/.xbindkeysrc file.
#author : dduits (https://github.com/dduits)
#licence : unlicense, see the LICENSE file for more information.
#version : 1.0
#usage : setup.sh
clear
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
echo "Select mouse to setup (enter number):"
echo "0. None "
echo "1. G305"
echo "2. MX Master S2"
read -p "> " mouseInput
if [[ $mouseInput = "0" || ! -n ${mouseInput} ]]
then
echo "Skipping mouse setup."
elif [ $mouseInput = "1" ]
then
echo "Setting up bindings for G305..."
echo >> ~/.xbindkeysrc
cat $DIR/config/xbindkeys-logitech-g305 >> ~/.xbindkeysrc
mkdir -p ~/script
cp $DIR/src/workspace-switcher.sh ~/script
cp $DIR/src/mouse-navigation.sh ~/script
elif [ $mouseInput = "2" ]
then
echo "Setting up bindings for MX Master S2..."
echo >> ~/.xbindkeysrc
cat $DIR/config/xbindkeys-logitech-mx-master-s2 >> ~/.xbindkeysrc
mkdir -p ~/script
cp $DIR/src/workspace-switcher.sh ~/script
cp $DIR/src/mouse-navigation.sh ~/script
else
echo "Invalid mouse choice."
exit 128
fi
echo "Mouse setup done."
echo
echo "Select a keyboard to setup (enter number):"
echo "0. None (Default)"
echo "1. Ducky One Two"
echo "2. Razer BlackWidow Ultimate"
echo "3. Laptop"
read -p "> " keyboardInput
if [[ $keyboardInput = "0" || ! -n ${keyboardInput} ]]
then
echo "Skipping keyboard setup."
elif [ $keyboardInput = "1" ]
then
echo "Setting up bindings for Ducky One Two..."
echo >> ~/.xbindkeysrc
cat $DIR/config/xbindkeys-ducky-one-two >> ~/.xbindkeysrc
elif [ $keyboardInput = "2" ]
then
echo "Setting up bindings for Razer BlackWiddow Ultimate..."
echo >> ~/.xbindkeysrc
cat $DIR/config/xbindkeys-razer-blackwidow >> ~/.xbindkeysrc
elif [ $keyboardInput = "3" ]
then
echo "Setting up bindings for Laptop..."
mkdir -p ~/script
cp $DIR/src/touchpad-toggle.sh ~/script
echo >> ~/.xbindkeysrc
cat $DIR/config/xbindkeys-laptop >> ~/.xbindkeysrc
else
echo "Invalid keyboard choice."
exit 128
fi
echo "Keyboard setup done."
echo
echo "Resetting xbindkeys"
killall xbindkeys
sleep 1
xbindkeys -f ~/.xbindkeysrc
echo "Reset done."
exit 0