Skip to content

Instantly share code, notes, and snippets.

View jslopez's full-sized avatar

Joao S. López jslopez

  • Viña del Mar, Chile
View GitHub Profile
@jslopez
jslopez / gist:3990739
Last active October 12, 2015 07:18
cd + virtualenv activation
# cd + virtualenv activation + ls
function cd() {
# default cd
builtin cd $1;
# virtualenv activation
GIT_DIR=`git rev-parse --git-dir 2> /dev/null`
if [[ $? == 0 ]]
then
if [[ -f $GIT_DIR/../.env/bin/activate ]]
@jslopez
jslopez / kb-layout-toggle
Created August 31, 2013 00:46
Keyboard layout toggle
setxkbmap -layout "latam,us" -option "grp:alt_shift_toggle"
@jslopez
jslopez / gist:6957303
Created October 13, 2013 02:13
Set Transmission as the default handler for magnet links in Google Chrome.

Check that the file /usr/share/applications/transmission-gtk.desktop contains:

Exec=transmission-gtk %U
MimeType=application/x-bittorrent;x-scheme-handler/magnet;

Configure xdg-open to use Transmission: xdg-mime default transmission-gtk.desktop x-scheme-handler/magnet

In order to work properly function with openbox, replace generic with gnome, kde, xfce, or lxde in the file /usr/bin/xdg-open: detectDE