This add a script to use either the user hook or the default one. Sometime we checked the user hook or a default code. We move this default code in a defaut hook. Signed-off-by: Stacy Harper <contact@stacyharper.net> Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>master
parent
0ed27f8538
commit
e6ea657634
22 changed files with 160 additions and 254 deletions
@ -0,0 +1,55 @@ |
||||
#!/usr/bin/env sh |
||||
|
||||
# include common definitions |
||||
# shellcheck source=scripts/core/sxmo_common.sh |
||||
. "$(which sxmo_common.sh)" |
||||
|
||||
pkill -9 lisgd |
||||
|
||||
if [ -z "$LISGD_THRESHOLD" ]; then |
||||
LISGD_THRESHOLD=125 |
||||
fi |
||||
if [ -z "$LISGD_THRESHOLD_PRESSED" ]; then |
||||
LISGD_THRESHOLD_PRESSED=60 |
||||
fi |
||||
|
||||
#-g format: |
||||
# fingers,swipe,edge,distance,command |
||||
#order matters, only the first match gets executed |
||||
lisgd "$@" -t "$LISGD_THRESHOLD" -T "$LISGD_THRESHOLD_PRESSED" \ |
||||
-g '1,DRUL,BR,*,sxmo_inputhandler.sh bottomrightcorner' \ |
||||
-g '1,DLUR,BL,*,sxmo_inputhandler.sh bottomleftcorner' \ |
||||
-g '1,ULDR,TL,*,sxmo_inputhandler.sh topleftcorner' \ |
||||
-g '1,URDL,TR,*,sxmo_inputhandler.sh toprightcorner' \ |
||||
-g '1,LR,B,L,sxmo_inputhandler.sh rightbottomcorner' \ |
||||
-g '1,RL,B,L,sxmo_inputhandler.sh leftbottomcorner' \ |
||||
-g '1,LR,L,*,sxmo_inputhandler.sh rightleftcorner' \ |
||||
-g '1,RL,R,*,sxmo_inputhandler.sh leftrightcorner' \ |
||||
-g '1,DU,L,*,P,sxmo_inputhandler.sh upleftcorner' \ |
||||
-g '1,UD,L,*,P,sxmo_inputhandler.sh downleftcorner' \ |
||||
-g '1,LR,T,*,P,sxmo_inputhandler.sh righttopcorner' \ |
||||
-g '1,RL,T,*,P,sxmo_inputhandler.sh lefttopcorner' \ |
||||
-g "1,DU,B,*,sxmo_inputhandler.sh upbottomcorner" \ |
||||
-g "1,UD,B,*,sxmo_inputhandler.sh downbottomcorner" \ |
||||
-g "1,UD,T,*,sxmo_inputhandler.sh downtopcorner" \ |
||||
-g "1,DU,T,*,sxmo_inputhandler.sh uptopcorner" \ |
||||
-g "2,UD,T,*,sxmo_inputhandler.sh twodowntopcorner" \ |
||||
-g "2,UD,B,*,sxmo_inputhandler.sh twodownbottomcorner" \ |
||||
-g "r,UD,B,*,sxmo_inputhandler.sh threedownbottomcorner" \ |
||||
-g '1,DU,R,*,P,sxmo_inputhandler.sh uprightcorner' \ |
||||
-g '1,UD,R,*,P,sxmo_inputhandler.sh downrightcorner' \ |
||||
-g '1,LR,R,S,sxmo_inputhandler.sh rightrightcorner_short' \ |
||||
-g '1,RL,L,S,sxmo_inputhandler.sh leftrightcorner_short' \ |
||||
-g '1,RL,*,*,sxmo_inputhandler.sh left' \ |
||||
-g '1,LR,*,*,sxmo_inputhandler.sh right' \ |
||||
-g '1,DU,*,*,sxmo_inputhandler.sh up' \ |
||||
-g '1,UD,*,*,sxmo_inputhandler.sh down' \ |
||||
-g '1,DRUL,*,*,sxmo_inputhandler.sh upleft' \ |
||||
-g '1,URDL,*,*,sxmo_inputhandler.sh downleft' \ |
||||
-g '1,DLUR,*,*,sxmo_inputhandler.sh upright' \ |
||||
-g '1,ULDR,*,*,sxmo_inputhandler.sh downright' \ |
||||
-g '2,RL,*,*,sxmo_inputhandler.sh twoleft' \ |
||||
-g '2,LR,*,*,sxmo_inputhandler.sh tworight' \ |
||||
-g '2,DU,*,*,sxmo_inputhandler.sh twoup' \ |
||||
-g '2,UD,*,*,sxmo_inputhandler.sh twodown' \ |
||||
>"$CACHEDIR/lisgd.log" 2>&1 |
@ -0,0 +1,3 @@ |
||||
#!/usr/bin/env sh |
||||
|
||||
pkill -9 lisgd |
@ -0,0 +1,9 @@ |
||||
#!/usr/bin/env sh |
||||
|
||||
VIBS=5 |
||||
VIBI=0 |
||||
while [ $VIBI -lt $VIBS ]; do |
||||
sxmo_vibratepine 400 & |
||||
sleep 0.5 |
||||
VIBI=$(echo $VIBI+1 | bc) |
||||
done |
@ -0,0 +1,11 @@ |
||||
#!/usr/bin/env sh |
||||
|
||||
# This script is called prior to suspending |
||||
|
||||
# include common definitions |
||||
# shellcheck source=scripts/core/sxmo_common.sh |
||||
. "$(which sxmo_common.sh)" |
||||
|
||||
pkill -STOP conky |
||||
pkill clickclack |
||||
pkill -f "$KEYBOARD" |
@ -0,0 +1,4 @@ |
||||
#!/usr/bin/env sh |
||||
|
||||
[ "$(xrandr | grep DSI-1 | cut -d ' ' -f 5)" = "right" ] && ORIENTATION=1 || ORIENTATION=0 |
||||
sxmo_hooks.sh lisgdstart -o $ORIENTATION & |
@ -0,0 +1,37 @@ |
||||
#!/usr/bin/env sh |
||||
|
||||
# include common definitions |
||||
# shellcheck source=scripts/core/sxmo_common.sh |
||||
. "$(dirname "$0")/sxmo_common.sh" |
||||
|
||||
modem_n() { |
||||
MODEMS="$(mmcli -L)" |
||||
echo "$MODEMS" | grep -oE 'Modem\/([0-9]+)' | cut -d'/' -f2 |
||||
return |
||||
} |
||||
|
||||
sim_n() { |
||||
SIMS="$(mmcli -m "$(modem_n)" | grep SIM)" |
||||
echo "$SIMS" | grep -oE 'SIM\/([0-9]+)' | cut -d'/' -f2 |
||||
return |
||||
} |
||||
|
||||
retry=1 |
||||
pkill dmenu #kill existing dmenu |
||||
while [ $retry -eq 1 ]; do |
||||
PICKED="$( |
||||
# shellcheck disable=SC2039,SC3037 |
||||
echo -e "Cancel\n0000\n1234" | sxmo_dmenu_with_kb.sh -l 3 -c -p "PIN:" | tr -d "\n\r " |
||||
)" |
||||
if [ -n "$PICKED" ] && [ "$PICKED" != "Cancel" ]; then |
||||
retry=0 |
||||
mmcli -i "$(sim_n)" --pin "$PICKED" > /tmp/unlockmsg 2>&1 || retry=1 |
||||
MSG=$(cat /tmp/unlockmsg) |
||||
[ -n "$MSG" ] && notify-send "$MSG" |
||||
if echo "$MSG" | grep -q "not SIM-PIN locked"; then |
||||
retry=0 |
||||
fi |
||||
else |
||||
retry=0 |
||||
fi |
||||
done |
@ -0,0 +1,10 @@ |
||||
#!/usr/bin/env sh |
||||
|
||||
hook="$1" |
||||
shift |
||||
|
||||
if [ -x "$XDG_CONFIG_HOME/sxmo/hooks/$hook" ]; then |
||||
exec "$XDG_CONFIG_HOME/sxmo/hooks/$hook" "$@" |
||||
elif [ -x "/usr/share/sxmo/default_hooks/$hook" ]; then |
||||
exec "/usr/share/sxmo/default_hooks/$hook" "$@" |
||||
fi |
@ -1,59 +0,0 @@ |
||||
#!/usr/bin/env sh |
||||
|
||||
# include common definitions |
||||
# shellcheck source=scripts/core/sxmo_common.sh |
||||
. "$(dirname "$0")/sxmo_common.sh" |
||||
|
||||
pkill -9 lisgd |
||||
|
||||
if [ -z "$LISGD_THRESHOLD" ]; then |
||||
LISGD_THRESHOLD=125 |
||||
fi |
||||
if [ -z "$LISGD_THRESHOLD_PRESSED" ]; then |
||||
LISGD_THRESHOLD_PRESSED=60 |
||||
fi |
||||
|
||||
if [ -x "$XDG_CONFIG_HOME"/sxmo/hooks/lisgdstart ]; then |
||||
"$XDG_CONFIG_HOME"/sxmo/hooks/lisgdstart "$@" & |
||||
else |
||||
#-g format: |
||||
# fingers,swipe,edge,distance,command |
||||
#order matters, only the first match gets executed |
||||
lisgd "$@" -t "$LISGD_THRESHOLD" -T "$LISGD_THRESHOLD_PRESSED" \ |
||||
-g '1,DRUL,BR,*,sxmo_inputhandler.sh bottomrightcorner' \ |
||||
-g '1,DLUR,BL,*,sxmo_inputhandler.sh bottomleftcorner' \ |
||||
-g '1,ULDR,TL,*,sxmo_inputhandler.sh topleftcorner' \ |
||||
-g '1,URDL,TR,*,sxmo_inputhandler.sh toprightcorner' \ |
||||
-g '1,LR,B,L,sxmo_inputhandler.sh rightbottomcorner' \ |
||||
-g '1,RL,B,L,sxmo_inputhandler.sh leftbottomcorner' \ |
||||
-g '1,LR,L,*,sxmo_inputhandler.sh rightleftcorner' \ |
||||
-g '1,RL,R,*,sxmo_inputhandler.sh leftrightcorner' \ |
||||
-g '1,DU,L,*,P,sxmo_inputhandler.sh upleftcorner' \ |
||||
-g '1,UD,L,*,P,sxmo_inputhandler.sh downleftcorner' \ |
||||
-g '1,LR,T,*,P,sxmo_inputhandler.sh righttopcorner' \ |
||||
-g '1,RL,T,*,P,sxmo_inputhandler.sh lefttopcorner' \ |
||||
-g "1,DU,B,*,sxmo_inputhandler.sh upbottomcorner" \ |
||||
-g "1,UD,B,*,sxmo_inputhandler.sh downbottomcorner" \ |
||||
-g "1,UD,T,*,sxmo_inputhandler.sh downtopcorner" \ |
||||
-g "1,DU,T,*,sxmo_inputhandler.sh uptopcorner" \ |
||||
-g "2,UD,T,*,sxmo_inputhandler.sh twodowntopcorner" \ |
||||
-g "2,UD,B,*,sxmo_inputhandler.sh twodownbottomcorner" \ |
||||
-g "r,UD,B,*,sxmo_inputhandler.sh threedownbottomcorner" \ |
||||
-g '1,DU,R,*,P,sxmo_inputhandler.sh uprightcorner' \ |
||||
-g '1,UD,R,*,P,sxmo_inputhandler.sh downrightcorner' \ |
||||
-g '1,LR,R,S,sxmo_inputhandler.sh rightrightcorner_short' \ |
||||
-g '1,RL,L,S,sxmo_inputhandler.sh leftrightcorner_short' \ |
||||
-g '1,RL,*,*,sxmo_inputhandler.sh left' \ |
||||
-g '1,LR,*,*,sxmo_inputhandler.sh right' \ |
||||
-g '1,DU,*,*,sxmo_inputhandler.sh up' \ |
||||
-g '1,UD,*,*,sxmo_inputhandler.sh down' \ |
||||
-g '1,DRUL,*,*,sxmo_inputhandler.sh upleft' \ |
||||
-g '1,URDL,*,*,sxmo_inputhandler.sh downleft' \ |
||||
-g '1,DLUR,*,*,sxmo_inputhandler.sh upright' \ |
||||
-g '1,ULDR,*,*,sxmo_inputhandler.sh downright' \ |
||||
-g '2,RL,*,*,sxmo_inputhandler.sh twoleft' \ |
||||
-g '2,LR,*,*,sxmo_inputhandler.sh tworight' \ |
||||
-g '2,DU,*,*,sxmo_inputhandler.sh twoup' \ |
||||
-g '2,UD,*,*,sxmo_inputhandler.sh twodown' \ |
||||
>"$CACHEDIR/lisgd.log" 2>&1 & |
||||
fi |
@ -1,23 +0,0 @@ |
||||
#!/usr/bin/env sh |
||||
|
||||
# include common definitions |
||||
# shellcheck source=scripts/core/sxmo_common.sh |
||||
. "$(dirname "$0")/sxmo_common.sh" |
||||
|
||||
finish() { |
||||
kill "$LOCKPID" |
||||
} |
||||
trap 'finish' TERM INT |
||||
|
||||
if [ -x "$XDG_CONFIG_HOME/sxmo/hooks/lock" ]; then |
||||
"$XDG_CONFIG_HOME/sxmo/hooks/lock" |
||||
fi |
||||
pkill -9 lisgd |
||||
sxmo_screenlock "$@" & |
||||
LOCKPID="$!" |
||||
wait $LOCKPID |
||||
[ "$(xrandr | grep DSI-1 | cut -d ' ' -f 5)" = "right" ] && ORIENTATION=1 || ORIENTATION=0 |
||||
sxmo_lisgdstart.sh -o $ORIENTATION & |
||||
if [ -x "$XDG_CONFIG_HOME/sxmo/hooks/unlock" ]; then |
||||
"$XDG_CONFIG_HOME/sxmo/hooks/unlock" |
||||
fi |
@ -1,16 +0,0 @@ |
||||
#!/usr/bin/env sh |
||||
|
||||
# This script is called when the system has successfully woken up after sleep |
||||
|
||||
# include common definitions |
||||
# shellcheck source=scripts/core/sxmo_common.sh |
||||
. "$(dirname "$0")/sxmo_common.sh" |
||||
|
||||
sxmo_statusbarupdate.sh |
||||
pkill -CONT conky |
||||
|
||||
(sleep 15 && sxmo_resetscaninterval.sh) & |
||||
|
||||
if [ -x "$XDG_CONFIG_HOME/sxmo/hooks/postwake" ]; then |
||||
"$XDG_CONFIG_HOME/sxmo/hooks/postwake" |
||||
fi |
@ -1,18 +0,0 @@ |
||||
#!/usr/bin/env sh |
||||
|
||||
# This script is called prior to suspending |
||||
|
||||
# include common definitions |
||||
# shellcheck source=scripts/core/sxmo_common.sh |
||||
. "$(dirname "$0")/sxmo_common.sh" |
||||
|
||||
pkill -STOP conky |
||||
pkill clickclack |
||||
pkill -f "$KEYBOARD" |
||||
|
||||
# If this script returns a non-zero exit code, suspension will be cancelled |
||||
|
||||
if [ -x "$XDG_CONFIG_HOME/sxmo/hooks/presuspend" ]; then |
||||
"$XDG_CONFIG_HOME/sxmo/hooks/presuspend" |
||||
exit $? |
||||
fi |
@ -1,41 +0,0 @@ |
||||
#!/usr/bin/env sh |
||||
|
||||
# include common definitions |
||||
# shellcheck source=scripts/core/sxmo_common.sh |
||||
. "$(dirname "$0")/sxmo_common.sh" |
||||
|
||||
modem_n() { |
||||
MODEMS="$(mmcli -L)" |
||||
echo "$MODEMS" | grep -oE 'Modem\/([0-9]+)' | cut -d'/' -f2 |
||||
return |
||||
} |
||||
|
||||
sim_n() { |
||||
SIMS="$(mmcli -m "$(modem_n)" | grep SIM)" |
||||
echo "$SIMS" | grep -oE 'SIM\/([0-9]+)' | cut -d'/' -f2 |
||||
return |
||||
} |
||||
|
||||
if [ -x "$XDG_CONFIG_HOME/sxmo/hooks/unlocksim" ]; then |
||||
"$XDG_CONFIG_HOME/sxmo/hooks/unlocksim" "$(sim_n)" |
||||
else |
||||
retry=1 |
||||
pkill dmenu #kill existing dmenu |
||||
while [ $retry -eq 1 ]; do |
||||
PICKED="$( |
||||
# shellcheck disable=SC2039,SC3037 |
||||
echo -e "Cancel\n0000\n1234" | sxmo_dmenu_with_kb.sh -l 3 -c -p "PIN:" | tr -d "\n\r " |
||||
)" |
||||
if [ -n "$PICKED" ] && [ "$PICKED" != "Cancel" ]; then |
||||
retry=0 |
||||
mmcli -i "$(sim_n)" --pin "$PICKED" > /tmp/unlockmsg 2>&1 || retry=1 |
||||
MSG=$(cat /tmp/unlockmsg) |
||||
[ -n "$MSG" ] && notify-send "$MSG" |
||||
if echo "$MSG" | grep -q "not SIM-PIN locked"; then |
||||
retry=0 |
||||
fi |
||||
else |
||||
retry=0 |
||||
fi |
||||
done |
||||
fi |
Loading…
Reference in new issue