diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2020-08-22 15:19:21 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2020-08-22 15:19:21 -0300 |
commit | ffe9f0c6009d0c757ef3ae34c71a7fe536e2655b (patch) | |
tree | 3238c261fe8128947a42a5f2593d3e7403d8cb44 | |
parent | 1079df752f29d1af0501c1b6fdd36cb477189c0c (diff) | |
download | utils-x11-ffe9f0c6009d0c757ef3ae34c71a7fe536e2655b.tar.gz utils-x11-ffe9f0c6009d0c757ef3ae34c71a7fe536e2655b.tar.bz2 |
Feat: support for selecting only some programs in a session (2)
-rwxr-xr-x | session | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -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 |