Diff terminal background on diff OS clones

Hi
Maybe cryptic title, but I would like to have the following.
I have three osx snow clones on my system, because of testing my current developments.
They are most identical to each other and once a while when needed they are cloned using CCC ( CarbonCopyCloner ).
The differences between those clones are controlled afterwards with a script ( echelon.sh ) that make the changes I need.
But the changes in the terminal I would like to have is difficult to control.
First to recognize in which terminal on what clone I am working.
To start with, how can I change the background color of the terminal, depending of the clone partition name <;-)> easier to recognize the next mornig, when I am not yet awake </;-)>
Let say I have the following clones:
Chimera
Chimera_CL1
Chimera_CL3
and I want
Partition Name Background Color
Chimera white
Chimera_CL1 yellow
Chimera_CL3 lichtgreen
*My Question is:* +Is there a way in the ~/.bash_profile or ~/.profile to check from what partition ( name ) is started?+
Above is a sample to let me start from, but I also need some different aliases on the diff clones.
I could use three .bash_profile files and copy it with my current echelon.sh script at the right clone, but that means that I have to control more files instead of only one .bash_profil file.
My echelon.sh script is on each clone, but have knowledge where it did start from. It knows the current / path and partition name. So not really excitement.
Thanks in advance

Maybe not as powerful, but you could use a different Color prompt depending on which clone you are using.
if [[ $WHO = master ]]; then
# Black on Red "I am Master> " prompt
PS1="[e[30;41;1m]I am the Master> [e[0m]$"
elif [[ $WHO = clone1 ]]; then
# Blue on Cyan "Number One> " prompt
PS1="[e[46;34;1m]Number One> [e[0m]$"
elif [[ $WHO = clone2 ]]; then
# Magenta on Blue "I'm a Second Cousin> " prompt
PS1="[e[44;35m] 'm a Second Cousin > [e[0m]$"
fi
"WHO" is just a made-up variable you get to provide provide for testing.
Here is a color table:
# Prompt
# -foreground- ----bold---- -underline-- --reverse--- -background-
# black e[30m e[30;1m e[30;4m e[30;7m e[40;fg;1m
# red e[31m e[31;1m e[31;4m e[31;7m e[41;fg;1m
# green e[32m e[32;1m e[32;4m e[32;7m e[42;fg;1m
# yellow e[33m e[33;1m e[33;4m e[33;7m e[43;fg;1m
# blue e[34m e[34;1m e[34;4m e[34;7m e[44;fg;1m
# magenta e[35m e[35;1m e[35;4m e[35;7m e[45;fg;1m
# cyan e[36m e[36;1m e[36;4m e[36;7m e[46;fg;1m
# White e[37m e[37;1m e[37;4m e[37;7m e[47;fg;1m
# Reset e[0m
You can also change the title, but that is not as useful, but can be helpful if using multiple tabbed Terminal windows. Just add the following escape sequenct to your PS1 prompt:
[e]0;This Is My Tab Title ]

Similar Messages

  • Getting current terminal background color

    is there any way to retrieve the current background color in the active terminal (xterm/konsole/whatever)? preferably in c.
    tnx.

    in C it wouldn't be that hard, however it gets difficult when you talk about different WMs...
    Basically, you iterate over each top level window (the frame)... but you'd need a way to determin which child of the fram is the application (the title bar, buttons, and possibly status bar are all children as well).
    Then you just call a "property get" on the app window...
    the main difficulty is going to be different window managers...

  • [SOLVED] dwm: Changing terminal background?

    Hello all,
    I'm trying out dwm and love the simplicity. I've gotten it up and running but am noticing something odd.
    - If I have an .xinitrc with "exec dwm" in it and run startx, it starts up but any terminal (ctrl+alt+enter) comes up with a white background and black font.
    - If I rename .xinitrc to something like .xinitrc2 and run startx, the terminal has a black background with a white font.
    I want the black background and white font with .xinitrc so I can show the date. I've played around with config.h but don't see anything for the terminal colors (only the 1 2 3 ... bar above).
    I'm pretty new to dwm so I might be missing something simple. Does anyone have any ideas?
    Last edited by Annorax (2013-05-07 20:35:58)

    karol wrote:
    SolarBoyMatt wrote:
    You also need
    xrdb ~/.Xresources &
    somewhere in your .xinitrc before you call exec dwm, so your xresources file applies each time you start dwm.
    This info is in the wiki and it warns against backgrounding the operation.
    Using xrdb to source your ~/.Xresources is pretty instant, so in addition to possibly causing problems, there will probably be no noticeable difference in time either.

  • Terminating background jobs

    I have been looking into the new Nokia phones on the US carriers and none of the sellers are able to tell me how to kill background applications/tasks.
    For example: When i go to a website, go back to home screen and let the phone idle for a time.. The first thing I see when I open the internet again is the last website I was on.
    Same with Nokia music., I wanted to discontinue listening can't I just terminate the app?  theres not a task mgr or app killer that i've seen.
    How do you guys go about this?
    kiitoksia
    T: Poropoika

    farby wrote:
    You may have a look at THIS or THIS
    Even though this Stop Music apps does the job of stopping music player, it will mean an extra tile on screen, right? One thing I like about WP8 is simplicity..
    Would be nice if there is just one apps that can stop all apps with one click.

  • Apps running in the background

    It seems to be if you have the app linked to a watch complication or you have it on your glances page, then those apps loads much faster.  I figure they are always running so the data can be displayed on the watch face or quickly at a glance.
    So if you have every possible app on your glances page, then your battery life would drain much faster than if you have fewer apps.
    I only have 3-4 apps on my glances page and I can easily get 20 hours of battery life, and this includes a 1 hour workout using GPS and HR monitoring.

    Tbh, the biggest battery drain is your email push settings. I'd look at those before worrying about terminating background apps.
    You can see everything that's running on your phone by using a "process monitor" app. I use one called "iStat". Unfortunately, iStat can only show you what's running, it can;t actually kill anything. It will definitely tell you which of the 1st party programs (browser, email, ipod) are running in the background.
    If you actually want to kill one of these, the procedure is:
    Open the app in question (e.g. launch the ipod app)
    Hold the power/sleep button until the red slider appears.
    Hold the sleep button for around 6 seconds (eventually the red slider will disappear and you will be returned to the home screen).
    Whichever app was running (e.g. ipod) will now be forced to close.
    ** note: To close safari, you can simply close all the "tabs" down, and then exit. If you close safari when there are no tabs in use, it will completely shut down.

  • Full-screen terminal dims display

    Hi,
    when switching to full-screen for Terminal my external display reduces its brightness to an irritating degree. Brightness level are back to normal when the menu is displayed or other windows are on top of the terminal (for example the preferences window or the alt-tab task switcher). As soon as these windows are gone the brightness drops again.
    I can't seem to find a setting for this. Any pointers are greatly appreciated.
    Cheers

    Problem solved. It turned out to be a setting of the monitor which would dim the backlight when a certain percentage of the screen is black (my terminal background is set to black). After un-setting this option the problem disappeared. (IIYAMA ProLite E2607WS, Contrast/Brightness -> ACR -> off)

  • [WONTFIX] Having trouble with git clone for a VCS type PKGBUILD

    I'm trying to update (QGIS) in the AUR to use git so that I can make use of patches as they become available.
    I have
    source=("$pkgname"::'git+https://github.com/qgis/QGIS/tree/release-2_4')
    but this pulls a lot of data (750+ MB) and the pull or clone should only be ~80MB for that specific branch.
    Changing the source to
    source=("$pkgname"::'git://github.com/qgis/QGIS.git#branch=release-2_4')
    it does the same thing and grabs a lot of data.
    I noticed the fragment(branch) is ignored and it clones "master" instead.
    From the terminal I can do
    git clone -b release-2_4 --single-branch --depth 1 git://github.com/qgis/QGIS.git qgis
    which works perfectly.
    Is there a way to make "git clone" in the PKGBUILD use those flags like "-b release-2_4 --single-branch --depth 1"?
    Last edited by saultdon (2014-06-29 02:03:54)

    apg wrote:https://bugs.archlinux.org/task/34677
    https://bugs.archlinux.org/task/36631
    https://bugs.archlinux.org/task/37747
    "Reason for closing:  Won't implement"
    So it looks like my idea of using the old VCS pkgbuild would be the next best thing to try and if that fails, just tell users to check for latest commits since their last compile and re-download the tarball if needed (really didn't want to do that... it's much better to only have to fetch changes instead of the entire source).
    Comment by Allan McRae (Allan) - Wednesday, 21 August 2013, 16:49 GMT-7
    That breaks the second checkout that is done by makepkg when "extracting sources".
    Just don't use the source array and manually download the source in prepare(). (i.e. basically the old style of VCS package)

  • Bootable Time Machine Restore Disks

    My data protection philosophy is one does not need a backup system; one needs a foolproof and tested restore system.  So I talk about restore volumes, not backup volumes.
    I followed PlotinusVeritas' advice and purchased Carbon Copy Cloner to create a clone of my internal storage as my fourth restore disk.  Great advice.  I will keep this cloned volume offsite as a medium-term archive.  Having used CCC for cloning I now use it for a different purpose.  I do not need a bootable clone onsite for my emergency restores.
    New procedure:  Each Time Machine disk can be bootable if one runs CCC on them to prepare them with a bootable recovery partition upon initialization.  This simple innovation avoids the need of keeping around a cloned disk with its recovery partition.  My onsite, bootable restore disks will be up-to-date as of the last TM snapshot.
    If I used a cloned disk as an emergency quickly-bootable volume, the changes between the clone time and the last TM snapshot would be lost.  For me, this loss of data is not worth saving the few hours of TM restore time to get back on my feet after an system volume failure.
    How might one easily create a bootable recovery partition without using CCC or other for-fee utilities?
    P.S.  Creating bootable recovery partitions on freshly reformatted TM restore disks should be a standard TM feature (a la CCC).  I will submit feedback to ask for this change.
    P.P.S  I tested restoring from my bootable TM restore disk.  I booted from the TM disk's recovery  partition.  I selected that disk's TM volume as the source and a freshly formatted external disk as the destination.  It erased the target disk and then to my horror said it was erasing my SSD system volume.  I powered the Mac off immediately.  It apparently did not get very far because my SSD system volume and its recovery partition are intact and Disk Utility verified my system filesystem is OK.  Whew!  This is a major bug in TM.  I will report it as well.

    The logic of all of this is sound but for 2 or 3 points.
    A: TM is designed to be a "click it and forget it" method of doing a simplex backup for amateur users, ......as such any complexity at all or elaborate nuances in explaining diff. in clones, backups, archives, active and static storage is mostly lost to any amateur who often has a "I dont care, its backed up" attitude.
    B:  You said---"This simple innovation avoids the need of keeping around a cloned disk with its recovery partition".     Neat idea, but far from 'simple'. Nothing is as "frozen" and secure as a clone stashed in a firebox or safe as the prosumers and pros do.
    Recovery partition isnt any kind of necessity, in fact the creator of SuperDuper didnt include and as I spoke with him never WILL include it for a clone option. Ive made clones for years without any recovery, and the recovery partition isnt needed 'in general'. If you upgrade a macbook Pro or Mac Mini, and stash the original drive (to use later to restore in case of selling it), you dont need a recovery on the upgraded internal larger HD, nor do you need one on a periodically updated CLONE.
    Lastly you said "How might one easily create a bootable recovery partition without using CCC......"
    Though Ive used CCC, Superduper for clones turns out more reliable, is more simple......however the entire statement of "how might one easily..........without" implies there IS something "more easy" than CLONE APPS like Superduper or CCC, and there utterly isnt.
    You seem to be pointing at a "revolving secure clone" which elminates the "GAP" between a monthly or biweekly clone update/refresh.
    Ideally you would erase and create a new clone of your updated system every 2 weeks or month, which would therefore leave a gap in data integrity and OS files and system changes.......
    Autonomous constant data hub archiving fills this downside “gap” of HD clones, wherein which the worst that would be lost is a 2 week or one month window of application updates, or system changes irrelevant to your vital data.
    I dont (however some do) care if I lose a system APP update, or a few web bookmarks etc over 2 weeks, I only care about important data I got, made, modified etc.
    For that reason I update/ archive data to 2 connected non-Time machine HD, and archive those in safe storage every month.

  • Ideas for a new kernel patchset

    Hi,
    I'm not much satisfied with the kernel patchsets currently available for Arch, so I'm planning a new patchset (well... it was ready when it was 2.6.20.7 based, but now I'm making a new 2.6.21 based one).
    These would be the planned patches:
    genpatches ( http://dev.gentoo.org/~dsd/genpatches/ ) [not all when they were for 2.6.20... we'll see for 2.6.21]
    AppArmor ( www.novell.com/linux/security/apparmor/ )
    PaX ( http://grsecurity.net/ ) [not the whole grsecurity patchset]
    cfs-scheduler ( http://people.redhat.com/mingo/cfs-scheduler/ ) [a new scheduler from Ingo Molnar... better than the -ck one? Probably yes.]
    Suspend 2 ( http://www.suspend2.net/ )
    SKAS ( http://www.user-mode-linux.org/~blaisorblade/ )
    Squashfs ( http://squashfs.sourceforge.net/ )
    Unionfs ( http://www.am-utils.org/project-unionfs.html )
    Reiser4 ( http://www.namesys.com/ )
    ACPI DSDT ( http://gaugusch.at/kernel.shtml )
    There are some small fixes (genpatches), some "hardening" patches (AppArmor, PaX, SKAS), a new scheduler (cfs-scheduler), improved filesystems support (Squashfs, Unionsfs, Reiser4) and the usual useful things (Suspend 2, ACPI DSDT).
    Do you have any other idea? Let me know.
    Last edited by ekerazha (2007-04-26 10:59:44)

    ekerazha wrote:So... probably I'll use Suspend2 but I'll leave out fbsplash (for the same reason Linus thinks mixed user-space/kernel-space suspend-to-disk capabilities are not a very good idea): fbsplash-based solution uses a mixed user-space/kernel-space approach. Suspend2 seems like a kernel-space only approach. Splashy is an user-space only approach. So no controversial userspace<->kernelspace interfaces using Suspend2 and Splashy (I think... tell me if I'm wrong).
    splashy is totally userspace.
    suspend2 has an option to support userspace progress interfaces, such as userui, fbsplash and others. but the logic and function of suspend2 does not depend on this, it's entirely in the kernel.
    fbsplash is userspace* and can give progress and everything from userspace, however it cannot set the terminal backgrounds unless it is patched -- none of the userspace splash tools set the background.
    regardless, before you get carried away, you might want to work out why you're making this patchset. and for each patch, why are you including it, do people really need these, or are you just beefing it up to try and make one size fit all? This doesn't always work as well as you'd think, and makes testing damn near impossible.
    Work these things out, or you'll probably end up like the other long gone patchsets, nitro, dark, emission, love, ragnarok, klight, light, kamikaze, no, kot, morph, rad, skunk, cko or hammer. And there's more...
    James

  • Separating images within a photo

    I have many birding photos with several birds in one image, such as 3 terns flying.  I want to be able to move one bird closer to another bird.
    Is that possible?

    warblerbird,
    Here's one way:
    1. Select the bird on the left, copy & paste selection to new layer (Layer 1), and move this bird to new position.
    http://www.pixentral.com/show.php?picture=1UKA49AMMi5udHKC70KOdDkwnJvLrs1
    2. Select the original bird and move selection to empty (ocean) area. I temporarily turned off the visibility of Layer 1 so that I would have an area large enough to work with. I used the Rectangular Marquee for the selection, but you can also use the Lasso to roughly select the bird.
    http://www.pixentral.com/show.php?picture=1MrU31ipvAbkw1jgeUK8BOfQgPqTg0
    3. Copy & paste the selection to a new layer (Layer 2) and move this layer to cover the original bird. Note that the edges of the rectangle show. Next step will fix this.
    http://www.pixentral.com/show.php?picture=10slvsalPmfVsms3NQb1uZhlYAXHMA
    4. Merge down Layer 2 onto Background layer. Use Clone tool with soft brush size to clone adjacent areas over the edges.
    http://www.pixentral.com/show.php?picture=1F7Tu8VvUS8YjPKII0gx39F1IKyX0

  • Pbfetch - Please not another AUR frontend

    pbfetch is an AUR frontend and optionally a Pacman wrapper.
    Background and Motivation
    I originally intended to keep pbfetch private, as there are already so many AUR frontends but, after using it for a bit I've decided to let others use, change, belittle, mock, praise and/or look at it.
    pbfetch(PKGBUILD fetch) started as merely a script to download a PKGBUILD from the AUR. I usually like to edit and run makepkg myself for AUR packages, however, there are times where I like a simple
    automated approach. With all due respect to the developers, I found yaourt to be slow(especially on my old laptop). After seeing how complicated yaourt has become I decided to extend pbfetch to encompass most if not all
    my Arch package managment needs.
    Features
    [Current]
    - Can optionally wrap pacman functionality so one can use pbfetch for most pacman commands(eg. pbfetch -Sy, pbfetch -Qs, pbfetch -Rd)
    - Search AUR
    - Download and extract AUR tar.gz to build directory
    - Option to edit PKGBUILD after download
    - Option to make the package with or without installing
    - Dependecy checking(mostly complete, though removes versioning for dependencies not found in official repos)
    - Check for and install AUR updates
    - Option to choose which AUR updates to install
    - Optional color output
    - By default uses sudo where needed
    [Todo]
    - Refactoring for readabilty and speed(already much faster than yaourt)
    - Further ABS support(currently only copies local abs pkg directory to build directory)
    - Better commandline option parsing(possibly getopts)
    - Add edit PKGBUILD option to pacman fallback commands(currently auto-edit only with AUR specific commands)
    - Prettier text output
    - Willing to consider any requests
    Overview
    I had two types of users in mind as I made/make pbfetch.
    1.) Those who prefer to have 1 tool to manage AUR and official repositories
    2.) Those who prefer to keep their AUR frontend separate from Pacman
    As such there are two sets of command line options: those that are AUR specific, and optionally, commands that call the pacman binary and extend for AUR functions.
    I have chosen to call pacman directly where ever possible rather than reimpliment pacman's functions.
    The following is a copy of pbfetch's usage prompt:
    Usage: pbfetch [opiton] [package1] [package2] ....
    options:
    -d Download from aur and extract to build directory
    -de Download from aur, extract and edit PKGBUILD
    -m Download from aur, extract, and make the package(s)
    -me Download from aur, extract, edit PKGBUILD and
    make the package(s)
    -i Download from aur, extract, make and install package(s)
    -ie Download from aur, extract, edit PKGBUILD, make and
    install package(s)
    -s Search aur for any package given
    (Searches name and description)
    -sa Search repo and aur for any package given
    -u Check aur for package updates
    -ue Check aur for package updates and
    edit PKGBUILD before install
    -ua Check aur and official repos for updates
    -abs Copy from local abs folder to build directory
    -v Display version information
    Pacman Fallback(On by default)
    options:
    -S Attempt install with Pacman if package not found
    in repo then install from AUR
    -Ss Search Pacman repos and AUR
    -Sy Refresh database then install from repo or
    AUR if not found in repository
    -Syu --aur Refresh database and upgrade from repo and
    AUR
    Example: pbfetch -S xorg
    pbfetch -d nvidia-beta nvidia-utils-beta
    pbfetch will also pass any pacman related options to the
    pacman binary specifed in the script, eg. pbfetch -Qs
    [Configuration]
    The config file is stored in /etc/pbfetch.conf
    There you can set whether to enable color output, pacman fallback, various working directories etc.
    The pacman binary can be specified as well.(Tested with pacman and pacman-color)
    Default build directory is ~/build/
    [Notes]
    - pbfetch can be called just like pacman and it will pass the command line options untouch if you prefer. Or it can extend pacman's sync to include AUR processing. This is set in the configuration.
    - When checking for AUR updates (eg. pbfetch -u, or pbfetch -Syu --aur) you will be prompted to either accept the updates or you may opt to only choose certain updates. To choose, type the number as seen next
      to the corresponding update. Separate each respective package number by a space.
    [Known or potential caveats]
    - All verbose options such as "--needed" are passed to pacman untouched. However some of the short hand versions have not been implemented when using sync (eg. pbfetch -Sg xorg) in combination with the fallback option set.
    - I've written the script with sudo in mind. The script inserts sudo where needed.
    - Color output assumes dark terminal background. Color can either be turned off or individual colors and be changed in the config file
    - pbfetch was made in my limited free time over the last month so testing of features has been limited to say the least.
    [Development]
    - I have put pbfetch up on github @ http://github.com/dalingrin/pbfetch
    - Please feel free contribute or make requests
    Make no mistake, I have no dreams of pbfetch becoming the next popular AUR frontend like yaourt. I have had fun writing it so far (first bash script) and thought a few like minded individual(s) may enjoy using it as well.
    Package can be found @ http://aur.archlinux.org/packages.php?ID=33256
    Last edited by dalingrin (2010-09-13 21:58:27)

    I have disabled sudo, still I get the following error:
    pbfetch -me qhandbrake-git
    ==> qhandbrake-git [Downloaded]
    ==> qhandbrake-git [Extracted]
    -> qhandbrake-git [Edit complete]
    Checking package for AUR dependencies...
    ==> ERROR: Cannot find the sudo binary! Is sudo installed?
    Missing dependencies cannot be installed or removed as a normal user
    without sudo; install and configure sudo to auto-resolve dependencies.
    cat /etc/pbfetch.conf
    #!/bin/bash
    ################## !WARNING! ####################
    # This file must contain only valid bash syntax #
    #### Pacman sync fallback to AUR ####
    fallback=true
    #fallback=false
    #### Clean up after package building ####
    # if false then package along with source
    # will be left in the build directory
    clean=true
    #clean=false
    #### Colorize output ####
    color=true
    #color=false
    # default colors
    color1="\e[1;37m" # white
    color2="\e[1;34m" # blue
    color3="\e[1;31m" # red
    color4="\e[1;32m" # green
    color5="\e[1;33m" # yellow
    color6="\e[1;35m" # magenta
    #### Pacman binary ####
    pacmanBin="pacman"
    #pacmanBin="pacman-color" # Recommend if using color output
    #### Automatically use sudo when needed ####
    #useSudo=true
    useSudo=false
    #### PKGBUILD editor ####
    editor="nano"
    #editor="gvim"
    #### BUILD DIRECTORY ####
    buildDir=~/build
    #### PACMAN PACKAGE CACHE ####
    pkgCache=/var/cache/pacman/pkg/
    #### LOCAL abs DIRECTORY ####
    abs="/var/abs"
    #### aur URL ####
    aur="http://aur.archlinux.org/packages"

  • Openbox cairo-compmgr or xcompmgr, no "real" compositing

    Hi everyone,
    I apologize in advance for my bad inglish.
    I just baught an old thinkpad x61, equiped with an intel GMA965 chip and an intel X3100 GPU.
    At first, I installed xfce with compiz-fusion. Everything worked perfectly, my terminals had a real transparency, nothing wrong.
    I decided to switch to openbox with xcompmgr or cairo-compmgr. But when I launched either of these, compositing didn't works. It's was copying the wallpaper into the terminal background. Like an image. There was no real transparency, I couldn't see window behind the terminal.
    I tested again on my XFCE session with fusion-icon configured to take openbox. When I launched xcompmgr or cairo-compmgr, it worked perfectly.
    Any Idea ?
    Let me know if something is unclear.
    Thanks in advance.

    Thanks shwick.
    Not affected by the bug. With or without background, no transparency.
    Plus the bug appears in compiz, which is fully operationnal on me, even for transparency.
    And there's no reason for other application, like xterm, to have the same problem
    I tested with the patch, but no change.
    Tryied on fluxbox too.  Didn't work
    I wonder if it comes from my drivers or my xorg configuration... anything like this...

  • What are some ways to remove shine from the face in portraits?

    What are some different methods that people use to remove shine from the face while still leaving enough for a subtle highlight? I would love to hear all the different options I have. Thanks!

    Here is one:
    Open a blank layer above the background layer
    Access the Clone Stamp Tool.
    On the tool's option bar, enter Mode: Darken  Opacity: 30%  Aligned: Checked  Sample all layers: checked
    Zoom in on the shiny area, then ALT+left click a non-shiny skin area to sample the skin. Now, paint over the shiny area

  • Cleaning up backdrop, University Project.

    Hi there,
    Here's a picture from a photo shoot of a table for a university project, unfortunalty the backdrop got pretty dirty and I now need to clean it up.
    After having a look on google I unfortunalty couldn't find anything which covers what I need.
    I have tried the blur, smudge, stamp and spot healing tool but nothing seems to do the trick.
    I am after a seamless background whilst keeping some sublte shadows, how should I go about doing this?
    Is my only option to delete the background and start from scratch?
    Your help is much appreciated.
    Thanks
    Charles

    Is my only option to delete the background and start from scratch?
    No.
    But I think you should make a good Mask for the background and then use Clone Stamp Tool, Healing Brush Tool, … and maybe also the Filters Dust & Scratches, Gaussian Blur, …
    The Brush Tool on a Layer with a Pattern Overlay (of neutral noise set to Linear Light and reduced Opacity) to emulate the noise/grain of the original image can also be useful.
    Edit:

  • Nano syntax highlighting: catch-all syntax for configuration files

    After years of using nano, I only recently learned that it supports syntax coloring... (Why would they turn that off by default? ) Well, I thought I'll make up for it by making extra good use of it from now on...
    Unfortunately it didn't ship a highlighting syntax for the the kind of files that I use nano the most for: system configuration files.
    So I wrote my own, and after tweaking a bit here and there whenever I encountered a config file for which the highlighting wasn't satisfactory at first, I think the result is now good enough (screenshots below) that it's worth sharing with my fellow Arch users:
    Code & Instructions:
    Here is the syntax definition:
    # config file highlighting
    syntax "conf" "(\.(conf|config|cfg|cnf|rc|lst|list|defs|ini|desktop|mime|types|preset|cache|seat|service|htaccess)$|(^|/)(\w*crontab|mirrorlist|group|hosts|passwd|rpc|netconfig|shadow|fstab|inittab|inputrc|protocols|sudoers)$|conf.d/|.config/)"
    # default text
    color magenta "^.*$"
    # special values
    icolor brightblue "(^|\s|=)(default|true|false|on|off|yes|no)(\s|$)"
    # keys
    icolor cyan "^\s*(set\s+)?[A-Z0-9_\/\.\%\@+-]+\s*([:]|\>)"
    # commands
    color blue "^\s*set\s+\<"
    # punctuation
    color blue "[.]"
    # numbers
    color red "(^|\s|[[/:|<>(){}=,]|\])[-+]?[0-9](\.?[0-9])*%?($|\>)"
    # keys
    icolor cyan "^\s*(\$if )?([A-Z0-9_\/\.\%\@+-]|\s)+="
    # punctuation
    color blue "/"
    color brightwhite "(\]|[()<>[{},;:=])"
    color brightwhite "(^|\[|\{|\:)\s*-(\s|$)"
    # section headings
    icolor brightyellow "^\s*(\[([A-Z0-9_\.-]|\s)+\])+\s*$"
    color brightcyan "^\s*((Sub)?Section\s*(=|\>)|End(Sub)?Section\s*$)"
    color brightcyan "^\s*\$(end)?if(\s|$)"
    # URLs
    icolor green "\b(([A-Z]+://|www[.])[A-Z0-9/:#?&$=_\.\-]+)(\b|$| )"
    # XML-like tags
    icolor brightcyan "</?\w+((\s*\w+\s*=)?\s*("[^"]*"|'[^']*'|!?[A-Z0-9_:/]))*(\s*/)?>"
    # strings
    color yellow "\"(\\.|[^"])*\"" "'(\\.|[^'])*'"
    # comments
    color white "#.*$"
    color blue "^\s*##.*$"
    color white "^;.*$"
    color white start="<!--" end="-->"
    To install, save the above above code snippet as a file called conf.nanorc in the folder /usr/share/nano/ (or /usr/local/share/nano/ or similar if you feel strongly about the /usr <--> /usr/local separation), and then add the following to the end of the file /etc/nanorc:
    ## Configuration files (catch-all syntax)
    include "/usr/share/nano/conf.nanorc"
    Hints:
    The colors I chose look good (imo) with the terminal background and color settings that I use, but might not look good, or even readable, with yours, so simply change the color names in the code snippet to whatever you prefer - valid color names are:
    If you use a console with white background, you'll have to change at least the white color I chose for comments and punctuation.
    The first code line in the snippet includes a regular expression that defines for which file names this syntax highlighting should be used. Whenever you encounter a config file that is not matched by this, but you would still like to open it with syntax highlighting, you can manually select this syntax with nano's -Y switch, like so:
    nano -Y conf myConfigFile
    Technical Note:
    It's implemented as a single catch-all syntax, since nano chooses which syntax to apply based on the filename, and in the case of config files usually not much can be learned about the content format from the file name extension (.conf can by anything from flat key/value tuples to XML, .ini can be the official INI format or something else, etc...).
    This means that some compromises have been made, so with this highlighting syntax probably no config file looks 100% as good as a highlighting syntax that would be specifically optimized for one kind of config format, but all in all the vast majority of config files should look pretty good.
    Screenshots:
    /etc/rc.conf,  /etc/hosts:
    /etc/pacman.conf,  /etc/group:
    xorg.conf,  some .desktop file:
    httpd.conf (Apache config),  php.ini:
    More screenshots:
    /etc/fonts/fonts.conf (uses XML)
    /etc/inittab
    /etc/fstab
    /etc/inputrc
    /etc/mime.types
    /etc/protocols
    /etc/xinetd.conf
    See Also:
    nano syntax highlighting: GNU makefiles
    Update [2012-01-28]: Made some more improvements to the syntax definition (see post)
    Last edited by sas (2012-02-01 15:26:43)

    doug piston wrote:I deal with alot of .mk files and would love to see it there.
    You mean GNU makefiles?
    I'm afraid they might be out of scope for this generic config-file syntax.
    Logically they're not system config files, and technically they're a pretty specialized and complex format (different "types" of rules, rules spanning multiple lines, rules containing arbitrary Bash code, etc.).
    This is how an .mk file currently looks with this highlighting syntax:
    $ nano -Y conf /usr/lib/httpd/build/rules.mk
    And apart from highlighting variables of the form $$abc or $(abc), I'm not sure how much can be improved here without breaking the highlighting for more conventional config files.
    It would probably be better to create a specialized highlighting syntax just for .mk files.
    EDIT: I sat down and did just that, here's the result: nano syntax highlighting: GNU makefiles, and here is how the above makefile snipped looks with it:
    Last edited by sas (2012-02-01 15:18:52)

Maybe you are looking for

  • How to avoid the selection of a Parent node and its child node at a time?

    Example: consider the below JTree. Parent1 ---->Parent2 -------->Child3 Parent3 ---->Parent4 My requirement : Parent1 and Parent3 can be selected at a time(using ctrl keys) Parent2 and Parent4 can be selected at a time Parent1 and Parent2 should not

  • How do i overcome "itunes library cannot be saved" message and problems?

    Hi fellow itunes users This is the second time i've had this problem in the past few months. I was working on my itunes for hours getting playlists in order, ripping songs from CDs, etc and all was going well. I burned a whole load of CDs with the ne

  • Old iPhone Vs. New (your thoughts?)

    I have owned the old model for six months and am madly in love. When I saw the new 3G model I was shocked. The sleek smooth design of the first model was changed to a cheep plastic chunky phone that looks like it has a smaller screen. I did not buy t

  • Preview.app search without toolbar

    I can't bear it anymore. I view pdfs (lots of them) in a clean window, with no huge icons taking screen space, no toolbar/sidebar, I take advantage of the marvelous control tool that is my MBP's keyboard, but the search feature of Preview.app has bee

  • Logout has timed out

    I can't seem to get my macbook pro to shut down, one or another Mac application, Mail, Safari, iCal (pick one) won't shut down and I get the Logout error, forcing me to force quit at least one application. Huge pain to shut down each day.