commit de652748920cd4d977f8b49207d2f49840550500
parent 69526dec8255e06b896d58501ace971eb8cab814
Author: Jan Pobříslo <ccx@te2000.cz>
Date: Fri, 18 Feb 2022 14:05:06 +0000
Change powerbox calling convention to slashes from exclamation mark (!).
Diffstat:
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/bin/handle-nsx11-message b/bin/handle-nsx11-message
@@ -55,12 +55,12 @@ ensure-container-started() {
abduco-run() {
local container session cmd rest out
local -a socket
- container=${1%%!*}
- rest=${1#*!}
+ container=${1%%/*}
+ rest=${1#*/}
- session=${rest%%!*}
- if [[ $rest == *!* ]]; then
- cmd=${rest#*!}
+ session=${rest%%/*}
+ if [[ $rest == */* ]]; then
+ cmd=${rest#*/}
fi
if [[ $container == */* ]]; then
@@ -115,19 +115,19 @@ abduco-run() {
typeset -f -t abduco-run
x11-run() {
- if ! [[ $1 == *!*!*!* ]]; then
+ if ! [[ $1 == */*/*/* ]]; then
nag -m "Got malformed x11 command: ${(qqq)1}"
return 1
fi
local container display cookie cmd rest out
- container=${1%%!*}
- rest=${1#*!}
+ container=${1%%/*}
+ rest=${1#*/}
- display=${rest%%!*}
- rest=${rest#*!}
+ display=${rest%%/*}
+ rest=${rest#*/}
- cookie=${rest%%!*}
- cmd=${rest#*!}
+ cookie=${rest%%/*}
+ cmd=${rest#*/}
if [[ $container == */* ]]; then
nag -m "Invalid container name: contains slashes"
@@ -177,8 +177,8 @@ case $data in
#in_terminal watch -n 1 'tree /run/containers/*.ccx/inbox'
;;
- (adjust-brightness!*)
- adjust-brightness "${data#*!}"
+ (adjust-brightness/*)
+ adjust-brightness "${data#*/}"
case adjustment in
([-+][0-9]*%)
;;
@@ -187,21 +187,21 @@ case $data in
esac
;;
- (abduco!*!*)
- abduco-run "${data#*!}"
+ (abduco/*/*)
+ abduco-run "${data#*/}"
;;
- (x11!*)
- x11-run "${data#*!}"
+ (x11/*)
+ x11-run "${data#*/}"
;;
- (ssh!*:*)
- local ssh_hostport="${data#*!}"
+ (ssh/*:*)
+ local ssh_hostport="${data#*/}"
local ssh_host="${ssh_hostport%:*}"
local ssh_port="${ssh_hostport##*:}"
in_terminal ssh -t -p $ssh_port -- $ssh_host
;;
- (ssh!*)
- local ssh_host="${data#*!}"
+ (ssh/*)
+ local ssh_host="${data#*/}"
in_terminal ssh -t -- $ssh_host
;;