diff options
| -rw-r--r-- | Xdefaults | 6 | ||||
| -rw-r--r-- | muttrc | 4 | ||||
| -rw-r--r-- | ratpoison/README.md | 41 | ||||
| -rwxr-xr-x | ratpoison/clipboard | 3 | ||||
| -rwxr-xr-x | ratpoison/firesend | 2 | ||||
| -rw-r--r-- | ratpoison/functions | 6 | ||||
| -rw-r--r-- | ratpoison/py/color_detect.py | 108 | ||||
| -rw-r--r-- | ratpoison/py/colorz.py | 71 | ||||
| -rw-r--r-- | ratpoison/py/colorz.pyc | bin | 0 -> 2992 bytes | |||
| -rwxr-xr-x | ratpoison/ratcolor | 7 | ||||
| -rw-r--r-- | ratpoison/ratpoisonrc.conf | 32 | ||||
| -rwxr-xr-x | ratpoison/spotlight | 3 | ||||
| -rwxr-xr-x | ratpoison/tray | 13 | ||||
| -rwxr-xr-x | ratpoison/window_menu | 8 | ||||
| -rwxr-xr-x | ratpoison/workspace_menu | 2 | ||||
| -rwxr-xr-x | ratpoison/wp | 252 | ||||
| -rw-r--r-- | vimrc | 9 | ||||
| -rwxr-xr-x | xinitrc | 16 | 
18 files changed, 544 insertions, 39 deletions
| @@ -16,7 +16,7 @@ Xft.hintstyle: hintslight  !-------------------------------------------------------------------------------  URxvt.geometry: 90x30 -URxvt.transparent: true +URxvt.transparent: false  URxvt.fading: 0  ! URxvt.urgentOnBell: true  ! URxvt.visualBell: true @@ -37,7 +37,7 @@ URxvt.scrollBar: false  ! Perl extensions  !URxvt.perl-ext-common: default,matcher  URxvt.matcher.button: 1 -URxvt.urlLauncher: firefox +URxvt.urlLauncher: uzbl-browser  ! Cursor  URxvt.cursorBlink: true @@ -55,5 +55,5 @@ URxvt.keysym.M-s: perl:keyboard-select:search  ! M-u to select open copy links  !URxvt.perl-ext-common: ...,url-select  URxvt.keysym.M-u: perl:url-select:select_next -URxvt.url-select.launcher: /home/vasko/.ratpoison/exec_to_workspace 2 firefox --new-tab +URxvt.url-select.launcher: /home/vasko/.ratpoison/exec_to_workspace 2 uzbl-browser --uri  @@ -2,7 +2,7 @@  #source "gpg2 -dq $HOME/.mutt/pass.gpg |"  # Source  -source ~/.mutt/sol.muttrc +#source ~/.mutt/sol.muttrc  source ~/.mutt/crypto.rc  #Load aliases @@ -87,7 +87,7 @@ macro index,pager gd "<change-folder>=Gmail/drafts<enter>" "Go to drafts"  set delete   #set edit_headers  set fast_reply -set help +unset help  set pager_stop  # Bindings  diff --git a/ratpoison/README.md b/ratpoison/README.md new file mode 100644 index 0000000..6970672 --- /dev/null +++ b/ratpoison/README.md @@ -0,0 +1,41 @@ +# wp + +wp is a small tool I use to generate color schemes from images, and manage desktop wallpapers. + +The color extraction scripts were taken from [this blog post](http://charlesleifer.com/blog/using-python-and-k-means-to-find-the-dominant-colors-in-images/) + with normalization reddit user radiosilence. + +## Dependencies + +As far as I know this only relies on PIL, python image library. I was able to fulfill this dependency with the `python-pillow` package on Arch Linux. +On other systems, `pip install Pillow`. + +## Usage + +``` +$ wp add [file] +``` + +Generates color files .[file].colors and .[file].Xres which can be sourced by shell +scripts and xrdb respectivly. The color files and the image are added to the backgrounds directory. + +``` +$ wp change [file] +``` + +Changes the background image to a random image from the ~/.wallpapers directory, or the file passed, and  loads the .Xres file +into xrdb so xterm or urxvt will use the colors. It also links a script to ~/.colors. If you `source ~/.colors` in a script  +you can use the generated colors with `$COLOR0`, `$COLOR1`, ... + + +``` +$ wp rm [file] +``` + +Removes the image and it's color files from the backgrounds directory. + +``` +$ wp ls +``` + +Lists the images in the backgrounds folder. diff --git a/ratpoison/clipboard b/ratpoison/clipboard index 6b34271..8b5a776 100755 --- a/ratpoison/clipboard +++ b/ratpoison/clipboard @@ -18,6 +18,7 @@  #  command=$1  option=$2 +source ~/.colors  function entries() {      # title entry @@ -42,7 +43,7 @@ function entries() {  function menu() {      echo ~/.ratpoison/ratmenu -label "\"clipboard $command\"" \ -        -style dreary -fg \'#657b83\' -bg \'#eee8d5\' -io 2 $(entries) | sh +        -style dreary -fg \"$COLOR11\" -bg \"$COLOR0\" -io 2 $(entries) | sh  }  function get_stack_depth() { diff --git a/ratpoison/firesend b/ratpoison/firesend index ddde2ef..d0df600 100755 --- a/ratpoison/firesend +++ b/ratpoison/firesend @@ -1,2 +1,2 @@  #!/bin/bash -$HOME/.ratpoison/exec_to_workspace 2 firefox --new-tab $@ +$HOME/.ratpoison/exec_to_workspace 2 uzbl-browser $@ diff --git a/ratpoison/functions b/ratpoison/functions new file mode 100644 index 0000000..fe9ab02 --- /dev/null +++ b/ratpoison/functions @@ -0,0 +1,6 @@ +#!/bin/bash + +function indent { +  echo ":: $*" +} + diff --git a/ratpoison/py/color_detect.py b/ratpoison/py/color_detect.py new file mode 100644 index 0000000..30661f8 --- /dev/null +++ b/ratpoison/py/color_detect.py @@ -0,0 +1,108 @@ +import sys +import colorsys +from colorz import colorz +from math import sqrt + +try: +    import Image +except ImportError: +    from PIL import Image + +if len(sys.argv) < 2: +  print "Usage: {0} FILENAME [num_colors]".format(sys.argv[0]) +  sys.exit() + + +print sys.argv[1] + +WALLPAPER = sys.argv[1] +filename = WALLPAPER.split('/').pop() +COLORS = ".{0}.colors".format(filename) +XRESOURCES = ".{0}.Xres".format(filename) +SAMPLE = ".{0}.sample.png".format(filename) + +cols = '' +xres = '' + +def torgb(hexv): +    hexv = hexv[1:] +    r, g, b = ( +        int(hexv[0:2], 16) / 256.0, +        int(hexv[2:4], 16) / 256.0, +        int(hexv[4:6], 16) / 256.0, +    ) +    return r, g, b + +def normalize(hexv, minv=128, maxv=256): +    r, g, b = torgb(hexv) +    h, s, v = colorsys.rgb_to_hsv(r, g, b) +    minv = minv / 256.0 +    maxv = maxv / 256.0 +    if v < minv: +        v = minv +    if v > maxv: +        v = maxv +    r, g, b = colorsys.hsv_to_rgb(h, s, v) +    return '#{:02x}{:02x}{:02x}'.format(int(r * 256), int(g * 256), int(b * 256)) + +def darkness(hexv): +  r, g, b = torgb(hexv) +  darkness = sqrt((255 - r) ** 2 + (255 - g) ** 2 + (255 - b) ** 2) +  return darkness + +def to_hsv(c): +    r, g, b = torgb(c) +    h, s, v = colorsys.rgb_to_hsv(r, g, b) +    return h, s, v + +def hex_color_to_rgb(color): +    color = color[1:] if color[0]=="#" else color +    return ( +        int(color[:2], 16), +        int(color[2:4], 16), +        int(color[4:], 16) +        ) + +def create_sample(f, colors): +    im = Image.new("RGB", (1000, 100), "white") +    pix = im.load() + +    width_sample = im.size[0]/len(colors) + +    for i, c in enumerate(colors): +        for j in range(width_sample*i, width_sample*i+width_sample): +            for k in range(0, 100): +                pix[j, k] = hex_color_to_rgb(c) + +    im.save(f) + +if __name__ == '__main__': +    if len(sys.argv) == 2: +        n = 16 +    else: +        n = int(sys.argv[2]) + + +    i = 0 +    # sort by value, saturation, then hue +    colors = colorz(WALLPAPER, n=n) +    colors.sort(key=lambda  x:darkness(x), reverse=True) +    for c in colors: +        if i == 0: +            c = normalize(c, minv=0, maxv=32) +        elif i == 8: +            c = normalize(c, minv=128, maxv=192) +        elif i < 8: +            c = normalize(c, minv=160, maxv=224) +        else: +            c = normalize(c, minv=200, maxv=256) +        c = normalize(c, minv=32, maxv=224) +        xres += """*color{}: {}\n""".format(i, c) +        cols += """export COLOR{}="{}"\n""".format(i, c) +        i += 1 + +    create_sample(SAMPLE, colors) +    with open(XRESOURCES, 'w') as f: +        f.write(xres) +    with open(COLORS, 'w') as f: +        f.write(cols) diff --git a/ratpoison/py/colorz.py b/ratpoison/py/colorz.py new file mode 100644 index 0000000..8c00f0c --- /dev/null +++ b/ratpoison/py/colorz.py @@ -0,0 +1,71 @@ +from collections import namedtuple +from math import sqrt +import random +try: +    import Image +except ImportError: +    from PIL import Image + +Point = namedtuple('Point', ('coords', 'n', 'ct')) +Cluster = namedtuple('Cluster', ('points', 'center', 'n')) + +def get_points(img): +    points = [] +    w, h = img.size +    for count, color in img.getcolors(w * h): +        points.append(Point(color, 3, count)) +    return points + +rtoh = lambda rgb: '#%s' % ''.join(('%02x' % p for p in rgb)) + +def colorz(filename, n=3): +    img = Image.open(filename) +    img.thumbnail((200, 200)) +    w, h = img.size + +    points = get_points(img) +    clusters = kmeans(points, n, 1) +    rgbs = [map(int, c.center.coords) for c in clusters] +    return map(rtoh, rgbs) + +def euclidean(p1, p2): +    return sqrt(sum([ +        (p1.coords[i] - p2.coords[i]) ** 2 for i in range(p1.n) +    ])) + +def calculate_center(points, n): +    vals = [0.0 for i in range(n)] +    plen = 0 +    for p in points: +        plen += p.ct +        for i in range(n): +            vals[i] += (p.coords[i] * p.ct) +    return Point([(v / plen) for v in vals], n, 1) + +def kmeans(points, k, min_diff): +    clusters = [Cluster([p], p, p.n) for p in random.sample(points, k)] + +    while 1: +        plists = [[] for i in range(k)] + +        for p in points: +            smallest_distance = float('Inf') +            for i in range(k): +                distance = euclidean(p, clusters[i].center) +                if distance < smallest_distance: +                    smallest_distance = distance +                    idx = i +            plists[idx].append(p) + +        diff = 0 +        for i in range(k): +            old = clusters[i] +            center = calculate_center(plists[i], old.n) +            new = Cluster(plists[i], center, old.n) +            clusters[i] = new +            diff = max(diff, euclidean(old.center, new.center)) + +        if diff < min_diff: +            break + +    return clusters diff --git a/ratpoison/py/colorz.pyc b/ratpoison/py/colorz.pycBinary files differ new file mode 100644 index 0000000..9c842d7 --- /dev/null +++ b/ratpoison/py/colorz.pyc diff --git a/ratpoison/ratcolor b/ratpoison/ratcolor new file mode 100755 index 0000000..97cd406 --- /dev/null +++ b/ratpoison/ratcolor @@ -0,0 +1,7 @@ +#!/bin/bash +source ~/.colors +ratpoison -c "set bgcolor $COLOR0" +ratpoison -c "set bwcolor $COLOR0" +ratpoison -c "set fgcolor $COLOR11" +ratpoison -c "set fwcolor $COLOR11" + diff --git a/ratpoison/ratpoisonrc.conf b/ratpoison/ratpoisonrc.conf index 0f8fdf6..05dac26 100644 --- a/ratpoison/ratpoisonrc.conf +++ b/ratpoison/ratpoisonrc.conf @@ -45,12 +45,12 @@ exec xsetroot -cursor_name left_ptr  #Effects & Background  #exec xcompmgr -c -f & -exec nitrogen --restore +#exec nitrogen --restore  #Border & Padding  alias showpadding set border 3  alias hidepadding set border 0 -hidepadding +showpadding  barinpadding 0  alias showborder set barpadding 0 0 @@ -68,21 +68,21 @@ alias rpbarsend exec ~/.ratpoison/rpbarsend  unmanage rpbar  # hooks -addhook switchwin rpbarsend -addhook switchframe rpbarsend -addhook switchgroup rpbarsend -addhook deletewindow rpbarsend -# RP versions >= 1.4.6 (from the git repo) have these hooks. -# Recommended! -addhook titlechanged rpbarsend -addhook newwindow rpbarsend +#addhook switchwin rpbarsend +#addhook switchframe rpbarsend +#addhook switchgroup rpbarsend +#addhook deletewindow rpbarsend +## RP versions >= 1.4.6 (from the git repo) have these hooks. +## Recommended! +#addhook titlechanged rpbarsend +#addhook newwindow rpbarsend  unmanage conky  unmanage xfce4-panel  unmanage ratbar.pl  alias showpanel set padding 0 27 0 0  alias hidepanel set padding 0 0 0 0 -showpanel +#showpanel  #-------------------------------------------------------------  # Workspaces  #------------------------------------------------------------- @@ -170,11 +170,10 @@ bind K exchangeup  bind w window_menu  bind a title  bind t time -definekey top s-l exec i3lock -n -i ~/Pictures/1440.png +definekey top s-l exec i3lock -n -i ~/.wallpaper  definekey top s-s exec ~/bin/sus  definekey top s-L redisplay -bind c exec gnome-control-center -bind C exec sudo gnome-control-center +bind C exec ~/.ratpoison/wp change  bind v hsplit  bind V hsplit 2/3  bind s vsplit @@ -227,6 +226,7 @@ bind i insert_X_selection  #-------------------------------------------------------------  definekey top s-f exec firefox +definekey top s-u exec uzbl-browser  definekey top s-m exec /home/vasko/.ratpoison/pentfocus  definekey top s-v exec vlc  definekey top s-g exec gvim @@ -261,8 +261,8 @@ definekey top s-Pause voltoggle  #-------------------------------------------------------------  # Brightness Control  #------------------------------------------------------------- -alias brightup exec xbacklight +2 -alias brightdown exec xbacklight -2 +alias brightup exec xbacklight -inc 10 +alias brightdown exec xbacklight -dec 2  definekey top XF86MonBrightnessUp brightup  definekey top XF86MonBrightnessDown brightdown diff --git a/ratpoison/spotlight b/ratpoison/spotlight index bfe196e..2ec8bfb 100755 --- a/ratpoison/spotlight +++ b/ratpoison/spotlight @@ -1,3 +1,4 @@  #!/bin/sh -{ find ~/ \( ! -regex '.*/\..*' \); find ~/ \( -regex '.*/\..*' \) ; } | grep -v 'dotfiles/vim/undodir' | sed 's/ /\\ /g'  | dmenu -i -l 20 -nb '#eee8d5' -nf '#657b83' | xargs urxvt -e rifle -p0 +source ~/.colors +find ~/ -not -path "~/Games/*" -not -path "~/.mozilla/*" -not -path "~/dotfiles/vim/undodir/*" | sed 's/ /\\ /g'  | dmenu -i -l 20 -nb $COLOR11 -nf $COLOR0 | xargs urxvt -e rifle -p0  exit 0 diff --git a/ratpoison/tray b/ratpoison/tray new file mode 100755 index 0000000..16fbb56 --- /dev/null +++ b/ratpoison/tray @@ -0,0 +1,13 @@ +#!/bin/bash + +source ~/.colors + +mon_num=${1:-0} +width=${2:-0} +height=${3:-0} +x=${4:-0} +y=${5:-0} + +let x_offset=$x+$width-16 +stalonetray -bg $COLOR0 --geometry 1x1+$x_offset+$y --grow-gravity NE \ +  --icon-size 16 --icon-gravity W --kludges force_icons_size diff --git a/ratpoison/window_menu b/ratpoison/window_menu index 46b4bd3..416ee12 100755 --- a/ratpoison/window_menu +++ b/ratpoison/window_menu @@ -8,27 +8,29 @@  order=sequential  ratmenu="~/.ratpoison/ratmenu" +source ~/.colors +  # Yes, bash is really necessary, because it's version of printf makes this  # script possible.  Regular bourne shell printf does NOT.  window_index_str=$(ratpoison -c "info" | sed 's/^.*\([0-9]\)(.*$/\1/')  if [ "$window_index_str" = "No window." ]; then      group_index=$($HOME/.ratpoison/workspace current) -    $ratmenu -style dreary -fg "#657b83" -bg "#eee8d5" "No windows in group $group_index"  +    $ratmenu -style dreary -fg \"$COLOR0\" -bg \"$COLOR0\" "No windows in group $group_index"   /bin/true  else      ratpoison -c "echo $window_index_str"      echo "$window_index_str">/tmp/log      window_index=$[ $window_index_str + 1 ]      if [ $order = sequential ]; then -        ( printf "$ratmenu -style dreary -fg '#657b83' -bg '#eee8d5' -io $window_index \ +        ( printf "$ratmenu -style dreary -fg \"$COLOR11\" -bg \"$COLOR0\" -io $window_index \            ";            ratpoison -c "windows %n %n %t" | sort -n | while read w x z; do              a=$(printf "%3q" $x); b="ratpoison -c \"select $x\"";              printf " %q\\ %q %q"  "$a" "$z" "$b";            done; echo \;) | sh      elif [ $order = last ]; then -        ( printf "$ratmenu -style dreary -fg '#657b83' -bg '#eee8d5' -io $window_index \ +        ( printf "$ratmenu -style dreary -fg \"$COLOR11\" -bg \"$COLOR0\" -io $window_index \            ";            ratpoison -c "windows %l %n %t" | sort -rn | while read w x z; do              a=$(printf "%3q" $x); b="ratpoison -c \"select $x\""; diff --git a/ratpoison/workspace_menu b/ratpoison/workspace_menu index 6ffcb14..dc3b723 100755 --- a/ratpoison/workspace_menu +++ b/ratpoison/workspace_menu @@ -9,7 +9,7 @@  workspace_command="/usr/bin/rpws"  ratmenu="~/.ratpoison/ratmenu" -( printf "$ratmenu -style dreary -fg '#657b83' -bg '#eee8d5' -io $[ $($workspace_command current) + 1 ]"; +( printf "$ratmenu -style dreary -fg \"$COLOR11\" -bg \"$COLOR0\" -io $[ $($workspace_command current) + 1 ]";    ratpoison -c "groups" | while read s; do      n=$(echo $s | sed 's/\([0-9]\+\).*/\1/');  #    w=$(echo $s | sed 's/[0-9]\+.\(.*\)/\1/'); diff --git a/ratpoison/wp b/ratpoison/wp new file mode 100755 index 0000000..9ee39f6 --- /dev/null +++ b/ratpoison/wp @@ -0,0 +1,252 @@ +#!/bin/bash + +function main { + +  # Snippet from SO user Dave Dopson http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in +  SOURCE="${BASH_SOURCE[0]}" +  # resolve $SOURCE until the file is no longer a symlink +  while [ -h "$SOURCE" ]; do +    DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" +    SOURCE="$(readlink "$SOURCE")" +    # if $SOURCE was a relative symlink, we need to resolve it +    # relative to the path where the symlink file was located +    [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" +  done +  DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" +  K_MEANS=16 +  WALLPAPER_DIR=${WALLPAPER_DIR:-~/.wallpapers/} + +  while test $# -gt 0; do +      case "$1" in +          usage | -h | --help) +              shift +              usage +              ;; +          n | -n) +              shift +              K_MEANS=$1 +              shift +              ;; +          add | -a | --add) +              shift +              add $* +              ;; +          rm | remove | -rm | --remove) +              shift +              remove $* +              ;; +          change) +              shift +              change $* +              ;; +          current) +              shift +              current $* +              ;; +          ls | list | -l | --list) +              shift +              list $* +              ;; +          colors) +              shift +              colors +              ;; +          slideshow) +              shift +              slideshow $* +              ;; +          *) +              shift +              indent "$1 is not a recognised directive" +              ;; +      esac +  done +} + +#:: Prety print function +function indent { +  echo ":: $*" +} + +#:: Confirm user input +function confirm { +  indent $1 +  read -sn 1 ans +  case "$ans" in +    y|Y|yes|YES|Yes) return 0 ;; +    *)  return 1 ;; +  esac +} + +#:: Directives + +function add { +  if [ 0 = $# ]; then +    indent "No file argument provided" +    exit 1 +  fi + +  files=$* + +  for file in $files; do +    if [ ! -f $file ]; then +      indent "File '$file' doesn't exist" +      exit 1 +    fi +  done + +  cp $files $WALLPAPER_DIR +  cd $WALLPAPER_DIR + +  for file in $*; do +    echo ":: Generating .$file.colors and .$file.Xres in $PWD" +    python2 $DIR/py/color_detect.py $file $K_MEANS +  done +} + +function remove { +  if [ 0 = $# ]; then +    if confirm "Delete current background? [Y/n]"; then +      remove $(basename $(get_current)) +    else +      echo "exiting" +      exit 1 +    fi +  fi + +  for file in $*; do +    indent "Removing $file" +    rm ${WALLPAPER_DIR}/${file} +    rm ${WALLPAPER_DIR}/.${file}.{colors,Xres} +  done +} + +function change { +  #:: Select a random background from WALLPAPER_DIR, or use the passed background +  if [ -z $1 ]; then +    background=$(find $WALLPAPER_DIR -type f \( ! -iname ".*" \) | shuf -n1) +  else +    background=$WALLPAPER_DIR/$1 + +    if [ ! -f $background ]; then +      indent "$1 does not exist in $WALLPAPER_DIR" +      exit 1 +    fi +  fi + +  if [ -f ${background}.Xres ] || [ -f ${background}.colors ]; then +    indent "Could not find ${background}.Xres or ${background}.colors" +    exit 1 +  fi + +  filename=$(basename $background) +  dirname=$(dirname $background) + +  #:: Set the background +  feh --bg-fill $background +  cp $background ~/.wallpaper + +  #:: Record the current background +  set_current $background + +  if [ $? -ne 0 ]; then +    indent "Failed to set $background as background" +  else +    indent "Set $background as background" + +    #:: Set the colorscheme +    ln -f ${dirname}/.${filename}.colors ~/.colors +    xrdb -merge ${dirname}/.${filename}.Xres +  fi +} + +function slideshow { +  if [ -z $2 ]; then +    PAPERS=$(list) +  elif [ -e $2 ]; then +    PAPERS=$(cat $2) +  else +    PAPERS=$2 +  fi + +  for img in $PAPERS; do +    change $img +    if [ ! -z "$1" ]; then +        /bin/bash -c "$1" +    fi +    sleep 7 +  done +} + +function current { +  indent $(get_current) +} + +function get_current { +  readlink -f $WALLPAPER_DIR/.current +} + +function set_current { +  ln -sf $1  $WALLPAPER_DIR/.current +} + +function list { +  ls $* $WALLPAPER_DIR +} + +function colors { +  # Original: http://frexx.de/xterm-256-notes/ +  #           http://frexx.de/xterm-256-notes/data/colortable16.sh +  # Modified by Aaron Griffin +  # and further by Kazuo Teramoto +  FGNAMES=(' black ' '  red  ' ' green ' ' yellow' '  blue ' 'magenta' '  cyan ' ' white ') +  BGNAMES=('DFT' 'BLK' 'RED' 'GRN' 'YEL' 'BLU' 'MAG' 'CYN' 'WHT') + +  echo "     ┌──────────────────────────────────────────────────────────────────────────┐" +  for b in {0..8}; do +    ((b>0)) && bg=$((b+39)) + +    echo -en "\033[0m ${BGNAMES[b]} │ " + +    for f in {0..7}; do +      echo -en "\033[${bg}m\033[$((f+30))m ${FGNAMES[f]} " +    done + +    echo -en "\033[0m │" +    echo -en "\033[0m\n\033[0m     │ " + +    for f in {0..7}; do +      echo -en "\033[${bg}m\033[1;$((f+30))m ${FGNAMES[f]} " +    done + +    echo -en "\033[0m │" +    echo -e "\033[0m" + +    ((b<8)) && +    echo "     ├──────────────────────────────────────────────────────────────────────────┤" +  done +  echo "     └──────────────────────────────────────────────────────────────────────────┘" +} + +function usage { +  printf "%b" "  $0 [action] [options] + +Actions +- usage:                Print this help message. +- n [number]   :        Number of colors to gather. +- add [file]...:        Add file, or files, to the wallpaper database. +- rm  [file]...:        Remove file, or files, from the wallpaper database. +- change [file]:        Set the wallpaper to file, or a random wallpaper +                        from the wallpaper database. +- slideshow [cmd file]: Rotate through wallpapers, optionally +                        running cmd each time and using only +                        wallpapers listed in the file. +- current:              List the current background +- ls:                   List all wallpapers in the database. +- colors:               Display the current set of colors. +" +} + +#:: End function declaration, begin executing +main $* +~/.ratpoison/ratcolor @@ -56,7 +56,7 @@ if filereadable("/etc/vim/vimrc.local")    source /etc/vim/vimrc.local  endif -set number +"set number  "set spell  set ruler @@ -64,7 +64,7 @@ set ruler  "Solarized settings  set background=light  set t_Co=256 -colorscheme solarized +"colorscheme solarized  "setlocal fo+=aw  "Autosave and Autoread @@ -80,6 +80,11 @@ let g:tex_flavor='latex -interaction=nonstopmode'  let g:Tex_DefaultTargetFormat='pdf'  let g:Tex_CompileRule_pdf = 'pdflatex -interaction nonstopmode $*' + +let Tex_FoldedSections="" +let Tex_FoldedEnvironments="" +let Tex_FoldedMisc="" +  "For god sake make line numbers usefull  "set relativenumber @@ -35,7 +35,7 @@ fi  wmname LG3D  # Background -nitrogen --restore +~/.ratpoison/wp change &  #Run dropbox  dropboxd & @@ -49,7 +49,7 @@ xset m 0 0  xset -b  # Launch locking program -xautolock -detectsleep -locker 'i3lock -i ~/Pictures/1440.png' -time 11 -corners 0-00 & +xautolock -detectsleep -locker 'i3lock -i ~/.wallpaper' -time 11 -corners 0-00 &  # Load xterm colors  xrdb -merge ~/.Xresources @@ -197,7 +197,7 @@ fi  #     window 1: wicd   if [ $run_everything = true -o $run_workspace = 2 ]; then      $workspace 11 -    $xtoolwait $term  wicd-curses +    $xtoolwait $term sudo wpa_supplicant -i wlp2s0 -c /etc/wpa_supplicant/wpa_supplicant-wlp2s0.conf      number_and_title 0 "wicd"  fi @@ -219,19 +219,17 @@ if [ $run_everything = true -o $run_workspace = 2 ]; then      number_and_title 0 "volume"  fi -# workspace 2 : Firefox workspace -#     window 1+: firefox +# workspace 2 : Uzbl workspace  if [ $run_everything = true -o $run_workspace = 2 ]; then      $workspace 2 -    firefox & -    number_and_title 0 "firefox" +    uzbl-browser &  fi  # Default workspace: 1(ranger)  #	$workspace 1 -xfce4-panel --disable-wm-check & -sleep 2 && rpbar +#xfce4-panel --disable-wm-check & +#sleep 2 && rpbar  #######################################################################  sleep 1 | 
