On Oct 16, 2009 at 12:16 PM, Nicholas Marriott <nicholas.marri...@gmail.com> wrote: > Hi > > On Fri, Oct 16, 2009 at 11:18:45AM -0700, Thayer Williams wrote: > > Could someone explain the correct syntax for the new if-shell command? I > > would like to implement a condition where the tmux statusbar is adjusted > > based on whether I am starting tmux from the Linux console or from within > > X. > > > > I'm hoping for something like this: > > > > if [ -z "$DISPLAY" ]; then set -g status-right with extended system info > > > > Everything I've I've tried ends up with this message: > > > > usage: if-shell shell-command command at line 78 > > > > I'd appreciate any advice at this point. > > If you put it in the configuration file it will only run when you start the > tmux server, but if that is what you want, this should work: > > if '[ -z "$DISPLAY" ]' 'set -g status-right "blah"' > > If you want it to do specific commands depending on where you attach, the best > bet is to write a wrapper script and use an alias.
Thanks, that did the trick! I had considered the timing of the config file initialization, but it shouldn't matter in my case. Sometimes I spend an entire session in the console and it's nice having the time/loadavg in the bar. The other 90% of the time, I'm in X and using dwm where much of the same info is already piped to dwm's status bar. Cheers and thanks for making tmux. As a long-time screen user I just recently made the transition and am loving it. Thayer ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users