diff --git a/README.md b/README.md
index 794d00c..cca0745 100644
--- a/README.md
+++ b/README.md
@@ -1,27 +1,49 @@
-# Ubuntu-Comfortable-3-Finger-Swipe
+# Ubuntu Comfortable Swipe
Author: Rico Tiongson
-Comfortable 3-finger and 4-finger swipe gestures. Uses Xdotool in native C++. For Ubuntu 14.04 LTS and beyond.
+Comfortable 3-finger (and 4-finger) swipe gestures for Ubuntu 14.04 LTS+.
+
+[](https://www.gnu.org/licenses/gpl-3.0)
## Installation
1. `sudo apt install libinput-tools libinput-dev libxdo-dev`
-2. `git clone https://github.com/Hikari9/Ubuntu-Comfortable-3-Finger-Swipe.git`
-3. `cd Ubuntu-Comfortable-3-Finger-Swipe`
+2. `git clone https://github.com/Hikari9/comfortable-swipe-ubuntu.git`
+3. `cd comfortable-swipe-ubuntu`
4. Tweak `src/comfortable-swipe.cpp` to fit keyboard shortcuts of your gestures
5. `bash install`
## How to Run
-1. `comfortable-swipe-serve`
+1. `comfortable-swipe start`
2. Flick away!
-### Input Permissions
+### Permissions
Sometimes, you'll need some permissions to read touchpad input data. Perform these steps to solve the permission issue:
-1. `sudo gpasswd -a input $USER`
+1. `sudo gpasswd -a $USER input`
2. Log out / log back in
## Optional: Add to Startup Applications
1. `gnome-session-properties`
-2. Click `Add`, then enter `comfortable-swipe-serve`
+2. Add, then enter:
+ 
- 
\ No newline at end of file
+3. Save
+
+## Configurations
+The configuration file is located at `~/.config/comfortable-swipe.conf`.
+Make sure to run `comfortable-swipe restart` after making changes.
+
+Property | Description | Default Value | Default Behavior
+--------- | ----------- | -------------- | -----
+left3 | 3-finger swipe left | ctrl+shift+Right | switch to right workspace
+right3 | 3-finger swipe right | ctrl+shift+Left | switch to left workspace
+up3 | 3-finger swipe up | super+w | window spread
+down3 | 3-finger swipe down | super+w | window spread
+left4 | 4-finger swipe left | ctrl+alt+shift+Right | move window to right workspace
+right4 | 4-finger swipe right | ctrl+alt+shift+Left | move window to left workspace
+up4 | 4-finger swipe up | super+d | show desktop
+down4 | 4-finger swipe down | super+d | show desktop
+threshold | mouse pixels to activate swipe; higher = less sensitive; integers only | 20
+
+## Bug Reports
+Please create an issue to report a bug.
diff --git a/img/sample.png b/img/sample.png
index ae10ca7..3439fed 100644
Binary files a/img/sample.png and b/img/sample.png differ
diff --git a/install b/install
index 994b96d..a504318 100755
--- a/install
+++ b/install
@@ -1,11 +1,21 @@
#!/bin/bash
DIR=$(dirname $0)
-echo "Compiling..."
+#copy config file
+mkdir -p ~/.config
+DCONF_PATH=$DIR/src/defaults.conf
+CONF_PATH=~/.config/comfortable-swipe.conf
+if [ ! -f $CONF_PATH ]; then
+ cat $DCONF_PATH > $CONF_PATH
+else
+ # config file found, ask user if overwrite
+ echo "Previous conf file found in $CONF_PATH"
+ read -r -p "Do you want to overwrite? [Y/n] " response
+ response=${response,,} # tolower
+ if [[ "$response" =~ ^(yes|y)$ ]]; then
+ cat $DCONF_PATH > $CONF_PATH
+ fi
+fi
+echo "Installing..."
mkdir -p ~/.local/bin
g++ -std=c++11 -O2 $DIR/src/comfortable-swipe.cpp -lxdo -o ~/.local/bin/comfortable-swipe || exec echo "Installation aborted"
-cat $DIR/src/comfortable-swipe-serve > ~/.local/bin/comfortable-swipe-serve
-chmod +x ~/.local/bin/comfortable-swipe-serve
-echo "Successfully installed. You may now try running 'comfortable-swipe-serve'."
-echo "--------------------------------------------------------------------------"
-echo "If you want 'comfortable-swipe-serve' to automatically load on login, add it to your Startup Applications."
-echo "See https://help.ubuntu.com/stable/ubuntu-help/startup-applications.html"
+echo "Successfully installed. You may now run 'comfortable-swipe start'."
diff --git a/src/comfortable-swipe-serve b/src/comfortable-swipe-serve
deleted file mode 100644
index 9e98f4b..0000000
--- a/src/comfortable-swipe-serve
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-stdbuf -oL -eL libinput-debug-events | comfortable-swipe "$@"
diff --git a/src/comfortable-swipe.cpp b/src/comfortable-swipe.cpp
index 98a7137..d383f9d 100644
--- a/src/comfortable-swipe.cpp
+++ b/src/comfortable-swipe.cpp
@@ -1,31 +1,25 @@
-// you may tweak these before calling `build`
-#define THRESHOLD 20
+/*
+Comfortable Swipe
+by Rico Tiongson
-#define CMD_THREE_FINGERS_RIGHT "ctrl+alt+Left"
-#define CMD_THREE_FINGERS_LEFT "ctrl+alt+Right"
-#define CMD_THREE_FINGERS_UP "super+w"
-#define CMD_THREE_FINGERS_DOWN "super+w"
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
-#define CMD_FOUR_FINGERS_RIGHT "ctrl+shift+alt+Left"
-#define CMD_FOUR_FINGERS_LEFT "ctrl+shift+alt+Right"
-#define CMD_FOUR_FINGERS_UP "super+d"
-#define CMD_FOUR_FINGERS_DOWN "super+d"
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
-#define MSK_THREE_FINGERS 0
-#define MSK_FOUR_FINGERS 1
-#define MSK_NEGATIVE 0
-#define MSK_POSITIVE 2
-#define MSK_HORIZONTAL 0
-#define MSK_VERTICAL 4
-
-const char* commands[] = {
- CMD_THREE_FINGERS_LEFT /* 000 */, CMD_FOUR_FINGERS_LEFT /* 001 */,
- CMD_THREE_FINGERS_RIGHT /* 010 */ , CMD_FOUR_FINGERS_RIGHT /* 011 */,
- CMD_THREE_FINGERS_UP /* 100 */ , CMD_FOUR_FINGERS_UP /* 101 */,
- CMD_THREE_FINGERS_DOWN /* 110 */, CMD_FOUR_FINGERS_DOWN /* 111 */
-};
+You should have received a copy of the GNU General Public License
+along with this program. If not, see .
+*/
#include
+#include
+#include
+#include