ZSH using a different PS1 depending on hostname? [SOLVED]

SOLVED
Mikachu on irc.freenode.net #zsh gave me a good solution:
case $HOST in
TARDIS)
hostcolor=blue
CentzonTotochtin)
hostcolor=cyan
Highwind)
hostcolor=white
hostcolor=gray
esac
PS1="%{$fg[$hostcolor]%}%B%m%b%u%{$reset_color%}:%{$fg[green]%}%2~%{$fg[magenta]%}%%%{$reset_color%} "
#PS1 thanks to Mikachu on irc.freenode.net #zsh
/SOLVED
A little background
I've got around to setting up git in my home directory (leaving a '*' in ~/.git/info/exclude, and using 'git add -f $FILE') to make sure all my machines are using the same dotfiles, but I use a different PS1 based on what machine I'm using.  I'd love to have a single .zshrc I could drop into the git repo and use for all machines, as opposed to say, zsh evaluating a seperate '~/.PS1' I set up by hand on each machine.
But getting to the point:
My PS1 is this:
PS1="%{$fg[cyan]%}%B%m%b%u%{$reset_color%}:%{$fg[green]%}%2~%{$fg[magenta]%}%%%{$reset_color%} "
the only difference between the .zshrc on each machine is that the hostname is given a different color, so that the machine 'TARDIS' might have the hostname in PS1 as blue, machine 'Centzon' might have the hostname as cyan, and if the .zshrc is on any other host, the hostname in PS1 is just grey.  I'm not sure how to go about this with .zshrc, but here's a rough idea:
eval hostname
if hostname=TARDIS
PS1="%{$fg[blue]%}%B%m%b%u%{$reset_color%}:%{$fg[green]%}%2~%{$fg[magenta]%}%%%{$reset_color%} "
if hostname=Centzon
PS1="%{$fg[cyan]%}%B%m%b%u%{$reset_color%}:%{$fg[green]%}%2~%{$fg[magenta]%}%%%{$reset_color%} "
else
PS1="%{$fg[grey]%}%B%m%b%u%{$reset_color%}:%{$fg[green]%}%2~%{$fg[magenta]%}%%%{$reset_color%} "
Has anyone come up with something like this?  If not, how would I do something like this in ZSH?
Last edited by 094TQ5 (2011-11-08 00:31:42)

Well, there are different ways of achieving this.
Solution 1:
You can create a new output type which will be triggered and call a same driver program and the new smart form. I am sure you can customize as to what Purchasing document type will trigger which output type. Get in touch with someone in the function team to get this configured.
Solution 2:
No Customizing, let the configuration be the same, but in the driver program change the value of  "TNAPR-FONAM" immediately after the form entry_neu to the new form name based on the Purchasing document type.

Similar Messages

  • Adress bar search uses a different engine depending on the amount of words entered

    I've been trying to figure this one out for a bit... If I enter one word into the adress bar - gamespot for instance - it takes me to a bing.com search. As opposed to the gamespot.com site as it has always done up until a few hours ago. Now, at first I figured this was just a matter of firefox changing the default, so looked for a solution to this. The given solution in most cases is to change to change keyword.url - which I have done. It is set to the google url that according to most of the sites I checked is supposed to work. However, typing 'gamespot' still gives me a bing search (not a google search or the site in question).
    But here's the kicker; if I type 'game spot' it takes me to the gamespot.com website. So I tried something else. 'facebook' vs. 'face book' - same thing. 'fastcars' - bing search, 'fast cars' - google search. 'firefox' - bing.com search, 'fire fox' - mozilla homepage... I take it you see what I mean by now...
    I have no idea what is going on here. Seems a bit of an odd effect for any kind of malware - allthough I'm running a full scan as I type, just in case...
    == This happened ==
    Every time Firefox opened
    == no idea what triggered it. Just happened all of a sudden this evening. After using the comp all day without it acting like this - and no new installs that I know of.

    Hi,
    >>A CHAR datatype and VARCHAR2 datatype are stored identically (eg: the word 'WORD' stored in a CHAR(4) and a varchar2(4) consume exactly the same amount of space on disk, both have leading byte counts).
    Ok, but on the other hands:
    SGMS@ORACLE10> create table x (name char(10), name2 varchar2(10));
    Table created.
    SGMS@ORACLE10> insert into  x values ('hello','hello');
    1 row created.
    SGMS@ORACLE10> commit;
    Commit complete.
    SGMS@ORACLE10> select vsize(name),vsize(name2) from x;
    VSIZE(NAME) VSIZE(NAME2)
             10            5
    SGMS@ORACLE10> select dump(name),dump(name2) from x;
    DUMP(NAME)                                         DUMP(NAME2)
    Typ=96 Len=10: 104,101,108,108,111,32,32,32,32,32  Typ=1 Len=5: 104,101,108,108,111Cheers

  • How can I use two different ToolTipUIs?

    Hi,
    I want to use two different ToolTipUIs depending (in my case) on the JRadioButton that the Cursor is hovering over. For some JRadioButtons, I want to use the default ToolTipUI, and for others I wish to display a large amount of text over multiple lines. It seems to me that this is not easily possible as ToolTipManager uses the same JTooltip for each component, so setting the UI for JToolTip will affect every tool-tip-text.
    Does anyone know of a simple method to achieve this goal? Or can someone please correct me if my understanding is wrong?!
    And yes, I do realise that I could just use the multi-line ToolTipUI for all tooltips.
    Thanks,
    Muel.

    As a point of interest, does anyone know why JToolTip doesn't have a public setUI(ComponentUI) method? Most other JComponents have such a method. This is really annoying because it means you have to do 1 of 2 things:
    1. Subclass JToolTip and subclass the particular JComponent
    public class WrappableToolTip extends JToolTip {
         public void setUI(ComponentUI ui) {
              super.setUI(ui);
    } //end class
    // and the subclass of the JComponent
    public class WrapToolTipRadioButton extends JRadioButton {
         public WrapToolTipRadioButton(String text) {
              super(text);
         public JToolTip createToolTip() {
              JToolTip toolTip = new WrappableToolTip();
              toolTip.setComponent(this);
              toolTip.setUI(new WrappableToolTipUI());
              return toolTip;
    } //end class
    2. Rank work around in particular JComponent
    public class WrapToolTipRadioButton extends JRadioButton {
         public WrapToolTipRadioButton(String text) {
              super(text);
         public JToolTip createToolTip() {
              JToolTip toolTip = super.createToolTip();
              ComponentUI oldUI = UIManager.getUI(toolTip);
              UIManager.put("ToolTipUI", WrappableToolTipUI.class.getName());
              toolTip.updateUI();
              UIManager.put("ToolTipUI", oldUI.getClass().getName());
              return toolTip;
    } //end classThis problem is really annoying, because I have to write 2 or 3 (depending on above methods) classes for something simple. If it were a different component, I'd just have to write 1 class - the UI class. Irritating!

  • Premiere Pro CC and Encoder CC ( 7.1.0 ) produce different outputs dependant on Queue or Export meth

    I have used a standard workflow for many months but recently something has changed. If I create a simple 720x576 sequence with video and then send this to Media encoder I get different results dependant on if I queue or export the sequence. If I export directly from the application then the resulting file is perfect ( MPEG2/QT ) , however if I queue the file and then export the resulting file contains small black vertical bands at either side of the image an the resulting image looks squashed.
    Testing the same workflow in CS6 does not have the issue.
    Has something changed with the latest 7.1.0 release ???
    Can anyone make a simple test and let me know ??
    If you simply queue to the Media encoder and view the window you can see the added bands ??
    I am using MAC OSX 10.7.5 as a platform
    Thanks

    Here you can download the trial they are all the first build (7.0)
    http://prodesigntools.com/adobe-cc-direct-download-links.html
    Updates can be found here:
    http://www.adobe.com/support/downloads/product.jsp?product=98&platform =Windows
    http://www.adobe.com/support/downloads/product.jsp?product=98&platform =Macintosh
    Take from http://forums.adobe.com/thread/1357792?tstart=0
    Also, take care to track down Adobe Media Encoder 7.0 — the installers above don't downgrade AME, and you'll have issues queing projects if you're sending it from Premiere 7.0 to AME 7.2.

  • Error Message When Leaving Review For Apps Downloaded Using a Different Country App Store

    DEVICES AND SOFTWARE:
    iPhone 6 Plus iOS 8.1.2, Macbook Air 11" 2013 OSX 10.10.2, iTunes 12.1.0.50
    DESCRIPTION:
    When attempting to leave a review for an App that has been previously downloaded or purchased using a different country store but on the same Apple ID - the user receives an error message. The issue stems from the App not being in the Purchase History of the presently associated country store as purchase history is country dependent rather than Apple ID dependent.
    STEPS:
    1. Login the App Store on iTunes or iOS Device using an Apple ID associated with a country.
    2. Download an App for the first time using said Apple ID.
    3. Change the country of said Apple ID.
    4. Attempt to leave a review of the previously downloaded app.
    EXPECTED RESULTS:
    A user should be able to leave a review to an App he/she has previously downloaded whilst the Apple ID is associated with a different country. The App Store button should show Downloaded after the country change and the App should continue to be displayed in the Purchase history. In other words the purchase history should not be country dependent but Apple ID dependent.
    ACTUAL RESULTS:
    User gets an error message indicating that the app needs to be downloaded or purchased first.
    NOTES:
    I have tried deleting my reviews from the original country store, and yet I am still not able to leave a review. Please make the purchase history dependent on the Apple ID rather than the Country Store. If this is not possible, provide a way for users to remove to delete the purchase history from the previous country store(s) - so these apps can appear on their current country store's purchase history. Thus they would be able to leave reviews for these apps.

    We are fellow users here on these user-to-user forums, you're not talking to iTunes Support nor Apple. If you want to leave feedback for Apple : http://www.apple.com/feedback/itunesapp.html

  • How to create a front panel display that lights up with different colours depending on its input signal?

    I am doing a project where I have this array which has different voltage outputs for each grid. How do I create a front panel object that lights up with different colours depending on the voltage input or is there already such a pre-built function?
    In addition, I wish to display these in an array on screen. Is there any pre-built function for this?

    Repulse wrote:
    I am doing a project where I have this array which has different voltage outputs for each grid. How do I create a front panel object that lights up with different colours depending on the voltage input or is there already such a pre-built function?
    The simplest way would be an intensity graph. It gives you a 2D grid where each grid point is colored according to the value of a 2D array. The Z axis color ramp determines the color.
    My second choice would be an array of colorboxes. (They could even be made to look like LEDs (see image, if course you can leave them square too), All you need is a scaling function thap maps voltages into a color ramp lookup table with an 8bit index)
    (Using booleans and color property nodes is relatively clumsy. Booleans are meant for two states because the value is boolean. Since array elements can only differ in value, and not in properties, it will not even work. Color boxes have a color data type which is much more appropriate for this case)
    LabVIEW Champion . Do more with less code and in less time .

  • Show different lists depending on subtype

    Hi,
    In transaction PA30 it is possible to show a list. Normally you define the list screen number in the customizing for infotypes, so just 1 different screen is possible. Now I want to know if it is possible to use  2 different screens for the list display. I need to redefine the screen number within the program flow depending on the subtype. I can't find an user-exit for this. Has anyone a solution??
    kind regards Maarten

    Hi Maarten,
            I think U can do this by definig a new feature based on the subtype and call the alternate screen  for the respective variable key.
    How to do:
    step 1 : Create a feature with the variable keys defined based on the subtype.
    step 2:U can use the table T588M to call different alternate screens for the respective variable key(Output from feature). 
    U can ask ur functional consultant to do this kind of work.The data in the table T588M is maintained by the functional people.

  • Hi. I have temporarily moved away from home. I am using a different internet connection, and I have lost my bookmarks. How do I get them back?

    Hi. I have temporarily moved away from home. I am using a different internet connection, and I have lost my bookmarks. How do I get them back?

    Generally speaking, your bookmarks are private to your computer, and if you set up multiple Firefox profiles on your computer, to the one profile.
    Your bookmarks might be available to you at another location if you used the Sync service. In order to connect a new computer to the Sync service when you aren't near your old computer, you need a recovery key. https://support.mozilla.org/en-US/kb/share-bookmarks-tabs-and-more-your-other-computers#w_what-if-im-not-near-my-first-computer
    If you didn't use Sync or can't access your account, someone with access to your old computer could email you your bookmarks. Since there is a range of different ways to do that and the best choice might depend on what you can expect the person you ask to be able to do... could they start up Firefox in your profile and follow menu steps to export a file? Could they drill down into a hidden folder on the system, zip a file, and mail that to you? Etc.

  • Use of different views..

    hi all ,
    what are the use of different views which we can create through data dictionary ?
    database view.
    maintanance view.
    projection view
    serch help view.
    please explain me the diffrence betn this 4 views in terms of Technical characteristic and functional characterestics...
    when to use which view ?
    what is the purpose of each view.?
    any special characteristics of a particular view ?
    Thanks in advance..
    regards
    Raj

    hi,
    Views improve perfromance in the following aspects
    1. If you want to use more than two table in 'JOIN' condition better to use Views . It will improve performance of a program
    2. If you want to use mutiple FOR ALL ENTRIES clause, better to club all SELECT statement in a view.
    Note:
    1.Views does not contain data in it. It fetches data from the database only depending on the condition ...
    2.Views are part of data dictionary. They are a window to view the data in database
    3.Views can be used to give security to data. users are allowed to view only basic data only
    The followings are different types of views:
    - Database View (SE11)
    Database views are implement an inner join, that is, only records of the primary table (selected via the join operation) for which the corresponding records of the secondary tables also exist are fetched. Inconsistencies between primary and secondary table could, therefore, lead to a reduced selection set.
    In database views, the join conditions can be formulated using equality relationships between any base fields. In the other types of view, they must be taken from existing foreign keys. That is, tables can only be collected in a maintenance or help view if they are linked to one another via foreign keys.
    - Help View ( SE54)
    Help views are used to output additional information when the online help system is called.
    When the F4 button is pressed for a screen field, a check is first made on whether a matchcode is defined for this field. If this is not the case, the help view is displayed in which the check table of the field is the primary table. Thus, for each table no more than one help view can be created, that is, a table can only be primary table in at most one help view.
    - Projection View
    Projection views are used to suppress or mask certain fields in a table (projection), thus minimizing the number of interfaces. This means that only the data that is actually required is exchanged when the database is accessed.
    A projection view can draw upon only one table. Selection conditions cannot be specified for projection views.
    - Maintenance View ( SE54 )
    Maintenance views enable a business-oriented approach to looking at data, while at the same time, making it possible to maintain the data involved. Data from several tables can be summarized in a maintenance view and maintained collectively via this view. That is, the data is entered via the view and then distributed to the underlying tables by the system.

  • IPhoto - is it using two different color spaces?

    I know I should have a better handle on this whole question by now, but am still confused by the 1.8 vs. 2.2 Gamma issue.
    On the recent advice of an Apple PhotoServices tech, I've just changed my main display's Gamma from the default 1.8 to the darker 2.2 -- hoping to maximize consistency between what I see onscreen and what I'll receive in my printed Calendar order. (Everything else is still based on the default "Cinema HD" profile.)
    Using one particular JPEG image as a test, I'm seeing something curious:
    In Aperture, the image's thumb and its full-screen version look basically the same. But in iPhoto, that same image looks quite different depending on whether I'm viewing it as a thumb (or as an image placed in a Calendar theme), vs. when I double-click that image and see it in iPhoto's Editor window.
    When I see it in iPhoto's editing mode, it suddenly looks noticeably lighter -- as if I'd switched my display back to the old 1.8 Gamma.
    Can anyone enlighten me here (pardon the pun)? Why does iPhoto's editor window seem to display an image differently than other programs, or even than elsewhere in iPhoto itself? And why am I only seeing this discrepancy after setting my display to the 2.2 Gamma?
    John Bertram
    Toronto

    Okay --
    The plot thickens. I followed your suggestion, Terence, and did some tests. Here are the interesting (if confusing) results:
    When I open anything from within the iPhotoLibrary folder using Preview, Preview gives the Color Profile info as follows:
    Color Model: RGB
    ColorSync Profile: Generic RGB Profile
    This seems to apply to anything from within the iPhotoLibrary package, whether we’re talking images from the Originals folder, from the Modified folder, or thumbs from the Data folder. And they all (when viewed in Preview) look the same, and they all look “correct” in terms of general contrast.
    BUT...
    When I do a Finder “Get Info” on those same files, suddenly there are differences.
    1) from the Modified folder:
    Most images from the Modified folder now say (in Get Info’s “More Info” pane):
    Color space: RGB
    Profile name: Adobe RGB (1998)*
    * (A few give the Profile name as “sRGB IEC61966-2.1”, and the one that got saved as a .psd file says “Camera Sync Profile”. The strange thing is I can’t seem to find any pattern between the images which were modified using my “external editor” -- Photoshop Elements -- vs. the ones which were edited using only iPhoto’s adjustment tools. The bulk of them all say “Adobe RGB (1998)” as the Profile Name.)
    Note that these are the same images which, when opened in Preview, ALL claim the “Generic RGB Profile” -- and all look correct under those circumstances.
    2) from the Data folder:
    Meantime, ALL the thumbnail images which iPhoto has created for its Data folder, when “Get Info’d” in the Finder, all state their Profile name as “sRGB IEC61966-2.1”.
    Open the same thumb image in Preview, and it’s back to “Generic RGB Profile” (as well as back to looking correct and not too dark).
    3) from the Originals folder:
    Finally, images from iPhoto’s Originals folder give no color profile data whatsoever in the “More info” pane of the Finder’s Get Info window. So is this the same as having the “Generic RGB Profile”?
    In any case, here are three different folders (Originals, Modified, and Data), and iPhoto appears to be using a different color profile for the images contained in each one -- and in the case of the Modified folder, several different profiles.
    Yet all of these images, when opened in Preview, appear to use the “Generic RGB Profile” -- and all appear as they should in terms of Gamma/contrast on screen -- while when viewed within iPhoto the same image will look quite different depending on whether it’s being seen in iPhoto’s regular window (as a thumb or as part of a Calendar layout, for instance -- all too dark) or in iPhoto’s editing window, in which case it suddenly looks fine.
    The other mystery is why this discrepancy between iPhoto’s regular viewer and its editing window wasn’t apparent when my display was set to the default 1.8 Gamma; it’s only become an issue under the new (AppleSupport-recommended) 2.2 setting.
    = = = = = == = = = = = = = = = = = = = = = = = = = = = = = =
    My brain officially hurts now. (I guess this is just more evidence that Computers and the Internet will all be very nice if they can finally just get them working.)
    Any help in interpreting this data will, as always, be much appreciated.
    Thanks,
    John Bertram
    Toronto

  • Reference product use a different class

    Hi
      I face  a inbound error queue in R/3 system :Reference product use a different class. What does it mean? I have checked the
    classification in apo in product. The value in  Reference Product (Loc.-Indep.) is 100_SER.  The value in CDP Class is
    CL_100_SER. BUt in R/3 the value in Cross-plant CM is 101_SER. Is it because this reason? I don't know the relationship
    between these fields. Could you please help expalin ? Thank you very much in advance.

    Hi,
    In R/3 there are two feilds  one is cross plant configurable material in basic data 2 veiw. This will appear in APO location independent reference material.
    In MRP3 there is plant specific configurable material which will appear in APO as location dependent configurable material.
    Genrally these both feilds will have same value.
    Secondly Z these feilds need to be assigned material post material is transfered to APO.
    Can you give some more details to help you.
    Like what is class type assigned in ECC?
    Regards,
    SANTOSH

  • HT1766 Does it matter if I use a different computer

    Does it matter if I use a different computer that than the one I set up my iPad with.

    Depends on what you mean by "use". An iPad can only be synced with one computer. If you attept to sync with another computer, you may lose all of your data.
    This has been covered in another thread. It might help you to read through this: https://discussions.apple.com/thread/4214342?start=0&tstart=0

  • TS1717 Itune Match not happy as I have used 2 different email address ID's how do I combine them into one?

    Itunes unhappy, Match issues!  I think it is because I have used two accounts on different emails.  Can I pull the two together to make just one account?

    Open Accounts preferences in System Preferences. Click on the lock icon and authenticate. Under the user list click on the Add [-] button button to create a new user account for yourself or your father (whoever is not the existing account owner.) Configure the account with a separate username and password.
    Now each of you should have a separate account on the computer. You can each sync your iDevices into completely separate accounts using completely different Apple IDs.

  • How can I send email using two different email address that both link back to my one exchange account on my Ipad mini

    How can I send email using two different email address that both link back to my one exchange account on my Ipad mini? 
    On my PC I simply have a master return email address and use a POP for the secondary address.  Both are through the one exchange account without a problem.  I need to be able to do the same on my Ipad.

    Ah, I should have made that clear.  My domain didn't come from google.  It was purchased at and is hosted at dreamhost, but I haven't used their email servers in years - I just route everything through gmail.  I actually have a bunch of domains (with websites).
    Gmail has an option that lets someone with custom domains send (and receive) email through gmail using the custom domain once Google confirms proper ownership of the domain (to prevent spammers and such).  Gmail has a setting for "send email as" which allows gmail to be sent using a custom domain as the sender.  I'm pretty sure Apple's old mobileme had this feature too, but I didn't use it.

  • Using a different .Mac account in iPhoto

    We have a .Mac family pack. My wife and I each have a personal account and we would like to use a completely different .Mac account to post our web galleries, but I don't want to have to create a new user on my Mac just to use iPhoto. Is there a way that iPhoto can use a different .Mac account than the one associated with my user account on my computer to publish galleries?
    Thanks,
    Aaron

    For POP:
    The following mail server settings will work with all AT&T email domains: @ameritech.net, @att.net, @bellsouth.net, @flash.net, @nvbell.net, @pacbell.net, @prodigy.net, @sbcglobal.net, @snet.net, @swbell.net, @wans.net.
    Email Program Settings Field:
    Enter:
    Incoming (POP)
    inbound.att.net
    Outgoing (SMTP)
    outbound.att.net(requires authentication)
    Incoming mail server:
    POP3
    Incoming/Outgoing User Name:
    Full AT&T email address, including domain (e.g., [email protected], [email protected])
    Incoming mail port #:
    995, secure connection (SSL) checked
    Outgoing mail port #
    465, secure connection (SSL) checked
    I assume the settings you are refering to gives that delay for marking the messages as read when highlighted for that period of time. Probably for scrolling through the list without changing the unread status. Lion doesn't have that selection, so I can't test that at the moment.

Maybe you are looking for

  • Translated description is not coming in BW reporting

    Hello, I have a BI report in which the description of each column is coming correctly when I have logged in english. When I logged in German Language the description is not coming correctly. It is coming like selektion 1, Selektion 2. KIndly suggest

  • Report for duplicate PO and Sales Order

    Hi All, I need to find out two reorts for below purpose: 1) Report that will give me list of all PO's which has duplicate sales order against them . 2) Report that will give me list of  all sales order which has duplicate PO's . I know there is a rep

  • Pass tdline and tdformat to Sapscript

    Hi all, Can we pass tdline and tdformat at the same time to Sapscript? My requirement needs the tdformat to be dynamically, is this possible ? How should I pass a dynamic format to sapscript? If yes, could someone provide some sample code? Thanks in

  • InfoObject domains

    Granted, I'm new to the SAP BI world/environment. However, I have to say I was shocked (SHOCKED, I tell you) when I was told that it is standard practice to just accept the default domains that are referenced by the Data Elements of newly created Inf

  • Transport Req  issue

    Hi All, I am not a basis person, but by a bit bad luck i created a transport request in which though i intended to include only my objects , i included lot of unnecessary req, and they are all coming directly under the main req number in , ie in "Obj