From a66e41ed81e8454bd9ebd733d15142f245e70fb4 Mon Sep 17 00:00:00 2001 From: Rico Tiongson Date: Fri, 8 May 2020 01:04:36 +0800 Subject: [PATCH] Improve install command --- README.md | 29 ++++++++++++++++------------- comfortable-swipe | 2 +- install | 2 ++ 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 8d5bf2f..7c4d298 100644 --- a/README.md +++ b/README.md @@ -48,9 +48,7 @@ Comfortable, seamless, and fast 3-finger (and 4-finger) touchpad swipe gestures 1. **_Important_**: After inputing your `sudo` password, log out then log back in -## List of Commands - -1. **Start the Program** +1. Start the Program ``` comfortable-swipe start @@ -63,24 +61,19 @@ Comfortable, seamless, and fast 3-finger (and 4-finger) touchpad swipe gestures Comfortable swipe is RUNNING in the background ``` -1. **Stop the Program** +1. (Optional) Stop the Program ``` comfortable-swipe stop ``` -1. **Toggle Autostart** (optional) +1. (Optional) Toggle autostart ```bash comfortable-swipe autostart - comfortable-swipe autostart on - comfortable-swipe autostart off - comfortable-swipe autostart toggle - comfortable-swipe autostart status - comfortable-swipe autostart path ``` -1. **Program status** +1. (Optional) See program status ```bash comfortable-swipe status @@ -108,7 +101,7 @@ Comfortable, seamless, and fast 3-finger (and 4-finger) touchpad swipe gestures mouse4 is NOTSET ``` -1. **Get config** +1. (Optional) Get config ``` comfortable-swipe @@ -128,7 +121,7 @@ Comfortable, seamless, and fast 3-finger (and 4-finger) touchpad swipe gestures comfortable-swipe mouse4 ``` -1. **Set config** +1. (Optional) Set config ```bash comfortable-swipe [=] @@ -162,6 +155,16 @@ Comfortable, seamless, and fast 3-finger (and 4-finger) touchpad swipe gestures comfortable-swipe --help ``` +1. Autostart commands + + ```bash + comfortable-swipe autostart on + comfortable-swipe autostart off + comfortable-swipe autostart toggle + comfortable-swipe autostart status + comfortable-swipe autostart path + ``` + 1. Show output with `--attach` Example output of 3-finger left, 4-finger left, 3-finger right, 3-finger up: diff --git a/comfortable-swipe b/comfortable-swipe index 0b6436a..6afdf0f 100755 --- a/comfortable-swipe +++ b/comfortable-swipe @@ -115,7 +115,7 @@ function start { debug | buffer $@ else # detach buffered output - nohup "$BASENAME" debug &1 | "$BASENAME" buffer $@ >/dev/null 2>&1 & + nohup "$BASENAME" debug &1 | "$BASENAME" buffer $@ >/dev/null 2>&1 & disown echo "Comfortable swipe is RUNNING in the background" fi } diff --git a/install b/install index 54d4cb6..f838bcb 100755 --- a/install +++ b/install @@ -116,6 +116,7 @@ function install_cpp_program { $COMPILE "$COMPILE_SOURCE" -o "$TMP_TARGET" -DCOMFORTABLE_SWIPE_VERSION="\"$VERSION\"" -DCOMFORTABLE_SWIPE_CONFIG="\"$CONF_TARGET\"" -DCOMFORTABLE_SWIPE_AUTOSTART="\"$AUTOSTART_TARGET\"" # compilation ok, now try to install # check permissions maybe if will need sudo + trysudo mkdir -p "$(dirname "$COMPILE_TARGET")" trysudo mv "$TMP_TARGET" "$COMPILE_TARGET" echo "Installed: $COMPILE_TARGET" } @@ -127,6 +128,7 @@ function install_cpp_program { # /home/$USER/.config/autostart/comfortable-swipe.desktop # function install_autostart { + mkdir -p "$(dirname "$AUTOSTART_TARGET")" cat "$AUTOSTART_SOURCE" > "$AUTOSTART_TARGET" echo "Installed: $AUTOSTART_TARGET" }