Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19
Linux console Colors And Other Trick's - Page 3
Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 38

Thread: Linux console Colors And Other Trick's

  1. #21
    Member
    Join Date
    Dec 2004
    Location
    Baltimore, MD
    Posts
    167

    Re: Linux console Colors And Other Trick's

    Wow! Sounds nice. I have a lot of really cool (at least I think so) ideas for my own little distro. Of course, as mentioned previously, I don't actually have time to create my own from scratch. This'll be the next best thing.

    A lot of my ideas center around making the distro more user-friendly and, as such, deal heavily with the window manager. One of my primary ideas is about the use of the desktop.

    I think the desktop should be context sensitive and super-smart. Users can configure the desktop to do certain things with certain files drag&dropped onto it. For instance:

    URL links from a browser can cause it to download that file, store the url in an easy to access "hot link" bar, or some other action.

    Images can cause it to open the image in a viewer, and editor, or place it in an image folder.

    Various selections of text will cause the desktop to parse the selection and determine the appropriate action:
    - If it's an address type selection, add it as an entry (or update an entry) in the address book.

    - Basic text will cause it to open a text editor with the selected text.


    Any item dragged to the desktop while the cntrl key is held down will be sent to the trash.

    I have fleshed it out more than this, but the basis of it is that any file will be processed using a set of defined actions/parameters. Users can add/edit these parameters at will. Maybe also add in Bayesian statistics to have the desktop get "smarter".

    I also have many other ideas but, again, they center around making the whole experience easier and faster for the user.


    The only thing I will miss from making my private distro, I think, is the name. When this thing really takes off, Comtux will be in the lime light.

  2. #22
    Advisor
    Join Date
    Apr 2004
    Location
    orlando
    Posts
    608
    Comtux do you have an iso of what is available so far? I could put some time into getting the Stabalizer started.

  3. #23
    Senior Member
    Join Date
    Apr 2004
    Location
    Atlanta GA
    Posts
    373

    Re: Linux console Colors And Other Trick's

    Quote Originally Posted by jro";p="4733
    Quote Originally Posted by ZennouRyuu";p="4682
    Here is a snap of my ever so complicated bash prompt:....
    Hey Zen, mind posting your PS1 env var? I am interested to see how you did it.
    Sure, but I would like to make a disclaimer, this is not my original work, I took someones brilliant Idea from the GEntoo forums and modified it to support ACPI battery reading and take out a few superfluous things that I didnt need.

    First I use the following script to create the prompt, This is done so you can actually use more complex bash scripting and have the ability to edit it all quickly without changing a million .bashrc files.

    Code:
    # SET THIS TO 0 if you are not using Gentoo Linux (http://www.gentoo.org)
    DIST_GENTOO=1
    batt=`/usr/bin/battery | cut -d " " -f 2`
    
    
    hostnam=$(hostname)
    unset temp
    
    function prompt_command
    {
    local EXIT_CODE=$?      # Getting last command exit code.
    TERMWIDTH=$(tput cols)  # Getting Term width.
    
    #awful way to get current emerge(if you have sandbox documentation email me :) )
    local C_EMERGE=`ps aux | grep sandbox | cut -d ']' -f 1 | cut -d '[' -f 2 | grep -v grep`
    
    
    #   n the term wide calculation. (length of your prompt PS1)
    #   Will be changed soon...
    usernam=$(whoami)
    
    local temp="$BLUEGREEN[ $usernam $BLUEGREEN]=[$GREY $hostnam $BLUEGREEN]$BLUEGREEN=[$GREY bg :$WHITE $JOBS $BLUEGREEN]=--$BLUEGREEN--=[$GREY $(date +%D) $(date +%T) $BLUEGREEN]"
    # Getting size of unused terminal space :) ==> for filling with $fill characters.
    local WHITE="\[\033[1;37m\]"
    local NO_COLOR="\[\033[0m\]"
    local RED="\[\033[1;31m\]"
    local BLUEGREEN="\[\033[0;36m\]"
    
    if [ ${#C_EMERGE} == 0 ]
    then
        C_DISK=$(df -h "$PWD" | grep / | awk '{print $4}')
        C_DISKPER=$(df -h "$PWD" | grep / | awk '{print $5}' | sed "s:%::")
    
        let fillsize=${TERMWIDTH}-${#temp}-${#C_DISK}-3
        if [ $C_DISKPER != "-" ]
            then
            if &#40;&#40; $C_DISKPER <= 65 &#41;&#41;
                then
                C_DISK=$BLUE_GREEN$C_DISK$NO_COLOR
            elif &#40;&#40; $C_DISKPER <= 85 &#41;&#41;
                then
                C_DISK=$WHITE$C_DISK$NO_COLOR
            else
                C_DISK=$RED$C_DISK$NO_COLOR
            fi
        else
            C_DISK=$WHITE"None"$NO_COLOR
            let fillsize=$&#123;TERMWIDTH&#125;-$&#123;#temp&#125;-7
        fi
    else
        let fillsize=$&#123;TERMWIDTH&#125;-$&#123;#temp&#125;-$&#123;#C_EMERGE&#125;-3
    fi
    
    if &#91; "$fillsize" -gt "0" &#93;
    then
            fill="                                              "
            # Just used for filling with this line when term wide calculation. Verify C_EMERGE !!!
            if &#91; $DIST_GENTOO != "1" &#93;
            then
                let fillsize=$&#123;TERMWIDTH&#125;-$&#123;#temp&#125;
                fill="$&#123;fill&#58;0&#58;$&#123;fillsize&#125;&#125;"  # non Gentoo distribution.
            else
                if &#91; $&#123;#C_EMERGE&#125; == 0 &#93;
                then
                    fill="$&#123;fill&#58;0&#58;$&#123;fillsize&#125;/2&#125; $C_DISK $&#123;fill&#58;0&#58;$&#123;fillsize&#125;/2&#125;" # DS
                else
                    fill="$&#123;fill&#58;0&#58;$&#123;fillsize&#125;/2&#125; $C_EMERGE $&#123;fill&#58;0&#58;$&#123;fillsize&#125;/2&#125;" # Gentoo
                fi
            fi
            newPWD="`echo $&#123;PWD&#125; | sed s&#58;$&#123;HOME&#125;&#58;~&#58;`"
    fi
    
    # prompt path size adaptor ... need to be changed...
    # doesn't work as expected now ...
    
    if &#91; "$fillsize" -lt "0" &#93;
    then
            fill=""
            # truncate PATH with "..."
            let cut=3-$&#123;fillsize&#125;
            newPWD="...$&#123;PWD&#58;$&#123;cut&#125;&#125;"
    fi
    
    # Calling the personnal prompt fct.
    lycos
    &#125;
    
    
    PROMPT_COMMAND=prompt_command
    
    
    function lycos
    &#123;
    # dirty ansi escape color codes... change to terminfo soon...
    local WHITE="\&#91;\033&#91;1;37m\&#93;"
    local NO_COLOR="\&#91;\033&#91;0m\&#93;"
    local BLUEGREEN="\&#91;\033&#91;0;36m\&#93;"
    local GREY="\&#91;\033&#91;0;37m\&#93;"
    local RED="\&#91;\033&#91;1;31m\&#93;"
    local PATH_COLOR=$NO_COLOR
    local APM_PATH="/bin/apm"
    local JOBS="$&#40;jobs | wc -l | awk '&#123; print $1 &#125;'&#41;"   # Getting current nb of background jobs.
    
    # Detecting superuser with visible color &#58;&#41;
    if &#91; $usernam != "root" &#93;
    then
        usernam="$GREY\u"
    else
        usernam="$RED\u"
    fi
    
    # Add a bold red number for exitcode if its nonzero
    if &#91; $EXIT_CODE -ne 0 &#93;
    then
        EXIT_STR="$RED$EXIT_CODE"
    else
        EXIT_STR="$WHITE$EXIT_CODE"
    fi
    
    if &#91; -f $APM_PATH &#93;
    then
       local POWER_APM="$BLUEGREEN&#91;$WHITE$&#40;apm | sed -e "s/.*&#58; \&#40;&#91;1-9&#93;&#91;0-9&#93;*\&#41;%/\1/" | tr -d " "&#41;$BLUEGREEN&#93;"       # Getting APM power status.
    else
        local POWER_APM=""
    fi
    
    # Directory color path.
    if &#91; -O "$PWD" &#93;
        then
        PATH_COLOR=$GREY #if owner.
    elif &#91; -w "$PWD" &#93;
        then
        PATH_COLOR=$BLUEGREEN #if write permission.
    else
        PATH_COLOR=$RED #if denied for write.
    fi
    
    # Prompt line... make your prompt here ... &#40;Need to be serialized.&#41;
    PS1="$BLUEGREEN&#91; $usernam $BLUEGREEN&#93;=&#91;$GREY $hostnam $BLUEGREEN&#93;$BLUEGREEN=&#91;$GREY bg &#58;$WHITE $JOBS $BLUEGREEN&#93;=-- $&#123;fill&#125;$BLUEGREEN--=&#91;$GREY $&#40;date +%D&#41; $&#40;date +%T&#41; $BLUEGREEN&#93;\n\
    $BLUEGREEN&#91;$GREY $PATH_COLOR$newPWD $BLUEGREEN&#93;-&#91; $RED$batt $BLUEGREEN&#93;&#58;$WHITE "
    
    PS2="$NO_COLOR>"
    PS3="$NO_COLOR>"
    PS4="$NO_COLOR>"
    &#125;
    Then I add the following line to my bashrc files

    Code:
    &#91; -f /path/to/prompt.bash &#93; && source /path/to/prompt.bash
    and there you have it.

  4. #24
    Senior Member comtux's Avatar
    Join Date
    Sep 2004
    Location
    Wilkes Barre Pa
    Posts
    342
    Sure maccorin let me finash the Lfs 6.0 build & the doc's
    for the installer and ill up load a copy of the iso some where right now the iso is like 25 megs and doesn't do much but sit there and look pretty ill try to have the base done in a day or 2 so that way it will install a base system and you can tear it a part.
    Buy the way question should i keep the base as 1 binary package or break them up into there own seperate packages i mean with the base you have no other option you have to install it so what's the point of haveing the base broke up into seperate packages?
    Wenn Sie Spaß meines Englisch mich Willensfuckingtötung Sie bilden.

  5. #25
    Advisor
    Join Date
    Apr 2004
    Location
    orlando
    Posts
    608
    Quote Originally Posted by comtux";p="4825
    Sure maccorin let me finash the Lfs 6.0 build & the doc's
    for the installer and ill up load a copy of the iso some where right now the iso is like 25 megs and doesn't do much but sit there and look pretty ill try to have the base done in a day or 2 so that way it will install a base system and you can tear it a part.
    Buy the way question should i keep the base as 1 binary package or break them up into there own seperate packages i mean with the base you have no other option you have to install it so what's the point of haveing the base broke up into seperate packages?
    i would break it up so updates are easier later on.

    I've also been thinking about the implementation of a system stabalizer, and have a few thoughts.

    So far the cleanest implementation that I have thought of would be a small kernel patch that hooks into do_coredump and logs fatal signals and some information to a special device, we could eventually provide ioctl's to change/setup what info get's logged. Then as things should be keep the real work in userspace, have a daemon that watches the device file and embeds a scripting engine of some sort, the user could provide callbacks for what to do upon certain signals. We would of course provide defaults.

    Any thoughts on that?

  6. #26
    Senior Member comtux's Avatar
    Join Date
    Sep 2004
    Location
    Wilkes Barre Pa
    Posts
    342
    Maccorin that sounds like what i had in mind but instead of a kernel patch i would have built a module that did the same thing.
    But then again you sound like you really know what your talking about my kernel
    experience is extremely limited.

    Pugio those are some very fresh ideas one's that i have not even considered id like to hear some more on how you would go about such thing's.

  7. #27
    Advisor
    Join Date
    Apr 2004
    Location
    orlando
    Posts
    608
    Quote Originally Posted by comtux";p="4847
    Maccorin that sounds like what i had in mind but instead of a kernel patch i would have built a module that did the same thing.
    But then again you sound like you really know what your talking about my kernel
    experience is extremely limited.

    Pugio those are some very fresh ideas one's that i have not even considered id like to hear some more on how you would go about such thing's.
    the main kernel-space functionality could be easily put into a module, but we need to hook into somewhere to be notified of the signals that mattered, and do_coredump seems to be the perfect place, but then again, there is a new subsystem in 2.6.10 for userspace programs to listen for events, i wonder what it would take to add the events we need to that... hmm.... /me reads some code tonight.

  8. #28
    Senior Member comtux's Avatar
    Join Date
    Sep 2004
    Location
    Wilkes Barre Pa
    Posts
    342
    Maccorin is tooooo coool let me know.
    I ran in to a problem with LFS 6.0 Turns out you can't compile glibc kernel 2.6 optimized with a host 2.4 kernel.
    I am upgradeing now and restarting the build.

  9. #29
    Senior Member comtux's Avatar
    Join Date
    Sep 2004
    Location
    Wilkes Barre Pa
    Posts
    342
    Ok maccorin i am on chapter 6.11 compileing Glibc-2.3.4
    the only problem as far as upgradeing packages i see is with GCC Glibc & Binutils everything should upgrade just fine when the time come's.
    Upgradeing GCC Glibc & Binutils might have to be made into some special type of packages then again i am not sure.
    Some have told me that i shouldn't have a problem as long
    as i upgrade like this Glibc-2.3.4 --> to Glibc-2.3.5 now from what i have heard upgradeing like this.
    Glibc-2.3.4 --> Glibc-2.4.0 will not work the same goes for GCC & Binutils.
    Everything so far is turning out really good.
    Oh i am useing kernel 2.6.8.1 as the default kernel
    for now.
    Wenn Sie Spaß meines Englisch mich Willensfuckingtötung Sie bilden.

  10. #30
    Advisor
    Join Date
    Apr 2004
    Location
    orlando
    Posts
    608
    Quote Originally Posted by comtux";p="4883
    Ok maccorin i am on chapter 6.11 compileing Glibc-2.3.4
    the only problem as far as upgradeing packages i see is with GCC Glibc & Binutils everything should upgrade just fine when the time come's.
    Upgradeing GCC Glibc & Binutils might have to be made into some special type of packages then again i am not sure.
    Some have told me that i shouldn't have a problem as long
    as i upgrade like this Glibc-2.3.4 --> to Glibc-2.3.5 now from what i have heard upgradeing like this.
    Glibc-2.3.4 --> Glibc-2.4.0 will not work the same goes for GCC & Binutils.
    Everything so far is turning out really good.
    Oh i am useing kernel 2.6.8.1 as the default kernel
    for now.
    hmmm... i know several people had issues with 2.6.8.1, any particular reason you chose this kernel?

    I would go with either 2.6.7 or 2.6.9 (2.6.10 isn't really tested enough yet)

Similar Threads

  1. New Colors
    By peter in forum Announcements and Suggestions
    Replies: 2
    Last Post: 10-02-2006, 02:58 AM
  2. Boring Colors
    By peter in forum Announcements and Suggestions
    Replies: 7
    Last Post: 02-14-2006, 05:26 PM
  3. Mac ssh colors & mouse
    By flashingcurser in forum Linux Distros
    Replies: 1
    Last Post: 03-29-2005, 03:27 AM
  4. Awsome trick with Mozilla
    By Blaqb0x in forum Linux - Software, Applications & Programming
    Replies: 1
    Last Post: 08-10-2002, 08:50 AM
  5. BASH colors
    By airhead in forum Linux - General Topics
    Replies: 4
    Last Post: 05-11-2002, 09:59 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •