~/Blog

Brandon Rozek

Photo of Brandon Rozek

PhD Student @ RPI studying Automated Reasoning in AI and Linux Enthusiast.

Launch Apps through the Terminal

Published on

Updated on

Normally when you launch an application through the terminal, the standard output appears, and closing the terminal closes the application.

Using systemd

Tem Tem recently tooted a blog post they wrote on replacing nohup with systemd-run

To run a graphical application it’s as easy as:

systemd-run --user application

If you want to see any of the application terminal output, then when the service is running you can check the status like any other systemd service.

systemd --user status application

Note that the current directory information is not known to systemd-run. Therefore, if you’ll need to specify absolute as opposed to relative paths. For example:

systemd-run --user okular "$PWD/document.pdf"

Check out Tem Tem’s blog post for more on systemd-run!

Using nohup (Legacy)

When the terminal closes, it sends a hangup signal to all of the processes it manages. The nohup command allows applications to run regardless of any hangups sent. Combine that with making it a background task, and you have a quick and easy way to launch applications through the terminal.

nohup application > /dev/null &
Reply via Email Buy me a Coffee
Was this useful? Feel free to share: Hacker News Reddit Twitter