Improve install command

This commit is contained in:
Rico Tiongson 2020-05-08 01:04:36 +08:00
parent 9deaf2da2c
commit a66e41ed81
3 changed files with 19 additions and 14 deletions

View File

@ -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 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 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 Comfortable swipe is RUNNING in the background
``` ```
1. **Stop the Program** 1. (Optional) Stop the Program
``` ```
comfortable-swipe stop comfortable-swipe stop
``` ```
1. **Toggle Autostart** (optional) 1. (Optional) Toggle autostart
```bash ```bash
comfortable-swipe autostart 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 ```bash
comfortable-swipe status comfortable-swipe status
@ -108,7 +101,7 @@ Comfortable, seamless, and fast 3-finger (and 4-finger) touchpad swipe gestures
mouse4 is NOTSET mouse4 is NOTSET
``` ```
1. **Get config** 1. (Optional) Get config
``` ```
comfortable-swipe <PROPERTY> comfortable-swipe <PROPERTY>
@ -128,7 +121,7 @@ Comfortable, seamless, and fast 3-finger (and 4-finger) touchpad swipe gestures
comfortable-swipe mouse4 comfortable-swipe mouse4
``` ```
1. **Set config** 1. (Optional) Set config
```bash ```bash
comfortable-swipe <PROPERTY> [=] <VALUES> comfortable-swipe <PROPERTY> [=] <VALUES>
@ -162,6 +155,16 @@ Comfortable, seamless, and fast 3-finger (and 4-finger) touchpad swipe gestures
comfortable-swipe --help 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` 1. Show output with `--attach`
Example output of 3-finger left, 4-finger left, 3-finger right, 3-finger up: Example output of 3-finger left, 4-finger left, 3-finger right, 3-finger up:

View File

@ -115,7 +115,7 @@ function start {
debug | buffer $@ debug | buffer $@
else else
# detach buffered output # detach buffered output
nohup "$BASENAME" debug </dev/null 2>&1 | "$BASENAME" buffer $@ >/dev/null 2>&1 & nohup "$BASENAME" debug </dev/null 2>&1 | "$BASENAME" buffer $@ >/dev/null 2>&1 & disown
echo "Comfortable swipe is RUNNING in the background" echo "Comfortable swipe is RUNNING in the background"
fi fi
} }

View File

@ -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\"" $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 # compilation ok, now try to install
# check permissions maybe if will need sudo # check permissions maybe if will need sudo
trysudo mkdir -p "$(dirname "$COMPILE_TARGET")"
trysudo mv "$TMP_TARGET" "$COMPILE_TARGET" trysudo mv "$TMP_TARGET" "$COMPILE_TARGET"
echo "Installed: $COMPILE_TARGET" echo "Installed: $COMPILE_TARGET"
} }
@ -127,6 +128,7 @@ function install_cpp_program {
# /home/$USER/.config/autostart/comfortable-swipe.desktop # /home/$USER/.config/autostart/comfortable-swipe.desktop
# #
function install_autostart { function install_autostart {
mkdir -p "$(dirname "$AUTOSTART_TARGET")"
cat "$AUTOSTART_SOURCE" > "$AUTOSTART_TARGET" cat "$AUTOSTART_SOURCE" > "$AUTOSTART_TARGET"
echo "Installed: $AUTOSTART_TARGET" echo "Installed: $AUTOSTART_TARGET"
} }