Made choice for virtual keyboard configurable through the $KEYBOARD environment variable.

This implements what was suggested in the discussion regarding the svkbd
patch, it makes the choice of virtual keyboard configurable using the
$KEYBOARD variable, rather than hard-coding it.
master
Maarten van Gompel 4 years ago committed by Miles Alan
parent 293bf69871
commit ace9960926
  1. 10
      scripts/appscripts/sxmo_reddit.sh
  2. 6
      scripts/appscripts/sxmo_timer.sh
  3. 4
      scripts/appscripts/sxmo_websearch.sh
  4. 4
      scripts/appscripts/sxmo_youtube.sh
  5. 4
      scripts/core/sxmo_dmenu_with_kb.sh
  6. 4
      scripts/core/sxmo_lisgdstart.sh
  7. 4
      scripts/core/sxmo_pipecomplete.sh
  8. 4
      scripts/core/sxmo_surf_linkselect.sh
  9. 1
      scripts/core/sxmo_xinit.sh

@ -2,20 +2,20 @@
[ -z "$SXMO_SUBREDDITS" ] && SXMO_SUBREDDITS="pine64official pinephoneofficial unixporn postmarketos linux" [ -z "$SXMO_SUBREDDITS" ] && SXMO_SUBREDDITS="pine64official pinephoneofficial unixporn postmarketos linux"
menu() { menu() {
pidof svkbd-sxmo || svkbd-sxmo & pidof "$KEYBOARD" || "$KEYBOARD" &
SUBREDDIT="$( SUBREDDIT="$(
printf %b "Close Menu\n$(echo "$SXMO_SUBREDDITS" | tr " " '\n')" | printf %b "Close Menu\n$(echo "$SXMO_SUBREDDITS" | tr " " '\n')" |
dmenu -p "Subreddit:" -c -l 10 -fn Terminus-20 dmenu -p "Subreddit:" -c -l 10 -fn Terminus-20
)" )"
pkill svkbd-sxmo pkill "$KEYBOARD"
[ "Close Menu" = "$SUBREDDIT" ] && exit 0 [ "Close Menu" = "$SUBREDDIT" ] && exit 0
REDDITRESULTS="$( REDDITRESULTS="$(
reddit-cli "$SUBREDDIT" | reddit-cli "$SUBREDDIT" |
grep -E '^((created_utc|ups|title|url):|===)' | grep -E '^((created_utc|ups|title|url):|===)' |
sed -E 's/^(created_utc|ups|title|url):\s+/\t/g' | sed -E 's/^(created_utc|ups|title|url):\s+/\t/g' |
tr -d '\n' | tr -d '\n' |
sed 's/===/\n/g' | sed 's/===/\n/g' |
sed 's/^\t//g' | sed 's/^\t//g' |
sort -t"$(printf '%b' '\t')" -rnk4 | sort -t"$(printf '%b' '\t')" -rnk4 |
awk -F'\t' '{ printf "↑%4s", $3; print " " $4 " " $1 " " $2 }' awk -F'\t' '{ printf "↑%4s", $3; print " " $4 " " $1 " " $2 }'
@ -23,7 +23,7 @@ menu() {
while true; do while true; do
RESULT="$( RESULT="$(
printf %b "Close Menu\n$REDDITRESULTS" | printf %b "Close Menu\n$REDDITRESULTS" |
dmenu -c -l 10 -fn Terminus-20 dmenu -c -l 10 -fn Terminus-20
)" )"

@ -24,7 +24,7 @@ timerrun() {
} }
menu() { menu() {
pidof svkbd-sxmo || svkbd-sxmo & pidof "$KEYBOARD" || "$KEYBOARD" &
TIMEINPUT="$( TIMEINPUT="$(
echo " echo "
1h 1h
@ -42,9 +42,9 @@ menu() {
Close Menu Close Menu
" | awk 'NF' | awk '{$1=$1};1' | dmenu -p Timer -c -fn "Terminus-30" -l 20 " | awk 'NF' | awk '{$1=$1};1' | dmenu -p Timer -c -fn "Terminus-30" -l 20
)" )"
pkill svkbd-sxmo pkill "$KEYBOARD"
[ "Close Menu" = "$TIMEINPUT" ] && exit 0 [ "Close Menu" = "$TIMEINPUT" ] && exit 0
st -f Monospace-50 -e "$0" timerrun "$TIMEINPUT" st -f Monospace-50 -e "$0" timerrun "$TIMEINPUT"
} }
if [ $# -gt 0 ]; then "$@"; else menu; fi if [ $# -gt 0 ]; then "$@"; else menu; fi

@ -1,9 +1,9 @@
#!/usr/bin/env sh #!/usr/bin/env sh
pidof svkbd-sxmo || svkbd-sxmo & pidof "$KEYBOARD" || "$KEYBOARD" &
SEARCHQUERY="$( SEARCHQUERY="$(
echo "Close Menu" | dmenu -t -p "Search Query:" -c -fn "Terminus-20" -l 20 echo "Close Menu" | dmenu -t -p "Search Query:" -c -fn "Terminus-20" -l 20
)" )"
pkill svkbd-sxmo pkill "$KEYBOARD"
[ "Close Menu" = "$SEARCHQUERY" ] && exit 0 [ "Close Menu" = "$SEARCHQUERY" ] && exit 0
echo "$SEARCHQUERY" | grep . || exit 0 echo "$SEARCHQUERY" | grep . || exit 0

@ -1,11 +1,11 @@
#!/usr/bin/env sh #!/usr/bin/env sh
menu() { menu() {
pidof svkbd-sxmo || svkbd-sxmo & pidof "$KEYBOARD" || "$KEYBOARD" &
SEARCHTERMS="$( SEARCHTERMS="$(
echo "Close Menu" | echo "Close Menu" |
dmenu -p "Yt Search" -c -l 10 -fn Terminus-20 dmenu -p "Yt Search" -c -l 10 -fn Terminus-20
)" )"
pkill svkbd-sxmo pkill "$KEYBOARD"
[ "Close Menu" = "$SEARCHTERMS" ] && exit 0 [ "Close Menu" = "$SEARCHTERMS" ] && exit 0
IDIOTRESULTS="$(youtube-cli "$SEARCHTERMS")" IDIOTRESULTS="$(youtube-cli "$SEARCHTERMS")"

@ -1,6 +1,6 @@
#!/usr/bin/env sh #!/usr/bin/env sh
pidof svkbd-sxmo >&2 || svkbd-sxmo & pidof "$KEYBOARD" >&2 || "$KEYBOARD" &
OUTPUT="$(cat | dmenu "$@")" OUTPUT="$(cat | dmenu "$@")"
pkill svkbd-sxmo >&2 pkill "$KEYBOARD" >&2
echo "$OUTPUT" echo "$OUTPUT"

@ -10,6 +10,6 @@ lisgd "$@" \
-g '1,ULDR,sxmo_lisgdonefingercheck.sh sxmo_brightness.sh down' \ -g '1,ULDR,sxmo_lisgdonefingercheck.sh sxmo_brightness.sh down' \
-g '2,LR,xdotool key --clearmodifiers Alt+e' \ -g '2,LR,xdotool key --clearmodifiers Alt+e' \
-g '2,RL,xdotool key --clearmodifiers Alt+r' \ -g '2,RL,xdotool key --clearmodifiers Alt+r' \
-g '2,DU,pidof svkbd-sxmo || svkbd-sxmo &' \ -g "2,DU,pidof $KEYBOARD || $KEYBOARD &" \
-g '2,UD,pkill -9 svkbd-sxmo' \ -g "2,UD,pkill -9 $KEYBOARD" \
& &

@ -3,14 +3,14 @@ INPUT="$(cat)"
STWIN="$(xprop -root | sed -n '/^_NET_ACTIVE_WINDOW/ s/.* //p')" STWIN="$(xprop -root | sed -n '/^_NET_ACTIVE_WINDOW/ s/.* //p')"
menu() { menu() {
pidof svkbd-sxmo || svkbd-sxmo & pidof "$KEYBOARD" || "$KEYBOARD" &
RESULT="$( RESULT="$(
printf %b "$( printf %b "$(
echo "Close Menu"; echo "Close Menu";
echo "$INPUT" | grep -Eo '\S+' | tr -d '[:blank:]' | sort | uniq echo "$INPUT" | grep -Eo '\S+' | tr -d '[:blank:]' | sort | uniq
)" | dmenu -p "$PROMPT" -l 10 -i -c -fn Terminus-20 )" | dmenu -p "$PROMPT" -l 10 -i -c -fn Terminus-20
)" )"
pkill svkbd-sxmo pkill "$KEYBOARD"
} }
copy() { copy() {

@ -73,7 +73,7 @@ link_select() {
link_normalize "$(xprop -id "$SURF_WINDOW" _SURF_URI | cut -d '"' -f 2)" link_normalize "$(xprop -id "$SURF_WINDOW" _SURF_URI | cut -d '"' -f 2)"
} }
pidof svkbd-sxmo || svkbd-sxmo & pidof "$KEYBOARD" || "$KEYBOARD" &
VAL="$(link_select)" VAL="$(link_select)"
pkill svkbd-sxmo pkill "$KEYBOARD"
echo "$VAL" echo "$VAL"

@ -6,6 +6,7 @@ envvars() {
command -v "$TERM" || export TERM=st command -v "$TERM" || export TERM=st
command -v "$BROWSER" || export BROWSER=surf command -v "$BROWSER" || export BROWSER=surf
command -v "$EDITOR" || export EDITOR=vis command -v "$EDITOR" || export EDITOR=vis
command -v "$KEYBOARD" || export KEYBOARD=svkbd-sxmo
[ -z "$MOZ_USE_XINPUT2" ] && export MOZ_USE_XINPUT2=1 [ -z "$MOZ_USE_XINPUT2" ] && export MOZ_USE_XINPUT2=1
[ -z "$XDG_CONFIG_HOME" ] && export XDG_CONFIG_HOME=~/.config [ -z "$XDG_CONFIG_HOME" ] && export XDG_CONFIG_HOME=~/.config
[ -z "$XDG_CACHE_HOME" ] && export XDG_CACHE_HOME=~/.cache [ -z "$XDG_CACHE_HOME" ] && export XDG_CACHE_HOME=~/.cache

Loading…
Cancel
Save