diff options
Diffstat (limited to 'home/xyz/.local/bin/o')
-rwxr-xr-x | home/xyz/.local/bin/o | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/home/xyz/.local/bin/o b/home/xyz/.local/bin/o new file mode 100755 index 00000000..21464974 --- /dev/null +++ b/home/xyz/.local/bin/o @@ -0,0 +1,15 @@ +#!/bin/sh + +# useful links +# https://stackoverflow.com/questions/3430330/best-way-to-make-a-shell-script-daemon +# https://serverfault.com/questions/117152/do-background-processes-get-a-sighup-when-logging-off +# https://wiki.archlinux.org/title/default_applications + +# I don't care about errors, I don't want to handle errors, just shut up please. +# nohup seems not necessary if don't care about daemon SIGHUP requirement + +if [ $# -eq 1 ] && [ -e "$1" ] && ! [ -x "$1" ]; then + nohup xdg-open "$1" 0<&- >&- 2>&- & +else + nohup "$@" 0<&- >&- 2>&- & +fi |