~/.xinitrc: start apps only if not already running
Local (per user) startup apps are added to ~/.xinitrc
.
There may be times when you want to restart X but not restart apps that are already running.
To do so, check if there's any active processes of the app and only start the app if there isn't any.
# start apps in background if not already running
[[ -z "$(pidof mpd)" ]] && mpd
[[ -z "$(pidof tmux)" ]] && tmux &
[[ -z "$(pidof urxvtd)" ]] && urxvtd -q -o -f
Source: https://bbs.archlinux.org/viewtopic.php?pid=1057419#p1057419
Written by Andrew Wong
Related protips
2 Responses
over 1 year ago
·
@jasonwryan Lol sorry. Forgot where I originally saw this. Link added.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Linux
Authors
Related Tags
#linux
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#