Mercurial > dotfiles
view .shell.d/00.path_manipulation.sh @ 266:93a8f55a4e30
xmonad: add takeTopFocus logHook
This is required to make IntelliJ (and supposedly all other Swing
applications) properly notice that they've recieved the
focus. According to [0], the problem is that "xmonad does not follow
ICCCM and ignores WM_TAKE_FOCUS protocol", but the patches on that
ticket haven't yet been accepted, so the function was added to
xmonad-contrib as a workaround until something happens in xmonad
proper.
[0]: http://code.google.com/p/xmonad/issues/detail?id=177
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Wed, 02 Nov 2011 09:53:57 -0500 |
parents | 7dfb7799567f |
children | c85072e620a8 |
line wrap: on
line source
# Functions for manipulating $PATH. Split out so I can use them in .zshenv if I want. function insert_path_element() { insert_element_into_var $1 PATH } function remove_path_element() { remove_element_from_var $1 PATH } function insert_element_into_var () { eval varcontents=\$"$2" eval varname="$2" newcomp="$1" if echo "$varcontents" | grep "$newcomp:" >> /dev/null; then true elif [[ "$varcontents" == "" ]] ; then export $varname="$newcomp" else export $varname="$newcomp:$varcontents" fi } function remove_element_from_var() { eval varcontents=\$"$2" eval varname="$2" newcomp="$1" if echo "$varcontents" | grep "$newcomp:" >> /dev/null; then export $varname="`echo $varcontents | sed s%$newcomp:%%`" elif [[ "$varcontents" == "$newcomp" ]] ; then unset $varname else echo $1 not in $varname fi }