I want to setup a launchagent to do the following on login:

  Start screen
  Start a processes inside the screen
  Detach the screen

What I do now is, manually:

$ screen -h 5000 -DRRS foobar
        [wait a second for screen to start]
$ foobar
        [wait a second for footer to start]
^a^d

(that detaches the screen so that I can later, either locally or via a remote 
terminal session type 

$ screen -h 5000 -DRRS foobar

And be right back in that session.

(in the initial command, the -DRR part of the flag is not needed, but I type 
the whole thing so that I can simply use the same command in the history 
regardless of if I am starting a new session or reconnecting to an existing one)

I tried this with irssi, but it’s not working (and I’m not logging any errors 
form it):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" 
"http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
<plist version="1.0">
<dict>
        <key>Label</key>
        <string>com.kreme.home.irssi</string>
        <key>ProgramArguments</key>
        <array>
                <string>/usr/bin/screen</string>
                <string>-dmS</string>
                <string>irc</string>
                <string>irssi</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
</dict>
</plist>

I then tried:

<key>ProgramArguments</key>
        <array>
                <string>/usr/bin/screen -dmS irc irssi</string>
        </array>

But I get:

4/9/15 05:22:12.111 com.apple.xpc.launchd[1]: (com.kreme.home.irssi[76637]) 
Could not find and/or execute program specified by service: 2: No such file or 
directory: /usr/bin/screen -dmS irc irssi

If I remove the full path, I get:

4/9/15 05:19:48.494 com.apple.xpc.launchd[1]: (com.kreme.home.irssi[76355]) 
Service could not initialize: 14D131: xpcproxy + 13421 
[1402][E34BADE4-4125-3886-AA5B-08E47BD0E884]: 0x2

Any ideas?

-- 
a vital ingredient of success is not knowing that what you're attempting
can't be done. A person ignorant of the possibility of failure can be a
half-brick in the path of the bicycle of history.

_______________________________________________
MacOSX-talk mailing list
[email protected]
http://www.omnigroup.com/mailman/listinfo/macosx-talk

Reply via email to