hgBranch() { if [ -d .hg ]; then printf "$1" "$(hg branch)" fi } export PS1='${USER}@${HOSTNAME}:\w$(hgBranch " [\033[1;31m(%s)\033[0m]")$ '
Tag: linux
Power of grep
How to highlight results in ls output:
ls|grep -E --color "sh$|$"
This will highlight all files with *.sh extension in current directory.
Where -E means that we’re matching entries with regex,
|$ means that we don’t want to skip entries that do not match our regex (passing pipe further and closing it with dollar sign).
Xubuntu-desktop (XFCE) recipes
How to move from Ubuntu 13.04 to Xubuntu (Xfce)?
Good steb-by-step manual: https://sites.google.com/site/easylinuxtipsproject/alternative
How to create keyboard layout shortcut?
setxkbmap -option grp:caps_toggle,grp_led:scroll "us,ru"
How to make desktop icons text transparent (icons shadow analog on Windows)?
Run vi ~/.gtkrc-2.0 and add the following config there:
style "xfdesktop-icon-view" {
## opacity of text background (0 - 255, 0 = transparent)
XfdesktopIconView::label-alpha = 0
XfdesktopIconView::selected-label-alpha = 100
## text background colors
base[NORMAL] = "#EDECEB"
base[ACTIVE] = shade (0.8, "#86ABD9")
base[SELECTED] = "#86ABD9"
## text foreground colors
fg[NORMAL] = shade (0.9, "#FFFFFF")
fg[ACTIVE] = shade (0.8, "#FFFFFF")
fg[SELECTED] = "#FFFFFF"
## whether or not unselected icon text gets truncated (...)
# XfdesktopIconVIew::ellipsize-icon-labels = 1
## text shadow to be painted with the icon labels
# XfdesktopIconView::shadow-x-offset = 0
# XfdesktopIconView::shadow-y-offset = 0
# XfdesktopIconView::shadow-color = "#000000"
# XfdesktopIconView::selected-shadow-x-offset = 0
# XfdesktopIconView::selected-shadow-y-offset = 0
# XfdesktopIconView::selected-shadow-color = "#ffffff"
## spacing and sizing of icons on the grid
# XfdesktopIconVIew::cell-spacing = 6
# XfdesktopIconView::cell-padding = 6
# XfdesktopIconView::cell-text-width-proportion = 2.5
}
widget_class "*XfdesktopIconView*" style "xfdesktop-icon-view"