Skip to content

Instantly share code, notes, and snippets.

@henrik242
Last active March 26, 2023 02:06
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save henrik242/8d039c06d8131863b510cc037635f977 to your computer and use it in GitHub Desktop.
Save henrik242/8d039c06d8131863b510cc037635f977 to your computer and use it in GitHub Desktop.
Run shell command in background upon macOS login, using tmux
#!/usr/bin/env bash
#
# Make this file executable with `chmod +x run-script-in-background.command`, and add it to
# System Preferences --> Users and Groups --> Startup Items. It needs to have the `.command` suffix.
#
tmux new-session -d -s ostepop \; send -t ostepop.0 "echo Let\'s do this\!; echo More stuff." ENTER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment