#!/bin/bash
if [ $# -gt 0 ] ; then
($@ &) &>/dev/null
else
cat <<-EOM
Usage: gui [COMMAND] [ARG]...
Runs a command in GUI mode, i.e., detached completely from the executing shell and terminal.
If no command is given, this help message is shown.
EOM
fi
- Save above script in a file called
gui
somewhere on the user'sPATH
(environment variable). - Make it executable:
chmod +x <PATH_TO_FILE>/gui
(enter the script's path in place of<PATH_TO_FILE>
).
Note: This script was inspired from this Stack Overflow answer.