From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Johnny Newsgroups: gmane.emacs.help Subject: Re: Customising .init.el for root user Date: Sat, 22 Jun 2013 14:52:16 +0100 Message-ID: <87txkqxnfz.fsf@gmx.co.uk> References: <871u7woijw.fsf@gmx.co.uk> <874ncra9fp@ch.ristopher.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1371909162 3104 80.91.229.3 (22 Jun 2013 13:52:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 22 Jun 2013 13:52:42 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jun 22 15:52:42 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UqOF6-0005Tt-4l for geh-help-gnu-emacs@m.gmane.org; Sat, 22 Jun 2013 15:52:40 +0200 Original-Received: from localhost ([::1]:50040 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UqOF5-0008BC-Hh for geh-help-gnu-emacs@m.gmane.org; Sat, 22 Jun 2013 09:52:39 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34904) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UqOEr-0008Ax-Qm for help-gnu-emacs@gnu.org; Sat, 22 Jun 2013 09:52:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UqOEm-000678-GU for help-gnu-emacs@gnu.org; Sat, 22 Jun 2013 09:52:25 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]:62959) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UqOEm-00066d-7Y for help-gnu-emacs@gnu.org; Sat, 22 Jun 2013 09:52:20 -0400 Original-Received: from deusexmachina ([81.141.146.13]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0LsD9n-1U9ej01dkt-013sNP for ; Sat, 22 Jun 2013 15:52:17 +0200 In-Reply-To: <874ncra9fp@ch.ristopher.com> (Christopher Schmidt's message of "Fri, 21 Jun 2013 14:18:51 +0100 (BST)") User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.1 (gnu/linux) X-Provags-ID: V03:K0:ftiLK2OawvlwozQJN+VDNRn+lDJXy2d3Z1VUB8i1E+YodLE0fCT 6Rj1Ej43kS8rjX2Xh1uL2Fw6G2h4WwMzYnbCNTdPZkn4cbLMkvgkTItuNnnv4Un6dDswKz+ nwp8u81CAVwf//xZXmOOMPMGL4mrsO3zxg0SkwRGI6Mff6GL+OERm7Q7P+qkGLGt88nRNis wQvpYOLTulS3bf2OntnZg== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 212.227.15.18 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:91666 Archived-At: Christopher Schmidt 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