Colors in terminal

Can anyone tell me how to get the terminal to actually support colors for things like doing an ls -al or when vi-ing files. Even when I select colors in vi it doesn't seem to actually display them.
Thanks,
glenn

Go to Terminal's Preferences dialog (File->Prefernces) and set the "Declare terminal type ($TERM) as: " to either 'xterm-color' or 'ansi'. Also, make sure that for getting color with ls, you have defined the CLICOLOR env variable. Just put the following in your ~/.profile:
export CLICOLOR=
Also, for getting color in vi, make sure syntax coloring is on. You can create ~/.vimrc (if you dont already have one) and append the following to it:
syntax on
Hope this helps.
Message was edited by: greenwrangler

Similar Messages

  • Emacs in the same color in terminal than in window

    Hello,
    When launching emacs in terminal mode, I'd like to have it in the same color as the ones I specified in ~/.emacs or at least not as ugly as that
    (left in window, right in gnome-terminal).
    The colors are from the color-theme-tango
    Any idea ?
    Thanks
    Edit: with
    export TERM=xterm-256color
    in the ~/.bashrc, I've something better but not perfect. I guess I can live with that but if you know how to fix it...
    Last edited by martvefun (2011-06-01 08:18:38)

    Yes I think also the problem is that I use more than the 256 colors in terminal
    With solarized is also nice looking but also not the same (in the mode "light", it's really hard to read in terminal)
    Last edited by martvefun (2011-06-05 11:54:35)

  • How can I permanently change a text color in Terminal.app?

    According to Terminal's help file:
    "To change the color of the Terminal window or text, drag a color from the Colors window to the Terminal window. If you drop the color on an empty part of the window, the window background changes to the color. If you drop it on text, the text changes to the new color."
    This works like a charm; I drag a lighter blue color onto the dark blue that some distributions of linux display by default when showing a directory in ls and the color changes for the rest of my terminal session in any ls.
    The question is how do I make this change permanent? I tried saving my terminal session into a .term file and opening it, but this change wasn't saved. Everything else was, of course, but not this one.
    Any ideas how to make this sort of change permanent?

    Sorry, but that doesn't address the actual question. I probably was unclear when I asked, so it's my own fault.
    I am not trying to change the color of the cursor, normal text, bold text, or selection. I am attempting to change which color blue shows up when an ansi code for blue is displayed. This can be done by opening the Show Colors interface from the Font menu then dragging the new color to the existing one (so if I have text displayed in Blue that reads "foobar" and I drag aqua onto that text, all Blue text now appears aqua in that Terminal session). The question is how do I make this change permanent?

  • Customizing ANSI Colors in Terminal.app

    Has anyone figured out a way to customize the ANSI colors in the Leopard Terminal? The TCColorArray plist setting seems to be ignored.
    I've even gone so far as to copy the Terminal.app from Tiger onto Leopard. Still no go, even Tiger's terminal is ignoring TCColorArray when running on Leopard (which I find very strange).
    Could this be a termcap issue?

    You might want to ask in the Unix forum:
    http://discussions.apple.com/forum.jspa?forumID=735

  • Color in Terminal when programing Python

    Hi,
    I am programing Python in the terminal on my OS X 10.5.3 and i dont have any colors in the terminal.
    I want my terminal to have colors when i am programing, different colors for class and objects etc.
    Like this: http://vim-taglist.sourceforge.net/images/taglist_python.gif
    i am using the Terminal now in OS X. Do i need to edit my .bash_profile to get this working or dose anyone got some tips for me?
    Have a great one.
    /P

    You either learn how to use vim or try a GUI text editor with Python support such as TextMate or TextWrangler.

  • How to permanently save the color settings in terminal.app

    Hi,
    I have configured the "ls" command in the terminal.app to give colored outputs. However, I realised that for some reason the color-set used is designed for a light-colored background. When I use "white on black", the default blue color of the directories is almost invisible.
    Of course, I can change this to another color, but this problem is true for all "blue" fonts, so for example, the default color for comments in vim is also blue and thus unreadable with black background.
    This is not a problem when I use the xterm in X11. The color set there is much lighter and is perfect for a black backgound.
    By drag-and-drop method (drag the chosen color on top of the directory texts in terminal), I am able to alter the blue color to a much lighter version. This apparently changes all fonts that is blue (this includes for example vim comments), and is exactly what I wanted. But I cannot figure out a way to save this as default. Clicking "Save setting as default" button in the inspector does nothing, the new terminal window still gives you this dark blue.
    Anyone know how do I do this?
    Cheers,
    Lianheng

    Hi Nils,
    Thanks for the replies.
    I think I see what the problem is: basically the colors in the terminal are darker than that of the xterm in X11. This can be clearly seen from the vim. May be this is to do with the fact that apple terminal.app has a "better" color support?
    I quite like the default LSCOLORS settings, which is:
    LSCOLORS=exfxcxdxcxegedabagacad
    The color settings in X11 is just perfect for me at the moment. It would be so much nicer if I can make the color scheme in terminal.app look like that of the X11. If say, I change LSCOLORS to
    LSCOLORS=gxfxcxdxcxegedabagacad
    and change the color schemes in vim to a lighter theme, but this will effect the colors in X11 too, which is perfect now. Cyan will look too light in X11.
    At the first I thought by drag and dropping the colors into terminal it will alter its color map. So my question was actually how can one (if it is possible) change the color map of the terminal.app, so that it inteprets the ANSI "blue" slightly differently.
    By the way, the way that you can see all colors in vim is really neat! Thanks for that tip.
    Cheers,
    Lianheng

  • RGB values of current terminal color settings?

    The colors displayed for different ANSI escape codes are configurable via .Xdefaults or directly on the command line via other ANSI escapes.
    Is there any way to dump the current values from a terminal? For example, given the ANSI escape code "\033[31m", I would like to know the current RGB values used to display it.
    Obviously this will depend on the terminal (e.g. urxvt can have different settings from xterm), but I'm hoping that there is some obscure tool to do this.

    Coincidentally, I recently wrote a script to do exactly this: query all the color values from a terminal emulator and show them in a nice table. I was planning to make a thread for this, but this thread is perfect.  In my opinion, the strategy of querying colors from the terminal itself is superior (when it is supported by the terminal) to mucking around with .Xresources, .Xdefaults, or "xrdb --query", which only work in pretty limited situations. The drawbacks of my approach are: (1) it can be challenging to make the same code work on different terminal emulators, and (2) you have to use it from the terminal you want to query, and not from within a screen or tmux session. (I think there may be partial workarounds for (2), but I haven't implemented them.) I've tested my code on a number of terminals, and the upshot is that xterm and urxvt are supported flawlessly, and VTE-based terminals like gnome-terminal and XFCE's "Terminal" are almost fully supported. (I wasn't able to query the default foreground and background colors, but everything else seems to work.) Most other X terminals don't seem to support this method of querying color values.
    Here's an example of what the script produces:
    Obviously, that's a heavily formatted table, but I think the code has enough comments that you can take what you need from it. It works under python 3 or python 2.7.
    Edit: This version is superseded by the one in post #27, which is structured better. I'm leaving this here since some of the future replies refer to it.
    #!/usr/bin/python
    This is a Python script to show off your terminal ANSI colors (or more
    colors, if your terminal has them). It works on both Python 2.7 and
    Python 3.
    This script must be run from the terminal whose colors you want to
    showcase. Not all terminal types are supported (see below). At the
    very minimum, 16-color support is required.
    Fully supported terminals:
    xterm
    urxvt
    For these terminals, this script can show a color table with correct RGB
    values for each color. It queries the RGB values from the terminal
    itself, so it works even if you change the colors after starting the
    terminal.
    Mostly supported terminals: pretty much all VTE-based terminals. This
    includes:
    vte
    Terminal (XFCE)
    gnome-terminal
    terminator
    tilda
    and many more. These are on "mostly" status because I don't know how to
    query their foreground and background colors. Everything else works,
    though, albeit with noticeable slowness (which may be beyond this
    script's control).
    Somewhat supported terminals: pretty much all other X-client terminals
    I've tried. These include:
    konsole (KDE)
    terminology (Enlightenment)
    Eterm (Enlightenment)
    (etc.)
    For these terminals, the script can output a color table just fine, but
    without RGB values.
    Unsupported terminals:
    ajaxterm
    Linux virtual console (i.e., basic TTY without X-windows)
    Warning: do not run this script on the Linux virtual console unless you
    want a garbled TTY! That said, you can still type `tput reset<Enter>'
    afterward to get back to a usable console. :-) The situation with
    ajaxterm is similar, but not as bad.
    If a terminal isn't mentioned here, I probably haven't tried it. Attempt
    at your own risk!
    Note regarding screen/tmux: this script can theoretically be run from a
    screen or tmux session, but you will not get any RGB values in the
    output (indeed, a screen session can be opened on multiple terminals
    simultaneously, so there typically isn't a well defined color value for
    a given index). However, it's interesting to observe that screen and
    tmux emulate a 256 color terminal independently of the terminal(s)
    to which they are attached, which is very apparent if you run the script
    with 256-color output on a screen session attached to a terminal with 8-
    or 16-color terminfo (or with $TERM set to such).
    This code is licensed under the terms of the GNU General Public License:
    http://www.gnu.org/licenses/gpl-3.0.html
    and with absolutely no warranty. All use is strictly at your own risk.
    from sys import stdin, stdout, stderr
    import re
    import select
    import termios
    from collections import defaultdict
    from argparse import (ArgumentParser, ArgumentError)
    # Operating system command
    osc = "\033]"
    # String terminator
    # ("\033\\" is another option, but "\007" seems to be understood by
    # more terminals. Terminology, for example, doesn't seem to like
    # "\033\\".)
    st = "\007"
    # Control sequence introducer
    csi = "\033["
    # ANSI SGR0
    reset = csi + 'm'
    # Errors that may be raised by rgb_query
    num_errors = 0
    class InvalidResponseError(Exception):
    The terminal's response couldn't be parsed.
    def __init__(self, q, r):
    global num_errors
    num_errors += 1
    Exception.__init__(self, "Couldn't parse response " + repr(r) +
    " to query " + repr(q))
    class NoResponseError(Exception):
    The terminal didn't respond, or we were too impatient.
    def __init__(self, q):
    global num_errors
    num_errors += 1
    Exception.__init__(self, "Timeout on query " + repr(q))
    # Wrappers for xterm & urxvt operating system controls.
    # These codes are all common to xterm and urxvt. Their responses aren't
    # always in the same format (xterm generally being more consistent), but
    # the regular expression used to parse the responses is general enough
    # to work for both.
    # Note: none of these functions is remotely thread-safe.
    def get_fg(timeout):
    Get the terminal's foreground (text) color as a 6-digit
    hexadecimal string.
    return rgb_query([10], timeout)
    def get_bg(timeout):
    Get the terminal's background color as a 6-digit hexadecimal
    string.
    return rgb_query([11], timeout)
    def get_color(a, timeout):
    Get color a as a 6-digit hexadecimal string.
    return rgb_query([4, a], timeout)
    def test_fg(timeout):
    Return True if the terminal responds to the "get foreground" query
    within the time limit and False otherwise.
    return test_rgb_query([10], timeout)
    def test_bg(timeout):
    Return True if the terminal responds to the "get background" query
    within the time limit and False otherwise.
    return test_rgb_query([11], timeout)
    def test_color(timeout):
    Return True if the terminal responds to the "get color 0" query
    within the time limit and False otherwise.
    return test_rgb_query([4, 0], timeout)
    def test_rgb_query(q, timeout):
    Determine if the terminal supports query q.
    Arguments: `q' and `timeout' have the same interpretation as in
    rgb_query().
    Return: True if the terminal gives a valid response within the
    time limit and False otherwise.
    This function will not raise InvalidResponseError or
    NoResponseError, but any other errors raised by rgb_query will
    be propagated.
    try:
    rgb_query(q, timeout)
    return True
    except (InvalidResponseError, NoResponseError):
    return False
    # String to use for color values that couldn't be determined
    rgb_placeholder = '??????'
    # This is what we expect the terminal's response to a query for a color
    # to look like. If we didn't care about urxvt, we could get away with a
    # simpler implementation here, since xterm and vte seem to give pretty
    # consistent and systematic responses. But I actually use urxvt most of
    # the time, so....
    ndec = "[0-9]+"
    nhex = "[0-9a-fA-F]+"
    crgb = ("\033\\]({ndec};)+rgba?:" +
    "({nhex})/({nhex})/({nhex})(/({nhex}))?").format(**vars())
    re_response = re.compile(crgb)
    # The problem I'm attempting to work around with this complicated
    # implementation is that if you supply a terminal with a query that it
    # does not recognize or does not have a good response to, it will simply
    # not respond *at all* rather than signaling the error in any way.
    # Moreover, there is a large variation in how long terminals take to
    # respond to valid queries, so it's difficult to know whether the
    # terminal has decided not to respond at all or it needs more time.
    # This is why rgb_query has a user-settable timeout.
    P = select.poll()
    P.register(stdin.fileno(), select.POLLIN)
    def flush_input():
    Discard any input that can be read at this moment.
    repeat = True
    while repeat:
    evs = P.poll(0)
    if len(evs) > 0:
    stdin.read()
    repeat = True
    else:
    repeat = False
    def rgb_query(q, timeout=-1):
    Query a color-valued terminal parameter.
    Arguments:
    q: The query code as a sequence of nonnegative integers, i.e.,
    [q0, q1, ...] if the escape sequence in pseudo-Python is
    "\033]{q0};{q1};...;?\007"
    timeout: how long to wait for a response. (negative means
    wait indefinitely if necessary)
    Return: the color value as a 6-digit hexadecimal string.
    Errors:
    NoResponseError will be raised if the query times out.
    InvalidResponseError will be raised if the terminal's
    response can't be parsed.
    See
    http://invisible-island.net/xterm/ctlseqs/ctlseqs.html
    ("Operating System Controls") to see the various queries
    supported by xterm. Urxvt supports some, but not all, of them,
    and has a number of its own (see man -s7 urxvt).
    Warning: before calling this function, make sure the terminal is
    in noncanonical, non-blocking mode.
    query = osc + ';'.join([str(k) for k in q]) + ';?' + st
    flush_input()
    stdout.write(query)
    stdout.flush()
    # This is addmittedly flawed, since it assumes the entire response
    # will appear in one shot. It seems to work in practice, though.
    evs = P.poll(timeout)
    if len(evs) == 0:
    raise NoResponseError(query)
    r = stdin.read()
    m = re_response.search(r)
    if not m:
    raise InvalidResponseError(query, r)
    # (possibly overkill, since I've never seen anything but 4-digit RGB
    # components in responses from terminals, in which case `nd' is 4
    # and `u' is 0xffff, and the following can be simplified as well
    # (and parse_component can be eliminated))
    nd = len(m.group(2))
    u = int('f'*nd, 16)
    # An "rgba"-type reply (for urxvt) is apparently actually
    # rgba:{alpha}/{alpha * red}/{alpha * green}/{alpha * blue}
    # I opt to extract the actual RGB values by eliminating alpha. (In
    # other words, the alpha value is discarded completely in the
    # reported color value, which is a compromise I make in order to get
    # an intuitive and compact output.)
    if m.group(5):
    # There is an alpha component
    alpha = float(int(m.group(2), 16))/u
    idx = [3, 4, 6]
    else:
    # There is no alpha component
    alpha = 1.0
    idx = [2, 3, 4]
    c_fmt = '%0' + ('%d' % nd) + 'x'
    components = [int(m.group(i), 16) for i in idx]
    t = tuple(parse_component(c_fmt % (c/alpha)) for c in components)
    return "%02X%02X%02X" % t
    def parse_component(s):
    Take a string representation of a hexadecimal integer and transorm
    the two most significant digits into an actual integer (or double
    the string if it has only one character).
    n = len(s)
    if n == 1:
    s += s
    elif n > 2:
    s = s[:2]
    return int(s, 16)
    def test_num_colors(timeout):
    Attempt to determine the number of colors we are able to query from
    the terminal. timeout is measured in milliseconds and has the same
    interpretation as in rgb_query. A larger timeout is safer but will
    cause this function to take proportionally more time.
    if not test_color(timeout):
    return 0
    a = 0
    b = 1
    while test_rgb_query([4, b], timeout):
    a = b
    b += b
    while b - a > 1:
    c = (a + b)>>1
    if test_rgb_query([4, c], timeout):
    a = c
    else:
    b = c
    return b
    class ColorDisplay(object):
    Class for producing a colored display of terminal RGB values.
    def __init__(self, timeout=100, color_level=3, do_query=True):
    timeout: same interpretation as in rgb_query. A larger timeout
    will be used a small number of times to test the
    capabilities of the terminal.
    color_level: how much color should be in the output. Use 0 to
    suppress all color and 3 or greater for maximum coloredness.
    do_query: whether to attempt to query RGB values from the
    terminal or just use placeholders everywhere
    self.timeout=timeout
    self.color_level=color_level
    # try getting the rgb value for color 0 to decide whether to
    # bother trying to query any more colors.
    self.do_query = do_query and test_color(self.timeout*5)
    def none_factory():
    return None
    # colors for highlighting
    self.hi = defaultdict(none_factory)
    self.hi['['] = 10
    self.hi[']'] = 10
    self.hi['+'] = 9
    self.hi['/'] = 9
    for c in '0123456789ABCDEF':
    self.hi[c] = 12
    def show_ansi(self):
    Show the 16 ANSI colors (colors 0-15).
    color_order = [0, 1, 3, 2, 6, 4, 5, 7]
    names = [' Black ', ' Red ', ' Green ', ' Yellow ',
    ' Blue ', ' Magenta', ' Cyan ', ' White ']
    stdout.write(self.fgcolor('15', 3))
    for k in range(8):
    a = color_order[k]
    stdout.write(names[a])
    stdout.write('\n')
    stdout.write(self.fgcolor(None, 3))
    c = None
    for k in range(8):
    a = color_order[k]
    c = self.hiprint(' [%X/%X] ' % (a, 8 + a), c)
    stdout.write('\n')
    self.show_color_table([0,8], color_order)
    def show_color_cube(self, n):
    Show the "RGB cube" (xterm colors 16-231 (256-color) or 16-79
    (88-color)). The cube has sides of length 6 or 4 (for 256-color
    or 88-color, respectively).
    base = {256:6, 88:4}[n]
    c = None
    c = self.hiprint('[ + ] ', c)
    for w in range(base):
    c = self.hiprint('[%X] ' % w, c)
    stdout.write('\n\n' + self.fgcolor(None, 3))
    for u in range(base):
    for v in range(base):
    stdout.write(' '*v)
    x = (u*base + v)*base
    self.hiprint(' [%02X] ' % (16 + x))
    for w in range(base):
    self.show_color(x + w + 16)
    stdout.write('\n')
    stdout.write('\n\n')
    def show_grayscale_ramp(self, end):
    Show the "grayscale ramp" (xterm colors 232-255 (256-color) or
    80-87 (88-color)).
    start = {256:232, 88:80}[end]
    n = end - start
    vals = [self.get_color(a) for a in range(start, end)]
    #stdout.write(reset)
    c = None
    c = self.hiprint('[ ', c)
    for v in range(n):
    c = self.hiprint('%02X ' % (start + v), c)
    c = self.hiprint(']\n', c)
    stdout.write('\n ' + self.fgcolor(None, 3))
    for v in range(n):
    stdout.write(' ' + self.block(start + v, 2))
    stdout.write('\n ')
    for u in range(3):
    for v in range(n):
    stdout.write(' ')
    stdout.write(self.fgcolor(start + v, 2))
    stdout.write(vals[v][2*u : 2*(u + 1)])
    stdout.write(self.fgcolor(None, 2))
    stdout.write('\n ')
    stdout.write('\n')
    def show_colors(self, n):
    Make a table showing colors 0 through n-1.
    self.show_color_table(range(0,n,8), range(8), n, True)
    def show_color_table(self, rows, cols, stop=-1, label=False):
    Make a color table with all possible color indices of the form
    rows[k] + cols[j] that are less than `stop' (if `stop' is not
    negative). If label is True, then print row and column labels.
    if label:
    self.hiprint('[ + ]')
    stdout.write(self.fgcolor(None, 3))
    for a in cols:
    stdout.write(' ' + self.octal(a) + ' ')
    stdout.write('\n')
    if label:
    stdout.write(' ')
    stdout.write('\n')
    for b in rows:
    if label:
    stdout.write(self.octal(b) + ' ')
    for a in cols:
    c = a + b
    if stop < 0 or c < stop:
    self.show_color(b + a)
    else:
    stdout.write(' ')
    stdout.write('\n')
    stdout.write('\n')
    def show_color(self, a):
    Make a pretty display of color number `a', showing a block of
    that color followed by the 6-character hexadecimal code for the
    color.
    stdout.write(' ' + self.block(a) + ' ')
    stdout.write(self.fgcolor(a, 2) + (self.get_color(a)))
    stdout.write(self.fgcolor(None, 2))
    def hiprint(self, s, last_color=-1):
    Print s to stdout, highlighting digits, brackets, etc. if the
    color level allows it.
    Arguments:
    s: the string to print.
    last_color: the current terminal foreground color. This
    should be `None' if no color is set, or the current
    color index, or something else (like a negative integer)
    if the color isn't known. (The last option is always
    safe and will force this function to do the right
    thing.)
    Return: the current foreground color, which can be passed as
    last_color to the next call if the color isn't changed in
    between.
    for c in s:
    if c == ' ':
    color = last_color
    else:
    color = self.hi[c]
    if color != last_color:
    stdout.write(self.fgcolor(color, 3))
    stdout.write(c)
    last_color = color
    return last_color
    def octal(self, x):
    Return a base-8 string for the integer x, highlighted if the
    color level allows it.
    return self.fgcolor(self.hi['+'], 3) + '0' + \
    self.fgcolor(self.hi['0'], 3) + ('%03o' % x)
    def block(self, c, n=1):
    Return a string that prints as a block of color `c' and size `n'.
    return self.bgcolor(c, 1) + ' '*n + self.bgcolor(None, 1)
    # Changing the foreground and background colors.
    # While the 38;5 and 48;5 SGR codes are less portable than the usual
    # 30-37 and 40-47, these codes seem to be fairly widely implemented (on
    # X-windows terminals, screen, and tmux) and support the whole color
    # range, as opposed to just colors 0-8. They also make it very easy to
    # set the background to a given color without needing to mess around
    # with bold or reverse video (which are hardly portable themselves).
    # This is useful even for the 16 ANSI colors.
    def fgcolor(self, a=None, level=-1):
    Return a string designed to set the foreground color to `a' when
    printed to the terminal. None means default.
    if self.color_level >= level:
    if a is None:
    return csi + '39m'
    else:
    return csi + '38;5;' + str(a) + 'm'
    else:
    return ''
    def bgcolor(self, a=None, level=-1):
    Return a string designed to set the background color to `a' when
    printed to the terminal. None means default.
    if self.color_level >= level:
    if a is None:
    return csi + '49m'
    else:
    return csi + '48;5;' + str(a) + 'm'
    else:
    return ''
    def get_color(self, a):
    if self.do_query:
    try:
    return get_color(a, timeout=self.timeout)
    except (InvalidResponseError, NoResponseError):
    return rgb_placeholder
    else:
    return rgb_placeholder
    # Command-line arguments
    timeout_dft = 200
    parser = ArgumentParser(
    description="Python script to show off terminal colors.",
    epilog="Run this script from the terminal whose colors " +
    "you want to showcase. " +
    "For a brief synopsis of which terminal types are " +
    "supported, see the top of the source code.")
    mode_group = parser.add_mutually_exclusive_group()
    p_choices = [16, 88, 256]
    arg_p = mode_group.add_argument(
    '-p', '--pretty',
    action='store_true', default=False,
    help="show colors 0 through N-1 in a pretty format. " +
    ("N must belong to %r. " % p_choices) +
    "If N > 16, it should be the actual number of colors " +
    "supported by the terminal, or the output will almost " +
    "certainly not be pretty.")
    mode_group.add_argument(
    '-f', '--flat',
    action='store_true', default=False,
    help="show a simple table with colors 0 through N-1. ")
    parser.add_argument(
    'n', nargs='?', metavar='N',
    type=int, default=16,
    help="number of colors to show. " +
    "Unless you explicitly supply -p/--pretty or -f/--flat, " +
    "--pretty is used if possible and --flat is used " +
    "otherwise. " +
    "N defaults to 16, showing the ANSI colors 0-15. " +
    "If N is 0, the script will attempt to determine the " +
    "maximum number of colors automatically " +
    "(which may be slow).")
    parser.add_argument(
    '--no-fgbg',
    action='store_false', dest='fgbg', default=True,
    help="suppress display of foreground/background colors.")
    parser.add_argument(
    '--no-query',
    action='store_false', dest='do_query', default=True,
    help="don't try to query any RGB values from the terminal " +
    "and just use placeholders.")
    parser.add_argument(
    '-t', '--timeout', metavar='T',
    type=int, default=timeout_dft,
    help="how long to wait for the terminal to "
    "respond to a query, in milliseconds " +
    "[default: {0}]. ".format(timeout_dft) +
    "If your output has '?' characters " +
    "instead of RGB values " +
    "or junk printed after the script runs, " +
    "increasing this value may or may not " +
    "help, depending on the terminal. " +
    "A negative T will behave like infinity.")
    parser.add_argument(
    '-l', '--level', metavar='L',
    type=int, default=3,
    help="choose how much color to use in the output. " +
    "(0 = no color; 3 = most color [default])")
    if __name__ == '__main__':
    args = parser.parse_args()
    assert not (args.pretty and args.flat)
    if args.pretty:
    if args.n not in p_choices:
    raise ArgumentError(
    arg_p,
    "N must belong to %r" % p_choices)
    tc_save = None
    try:
    tc_save = termios.tcgetattr(stdout.fileno())
    tc = termios.tcgetattr(stdout.fileno())
    # Don't echo the terminal's responses
    tc[3] &= ~termios.ECHO
    # Noncanonical mode (i.e., disable buffering on the terminal
    # level)
    tc[3] &= ~termios.ICANON
    # Make input non-blocking
    tc[6][termios.VMIN] = 0
    tc[6][termios.VTIME] = 0
    termios.tcsetattr(stdout.fileno(), termios.TCSANOW, tc)
    if args.n == 0:
    args.n = test_num_colors(args.timeout)
    # We are guaranteed to have failed some queries now, but
    # that isn't meaningful.
    num_errors = 0
    if not (args.pretty or args.flat):
    if args.n in p_choices:
    args.pretty = True
    else:
    args.flat = True
    if args.level >= 1:
    stdout.write(reset)
    if args.fgbg:
    if args.do_query:
    try:
    bg = get_bg(timeout=args.timeout)
    except (InvalidResponseError, NoResponseError):
    bg = rgb_placeholder
    try:
    fg = get_fg(timeout=args.timeout)
    except (InvalidResponseError, NoResponseError):
    fg = rgb_placeholder
    else:
    bg = rgb_placeholder
    fg = rgb_placeholder
    stdout.write("\n Background: %s\n" % bg)
    stdout.write(" Foreground: %s\n\n" % fg)
    C = ColorDisplay(args.timeout, args.level, args.do_query)
    if args.pretty:
    assert args.n in p_choices
    stdout.write('\n ANSI colors:\n\n')
    C.show_ansi()
    if args.n > 16:
    stdout.write('\n RGB cube:\n\n')
    C.show_color_cube(args.n)
    stdout.write(' Grayscale ramp:\n\n')
    C.show_grayscale_ramp(args.n)
    else:
    C.show_colors(args.n)
    if num_errors > 0:
    stderr.write("Warning: not all queries succeeded\n" +
    "Warning: (output contains " +
    "placeholders and may be inaccurate)\n")
    finally:
    if args.level >= 1:
    stdout.write(reset)
    flush_input()
    if tc_save != None:
    termios.tcsetattr(stdout.fileno(),
    termios.TCSANOW, tc_save)
    Run it as
    python showcolors.py -h
    to get an overview of the functionality.
    TL;DR: you can echo a string like "\033]4;13;?\007" to an xterm, and it will output the RGB value of color #13 to itself in the form "\033]4;13;rgb:rrrr/gggg/bbbb\007", which you can then read and parse. To try it out:
    $ echo -en "\033]4;13;?\007"
    There are some subtleties if you want this to work on other terminals like urxvt; for that you can experiment yourself or read the code. 
    Further reading: http://invisible-island.net/xterm/ctlseqs/ctlseqs.html (heading "Operating System Controls").
    Xyne, regarding determining the number of colors: I don't know how to do that completely reliably. You can try simply
    tput colors
    but this relies on the value of $TERM and its terminfo and thus may be unreliable. A kludgy but workable way to do this using the "rgb_query" function in my script is to query color values using binary search to find the highest color value the terminal will allow you to query. The main problem with this is that if you query an invalid color index, then the terminal just won't respond at all, and if you query a valid index, it will respond but after a somewhat unpredictable delay, so it's hard to know for sure which one is the case. Like I said, it's kludgy but workable.
    Edit: I went ahead and added that functionality to my script. Try running it as
    python showcolors.py 0
    or look at the function "test_num_colors".
    Last edited by Lux Perpetua (2012-10-22 11:18:21)

  • ICal highlight color too dim

    I can barely see the pale color of the iCal cell for the date.  I remember this being a problem for a long time with iCal.  You can't see the highlight color in the day cell.  I have the same problem with the search or find.  The highlight color is so pale it is hard to find in a page of text.
    I vaguely remember there was a way to darken that color in terminal, but I don't remember any details.
    Can someone help fix this.  This is a bug that Apple seems to ignore year after year.
    Thanks

    I have a similar problem with iCal, and always have. It uses light grey on a white background for days and hours. Can't see the days well, but especially the hours, can't discriminate those at all.  Am not sure why more people haven't complained, or why this hasn't been fixed before this.
    Maybe it doesn't show up on iMac's which have their own monitors built in. I use a MacMini, with a Samsung monitor. Have played with the Samsung monitor's settings, but can't fix the problem that way either.
    Did check my Contrast setting in System Prefs, and it's Normal, and all the way to the left.
    I think Apple needs to fix this. I'm not sure there's anything the end user can do.

  • Terminal input wrong behaviour

    Basically, I have a very strange problem - when I ssh into the machine running CentOS and I open some file in nano to edit it my terminal behaves like crazy.
    When I delete something it can put either a simicolon or a closing parathesis or actually delete the thing I want.
    Also, the cursor can jump from one place to the other when pressing left/right key. This jumping is only along the line.
    Finally, when I press left/right some characters may be overwritten by the characters from the other parts on that line where the cursor happened to be.
    It almost seems like the wrong commands are being sent.
    Last thing – which is not related to the terminal – if I put mission control to be triggered by Ctrl+Right I can trigger it ALSO by pressing FN. It seems to me that something is very wrong with how character input is being interpreted... Although I do not have ANY problems when typing in other apps.

    The problem is a combination of the older version of nano + xterm-256color + Terminal.
    The older version of nano does some odd things when moving the cursor left and right: if the cursor is one column to the left of a tab stop, moving the cursor one column to the right sends a tab (Control-I) character, and if it's one column to the right of a tab stop, moving the cursor one column to the left sends a "back tab" (ESC [ Z) sequence. I say "odd" because it's odd that it bothers using these sequences when next to tab stops instead of moving the cursor left/right in the same manner as it does when it's farther away from a tab stop.
    The reason this is a problem is that Terminal doesn't support the "back tab" escape sequence. So, nano thinks it moved the cursor to the left one column, but Terminal hasn't moved it, and further editing and cursor movement on that line is out of synch with what's displayed in the terminal and it gets progressively more confusing looking. And since it only occurs when moving one character to the left to a tab stop, the user-observable behavior can seem even more surprising and unpredictable.
    Now, it only uses "back tab" if the terminfo file says that the terminal supports it. It does this with a "cbt" entry. You can see this with the "infocmp xterm-256color" command, which shows "cbt=\E[Z". This code is supported by modern Xterm and is found in several variations of the xterm terminfo entry, but xterm-color represents an older branch of Xterm and does not include "cbt". So, switching to xterm-color gives you something roughly similar to xterm and xterm-256color, except without "cbt" (and some important behaviors like Background Color Erase and 256 colors) and so this older version of nano behaves better in combination with xterm-color and Terminal.
    So, you can work around the problem by setting the TERM environment variable to xterm-color (or, really, any terminfo value that doesn't include "cbt" and is reasonably compatible with Terminal), or by upgrading the older nano on the remote host to a newer version that doesn't have this somewhat odd cursor movement behavior. You could also create a custom terminfo file that's a copy of xterm-256color with cbt removed (assuming you're comfortable creating and editing custom terminfo files).
    The easiest way for users to set the TERM value is with the popup menu in Terminal > Preferences > Settings > [profile] > Advanced > Declare terminal as. However, that sets it for every program used with that profile. I recommend one of two approaches:
    1. Duplicate (in the "action" menu below the profiles list) the profile you want to use with the remote host and set the "Declare terminal as" value (which just sets the TERM environment variable), then always use that profile for terminals that you use to ssh to CentOS machines. In fact, if you only have one or two remote hosts for which this is a problem, you could customize "… > Settings > Shell > Startup > Run command" to include the "ssh …" command, which will connect to the remote host automatically when you create a new terminal with that profile. Then create a similar custom profile for each remote host.
    2. Invoke nano with something like "TERM=xterm-color nano" to set the terminfo value only when running the older version of nano. You could even turn this into an alias, e.g., "alias nano='TERM=xterm-color nano'". If you only have one remote host (or you don't mind doing this on mulitple hosts), customise the appropriate shell startup script to do this so it only does this when invoking nano on that host. Or just remember to "export TERM=xterm-color" after you login to the remote host.
    As always, this forum is not an official means to provide feedback to Apple. If this issue is important to you, please file a bug report either at <http://www.apple.com/feedback/macosx.html> (set Feedback Area to Applications/Utilities) or <http://developer.apple.com/bugreporter/> (requires registering for a free developer account). Apple uses reports like these to prioritize work and to decide what's important to put in system updates.

  • [SOLVED] Sup email client 256 colors support

    I've installed sup email client (https://aur.archlinux.org/packages/sup-git) and wombat theme (https://github.com/mklinik/sup-colorscheme-wombat) for it. But everything become red-colored in the background and white-colored for text (I'm using rxvt-unicode and it has 256-color support so things should work find). I tried to google but found nothing.
    I though there is issue with support 256 colors in ncurses so I rebuild this package with necessary flags from pkgbuild: https://projects.archlinux.org/svntogit … es/ncurses and installed it. But due to version differences gem file didn't build after it with message "error while loading shared libraries: libncursesw.so.5: cannot open shared object file: No such file or directory" (and also really much stuff broke so I hardly restored original ncurses).
    Somebody know the way to use sup with 256 colors in terminal?
    Last edited by Shagabutdinov (2014-04-28 07:00:40)

    jasonwryan wrote:The correct way is to use terminfo: setting the variable in Xresources or anywhere else is an ugly hack that will likely cause other problems down the track...
    Not causing problems down the track is the exact reason given for why you should use Xresources to set TERM. The consensus seems to be that the terminal emulator should be the one to set it and using Xresources is one way to do that.
    However TERM is set - Xresources, arguments, .bashrc - all that matters is that the capabilities defined in the terminfo file match the actual capabilities of the terminal emulator. Having the terminal emulator do it at least gives it the chance to match capabilities. It also prevents TERM from getting set to the wrong value for other terminal emulators or virtual consoles.
    (Also, one does not "use terminfo" to set TERM. Terminfo uses TERM to tell terminal apps the capabilities of whatever they're outputting to.)

  • Color shell/script output in bash/zsh

    So, I wanted to have an easy way to color my script output. In zsh there is a color module, but as far as I know it does only bold for special effects. Also there are some scripts around that let you call a predefined array, but there aren't any where you can combine options easily, like both bold and italic. ansi-color comes close, but it has almost 250 lines of code and I thought it could be done more efficiently. So here's color, both in a zsh and a bash variant (the shebang and the way of defining an array being the only difference).
    Save as "color" in your path, or wrap it in a function to store in either .bashrc or .zshrc. color --help for instructions. Let me know what you think, if it has bugs or if the coding can be more efficient or better (I did this mostly as a programming exercise, it's not *that* useful.
    ZSH color
    #!/bin/zsh
    color-usage() {
    cat <<"USAGE"
    Usage: color [OPTIONS] <color>
    -b|--bold for bold text
    -i|--italic for italic text
    -u|--underline for underlined text
    -f|--flash for blinking text, not possible together with --bg
    -r|--reverse to switch fg and bg colors
    -/--bg <color> for background color
    -d|--dark for fainted / less intense colors (your terminal may not support this)
    -x|--invisible for invisible text (your terminal may not support this)
    -ff|--fastflash for fast blinking text (your terminal may not support this), not possible together with --bg
    Color can be: black, red, green, yellow, blue, magenta, cyan, white and lightblack, lightred etc.
    Use "color" without specifying the color to reset to default.
    Notes:
    1. You can not use blink in combination with --bg, but you can do -r instead and define <color> as desired bg-color. Example: color -f -r blue lets black text blink on blue background. This means you have the bg color as text color, which can't be changed."
    2. Append $(color) behind the string you have formatted, or the color sequence may stay in effect, especially in bash.
    3. You can combine options like -b -i -f, but be sensible; -x -f is not sensible; neither is -d lightred.
    Examples:
    echo "This is $(color -f -i lightred)blinking italic lightred text$(color)"
    echo "This is $(color -bg blue white)white text on blue bg$(color)"
    echo "This shows words in $(color green)green $(color magenta)magenta $(color)and the rest normal"
    echo "This shows $(color -f -r cyan)bold blinking text on cyan background$(color)"
    USAGE
    # Define and create array "colors"
    typeset -Ag colors
    colors=( black "0" red "1" green "2" yellow "3" blue "4" magenta "5" cyan "6" white "7" )
    # Loop to read options and arguments
    while [ $1 ]; do
    case "$1" in
    '-h'|'--help') color-usage;;
    '-b'|'--bold') mode="${mode}1;";;
    '-d'|'--dark') mode="${mode}2;";;
    '-i'|'--italic') mode="${mode}3;";;
    '-u'|'--underline') mode="${mode}4;";;
    '-f'|'--flash') mode="${mode}5;";;
    '-ff'|'--fastflash') mode="${mode}6;";;
    '-r'|'--reverse') mode="${mode}7;";;
    '-x'|'--invisible') mode="8;";;
    '-bg'|'--bg') case "$2" in
    light*) bgc=";10${colors[${2#light}]}"; shift;;
    black|red|green|yellow|blue|magenta|cyan|white) bgc=";4${colors[$2]}"; shift;;
    esac;;
    'reset') reset=true;;
    *) case "$1" in
    light*) fgc=";9${colors[${1#light}]}";;
    black|red|green|yellow|blue|magenta|cyan|white) fgc=";3${colors[$1]}";;
    *) echo The color loop is buggy or you used it wrong;;
    esac;;
    esac
    shift
    done
    # Set color sequence
    mode="${mode%;}" # strip ";" from mode string if it ends with that
    echo -e "\e[${mode:-0}${fgc}${bgc}m" # (default value for mode = 0, so if nothing was set, go default; -e to please bash)
    unset mode intensity bgc fgc # clean up
    BASH color
    #!/bin/bash
    color-usage() {
    cat <<"USAGE"
    Usage: color [OPTIONS] <color>
    -b|--bold for bold text
    -i|--italic for italic text
    -u|--underline for underlined text
    -f|--flash for blinking text, not possible together with --bg
    -r|--reverse to switch fg and bg colors
    -/--bg <color> for background color
    -d|--dark for fainted / less intense colors (your terminal may not support this)
    -x|--invisible for invisible text (your terminal may not support this)
    -ff|--fastflash for fast blinking text (your terminal may not support this), not possible together with --bg
    Color can be: black, red, green, yellow, blue, magenta, cyan, white and lightblack, lightred etc.
    Use "color" without specifying the color to reset to default.
    Notes:
    1. You can not use blink in combination with --bg, but you can do -r instead and define <color> as desired bg-color. Example: color -f -r blue lets black text blink on blue background. This means you have the bg color as text color, which can't be changed."
    2. Append $(color) behind the string you have formatted, or the color sequence may stay in effect, especially in bash.
    3. You can combine options like -b -i -f, but be sensible; -x -f is not sensible; neither is -d lightred.
    Examples:
    echo "This is $(color -f -i lightred)blinking italic lightred text$(color)"
    echo "This is $(color -bg blue white)white text on blue bg$(color)"
    echo "This shows words in $(color green)green $(color magenta)magenta $(color)and the rest normal"
    echo "This shows $(color -f -r cyan)bold blinking text on cyan background$(color)"
    USAGE
    # Define and create array "colors"
    declare -A colors
    colors=( [black]="0" [red]="1" [green]="2" [yellow]="3" [blue]="4" [magenta]="5" [cyan]="6" [white]="7" )
    # Loop to read options and arguments
    while [ $1 ]; do
    case "$1" in
    '-h'|'--help') color-usage;;
    '-b'|'--bold') mode="${mode}1;";;
    '-d'|'--dark') mode="${mode}2;";;
    '-i'|'--italic') mode="${mode}3;";;
    '-u'|'--underline') mode="${mode}4;";;
    '-f'|'--flash') mode="${mode}5;";;
    '-ff'|'--fastflash') mode="${mode}6;";;
    '-r'|'--reverse') mode="${mode}7;";;
    '-x'|'--invisible') mode="8;";;
    '-bg'|'--bg') case "$2" in
    light*) bgc=";10${colors[${2#light}]}"; shift;;
    black|red|green|yellow|blue|magenta|cyan|white) bgc=";4${colors[$2]}"; shift;;
    esac;;
    'reset') reset=true;;
    *) case "$1" in
    light*) fgc=";9${colors[${1#light}]}";;
    black|red|green|yellow|blue|magenta|cyan|white) fgc=";3${colors[$1]}";;
    *) echo The color loop is buggy or you used it wrong;;
    esac;;
    esac
    shift
    done
    # Set color sequence
    mode="${mode%;}" # strip ";" from mode string if it ends with that
    echo -e "\e[${mode:-0}${fgc}${bgc}m" # (default value for mode = 0, so if nothing was set, go default; -e to please bash)
    unset mode intensity bgc fgc # clean up

    Soemthing like this will work

  • Error while reading data through External Table!!!

    CREATE TABLE "COGNOS"."EXT_COGNOS_TBS9_TEST"
    (     "ITEM_DESC" VARCHAR2(200 BYTE),
    "EXT_CODE" VARCHAR2(20 BYTE),
    "RC_DATE" DATE,
    "RES_KD_AMNT" NUMBER(18,3),
    "RES_FC_AMNT" NUMBER(18,3),
    "NRES_KD_AMNT" NUMBER(18,3),
    "NRES_FC_AMNT" NUMBER(18,3),
    "TOTAL" NUMBER(18,3),
    "OF_WHICH_OVR1" NUMBER(18,3)
    ORGANIZATION EXTERNAL
    ( TYPE ORACLE_LOADER
    DEFAULT DIRECTORY "EXTDATADIR"
    ACCESS PARAMETERS
    ( RECORDS
    DELIMITED BY NEWLINE LOAD WHEN *({color:#ff0000}EXT_CODE LIKE 'TBS9%'{color})* FIELDS TERMINATED BY ','
    MISSING FIELD VALUES ARE NULL )
    LOCATION
    ( 'TBS9_TEST.CSV'
    External table creation went through successfully but am getting error while reading data. Am quite sure error is because of above line in red color. Could you please help me in transforming logic.
    Thanks in Advance,
    AP

    Let's start with the basics...
    1) You state that you are getting an error. What error do you get? Is this an Oracle error (i.e. ORA-xxxxx)? If so, please include the error number and the error message as well as the triggering statement. Or is the problem that rows are getting written to the reject file and errors are being written to the log file? If so, what record(s) are being rejected and what are the reasons given in the log file? Or perhaps the problem is something else?
    2) You state that you are quite sure that the problem relates to the hilighted code. What makes you quite sure of this?
    Justin

  • Yaourt: pacman frontend

    Homepage:   http://archlinux.fr/yaourt-en/
    yaourt is a pacman frontend whith a lot of features like:
    - AUR support (search, easy install, vote etc..)
    - interactiv search + install (with AUR Unsupported results integrated)
    - building packages directly from ABS cvs sources
    - search output colorised (skinable) + always show the repository where a package came from
    - handling config files .pacnew/.pacsave
    - managing alpm database backup (save, restore, query database directly on backup file)
    - alert user when new orphans  are  detected  and  check  the  database integrity with testdb after each operation
    - downloading PKGBUILD directly from ABS cvs or AUR Unsupported
    - statistics on installed packages
    Yaourt can be run as a non-privileged user (safest for AUR unsupported packages).
    Root password will be required only when it is necessary.
    USAGE: yaourt [OPTION...] <parameter>
    example:
      $ yaourt [regexp]        : search for matching strings (with *) and allows to install it
      $ yaourt -S [packagename]: download package from repository, and fallback on AUR
      $ yaourt -S [list file]  : download all packages stored in the first column of the given file
      $ yaourt -Ss [regexp]    : search remote repositories and AUR for matching strings
      $ yaourt -Syu --aur      : upgrade system + packages from aur
      $ yaourt -Sybu --aur     : upgrade by building PKGBUILD + packages from aur
      $ yaourt -Syu --devel    : upgrade all cvs/svn/mercurial packages (from aur)
    OPTIONS:
    yaourt's options are the same as pacman, so check the pacman man page for more info
    yaourt adds/enhances options marked with '*'
    General:
    (-h, --help)                      give this help list
    (-V, --version)                   give program version
    --noconfirm                       do not ask for any confirmation
    --tmp /where/you/want             use given directory for temporary files
    --lightbg                         change colors for terminal with light background
    --nocolor                         don't use any color
    --textonly                        good for scripting yaourt's output
    --stats                           display various statistics of installed pacakges
    Install:
    (-S, --sync)     <package>      * download package from repository, and fallback on aur
    (-S, --sync)     <file>         * download all packages listed on the first column of the file
    (-S, --sync) -b                 * builds the targets from source
    (-S, --sync) -c, --clean          remove old packages from cache directory (use -cc for all)
    (-S, --sync) -d, --nodeps         skip dependency checks
    (-S, --sync) -f, --force          force install, overwrite conflicting files
    (-S, --sync) -g, --groups         view all members of a package group
    (-S, --sync) -i, --info         * view package (or PKGBUILD from AUR) information
    (-S, --sync) -l, --list         * list all packages belonging to the specified repository
    (-S, --sync) -p, --print-uris     print out download URIs for each package to be installed
    (-S, --sync) --export <destdir> * export packages for local repository
    (-S, --sync) --ignore <pkg>       skip some package
    (-U, --upgrade) <file.pkg.tar.gz> upgrade a package from <file.pkg.tar.gz>
    (<no option>) <file.pkg.tar.gz> * upgrade a package from <file.pkg.tar.gz>
    (-G, --getpkgbuild) <pkg>       * Retrieve PKGBUILD and local sources for package name
      --asdeps                         Install packages non-explicitly to be installed as a dependency
    Upgrade:
    -Su,  --sysupgrade                upgrade all packages that are out of date
    -Su --aur                       * upgrade all aur packages
    -Su --devel                     * upgrade all cvs/svn/mercurial/git/bazar packages
    -Sud, --nodeps                    skip dependency checks
    -Suf, --force                     force install, overwrite conflicting files
    -Su --ignore <pkg>                skip some package
    -Sy,  --refresh                   download fresh package databases from the server
    Note: yaourt always shows new orphans after package update
    Downgrade:
    -Su --downgrade                *  reinstall all packages which are marked as "newer than extra or core" in -Su output
               (this is specially for users who experience problems with [testing] and want to revert back to current)
    Local search:
    (-Q, --query) -e,            * list all packages explicitly installed
    (-Q, --query) -d,            * list all packages installed as a dependency for another package
    (-Q, --query) -t             * list all packages unrequired by any other package
                   -Qdt           * list missed packages installed as dependecies but not required
                   -Qet           * list top level packages explicitly installed
    (-Q, --query) -g, --groups     view all members of a package group
    (-Q, --query) -i, --info       view package information (use -ii for more)
    (-Q, --query) -l, --list       list the contents of the queried package
    (-Q, --query) -o  <string>   * search for package that owns <file> or <command>
    (-Q, --query) -p, --file       will query the package file [package] instead of db
    (-Q, --query) -s, --search   * search locally-installed packages for matching strings
    (-Q) --backupfile  <file>    * query a database previously saved in a tar.bz2 file (with yaourt --backup)
    Example: you want to reinstall archlinux with the same packages as your backup pacman-2008-02-22_10h12.tar.bz2
      just run yaourt -Qet --backupfile pacman-2008-02-22_10h12.tar.bz2 > TopLevelPackages.txt
      To reinstall later, just run yaourt -S TopLevelPackages.txt
    Remote search:
    (-S, --sync)  -s [string]    * search remote repositories and AUR for matching strings
    <no option>      [string]    * search for matching strings + allows to install (interactiv)
    -Sq --depends    <pkg>       * list all packages which depends on <pkg>
    -Sq --conflicts  <pkg>       * list all packages which conflicts with <pkg>
    -Sq --provides   <pkg>       * list all packages which provides <pkg>
    Clean:
    (-C, --clean)                * manage, show diff .pacsave/.pacnew files
    (-C, --clean) -c             * delete all .pacsave/.pacnew files
    (-C, --clean) -d, --database * clean database (show obsolete repositories)
    (-S, --sync)  -c               remove old packages from cache
    (-S, --sync)  -c -c            remove all packages from cache
    (-R, --remove)  <package>      remove packages
    (-R, --remove) -c, --cascade   remove packages and all packages that depend on them
    (-R, --remove) -d, --nodeps    skip dependency checks
    (-R, --remove) -k, --dbonly    only remove database entry, do not remove files
    (-R, --remove) -n, --nosave    remove configuration files as well
    (-R, --remove) -s, --recursive remove dependencies also (that won't break packages)
    Note: yaourt always shows new orphans after package removal
    Backup:
    (-B, --backup) [directory]     * backup pacman database in given directory
    (-B, --backup) <file.tar.bz2>  * restore a previous backup of the pacman database
    Runing yaourt as a non-privileged user requiers some entries in sudoers file:
      - pacman (remove package + refresh database + install AUR's package)
      - pacdiffviewer (manage pacsave/pacnew files)
    Download yaourt:
    AUR: http://aur.archlinux.org/packages.php?d … =1&ID=5863
    or
    [archlinuxfr]
    Server = http://repo.archlinux.fr/i686
    [archlinuxfr]
    Server = http://repo.archlinux.fr/x86_64
    Last edited by wain (2008-03-18 21:09:39)

    cromo wrote:
    Indeed, I was always running it with sudo, I thought it's the way it's meant to be. I just realized I can run yaourt without sudo and yaourt will ask for password when there's a need. Nice!
    BTW. I found another bug. When I run yaourt -Syu I get:
    cromo@kromka:~$ yaourt -Syu
    Yaourt 0.4.8: Archlinux package manager
    :: Synchronizing package databases...
    testing [################] 100% 0K 0.1K/s 00:00:04
    :: current is up to date
    :: extra is up to date
    :: unstable is up to date
    :: community is up to date
    :: bluez-libs: local (3.7-3) appears to be newer than repo (current/3.7-1)
    :: bluez-utils: local (3.7-4) appears to be newer than repo (current/3.7-2)
    :: kmobiletools: local (0.5_beta1-1) appears to be newer than repo (extra/0.4.3.3-1)
    :: Above packages will be skipped. To manually upgrade use 'pacman -S <pkg>'
    error: no targets specified
    usage: pacman {-S --sync} [options] [package]
    options:
    -c, --clean remove old packages from cache directory (use -cc for all)
    -d, --nodeps skip dependency checks
    // cut //
    -r, --root <path> set an alternate installation root
    -b, --dbpath <path> set an alternate database location
    Thing is about what happens after the "To manually upgrade use 'pacman -S <pkg>'"part.
    This is a bug in srcpac:
    http://bugs.archlinux.org/task/5696

  • [SOLVED]dwm-sprinkles: can't right click

    Just installed dwm-sprinkles (compiled from source grabbed using svn because there's nothing in AUR or ABS for it), and I can no longer right click in firefox or use the drop-down menus.  Drop downs on websites work fine, but I can't use anything in the firefox toolbar.  ie, File, Edit, address bar history, ABP menu, etc.  These things all work fine in gftp and goggles, which are the only other gui apps that I really use.
    It worked fine in vanilla dwm, which I built from the package in AUR.  Switched to dwm sprinkles because patching was a pain in the ass and sprinkles already has pretty much everything I need.  I'm guessing there is something in config.h that is causing this but I haven't changed anything except colors and terminal command. 
    Sorry if this has been posted/solved before, but there's just not much in-depth documentation on DWM out there (which is why I switched to a pre-patched version of it in the first place).
    Last edited by clutch (2010-06-04 22:08:28)

    ok, it works now after a reboot.  No idea. 

  • Herbstluftwm

    Couldn't find one of these yet.  Please contribute your own herbstluft stuff as well!
    First things first: Herbstluft is German for "Autumn air." I'm not sure what Autumn air has to do with window management, but it's a lovely name nonetheless.
    btw, Doomicide already has a nice thread about herbstluftwm on the #! forums.  He's covered some good stuff there, so I won't repeat it.  Doom, if you ever read this, I've used some of your stuff in setting up mine, but I'm not registered at #!.  Your effort is appreciated nonetheless.
    Anyway, I've recently switched from scrotwm to herbstluftwm.  This wasn't for any fault of scrotwm.  I just saw some screenshots of herbstluftwm, and it looked like it gave greater possibilities in terms of tiling layouts.  I tried it.  That was true.  I also found out that it has one particular feature that makes it capable of doing all kinds of crazy stuff.
    herbstluftwm is completely controlled and configured by shell commands.  There is literally no other way to get it to do anything.  You can map keybidings with it, but you do that with a shell command, and those bindings lauch other shell commands.  As you might guess, the config file is just a bash script (could be any shell language, I'm sure) that turns on your settings.  This means, of course, that you can use bash functions in the config file.  Not a super big deal.  awesome, dwm, and xmonad all use more powerful languages for configuration.
    What is a big deal is the fact that you can create additional scripts to preform rather sophisticated window management functions.  You could theoretically have an entirely new configuration file set to a keybiding to call whenever you wanted.  I haven't quite gone this far, but I did go pretty nuts with it.
    [edit]ok, I've actually gone farther now. I've written a script that allows hlwm to do some of the things dynamic tilers do. see "swap" script here
    [UPDATE]
    We've figured something out that will make the herbstluftwm autostart file run faster for everyone with a version of the program that includes the "chain" command:
    There is a line like this in the default autostart file:
    function hc() {
    herbstclient "$@"
    Comment it out and/or replace it with this:
    hc() {
    cmds="$cmds , $@"
    Then, at the end of the file, before the "# find the panel" section, add this line:
    herbstclient chain $cmds&
    This pipes all of your settings to herbstluftwm with a single instance of herbstclient rather than dozens of them. It also forks that process so it can find the panel while it's loading your settings. This should offer a noticeable increase in load speed on most systems. May have to modify some things if your autostart has anything wacky in it (like mine).
    Not that herbstluftwm loads slowly by default, but no reason not to squeeze out every ounce of performance, especially if you use an older system.
    original post follows
    So, by default, I like to have a sort of "solid wall" kind of look to my tilers, so I set it up to look more or less like this:
    Dzen with conky info came later, but we'll get there.  This shot also shows a frame layout that I like to work with, which I have set to a keybiding.  You do this with the 'dump' and 'load' commands as detailed in the man page.
    Anyway, then I decided that sometimes I might want to see my wallpaper a little bit, so I added a binding for an alternative, translucent terminal and created bindings to change the gap between frames.  It actually uses the number keys, so I can set the gap to any even number of pixels between 0 and 18.
    I noticed that my default window and frame border settings didn't look right with the gap, so I wrote a script that changes the borders according to whether or not there is a frame gap.  (I also did a script to adjust the border settings for when herbstluftwm is in floating mode, and those colors also get adjusted according to the snapping gap)
    So then I figured out how to add the status bar, and I wrote a script to toggle it on and off.  Here it is off:
    I also decided that I wanted it to be different colors to go with adjusted border colors with and without the frame gaps, so I wrote a some scripts to handle giving dzen the right color to go with the gap size.  You can see a different shade of grey on the bar in the first two pictures.  This is probably more pedantic than what anyone else would want to do, but it makes me happy.
    There is one thing that herbstluftwm doesn't have build-in handling for that you might want, and that is fullscreen applications. You can make an application take up an entire frame and put it in fullscreen mode, but it won't hide the other frames or the bar (one of the reasons I wanted a binding to hide the status bar).  This isn't such a big deal, but it did prompt me to create one additional script that changes several config settings to make a better environment for watching movies.  It changes the border colors to black and a very dark grey, and it changes the terminal launch command to launch a back terminal with dark grey text.  I did this so I could leave up the mplayer output in a way that wasn't distracting.  This script also turns off dzen by default, but it can be brought back with the same subdued color scheme as the terminal.
    And finally, here's a scrot from two days ago showing how the floating mode looks (or rather, can look).
    Scripts in the next post.
    Last edited by ninjaaron (2012-11-27 22:05:39)

    Ok, so here are the scripts.  First, the normal startup script, ~/.config/herbstluftwm/autostart
    #!/bin/bash
    function hc() {
    herbstclient "$@"
    # keybindings
    Mod=Mod4
    hc keybind $Mod-Shift-q quit
    hc keybind $Mod-i reload
    hc keybind $Mod-x close
    hc keybind $Mod-Return spawn urxvtc
    hc keybind $Mod-p spawn dmenu_run -i -fn -*-bitocra -nb '#1e1e1e' -nf '#888888' -sb '#FFFF84' -sf '#1e1e1e'
    hc keybind $Mod-f spawn urxvtc -tr -sh 20 -fg rgb:bb/bb/bb
    # tags
    hc rename default 1 || true
    for i in {1..9} ; do
    hc add "$i"
    hc keybind "$Mod-$i" use "$i"
    hc keybind "$Mod-Shift-$i" move "$i"
    #commands dealing with spaces and borders
    hc keybind "$Mod-Alt-$i" spawn ~/.config/herbstluftwm/mindthegap "$(($i*2))"
    done
    hc keybind $Mod-Alt-0 spawn ~/.config/herbstluftwm/mindthegap 0
    hc keybind $Mod-0 spawn ~/.config/herbstluftwm/autogap
    # layouting
    hc keybind $Mod-r remove
    hc keybind $Mod-space cycle_layout 1
    hc keybind $Mod-Alt-space cycle_layout -1
    hc keybind $Mod-u split vertical 0.5
    hc keybind $Mod-o split horizontal 0.5
    hc keybind $Mod-s spawn ~/.config/herbstluftwm/float
    hc keybind $Mod-d spawn ~/.config/herbstluftwm/dzen
    hc keybind $Mod-m load '(split horizontal:0.710000:0 (split vertical:0.820000:0 (clients horizontal:1 0x100001e 0x801fa3) (clients horizontal:0)) (clients vertical:0 0x801ff3 0x80207d))'
    hc keybind $Mod-v spawn .config/herbstluftwm/vidmode
    # resizing
    RESIZESTEP=0.02
    hc keybind $Mod-Control-h resize left +$RESIZESTEP
    hc keybind $Mod-Control-j resize down +$RESIZESTEP
    hc keybind $Mod-Control-k resize up +$RESIZESTEP
    hc keybind $Mod-Control-l resize right +$RESIZESTEP
    # mouse
    hc mousebind $Mod-Button1 move
    hc mousebind $Mod-Button2 zoom
    hc mousebind $Mod-Button3 resize
    # focus
    hc keybind $Mod-BackSpace cycle_monitor
    hc keybind $Mod-Tab cycle_all +1
    hc keybind $Mod-Shift-Tab cycle_all -1
    hc keybind $Mod-c cycle
    hc keybind $Mod-h focus left
    hc keybind $Mod-j focus down
    hc keybind $Mod-k focus up
    hc keybind $Mod-l focus right
    hc keybind $Mod-Shift-h shift left
    hc keybind $Mod-Shift-j shift down
    hc keybind $Mod-Shift-k shift up
    hc keybind $Mod-Shift-l shift right
    # defaults
    hc set frame_border_active_color '#101010'
    hc set frame_border_normal_color '#101010'
    hc set frame_bg_normal_color '#1e1e1e'
    hc set frame_bg_active_color '#000000'
    hc set window_border_width 1
    hc set window_border_active_color '#666666'
    hc set focus_follows_shift 1
    hc set snap_distance 8
    echo 1 > ~/.config/herbstluftwm/dz
    ~/.config/herbstluftwm/mindthegap $(cat ~/.config/herbstluftwm/gap)
    Ok, I've changed some of the default settings and keybindings, and I added dmenu.  I also added a second terminal launch command with different settings, cause sometimes I like to see my wallpaper, and sometimes not.  That's pretty standard stuff that you can read about in the man page.
    First non-standard thing is in for loop that controls workspace switching, I've added a call for  ~/.config/herbstluftwm/mindthegap.
    #!/bin/bash
    if [ $1 = 0 ]; then
    herbstclient set frame_border_width 0
    herbstclient set window_border_normal_color '#1e1e1e'
    echo 1 > ~/.config/herbstluftwm/dcolor
    else
    herbstclient set frame_border_width 1
    herbstclient set window_border_normal_color '#101010'
    echo 2 > ~/.config/herbstluftwm/dcolor
    fi
    pkill conky
    if [ `cat ~/.config/herbstluftwm/dz` = 1 ];then
    ~/bin/dzen
    sleep .2
    fi
    herbstclient set window_gap "$1"
    herbstclient set snap_gap "$1"
    echo $1 > ~/.config/herbstluftwm/gap
    This script is busy.  Changes the frame gap and the snap gap (being called in the for loop like it is, it means I any gap size I want from 0-18 on the fly. Not necessary, but it makes me happy, and I wasn't using the bindings for anything anyway), and it adujsts some border colors and widths to fit the way it should look with the gap (according to my tastes, at least). It also sets the color option for dzen (in the dcolor file) and kills dzen if it's running and if it's supposed to be on, resets the color and redraws it. 'dz' is just a file that contains either 1 or 0, depending on if dzen is running.  This brings us to ~/bin/dzen
    #!/bin/bash
    color=`cat ~/.config/herbstluftwm/dcolor`
    if [ $color = 1 ];then
    conky|dzen2 -fn '-*-bitocra' -bg '#1e1e1e' -fg '#888888'&
    elif [ $color = 2 ];then
    conky|dzen2 -fn '-*-bitocra' -bg '#101010' -fg '#888888'&
    elif [ $color = 3 ];then
    conky|dzen2 -fn '-*-bitocra' -bg '#000000' -fg '#1e1e1e'&
    fi
    This script checks the 'dcolor' file for a number which tells it which color scheme to use, which 'mindthegap' has just set. It also makes a space the "pad" command so windows won't cover dzen.
    Ok, what's next? back to the config file. The next thing of interest is ~/.config/herbstluftwm/autogap
    #!/bin/bash
    if [ "$(cat ~/.config/herbstluftwm/gap)" = "0" ];then
    ~/.config/herbstluftwm/mindthegap 4
    else
    ~/.config/herbstluftwm/mindthegap 0
    fi
    Just a simple script to toggle the gap on and off without having to think about pixel sizes.
    Next is ~/.config/herbstluftwm/float
    #!/bin/bash
    if [ `cat ~/.config/herbstluftwm/wb` = 1 ];then
    herbstclient set window_border_width 1
    herbstclient floating off
    echo 0 > ~/.config/herbstluftwm/wb
    else
    herbstclient set window_border_width 2
    herbstclient floating on
    echo 1 > ~/.config/herbstluftwm/wb
    fi
    This script toggles floating and tiling modes.  There is a command to do this automatically, so you don't need a script, but I wanted to change the border settings when I toggled, so this lets me do that.
    Then comes ~/.config/herbstluftwm/dzen.  It's just another simple toggle script that doesn't really need to be quoted.  It checks ~/.config/herbstluftwm/dz to see if dzen is on or not and switches it. If it turns it on, it uses ~/bin/dzen so the color will match gap and border settings.  Nothing you wouldn't expect to find in a toggle script.
    There is a 'load' command after that.  You can (and should) read about it in the man page.  After that is a binding for my movie-viewing mode via ~/.config/herbstluftwm/vidmode.
    #!/bin/bash
    pkill conky
    herbstclient pad 0 0
    echo 0 > ~/.config/herbstluftwm/dz
    herbstclient set frame_border_width 0
    herbstclient set window_border_normal_color '#000000'
    herbstclient set window_border_active_color '#060606'
    echo 3 > ~/.config/herbstluftwm/dcolor
    p
    herbstclient set window_gap 0
    echo 0 > ~/.config/herbstluftwm/gap
    herbstclient load '(split vertical:0.900000:1 (clients max:0 0x8024d4) (clients horizontal:0 0x8024f4))'
    herbstclient keybind Mod4-Return spawn urxvtc -fg rgb:1e/1e/1e -bg rgb:00/00/00
    This just changes a bunch of settings (including some contained in files called by the scripts) and loads a frame layout that I think is good for movies.  It also changes the color of terminal that the binding launches to something really dark.  The only way to get all the settings back after this is to reload the autostart file.
    It also calls the 'mindthegap' script to finish off the settings, so all the gap, border, and dzen settings will be persistent between sessions.  I've opted to have dzen start in every session regardless of how I left it by echoing a new value to ~/.config/herbstluftwm/dz.  I could leave it out, and that would also be persistent. I could also echo a set a specific gap size instead of cat-ing the old one.
    So, I guess that's it.

Maybe you are looking for

  • Upgrade to iLife 09

    I just purchased iLife 08 about two weeks ago, now I see iLife 09 is out. Is there anyway of getting a free update since so short of time passed? Also, I only bought the one copy since my wife's Mac Pro was the only Mac in the house. After setting up

  • FileVaulted data from Powerbook [10.3.x] disk to a new MacBook Pro [10.5.x]

    Hi! My powerbook was damaged & the insurers have returned my hard drive and are supplying me with a new MacBook Pro. The data on the Hard drive is encrypted with FileVault from 10.3.someting..... What's the best way to proceed, with regards to gettin

  • Data Conversion/Extraction

    Hi Hussein, I am task to migrate, extract data and convert it to .csv to be loaded to our new set-up/implemented 11i. The data comes from Oracle Apps 11.0.3 and partly on another 11i (11.5.10.2). I am task to extract "Suppliers" data. How do you do i

  • Facing problem in sync

    i am facing problem in sync of my contact from outlook ids and, showing error when i click in invite button on outlook contact

  • Trial Version: Crash in progress. Last logged message was ae.blitpipe

    I've downloaded and installed the trial version of AE CS4. The program installs fine and it starts up but when I try to import a video file (i've tried many many different formats) it crashes. I then updated the program using the "update" option from