Imported colours and scripts.
[profile.git] / .xbindkeys / colours / Green
1 #!/bin/bash
2 #
3 # Script to send keystrokes to urxvt to set foreground or background colours.
4 # Usage: $SOME_PATH/<fgbg>/<colour>
5 # Notes: fgbg should be 39 (foreground) or 49 (background).
6 #        colour should be a colour name or a hex code or a string name:#hex
7 #        Create a hardlink to the script with the name of a new colour.
8 # Example: 39/Blue
9 #          49/#2569d9
10 #          49/CacheLogic:#2569d9
11 #
12
13 # Find the type by checking which dir we're in and extracting the 39/49 part.
14 dir=$(dirname $0)
15 fgbg=$(basename $dir)
16
17 # Find the desired colour by looking at this script's name.
18 colour=$(basename $0)
19 colour=${colour#*:}
20
21 cat << EOF | xmacroplay $DISPLAY &>/dev/null
22 KeyStr Escape
23 String iecho -e '\033]$fgbg;$colour\007'
24 KeyStr Return
25 EOF