delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2023/08/18/05:52:34

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7496A387689E
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1692352352;
bh=Hl/6tJdJjIRUQiCNdVRVUQA6nH/AeBbO13sUG52gDJ8=;
h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
From;
b=rrVS/DGK97v9NPdgt5TXnzLCnThsDzydqMUzv427bAZhcJIzYhkvZ5tkCU40qRDO1
G4txbxv3zpbCfcFJuKeb04lYcTouCZtxbFRFNe8JERbIO8kdzIcu9IcSBNpPgsvEgl
VFkOI2Kr9LBX4dHQEPeA2eCX/c39izz5lIEpkOZE=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 348963836E93
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20221208; t=1692352334; x=1692957134;
h=content-transfer-encoding:to:subject:message-id:date:from
:in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
:subject:date:message-id:reply-to;
bh=QVwmKc82VOfTSEsOzdCtfyKhjP3rfIxhuKSC0p1wpWc=;
b=Qi0ChOgF9Fc4G0Eyssn/d9a5yulziz3WEdSWosS1ocwvkNPoxMQNbf1NMmWquoHaLY
d6FGWWDX7Hi/EPk9A3Ci+vAKdaOQ9MQTEsedDvnxpKB4H1v2trkudB8TrAQ20a4thBuj
SuoJIN+yqIb2x+r4DU2nJfC2OoAJ0A5n9hHXXctQv4ikntti4cMlqBJdGjk+y6d/0CI0
6fkx+tfBln7XskAMSoZCxfivjdG5vLwd+gKDrf1I3UnrhnGEkcwfCED142muqH5Fk3wk
qjysMr0YhLmSDeCyKjeDmyXGm8K6f45Y8uXyutqmRHBiFE44mbgFJhnBY5USzUPdXSOh
sGOQ==
X-Gm-Message-State: AOJu0Yyaw0lmDXwJajxGUClg170v+TztRKY4Nfc98X1oYXAek1QDQv+v
Gbw3s82G+YBpi8Ny1GglTfuwZhQjSvnUE5OSA1Kk66r8YaA=
X-Google-Smtp-Source: AGHT+IECLf9aF/44FWiAMBiEGbkC8BtekJrvKmyKc2avGFgXMTSAbdAtfkIb33mXn34THKyZh8GvMi8c2DoRNfv4uR0=
X-Received: by 2002:a05:6870:d620:b0:1bf:9f6:b810 with SMTP id
a32-20020a056870d62000b001bf09f6b810mr2370507oaq.36.1692352334176; Fri, 18
Aug 2023 02:52:14 -0700 (PDT)
MIME-Version: 1.0
References: <CANH4o6PFnrVbi7TkRn26Q7Sk24fcftZvavwF4vhV9sxFM4MmVQ AT mail DOT gmail DOT com>
<CAB7+T8gVwQtR3XZ6FvAtOkHwZ0AVPzzPOtk2JTA9HBvNQiBfdQ AT mail DOT gmail DOT com>
In-Reply-To: <CAB7+T8gVwQtR3XZ6FvAtOkHwZ0AVPzzPOtk2JTA9HBvNQiBfdQ@mail.gmail.com>
Date: Fri, 18 Aug 2023 11:51:00 +0200
Message-ID: <CANH4o6Ot_zr5KG0-wpYqJBZq5ux5gEn1ofbBTP7VY=H2oQMzAg@mail.gmail.com>
Subject: Re: Cygwin console: Different default background color when terminal
runs as Admin?
To: "[Cygwin]" <cygwin AT cygwin DOT com>
X-Spam-Status: No, score=0.5 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,
SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Martin Wege via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Martin Wege <martin DOT l DOT wege AT gmail DOT com>
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 37I9qYZO002085

On Fri, Aug 18, 2023 at 7:27 AM Jonathon Merz via Cygwin
<cygwin AT cygwin DOT com> wrote:
>
> On Thu, Aug 17, 2023 at 7:13 PM Martin Wege via Cygwin <cygwin AT cygwin DOT com>
> wrote:
>
> > Just an idea: Could the default background color of the Cygwin console
> > be changed from black to grey (or RED) if the terminal has been
> > started with Administrator rights?
> >
>
> Assuming that:
> 1. The Administrators group is called "Administrators"
> 2. There aren't any non-administrative groups with "Administrators" in the
> name
> 3. You're using mintty for your terminal
>
> You can run the following in bash or zsh with the desired RGB values:
>
> if [[ `id -Gn` == *Administrators* ]]
> then
>     echo -ne "\e]11;#FFBBEE\a";
> fi
>

Looking at the output of /usr/bin/id -a was my first guess too. But
this fails quickly because the names are localized. Seriously MS runs
the Windows group names through the l10n wringer!! So what works on
Windows for Germany will surely fail for Windows for Japan. Thus I am
looking for a more portable solution.

Maybe the numeric group ids are more 'portable' across the Windows
versions for different countries?

Thanks,
Martin

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019