Search This Blog

Powered By Blogger

Saturday, January 8, 2011

Surfing Troves: Enable X Shared Memory Extension Pixmaps

Surfing Troves: Enable X Shared Memory Extension Pixmaps: "Definitely not encouraged to use, sometimes this feature is needed for using certain applications what depends on this deprecated X window e..."

Thursday, January 6, 2011

Surfing Troves: How to get the screen resolution in Linux C (and m...

Surfing Troves: How to get the screen resolution in Linux C (and m...: "Linux C: get the screen resolution and window size Happened to necessitate the retrieval of information about the screen of the cano..."

Monday, January 3, 2011

Surfing Troves: Fix bugs for Buidling installation of G3D 7.01 in ...

Surfing Troves: Fix bugs for Buidling installation of G3D 7.01 in ...: "Today I am porting such and such a project which is dependent on G3D and for historical reasons this project could not work with other..."

Surfing Troves: A Funny Time Varying VIM color scheme switching

Surfing Troves: A Funny Time Varying VIM color scheme switching: "Vi/vim is really the most popular editor under Linux esp. for those advanced users or Linux fans, even though there are dozen of other fea..."

Make a time adaptive vim in Linux

Vi/vim is really the most popular editor under Linux esp. for those advanced users or Linux fans, even though there are dozen of other featured ones including visual editors and the most worthy of mentioning, Emacs for programming gurus.

Here I just got a whimsy yet actually a fortuitous idea, to make this editor of daily use to be adaptive with current local time periods such as morning, noon, evening and other phases of a day.

The snippet  meant to be placed in or tailed at the vim configuration file, as is mostly the /etc/vimrc or $HOME/vimrc, will make the vim editor apply different color scheme that is meaningfully in accordance with the time of period when vim is launched. Additionally, color schemes for other time of period than morning and evening will be changed with the weekday.


" # intelligent colorscheme switching
let weekday=system('date +%u')
let hour=system('date +%H')

" if the shell command gets any exception during execution, nothing will be 
" done on color scheme setting
if !v:shell_error


   " in other time slots than mornings and evenings, scheme to be applied depends 
   " on which the weekday it is today, beginning from 1 as Monday, through 6 as 
   " Saturday and Sunday numbered as 0
    if     1== weekday
        let coloration="elflord"
    elseif 2 == weekday
        let coloration="koehler"
    elseif 3 == weekday
        let coloration="slate"
    elseif 4 == weekday
        let coloration="zellner"
    elseif 5 == weekday
        let coloration="torte"
    elseif 6 == weekday
        let coloration="ron"
    else "Sundays
        let coloration="blue"
    endif 
 
    " exert the color scheme application
    execute "colorscheme ".coloration 
 
    " in mornings, alwasy using the "morning" scheme
    if hour >= 7 && hour <= 10
        let coloration="morning"
    " in evenings, alwasy using the "evening" scheme
    elseif hour >= 18 && hour <= 23
        let coloration="evening"
    endif
 
endif


Just give it a try, you may be intrigued with use of it afterwards like me!

-----------------------------------
other interesting links
-------------------------------------

Full range of vim color scheme implemented in a Google code project
http://vimcolorschemetest.googlecode.com/svn/html/index-c.html

A find-tweaked color scheme for Mac:
http://blog.toddwerth.com/entries/show/8

Sunday, January 2, 2011

Surfing Troves: Linux : Access network service in Single user mod...

Surfing Troves: Linux : Access network service in Single user mod...: "1. Enter the Level 1 - Single User Mode In the grub boot memu, select the entry for the OS you want to start up, press 'e' to edit : Just re..."

Surfing Troves: Fedora Linux : Always got wrong IP configured

Surfing Troves: Fedora Linux : Always got wrong IP configured: "while the network configuration in the ifcfg-eth0 is as follows: IPADDR=x.x.31.231 BROADCAST=x.255.255.255 NETWORK=x.x.31.0 NETMASK=255.255..."

Surfing Troves: How to restore or upgrade Fedora linux without los...

Surfing Troves: How to restore or upgrade Fedora linux without los...: "When you are inflicted with some faults of current Linux, the Fedora distribution, say, you might want to restore the OS kernel only witho..."

Surfing Troves: Restore Linux installation after installing Window...

Surfing Troves: Restore Linux installation after installing Window...: "By default Linux uses the grub Bootloader to manage OS booting with support of multiple OS, and this makes Linux, Fedora distribution say, r..."

Surfing Troves: uninterruptedly running program in the background ...

Surfing Troves: uninterruptedly running program in the background ...: "For instance, wanna copy a big file, more than 10G, say, from remote host to local machine by a shell like : scp -r user@hostname/i..."

Surfing Troves: Install Nvidia Driver (non Gefore series) in Fedor...

Surfing Troves: Install Nvidia Driver (non Gefore series) in Fedor...: "Intro: While here places a complete guide that is already great for novices in Fedora community at http://www.if-not-true-then-false.c..."