~alpine/aports

3 3

[PATCH sxmo-utils v5 1/8] Do not prevent interactive editors to write messages

Details
Message ID
<20201010135935.19235-1-reedwade@misterbanal.net>
DKIM signature
missing
Download raw message
Patch: +6 -5
We run EDITOR in a subshell and that prevent some editors as kakoune :

Fatal error: stdout is not a tty

This refactorise a little bit editmsg logic to not run EDITOR in a
subshell and allow those editors to work.

Signed-off-by: Reed Wade <reedwade@misterbanal.net>
---
 scripts/modem/sxmo_modemtext.sh | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

Rebased works. I expect it to be mergeable now !

diff --git a/scripts/modem/sxmo_modemtext.sh b/scripts/modem/sxmo_modemtext.sh
index 61ca43d..2551dec 100755
--- a/scripts/modem/sxmo_modemtext.sh
+++ b/scripts/modem/sxmo_modemtext.sh
@@ -22,14 +22,12 @@ modem_n() {
}

editmsg() {
	TMP="$(mktemp --suffix "$1_msg")"
	echo "$2" > "$TMP"
	TMP="$1"
	if [ "$TERMMODE" != "true" ]; then
		st -e "$EDITOR" "$TMP"
	else
		"$EDITOR" "$TMP"
	fi
	cat "$TMP"
}

sendtextmenu() {
@@ -47,7 +45,10 @@ sendtextmenu() {
	echo "$NUMBER" | grep -qE '^[+0-9]+$' || err "That doesn't seem like a valid number"

	# Compose first version of msg
	TEXT="$(editmsg "$NUMBER" 'Enter text message here')"
	TMP="$(mktemp --suffix "${NUMBER}_msg")"
	echo 'Enter text message here' > "$TMP"
	editmsg "$TMP"
	TEXT="$(cat "$TMP")"

	while true
	do
@@ -57,7 +58,7 @@ sendtextmenu() {
		)"
		echo "$CONFIRM" | grep -E "^Send" && (echo "$TEXT" | sxmo_modemsendsms.sh "$NUMBER" -) && exit 0
		echo "$CONFIRM" | grep -E "^Cancel$" && exit 1
		echo "$CONFIRM" | grep -E "^Edit Message" && TEXT="$(editmsg "$NUMBER" "$TEXT")"
		echo "$CONFIRM" | grep -E "^Edit Message" && editmsg "$TMP" && TEXT="$(cat "$TMP")"
	done
}

--
2.28.0

[PATCH sxmo-utils v5 7/8] use mpv to open images

Details
Message ID
<20201010135935.19235-7-reedwade@misterbanal.net>
In-Reply-To
<20201010135935.19235-1-reedwade@misterbanal.net> (view parent)
DKIM signature
missing
Download raw message
Patch: +1 -1
Signed-off-by: Reed Wade <reedwade@misterbanal.net>
---
 scripts/appscripts/sxmo_files.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/appscripts/sxmo_files.sh b/scripts/appscripts/sxmo_files.sh
index 280f4b9..6cc9e0f 100755
--- a/scripts/appscripts/sxmo_files.sh
+++ b/scripts/appscripts/sxmo_files.sh
@@ -9,7 +9,7 @@ handlefiles() {
	elif echo "$1" | grep -iE ".(wav|opus|m4a|flac|mp3)$"; then
		st -e mpv -ao=alsa --vid=no -v "$@"
	elif echo "$1" | grep -iE ".(jpg|png|gif)$"; then
		st -e sxiv "$@"
		st -e mpv --profile=image "$@"
	else
		st -e sh -ic "$EDITOR $*"
	fi
-- 
2.28.0
Details
Message ID
<20201010165650.GB2986883@alpha>
In-Reply-To
<20201010135935.19235-1-reedwade@misterbanal.net> (view parent)
DKIM signature
missing
Download raw message
On Sat, Oct 10, 2020 at 03:59:28PM +0200, Reed Wade wrote:
> We run EDITOR in a subshell and that prevent some editors as kakoune :
> 
> Fatal error: stdout is not a tty
> 
> This refactorise a little bit editmsg logic to not run EDITOR in a
> subshell and allow those editors to work.
> 
> Signed-off-by: Reed Wade <reedwade@misterbanal.net>
> ---
>  scripts/modem/sxmo_modemtext.sh | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> Rebased works. I expect it to be mergeable now !
> 
> diff --git a/scripts/modem/sxmo_modemtext.sh b/scripts/modem/sxmo_modemtext.sh
> index 61ca43d..2551dec 100755
> --- a/scripts/modem/sxmo_modemtext.sh
> +++ b/scripts/modem/sxmo_modemtext.sh
> @@ -22,14 +22,12 @@ modem_n() {
>  }
> 
>  editmsg() {
> -	TMP="$(mktemp --suffix "$1_msg")"
> -	echo "$2" > "$TMP"
> +	TMP="$1"
>  	if [ "$TERMMODE" != "true" ]; then
>  		st -e "$EDITOR" "$TMP"
>  	else
>  		"$EDITOR" "$TMP"
>  	fi
> -	cat "$TMP"
>  }
> 
>  sendtextmenu() {
> @@ -47,7 +45,10 @@ sendtextmenu() {
>  	echo "$NUMBER" | grep -qE '^[+0-9]+$' || err "That doesn't seem like a valid number"
> 
>  	# Compose first version of msg
> -	TEXT="$(editmsg "$NUMBER" 'Enter text message here')"
> +	TMP="$(mktemp --suffix "${NUMBER}_msg")"
> +	echo 'Enter text message here' > "$TMP"
> +	editmsg "$TMP"
> +	TEXT="$(cat "$TMP")"
> 
>  	while true
>  	do
> @@ -57,7 +58,7 @@ sendtextmenu() {
>  		)"
>  		echo "$CONFIRM" | grep -E "^Send" && (echo "$TEXT" | sxmo_modemsendsms.sh "$NUMBER" -) && exit 0
>  		echo "$CONFIRM" | grep -E "^Cancel$" && exit 1
> -		echo "$CONFIRM" | grep -E "^Edit Message" && TEXT="$(editmsg "$NUMBER" "$TEXT")"
> +		echo "$CONFIRM" | grep -E "^Edit Message" && editmsg "$TMP" && TEXT="$(cat "$TMP")"
>  	done
>  }
> 
> --
> 2.28.0

I think you send this to the wrong mailing list. This does not seem to
have anything to do with Alpine Linux aports.

Kevin
Details
Message ID
<27VDRBMQ9W0EZ.1YJDUA5LN5DS4@green-medusa.misterbanal.net>
In-Reply-To
<20201010165650.GB2986883@alpha> (view parent)
DKIM signature
missing
Download raw message
Oh got, I'm so sorry for this spam :O

I messed-up with my Ctrl-R and used the wrong command.
Let's never do it again.
Reply to thread Export thread (mbox)