Skip to content

Instantly share code, notes, and snippets.

View Soft's full-sized avatar

Samuel Laurén Soft

View GitHub Profile
@Soft
Soft / now_playing.sh
Created November 23, 2010 03:11
Mpd status indicator for xmobar
#!/bin/sh
INFO=`mpc`
SONG=`echo -e "$INFO" | head -n1 | tr -d '\n'`
PROGRESS=`echo "$INFO" | sed -ne 's/^.*(\([0-9]*\)%).*$/\1/p'`
if [ -z $PROGRESS ] ; then exit ; fi
if [ "$PROGRESS" -lt "10" ] ; then BAR='<fc=#ffffff>[</fc>----------]' ; fi
if [ "$PROGRESS" -ge "10" ] ; then BAR='<fc=#ffffff>[</fc><fc=#00ff00>></fc>---------<fc=#ffffff>]</fc>' ; fi
if [ "$PROGRESS" -ge "20" ] ; then BAR='<fc=#ffffff>[</fc><fc=#00ff00>=></fc>--------<fc=#ffffff>]</fc>' ; fi
if [ "$PROGRESS" -ge "30" ] ; then BAR='<fc=#ffffff>[</fc><fc=#00ff00>==></fc>-------<fc=#ffffff>]</fc>' ; fi
@Soft
Soft / PKGBUILD
Created November 30, 2010 18:17
pkgbuild for Liero
pkgname=liero-hg
pkgver=`date +%G%m%d`
pkgdesc="OpenLiero continued"
pkgrel=1
license=('BSD')
arch=('686' 'x86_64')
url="https://code.google.com/p/liero/"
depends=('sdl' 'sdl_mixer')
makedepends=('ftjam' 'mercurial' 'unzip' 'wget')
@Soft
Soft / xmonad.hs
Created January 3, 2011 04:35
My Xmonad config
import XMonad
import XMonad.StackSet (sink)
import XMonad.Layout.Named (named)
import XMonad.Layout.NoBorders (smartBorders)
import XMonad.Layout.Reflect (reflectHoriz)
import XMonad.Layout.IM (withIM, Property(..))
import XMonad.Layout.ToggleLayouts (toggleLayouts, ToggleLayout(..))
import XMonad.Layout.ThreeColumns (ThreeCol(..))
import XMonad.Layout.Tabbed (tabbedBottom, defaultTheme, activeColor, inactiveColor,
urgentColor, activeTextColor, inactiveTextColor, urgentTextColor, activeBorderColor,
@Soft
Soft / config
Created January 24, 2011 11:50
My ncmpcpp config
# vim: ft=config
mpd_host = "/home/soft/.mpd/socket"
mpd_music_dir = "/home/soft/music"
user_interface = "alternative"
playlist_display_mode = "columns"
browser_display_mode = "columns"
columns_display_mode = "columns"
@Soft
Soft / toggle_mouse.sh
Created February 14, 2011 16:55
Enables and Disables mouse
#!/bin/sh
state=`xinput --list-props $1 | sed -nr "s/.*Enabled \([0-9]+\):\s+([0-1]).*/\1/p"`
if [ "$state" = "1" ]; then
xinput --set-prop $1 "Device Enabled" 0
else
xinput --set-prop $1 "Device Enabled" 1
fi
@Soft
Soft / statusbar.sh
Created February 17, 2011 15:48
Simple status indicators for xmobar
#!/usr/bin/env sh
status=`amixer -c 0 get Master`
volume=`echo "$status" | sed -rn "s/.*Playback [0-9]+ \[([0-9]+)%\].*/\1/p"`
enabled=`echo "$status" | sed -rn "s/.*Playback [0-9]+ \[[0-9]+%\] \[[0-9\.\-]+dB\] \[(on|off)\].*/\1/p"`
volume_out=0
if [ "$enabled" = "on" ]; then
if [ "$volume" -lt "100" ]; then
echo -n "<fc=#00FF00>$volume%</fc>"
@Soft
Soft / keys
Created May 6, 2011 15:39
More vim like ncmpcpp keys config
key_move_song_up = 'K'
key_move_song_down = 'J'
key_next_found_position = 'n'
key_prev_found_position = 'N'
key_prev_column = 260 'h'
key_next_column = 261 'l'
key_lyrics = '.'
key_home = 262 'g'
key_end = 360 'G'
@Soft
Soft / .tmux.conf
Created May 8, 2011 13:42
My tmux config
set -g prefix C-a
unbind-key C-b
bind-key C-a send-prefix
set -g status off
bind-key m set-option status
set -g default-terminal "screen-256color"
set-option -g status-bg blue
set-option -g status-fg white
@Soft
Soft / .pentadactylrc
Created May 8, 2011 13:45
My Pentadactyl config
" vim: set filetype=vim :
set defsearch=d
set guioptions=bs
set showtabline=never
set complete=sbl
set newtab=all
set hlfind
set titlestring=
@Soft
Soft / gist:970308
Created May 13, 2011 10:22
Weechat key config
/key bind ctrl-H /buffer -1
/key bind ctrl-L /buffer +1
/key bind ctrl-K /window -1
/key bind ctrl-J /window +1
/key bind ctrl-U /window page_up
/key bind ctrl-D /window page_down