Thomas Pelletier avatar Thomas Pelletier committed b3824fc Merge

Merged with master.

Comments (0)

Files changed (13)

 Xft.hintstyle: hintslight
 
 URxvt.scrollBar: off
-URxvt.font: xft:Menlo for Powerline:size=13
 URxvt*termName:screen-256color
-URxvt.foreground:black
-URxvt.background:white
+URxvt.foreground:white
+URxvt.background:black
+
+URxvt*font:                 xft:Menlo for Powerline:regular:size=10
+URxvt*imFont:               xft:Menlo for Powerline:regular:size=10
+URxvt*boldFont:             xft:Menlo for Powerline:bold:size=10
+URxvt*italicFont:           xft:Menlo for Powerline:italic:size=10
+URxvt*boldItalicFont:       xft:Menlo for Powerline:bold:italic:size=10
+
+! black
+URxvt*color0  : #000000
+URxvt*color8  : #000000
+! red
+URxvt*color1  : #E52222
+URxvt*color9  : #E52222
+! green
+URxvt*color2  : #A6E32D
+URxvt*color10 : #A6E32D
+! yellow
+URxvt*color3  : #FC951E
+URxvt*color11 : #FC951E
+! blue
+URxvt*color4  : #BF8DFF
+URxvt*color12 : #BF8DFF
+! magenta
+URxvt*color5  : #FA250F
+URxvt*color13 : #FA250F
+! cyan
+URxvt*color6  : #67D9F0
+URxvt*color14 : #67D9F0
+! white
+URxvt*color7  : #F2F2F2
+URxvt*color15 : #F2F2F2
+
 
 #i18n
 export LANG=en_US.UTF-8 # I prefer english over french, sorry
+export XTERM_LOCALE=$LANG
 
 PYTHONPATH="./:$PYTHONPATH"
 export PYTHONPATH
     PATH="/home/thomas/.gem/ruby/1.9.1/bin:$PATH"
     PATH="/home/thomas/bin/:$PATH"
     export PATH=$PATH
+
+    # Power control using DBus. (need to be in %wheel).
+    alias shutdown='dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop'
+    alias reboot='dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart'
+    alias suspend='dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Suspend'
+    alias hibernate='dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Hibernate'
 # OS X specific
 else
+    alias l='ls -1'
     alias ll='ls -C'
     # Some various binaries
     PATH="/Users/thomas/Bin:$PATH"
 oh-my-zsh = [git]git://github.com/sjl/oh-my-zsh.git
-wo = ssh://hg@bitbucket.org/pelletier/wo
+wo = https://bitbucket.org/pelletier/wo
 vim/.vim/bundle/threesome.vim = https://bitbucket.org/sjl/threesome.vim
 vim/.vim/bundle/gundo.vim = https://bitbucket.org/sjl/gundo.vim
-hg/hg-publishall = ssh://hg@bitbucket.org/pelletier/hg-publishall
+hg/hg-publishall = https://bitbucket.org/pelletier/hg-publishall
 hg/hg-prompt = https://bitbucket.org/sjl/hg-prompt
 hg/hg-git = https://bitbucket.org/durin42/hg-git
 vim/.vim/bundle/powerline = [git]git://github.com/Lokaltog/vim-powerline.git
 xmodmap -e "add Control = Control_L"
 
 export GTK2_RC_FILES="$HOME/.gtkrc-2.0"
+export XTERM_LOCALE=en_US.UTF-8
+export LANG=$XTERM_LOCALE 
+
+export PATH=/home/thomas/bin:$PATH
 
 dropboxd &
 
+#!/bin/bash
+chromium --memory-model=low --purge-memory-button --disk-cache-dir=/tmp=/cache "$@"
+#!/usr/bin/env ruby
+
+require 'date'
+require 'net/http'
+
+$CLOUDAPP_USER = "pelletier.thomas@gmail.com"
+$CLOUDAPP_PASS = "xjm41s3l"
+
+# Generate a file name.
+$FNAME = Time.now.to_s.gsub(':', '-').gsub(' ', '-').gsub('+','') + ".png"
+
+# Function to send a notification using libnotify
+def notify(message)
+  %x{notify-send "[Cloudshot] #{message}"}
+end
+
+# Create the file.
+%x{import #{$FNAME}}
+
+# Ask for the S3 info.
+response = %x{curl http://my.cl.ly/items/new --digest -u "#{$CLOUDAPP_USER}:#{$CLOUDAPP_PASS}" -G -H "Accept: application/json"}
+
+# Check that we haven't reached the limit.
+/\"uploads_remaining\":(?<uploads_count>\d+)/ =~ response
+
+if uploads_count.to_i == 0
+  notify("Daily limit hit!")
+  Process.exit
+end
+
+# Let's construct the S3 request.
+response.gsub! "${filename}", $FNAME
+/\"url\":\"(?<url>.+?)\"/ =~ response
+/\"params\":{(?<params_raw>.+?)}/ =~ response
+
+curl_cmd = ['curl']
+
+params_raw.split(',').each do |param_raw|
+  /\"(?<key>.+?)\":\"(?<val>.+)\"/ =~ param_raw
+  curl_cmd << "-F \"#{key}=#{val}\""
+end
+
+# Add the file.
+curl_cmd << "-F \"file=@#{$FNAME}\""
+curl_cmd << url
+curl_cmd << '-v'
+curl_cmd << '-X POST'
+curl_cmd << '2> /tmp/drop && cat /tmp/drop'
+
+response = %x{#{curl_cmd.join(' ')}}
+
+/< Location: (?<follow>.+)/ =~ response
+
+
+response = %x{curl "#{follow.chomp}" --digest -u "#{$CLOUDAPP_USER}:#{$CLOUDAPP_PASS}" -G -H "Accept: application/json" -v}
+
+/"url":"(?<final_url>.+?)"/ =~ response
+
+%x{echo -n "#{final_url}" | xsel -i -b}
+
+notify("New URL copied to the clipboard")

bin/mount_laptop.sh

+#!/usr/bin/env bash
+cd ~/mnt/
+sshfs 192.168.0.20:/Users/thomas laptop
+#!/bin/bash
+
+synergys -f --config ~/.config/synergy/synergy.conf --debug ERROR
Add a comment to this file

iterm2/com.googlecode.iterm2.plist

Binary file modified.

 beautiful.init("/home/thomas/.config/awesome/theme/theme.lua")
 
 -- This is used later as the default terminal and editor to run.
-terminal = "xterm"
-editor = os.getenv("EDITOR") or "nano"
+terminal = "urxvt"
+editor = os.getenv("EDITOR") or "vim"
 editor_cmd = terminal .. " -e " .. editor
 
 -- Default modkey.
     awful.key({ modkey, "Control" }, "n", awful.client.restore),
 
     -- Prompt
-    awful.key({ modkey },            "r",     function () mypromptbox[mouse.screen]:run() end),
+    awful.key({ modkey }, "r", function() awful.util.spawn( "dmenu_run" ) end),
 
     awful.key({ modkey }, "x",
               function ()
 set guioptions-=r
 set guioptions-=R
 
+if g:os == 'linux'
+    set guioptions-=m
+end
+
 " Set the same leader as in .vimrc
 let mapleader = ","
 
 " Full-screen editing
 nnoremap <leader>f :set invfu<CR>
-

vim/.vim/syntax/hgcommit.vim

+" Language:     hg commit file
+" Author:       Dan LaMotte <lamo0070@umn.edu>
+" Filenames:    ^hg-editor-*.txt
+" Last Change:  2012/06/07
+
+if exists("b:current_syntax")
+    finish
+endif
+
+syn match hgcommitFirstLine  "\%^[^#].*"  nextgroup=hgcommitBlank skipnl
+syn match hgcommitSummary   "^.\{0,50\}" contained containedin=hgcommitFirstLine nextgroup=hgcommitOverflow contains=@Spell
+syn match hgcommitOverflow   ".*" contained contains=@Spell
+syn match hgcommitBlank  "^[^#].*" contained contains=@Spell
+syn match hgcommitComment   "^HG: .*"
+syn match hgcommitOnBranch  "\%(^HG: \)\@<=\<branch\> '" contained containedin=hgcommitComment nextgroup=hgcommitBranch
+syn match hgcommitBranch    "[^']\+" contained
+syn match hgcommitAdded     "\%(^HG: \)\@<=\<added\>" contained containedin=hgcommitComment nextgroup=hgcommitFile
+syn match hgcommitChanged   "\%(^HG: \)\@<=\<changed\>" contained containedin=hgcommitComment nextgroup=hgcommitFile
+syn match hgcommitRemoved   "\%(^HG: \)\@<=\<removed\>" contained containedin=hgcommitComment nextgroup=hgcommitFile
+syn match hgcommitFile      " \S\+" contained containedin=hgcommitAdded,hgcommitChanged
+
+hi def link hgcommitComment         Comment
+hi def link hgcommitOnBranch        Type
+hi def link hgcommitBranch          Keyword
+hi def link hgcommitOnBranchEnd     Comment
+hi def link hgcommitAdded           Type
+hi def link hgcommitChanged         Type
+hi def link hgcommitRemoved         Type
+hi def link hgcommitFile            Constant
+hi def link hgcommitSummary         Keyword
+hi def link hgcommitOverflow        Error
+hi def link hgcommitBlank           Error
+
+let b:current_syntax = "hgcommit"
 
 " Fill the current line with dashes and replace the last 4 characters by
 " markers.
-nnoremap <leader>k mq:call FillLine('-')<cr>`qA<esc>xxxxa {<esc>a{{<esc>
+nnoremap <leader>K mq:call FillLine('-')<cr>`qA<esc>xxxxa {<esc>a{{<esc>
+nnoremap <leader>k mq:call FillLine('-')<cr>`qA
 
 " }}}
 
 " Javascript {{{
 autocmd FileType javascript set tw=80 
 " }}}
+" Mercurial {{{
+
+augroup ft_mercurial
+    au!
+
+    au BufNewFile,BufRead *hg-editor-*.txt setlocal filetype=hgcommit
+augroup END
+
+" }}}
 " Puppet {{{
 
 " Add Puppet file highlighting 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.