all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Johnny <yggdrasil@gmx.co.uk>
To: help-gnu-emacs@gnu.org
Subject: Re: Customising .init.el for root user
Date: Sat, 22 Jun 2013 14:52:16 +0100	[thread overview]
Message-ID: <87txkqxnfz.fsf@gmx.co.uk> (raw)
In-Reply-To: <874ncra9fp@ch.ristopher.com> (Christopher Schmidt's message of "Fri, 21 Jun 2013 14:18:51 +0100 (BST)")

Christopher Schmidt <christopher@ch.ristopher.com> writes:

> david@adboyd.com (J. David Boyd) writes:
>> (setq whoami-string
>>       (substring
>>        (shell-command-to-string "whoami")
>>       0 -1))
>>
>>
>>
>> Then you could do
>>
>> (when (string= (whoami-string) "root")
>>       ..run some customisations...
>> )
>
>     (eq (user-uid) 0)
>
>         Christopher
>

Nice, thanks for both suggestions! I haven't used
shell-command-to-string, but can see it's flexibility. To just change
the colourisation when running as root I ended up doing simply

,----
| (when (eq (user-uid) 0)
|   (load-theme 'light-blue)
|   )
`----

Many thanks

-- 
Johnny



  parent reply	other threads:[~2013-06-22 13:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-20 16:25 Customising .init.el for root user Johnny
2013-06-21 13:13 ` J. David Boyd
2013-06-21 13:18   ` Christopher Schmidt
2013-06-21 14:55     ` J. David Boyd
2013-06-21 15:46       ` Stefan Monnier
2013-06-21 16:00         ` J. David Boyd
     [not found]         ` <mailman.2149.1371830721.22516.help-gnu-emacs@gnu.org>
2013-06-21 16:55           ` Barry Margolin
2013-06-21 17:15             ` J. David Boyd
2013-06-22 13:52     ` Johnny [this message]
2013-06-21 19:49 ` Harry Putnam
2013-06-22 14:03   ` Johnny
2013-06-22 21:26     ` Harry Putnam

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=87txkqxnfz.fsf@gmx.co.uk \
    --to=yggdrasil@gmx.co.uk \
    --cc=help-gnu-emacs@gnu.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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.