greymd / tmux-xpanes

Awesome tmux-based terminal divider
MIT License
1.96k stars 61 forks source link

wanna run xpanes automatically at boot #161

Closed icq4ever closed 3 years ago

icq4ever commented 3 years ago

I wrote shell script and it works. but when I tried to run that script in /etc/rc.local, it failed.

xpanes:Error: Both arguments and other options (like '-c', '-e') which updates <command> are given.

how can I resolve this issue?

this is the shell script

#! /bin/bash
clear;
xpanes -l eh -c "ssh pi@{}" 192.168.0.101 192.168.0.102 192.168.0.103
greymd commented 3 years ago

It seems xpanes is working as pipe mode since that standard input is opened to the command in rc.local. I guess, what happened in rc.local is same below.

$ echo | xpanes -l eh -c "ssh pi@{}" 192.168.0.101 192.168.0.102 192.168.0.103
xpanes:Error: Both arguments and other options (like '-c', '-e') which updates <command> are given.

As the workaround, can you update the script like this?

printf '%s\n' 192.168.0.101 192.168.0.102 192.168.0.103 | xpanes -l eh -c "ssh pi@{}"

ssh pi@192.168.0.101, ssh pi@192.168.0.102, ssh pi@192.168.0.103 will be executed even if the script is called with opening stdin.

greymd commented 3 years ago

Let me close the issue. if you need any helps, plz reopen it.