From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on sa.int.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DNS_FROM_OPENWHOIS, RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.2.5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=A4KqvazDzPQj4o6TN8F9d0Uhz0IVpLsE1wRfykFAHl8=; b=ai9W+cCP9AsBsjI1TzHRdI7H41ihZlfm/uG+HYomhpkHDzXftGKQ0Ctm3tRw+INKZt /Z85aPeUGnSZewkZ3eh7G6Lm07QwtumParckB2AI5O25iGMiMSUyRbzKkWdGOPyZvNnq nE+TM9lJbh1dCcnbRayF+3x68EZRewhZHF4m0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=udEpnLqiC+aCPjboORz5dZsCwbEeGw+CxXAgd/oZ3z22n9cowGdG/BQEtlT/FLt5TH XUR5QFDC7U0+JEhkS4UceZFKc/jTu2iRlMhSgUQI3MslzobTvDgKG+ZObsWFncZ7J8m0 2w78g88ys8lzL6vgUHYfGezcFCSORvIrh9lh0= MIME-Version: 1.0 Sender: dustin.kirkland@gmail.com In-Reply-To: References: Date: Mon, 28 Mar 2011 15:29:06 -0500 X-Google-Sender-Auth: wVhNVqX_UpqtCJBDgHjIRh9zANE Message-ID: From: Dustin Kirkland To: kbd@lists.altlinux.org Content-Type: multipart/mixed; boundary=bcaec51f986190829d049f90cbef X-Mailman-Approved-At: Mon, 28 Mar 2011 21:08:08 +0000 Cc: Michael Schutte Subject: [kbd] Feature Request: add the setvtrgb utility X-BeenThere: kbd@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: Linux console tools development discussion List-Id: Linux console tools development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2011 20:29:16 -0000 Archived-At: List-Archive: --bcaec51f986190829d049f90cbef Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Howdy! We're carrying a new feature in Ubuntu's kbd package, provided by a neat little utility called /sbin/setvtrgb. I recently became aware of a nifty little ioctl, ioctl(fd, PIO_CMAP, cmap), which is able to dynamically modify the console colors in all virtual terminals. Providing this utility gives distributions, as well as interested system administrators, a really convenient way to make the console's color scheme easier on the eyes, or higher contrast for the vision-impaired. See the included manpage for detailed operation. As for values, we are using the following values selected by the Ubuntu Design Team, which are within the current Ubuntu color scheme: /etc/vtrgb: 1,222,57,255,0,118,44,204,128,255,0,255,0,255,0,255 1,56,181,199,111,38,181,204,128,0,255,255,0,0,255,255 1,43,74,6,184,113,233,204,128,0,0,0,255,255,255,255 Alternatively, the stock, default Linux kernel's VGA values are: 0,170,0,170,0,170,0,170,85,255,85,255,85,255,85,255 0,0,170,85,0,0,170,170,85,85,255,255,85,85,255,255 0,0,0,0,170,170,170,170,85,85,85,85,255,255,255,255 You can place these values, or a modified version of them in a file, and then run "sudo setvtrgb [FILE]" to test this. =A0The three lines of configuration represent 16 red values, 16 green values, and 16 blue values. =A0The format matches those exported by the kernel in sysfs. See: =A0$ cat /sys/module/vt/parameters/default_{red,grn,blu} I'm attaching a patch. =A0You may choose to put something like the following in a changelog entry if you apply my patch: [ Dustin Kirkland ] =A0* src/setvtrgb.c, man/man8/setvtrgb.8, COPYING, debian/rules, =A0 =A0debian/copyright: LP: #730672 =A0 =A0- Add a 'setvtrgb' utility to configure vt/console colors =A0 =A0- add to udeb (so that this can improve installer usability) =A0 =A0- add to /sbin, run by root =A0 =A0- update copyright statement -- :-Dustin Dustin Kirkland Ubuntu Core Developer --bcaec51f986190829d049f90cbef Content-Type: text/x-patch; charset=UTF-8; name="kbd-setvtrgb.patch" Content-Disposition: attachment; filename="kbd-setvtrgb.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gll6qak90 ZGlmZiAtdSBrYmQtMS4xNS9kZWJpYW4vY29weXJpZ2h0IGtiZC0xLjE1L2RlYmlhbi9jb3B5cmln aHQKLS0tIGtiZC0xLjE1L2RlYmlhbi9jb3B5cmlnaHQKKysrIGtiZC0xLjE1L2RlYmlhbi9jb3B5 cmlnaHQKQEAgLTYzLDAgKzY0LDYgQEAKKworRmlsZXM6IHNldHZ0cmdiLmMKK0NvcHlyaWdodCDC qSAyMDExIENhbm9uaWNhbCBMdGQuCitMaWNlbnNlOiBHUEwtMisKK0F1dGhvcnM6IFNldGggRm9y c2hlZSA8c2V0aC5mb3JzaGVlQGNhbm9uaWNhbC5jb20+CisgICAgICAgICBEdXN0aW4gS2lya2xh bmQgPGtpcmtsYW5kQGNhbm9uaWNhbC5jb20+CmRpZmYgLXUga2JkLTEuMTUvZGViaWFuL3J1bGVz IGtiZC0xLjE1L2RlYmlhbi9ydWxlcwotLS0ga2JkLTEuMTUvZGViaWFuL3J1bGVzCisrKyBrYmQt MS4xNS9kZWJpYW4vcnVsZXMKQEAgLTQsMTIgKzQsMTIgQEAKIEtCRCA9ICQoVE9QRElSKS9kZWJp YW4va2JkCiBLQkRfVURFQiA9ICQoVE9QRElSKS9kZWJpYW4va2JkLXVkZWIKIAotVURFQl9CSU5B UklFUyA9IGxvYWRrZXlzIGtiZF9tb2RlIHNldGZvbnQKK1VERUJfQklOQVJJRVMgPSBsb2Fka2V5 cyBrYmRfbW9kZSBzZXRmb250IHNldHZ0cmdiCiBFWFRSQV9CSU5BUklFUyA9IHNjcmVlbmR1bXAg c2V0bG9nY29ucyBzZXR2ZXNhYmxhbmsKIENPTlRSSUJfQklOQVJJRVMgPSBjb2RlcGFnZSBzcGxp dGZvbnQgdmNzdGltZQogCiBNT1ZFX1RPX0JJTiA9IGtiZF9tb2RlIHNldGZvbnQg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