zsh-users
 help / color / mirror / code / Atom feed
From: Matt Zagrabelny <mzagrabe@d.umn.edu>
To: zsh-users@zsh.org
Subject: passing data to .zshrc
Date: Wed, 17 Jan 2018 16:43:20 -0600	[thread overview]
Message-ID: <CAOLfK3WOCzv5MTSn9RD2eWZN-M6-qmsabeb0K8BrTYCn=nT=Bw@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1196 bytes --]

Greetings,

I am not (yet) subscribed to the -users mailing list. Please CC me. Thanks!

I use a simple shell script wrapper to launch mate-terminal:

#/bin/sh
mate-terminal --geometry=156x42

My default shell is zsh - which gets successfully spawned in the
aforementioned terminal.

I'd like to make programatic decisions inside my .zshrc file based on a
variable in my wrapper script. Or I'd like to pass some sort of data to the
.zshrc script.

I could imagine something like:

#/bin/sh
mate-terminal --geometry=156x42 --command /bin/zsh --env FOO=bar

and then in my .zshrc do things for various values of $FOO.

I've googled and checked the man pages for passing environment variables
into zsh via a CLI option, but couldn't find anything.

The graphical nature of the mate-terminal makes it so I can't:

#/bin/sh
export FOO=bar
mate-terminal --geometry=156x42

Similarly the following does not work:

#/bin/sh
mate-terminal --geometry=156x42 --command FOO=bar /bin/zsh

I suppose I could do some convoluted exec'ing with the mate-terminal to
pass in an environment variable, but I'd rather find a (somewhat) elegant
solution.

Does anyone have any ideas or suggestions for me?

Thanks!

-m

             reply	other threads:[~2018-01-17 22:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-17 22:43 Matt Zagrabelny [this message]
2018-01-17 22:54 ` Eric Cook
2018-01-18 21:14   ` Matt Zagrabelny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOLfK3WOCzv5MTSn9RD2eWZN-M6-qmsabeb0K8BrTYCn=nT=Bw@mail.gmail.com' \
    --to=mzagrabe@d.umn.edu \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).