aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2020-08-22 15:19:21 -0300
committerSilvio Rhatto <rhatto@riseup.net>2020-08-22 15:19:21 -0300
commitffe9f0c6009d0c757ef3ae34c71a7fe536e2655b (patch)
tree3238c261fe8128947a42a5f2593d3e7403d8cb44
parent1079df752f29d1af0501c1b6fdd36cb477189c0c (diff)
downloadutils-x11-ffe9f0c6009d0c757ef3ae34c71a7fe536e2655b.tar.gz
utils-x11-ffe9f0c6009d0c757ef3ae34c71a7fe536e2655b.tar.bz2
Feat: support for selecting only some programs in a session (2)
-rwxr-xr-xsession14
1 files changed, 8 insertions, 6 deletions
diff --git a/session b/session
index fdb4750..d672bf7 100755
--- a/session
+++ b/session
@@ -26,7 +26,7 @@ function __session_not_ignored {
fi
if [ ! -z "$UNIGNORE" ]; then
- if [ "$UNIGNORE" == "$1" ]; then
+ if echo "$UNIGNORE" | grep -q " $1 "; then
return 0
else
return 1
@@ -152,13 +152,14 @@ function __session_chooser {
read -rep "Choose session: " n
local name="`echo $n | awk '{ print $1 }'`"
- local program="`echo $n | awk '{ print $2 }'`"
+ #local programs="`echo $n | awk '{ print $2 }'`"
+ local programs="`echo $n | sed -e \"s/^$name//\"`"
if [ ! -z "$name" ]; then
session="$(__session_list | grep -E "(^$name.| $name:)" | sed -e "s/^[0-9]*. //" | cut -d : -f 1)"
if [ ! -z "$session" ]; then
- __session_open $session $program
+ __session_open $session $programs
fi
fi
}
@@ -180,10 +181,11 @@ function __session_exec {
# Open a session
function __session_open {
local session="$1"
- local program="$2"
+ shift
+ local programs="$*"
- if [ ! -z "$program" ]; then
- UNIGNORE="$program"
+ if [ ! -z "$programs" ]; then
+ UNIGNORE=" $programs "
fi
# Custom