mirror of
https://github.com/jarun/nnn.git
synced 2025-01-10 01:49:38 +00:00
nlaunch: add sleep to wait for child
This commit is contained in:
parent
a5c5fc97e2
commit
ee11e78f14
|
@ -1 +1,5 @@
|
||||||
`nlaunch` is an independent POSIX-compliant GUI application launcher shell script. Its only dependency is `fzy`. It's possible to set a keyboard shortcut to open `nlaunch` in a terminal and use it as the regular launcher.
|
`nlaunch` is an independent POSIX-compliant GUI application launcher shell script. Its only dependency is `fzy`. It's possible to set a keyboard shortcut to open `nlaunch` in a terminal and use it as the regular launcher.
|
||||||
|
|
||||||
|
To use `nlaunch` as an independent launcher add a keybind to open `nlaunch` in a terminal e.g.
|
||||||
|
|
||||||
|
xfce4-terminal -e nlaunch
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
#
|
#
|
||||||
# Requires fzy.
|
# Requires fzy.
|
||||||
#
|
#
|
||||||
|
# Usage: nlaunch [delay]
|
||||||
|
# delay is in seconds, if omitted nlaunch waits for 1 sec
|
||||||
|
#
|
||||||
# Shell: POSIX compliant
|
# Shell: POSIX compliant
|
||||||
# Author: Arun Prakash Jana
|
# Author: Arun Prakash Jana
|
||||||
|
|
||||||
|
@ -17,4 +20,10 @@ get_selection() {
|
||||||
|
|
||||||
if selection=$( get_selection ); then
|
if selection=$( get_selection ); then
|
||||||
setsid "$selection" 2>/dev/null 1>/dev/null &
|
setsid "$selection" 2>/dev/null 1>/dev/null &
|
||||||
|
|
||||||
|
if ! [ -z "$1" ]; then
|
||||||
|
sleep "$1"
|
||||||
|
else
|
||||||
|
sleep 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -3985,7 +3985,7 @@ nochange:
|
||||||
goto begin;
|
goto begin;
|
||||||
case SEL_LAUNCH:
|
case SEL_LAUNCH:
|
||||||
if (getutil(utils[NLAUNCH])) {
|
if (getutil(utils[NLAUNCH])) {
|
||||||
spawn(utils[NLAUNCH], NULL, NULL, path, F_NORMAL);
|
spawn(utils[NLAUNCH], "0", NULL, path, F_NORMAL);
|
||||||
break;
|
break;
|
||||||
} // fallthrough
|
} // fallthrough
|
||||||
default: /* SEL_RUNCMD */
|
default: /* SEL_RUNCMD */
|
||||||
|
|
Loading…
Reference in a new issue