Skip to main content

Admineral's answer is good and you should read it :)

For a graphical application on a modern desktop system, you can also completely avoid having to deal with standard input and output, by letting your graphical session run the program (just as if you had run it, say, from the application launcher) including arguments. I'd recommend that over nohup / disown, because it doesn't even start the firefox process as a child of your shell.

systemd-run --user --quiet --same-dir firefox web/*.html

Note that this is a bit of typing. I hence have in my ~/.zshrc (or you can have it in your ~/.bashrc if you're using bash) an alias userrun="systemd-run --user --quiet --same-dir", so that I can userrun firefox ….

Because you say (in the comments) you want to use this for nice purposes: don't; nice is not the tool you want there. Instead, allow your system to assign a percentage of CPU time allocatable to firefox (compare this earlier answer of mine):

systemd-run --user --quiet --same-dir -p CPUQuota=300% firefox …

or just

userrun -p CPUQuota=300% firefox …

to allow no more than 3 CPU cores to be spent (or 6 half-spent, you get the idea) on firefox and all processes that it spawns (firefox runs each website tab in its own process, for security reasons).


By the way, systemd-run lets you do a great deal of things. For example, if you use -u some-name-I-thought-of as argument to it (so, before the command you want to run), you can check whether whether the command is still running using systemctl --user status some-name-I-thought-of. (For firefox, that can be tricky – if there's already a Firefox window open when you run the command, the command will return "immediately" after opening the HTML documents in tabs.)

Another thing I often do is

userrun --on-calendar="$(date -I) 11:30" notify-send 'Lunch!'

for reminders (you can of course do anything anything else than notify-send you reminders, or using date -I to get today's date).

If you want to start firefox in 1 minute and 12 seconds:

userrun --on-active=1min12s firefox

Admineral's answer is good and you should read it :)

For a graphical application on a modern desktop system, you can also completely avoid having to deal with standard input and output, by letting your graphical session run the program (just as if you had run it, say, from the application launcher) including arguments. I'd recommend that over nohup / disown, because it doesn't even start the firefox process as a child of your shell.

systemd-run --user --quiet --same-dir firefox web/*.html

Note that this is a bit of typing. I hence have in my ~/.zshrc (or you can have it in your ~/.bashrc if you're using bash) an alias userrun="systemd-run --user --quiet --same-dir", so that I can userrun firefox ….

Because you say (in the comments) you want to use this for nice purposes: don't; nice is not the tool you want there. Instead, allow your system to assign a percentage of CPU time allocatable to firefox (compare this earlier answer of mine):

systemd-run --user --quiet --same-dir -p CPUQuota=300% firefox …

or just

userrun -p CPUQuota=300% firefox …

to allow no more than 3 CPU cores to be spent (or 6 half-spent, you get the idea) on firefox and all processes that it spawns (firefox runs each website tab in its own process, for security reasons).


By the way, systemd-run lets you do a great deal of things. For example, if you use -u some-name-I-thought-of as argument to it (so, before the command you want to run), you can check whether whether the command is still running using systemctl --user status some-name-I-thought-of. (For firefox, that can be tricky – if there's already a Firefox window open when you run the command, the command will return "immediately" after opening the HTML documents in tabs.)

Another thing I often do is

userrun --on-calendar="$(date -I) 11:30" notify-send 'Lunch!'

for reminders (you can of course do anything anything else than notify-send you reminders, or using date -I to get today's date).

If you want to start firefox in 1 minute and 12 seconds:

userrun --on-active=1min12s firefox

Admineral's answer is good and you should read it :)

For a graphical application on a modern desktop system, you can also completely avoid having to deal with standard input and output, by letting your graphical session run the program (just as if you had run it, say, from the application launcher) including arguments. I'd recommend that over nohup / disown, because it doesn't even start the firefox process as a child of your shell.

systemd-run --user --quiet --same-dir firefox web/*.html

Note that this is a bit of typing. I hence have in my ~/.zshrc (or you can have it in your ~/.bashrc if you're using bash) an alias userrun="systemd-run --user --quiet --same-dir", so that I can userrun firefox ….

Because you say (in the comments) you want to use this for nice purposes: don't; nice is not the tool you want there. Instead, allow your system to assign a percentage of CPU time allocatable to firefox (compare this earlier answer of mine):

systemd-run --user --quiet --same-dir -p CPUQuota=300% firefox …

or just

userrun -p CPUQuota=300% firefox …

to allow no more than 3 CPU cores to be spent (or 6 half-spent, you get the idea) on firefox and all processes that it spawns (firefox runs each website tab in its own process, for security reasons).


By the way, systemd-run lets you do a great deal of things. For example, if you use -u some-name-I-thought-of as argument to it (so, before the command you want to run), you can check whether the command is still running using systemctl --user status some-name-I-thought-of. (For firefox, that can be tricky – if there's already a Firefox window open when you run the command, the command will return "immediately" after opening the HTML documents in tabs.)

Another thing I often do is

userrun --on-calendar="$(date -I) 11:30" notify-send 'Lunch!'

for reminders (you can of course do anything else than notify-send you reminders, or using date -I to get today's date).

If you want to start firefox in 1 minute and 12 seconds:

userrun --on-active=1min12s firefox
added 718 characters in body
Source Link
Marcus Müller
  • 51k
  • 4
  • 77
  • 118

Admineral's answer is good and you should read it :)

For a graphical application on a modern desktop system, you can also completely avoid having to deal with standard input and output, by letting your graphical session run the program (just as if you had run it, say, from the application launcher) including arguments. I'd recommend that over nohup / disown, because it doesn't even start the firefox process as a child of your shell.

systemd-run --user --quiet --same-dir firefox web/*.html

Note that this is a bit of typing. I hence have in my ~/.zshrc (or you can have it in your ~/.bashrc if you're using bash) an alias userrun="systemd-run --user --quiet --same-dir", so that I can userrun firefox ….

Because you say (in the comments) you want to use this for nice purposes: don't; nice is not the tool you want there. Instead, allow your system to assign a percentage of CPU time allocatable to firefox (compare this earlier answer of mine):

systemd-run --user --quiet --same-dir -p CPUQuota=300% firefox …

or just

userrun -p CPUQuota=300% firefox …

to allow no more than 3 CPU cores to be spent (or 6 half-spent, you get the idea) on firefox and all processes that it spawns (firefox runs each website tab in its own process, for security reasons).


By the way, systemd-run lets you do a great deal of things. For example, if you use -u some-name-I-thought-of as argument to it (so, before the command you want to run), you can check whether whether the command is still running using systemctl --user status some-name-I-thought-of. (For firefox, that can be tricky – if there's already a Firefox window open when you run the command, the command will return "immediately" after opening the HTML documents in tabs.)

Another thing I often do is

userrun --on-calendar="$(date -I) 11:30" notify-send 'Lunch!'

for reminders (you can of course do anything anything else than notify-send you reminders, or using date -I to get today's date).

If you want to start firefox in 1 minute and 12 seconds:

userrun --on-active=1min12s firefox

Admineral's answer is good and you should read it :)

For a graphical application on a modern desktop system, you can also completely avoid having to deal with standard input and output, by letting your graphical session run the program (just as if you had run it, say, from the application launcher) including arguments. I'd recommend that over nohup / disown, because it doesn't even start the firefox process as a child of your shell.

systemd-run --user --quiet --same-dir firefox web/*.html

Note that this is a bit of typing. I hence have in my ~/.zshrc (or you can have it in your ~/.bashrc if you're using bash) an alias userrun="systemd-run --user --quiet --same-dir", so that I can userrun firefox ….


By the way, systemd-run lets you do a great deal of things. For example, if you use -u some-name-I-thought-of as argument to it (so, before the command you want to run), you can check whether whether the command is still running using systemctl --user status some-name-I-thought-of. (For firefox, that can be tricky – if there's already a Firefox window open when you run the command, the command will return "immediately" after opening the HTML documents in tabs.)

Another thing I often do is

userrun --on-calendar="$(date -I) 11:30" notify-send 'Lunch!'

for reminders (you can of course do anything anything else than notify-send you reminders, or using date -I to get today's date).

If you want to start firefox in 1 minute and 12 seconds:

userrun --on-active=1min12s firefox

Admineral's answer is good and you should read it :)

For a graphical application on a modern desktop system, you can also completely avoid having to deal with standard input and output, by letting your graphical session run the program (just as if you had run it, say, from the application launcher) including arguments. I'd recommend that over nohup / disown, because it doesn't even start the firefox process as a child of your shell.

systemd-run --user --quiet --same-dir firefox web/*.html

Note that this is a bit of typing. I hence have in my ~/.zshrc (or you can have it in your ~/.bashrc if you're using bash) an alias userrun="systemd-run --user --quiet --same-dir", so that I can userrun firefox ….

Because you say (in the comments) you want to use this for nice purposes: don't; nice is not the tool you want there. Instead, allow your system to assign a percentage of CPU time allocatable to firefox (compare this earlier answer of mine):

systemd-run --user --quiet --same-dir -p CPUQuota=300% firefox …

or just

userrun -p CPUQuota=300% firefox …

to allow no more than 3 CPU cores to be spent (or 6 half-spent, you get the idea) on firefox and all processes that it spawns (firefox runs each website tab in its own process, for security reasons).


By the way, systemd-run lets you do a great deal of things. For example, if you use -u some-name-I-thought-of as argument to it (so, before the command you want to run), you can check whether whether the command is still running using systemctl --user status some-name-I-thought-of. (For firefox, that can be tricky – if there's already a Firefox window open when you run the command, the command will return "immediately" after opening the HTML documents in tabs.)

Another thing I often do is

userrun --on-calendar="$(date -I) 11:30" notify-send 'Lunch!'

for reminders (you can of course do anything anything else than notify-send you reminders, or using date -I to get today's date).

If you want to start firefox in 1 minute and 12 seconds:

userrun --on-active=1min12s firefox
added 132 characters in body
Source Link
Marcus Müller
  • 51k
  • 4
  • 77
  • 118

Admineral's answer is good and you should read it :)

For a graphical application on a modern desktop system, you can also completely avoid having to deal with standard input and output, by letting your graphical session run the program (just as if you had run it, say, from the application launcher) including arguments. I'd recommend that over nohup / disown, because it doesn't even start the firefox process as a child of your shell.

systemd-run --user --quiet --same-dir firefox web/*.html

Note that this is a bit of typing. I hence have in my ~/.zshrc (or you can have it in your ~/.bashrc if you're using bash) an alias userrun="systemd-run --user --quiet --same-dir", so that I can userrun firefox ….


By the way, systemd-run lets you do a great deal of things. For example, if you use -u some-name-I-thought-of as argument to it (so, before the command you want to run), you can check whether whether the command is still running using systemctl --user status some-name-I-thought-of. (For firefox, that can be tricky – if there's already a Firefox window open when you run the command, the command will return "immediately" after opening the HTML documents in tabs.)

Another thing I often do is

userrun --on-calendar=calendar="$(date -I) 11:30" notify-send 'Lunch!'

for reminders (you can of course do anything anything else than notify-send you reminders, or using date -I to get today's date).

If you want to start firefox in 1 minute and 12 seconds:

userrun --on-active=1min12s firefox

Admineral's answer is good and you should read it :)

For a graphical application on a modern desktop system, you can also completely avoid having to deal with standard input and output, by letting your graphical session run the program (just as if you had run it, say, from the application launcher) including arguments. I'd recommend that over nohup / disown, because it doesn't even start the firefox process as a child of your shell.

systemd-run --user --quiet --same-dir firefox web/*.html

Note that this is a bit of typing. I hence have in my ~/.zshrc (or you can have it in your ~/.bashrc if you're using bash) an alias userrun="systemd-run --user --quiet --same-dir", so that I can userrun firefox ….


By the way, systemd-run lets you do a great deal of things. For example, if you use -u some-name-I-thought-of as argument to it (so, before the command you want to run), you can check whether whether the command is still running using systemctl --user status some-name-I-thought-of. (For firefox, that can be tricky – if there's already a Firefox window open when you run the command, the command will return "immediately" after opening the HTML documents in tabs.)

Another thing I often do is

userrun --on-calendar=

Admineral's answer is good and you should read it :)

For a graphical application on a modern desktop system, you can also completely avoid having to deal with standard input and output, by letting your graphical session run the program (just as if you had run it, say, from the application launcher) including arguments. I'd recommend that over nohup / disown, because it doesn't even start the firefox process as a child of your shell.

systemd-run --user --quiet --same-dir firefox web/*.html

Note that this is a bit of typing. I hence have in my ~/.zshrc (or you can have it in your ~/.bashrc if you're using bash) an alias userrun="systemd-run --user --quiet --same-dir", so that I can userrun firefox ….


By the way, systemd-run lets you do a great deal of things. For example, if you use -u some-name-I-thought-of as argument to it (so, before the command you want to run), you can check whether whether the command is still running using systemctl --user status some-name-I-thought-of. (For firefox, that can be tricky – if there's already a Firefox window open when you run the command, the command will return "immediately" after opening the HTML documents in tabs.)

Another thing I often do is

userrun --on-calendar="$(date -I) 11:30" notify-send 'Lunch!'

for reminders (you can of course do anything anything else than notify-send you reminders, or using date -I to get today's date).

If you want to start firefox in 1 minute and 12 seconds:

userrun --on-active=1min12s firefox
added 132 characters in body
Source Link
Marcus Müller
  • 51k
  • 4
  • 77
  • 118
Loading
Source Link
Marcus Müller
  • 51k
  • 4
  • 77
  • 118
Loading