Jason Ryan avatar Jason Ryan committed 7e4b727

Termite, some new scripts and other bits & pieces

Comments (0)

Files changed (10)

 # vim:fenc=utf-8:nu:ai:si:et:ts=4:sw=4:ft=sh:
 #-------------------------------------------------
 
-# GPG Key
-export GPGKEY=B1BD4E40
+# check for interactive
+[[ $- = *i* ]] || return
 
 # bash options ------------------------------------
 set -o vi                   # Vi mode
-set -o noclobber            # don't inadvertently overwrite files
+set -o noclobber            # do not overwrite files
 shopt -s autocd             # change to named directory
 shopt -s cdable_vars        # if cd arg is not valid, assumes its a var defining a dir
 shopt -s cdspell            # autocorrects cd misspellings
 shopt -s checkwinsize       # update the value of LINES and COLUMNS after each command if altered
 shopt -s cmdhist            # save multi-line commands in history as single line
-shopt -s histappend         # don't overwrite history
+shopt -s histappend         # do not overwrite history
 shopt -s dotglob            # include dotfiles in pathname expansion
 shopt -s expand_aliases     # expand aliases
 shopt -s extglob            # enable extended pattern-matching features
 shopt -s hostcomplete       # attempt hostname expansion when @ is at the beginning of a word
 shopt -s nocaseglob         # pathname expansion will be treated as case-insensitive
 
-# If not running interactively, don't do anything
-[ -z "$PS1" ] && return
-
 set_prompt_style () {
     if [ -n "$SSH_CLIENT" ]; then
         PS1="┌─[\[\e[0;34m\]\h\[\e[0m\] \[\e[1;33m\]\w:\[\e[0m\] \[\e[1;31m\]SSH\[\e[0m\]]\n└─╼ "
 PROMPT_COMMAND="history -a; history -c; history -r"
 export HISTSIZE PROMPT_COMMAND
 
-# Bash completion
-set show-all-if-ambiguous on
+# command not found
+source /usr/share/doc/pkgfile/command-not-found.bash
 
 # visual bell
 set bell-style visible
 alias grep="grep --color=auto"
 alias ls="ls --color=auto"
 
-# command not found
-source /usr/share/doc/pkgfile/command-not-found.bash
-
 # TTYtter hack
 export PERL_SIGNALS=unsafe
 
 alias backmusic="rsync -azPv --exclude=Juno* Music /media/Apollo"
 alias ttytter="Scripts/ttytter.pl -keyf=$HOME/.config/ttytter/key -rc=$HOME/.config/ttytter/jwr"
 
-# Power
-alias reboot="sudo shutdown -r now"
-alias shut="sudo shutdown -h now"
+### Pacman ###
+# bash completion
+complete -cf pacman
 
-######## Pacman ########
-
+# update
 alias pacup="sudo pacman -Syu"
 
 # List updates
 alias lspkg="pacman -Qqu --dbpath /tmp/checkup-db-jason/"
 
 # Remove orphans
-alias orphans="pacman -Qtdq > ~/orphans.txt && less orphans.txt"
+alias orphans="pacman -Qtdq"
 
 # sudo pacman backup packages to Dropbox
 alias pacback='pacman -Qqe | grep -v "$(pacman -Qmq)" > ~/Dropbox/Centurion/pklist.txt'
 # check the log
 paclog() { tail -n"$1" /var/log/pacman.log ;}
 
-# coloured repo search
-search() {
-       echo -e "$(pacman -Ss $@ | sed \
-       -e 's#core/.*#\\033[1;31m&\\033[0;37m#g' \
-       -e 's#extra/.*#\\033[0;32m&\\033[0;37m#g' \
-       -e 's#community/.*#\\033[1;35m&\\033[0;37m#g' \
-       -e 's#^.*/.* [0-9].*#\\033[0;36m&\\033[0;37m#g' )"
-}
-
 unsigned() { expac -S '%r %n %g'|awk '$3=="(null)" {print $1 "/" $2}' > unsigned.packages ; }
 
 # Mounts 

.config/termite/config

+[options]
+resize_grip = false
+scroll_on_output = false
+scroll_on_keystroke = true
+audible_bell = false
+visible_bell = true
+mouse_autohide = true
+allow_bold = false
+dynamic_title = true
+urgent_on_bell = true
+clickable_url = true
+font = Dejavu Sans Mono 10.5
+scrollback_lines = 10000
+search_wrap = true
+geometry = 640x480
+#icon_name = terminal
+
+# 0.0: opaque, 1.0: transparent
+transparency = 0.0
+pseudo_transparency = false
+
+# "system", "on" or "off"
+cursor_blink = system
+
+# "block", "underline" or "ibeam"
+cursor_shape = block
+
+# $BROWSER is used by default
+browser = /home/jason/Scripts/vimprobtab.sh
+
+# word characters used for word selection
+# (default if unset: all graphic non-punctuation/space characters)
+#word_chars = -A-Za-z0-9,./?%&#:_=+@~
+
+[colors]
+foreground = #999999
+foreground_bold = #ffffff
+#foreground_dim = #888888
+background = #080808
+cursor = #5E468C
+
+# if unset, will reverse foreground and background
+highlight = #2f2f2f
+
+# colors from color0 to color254 can be set
+color0 = #242424
+color1 = #8A2F58
+color2 = #287373
+color3 = #914E89
+color4 = #395573
+color5 = #5E468C
+color6 = #2B7694
+color7 = #899CA1
+color8 = #474747
+color9 = #CF4F88
+color10 = #53A6A6
+color11 = #BF85CC
+color12 = #4779B3
+color13 = #7F62B3
+color14 = #47959E
+color15 = #C0C0C0
+
+[hints]
+font = DejaVu Sans Mono 10
+foreground = #121212
+background = #888888
+padding = 2
+border = #3f3f3f
+border_width = 0
+#roundness = 2.0
+
+# vim: ft=dosini
 
 # TAB completion
 set show-all-if-ambiguous on
+set show-all-if-unmodified on
 
 # for vi mode
 set editing-mode vi
     [[ -r $HOME/.bashrc ]] && source $HOME/.bashrc ;; 
 esac
 
+# setup default dirs
+[[ "$XDG_CACHE_HOME" ]] || export XDG_CACHE_HOME="$HOME/.cache"
+[[ "$XDG_CONFIG_HOME" ]] || export XDG_CONFIG_HOME="$HOME/.config"
+[[ "$XDG_DATA_HOME" ]] || export XDG_DATA_HOME="$HOME/.local/share"
+
 # setup environment
 export LC_ALL=
 export LC_COLLATE="C"
 export EDITOR="vim"
+export FCEDIT="vim"
 export VISUAL=$EDITOR
-export FCEDIT="vim"
-export BROWSER="/usr/bin/vimprobable2"
+export GPGKEY="B1BD4E40"
+export BROWSER="$HOME/Scripts/vimprobtab.sh"
 export PRINTER="HP_psc_1200_series"
 export http_proxy="http://127.0.0.1:8118"
 export https_proxy="http://127.0.0.1:8118"
 # Based on Thayer Williams' (http://cinderwick.ca)
 
 # set correct term
-set -g default-terminal screen-256color
+set -g default-terminal "screen-256color-italics"
 
 # set prefix key to ctrl+t
 unbind C-b
     colorscheme miromiro 
 endif
 
+set ttyfast             " don't lag…
 set cursorline          " track position
-set nocompatible        " leave the old ways behind...
+set nocompatible        " leave the old ways behind
 set nowrap              " don't wrap lines
 set nobackup            " disable backup files (filename~)
 set splitbelow          " place new files below the current

Build/vimprobable2-git/PKGBUILD

 _gitbranch="vimprobable2"
 source=("$_gitname::git://git.code.sf.net/p/$_gitname/code")
 md5sums=('SKIP')
+epoch=1
 
 pkgver() {
   cd "$_gitname"
+#!/bin/bash
+# from https://bbs.archlinux.org/viewtopic.php?pid=1231045#p1231045
+
+inf="${1}"
+outf="${2}"
+
+printf "%s\n" "File: $inf"
+
+flac -scd "$inf" | oggenc -o "$outf" -q "${quality:-7}" -
+
+metaflac "$inf" --export-tags-to=- \
+    | perl -ne 'if (m/^([\w]+)\=/) {print "$1\n"}' \
+    | while read tag; do
+        metaflac "$inf" --show-tag="$tag" \
+            | perl -0777pe 's/\n$//;s/\//\/\//g;s/[\n\r]/\\n/g;s/(.)$/$1\n/'
+    done | vorbiscomment -ea "$outf"

Scripts/mp32youtube

+#!/bin/bash
+# based on http://www.crimulus.com/2010/01/21/linux-bash-script-convert-mp3-to-avi-with-static-image-command-line/
+                      
+if [ $# != 3 ] ; then
+    echo "Usage: $0 <image_file> <mp3_file> <output_file.avi>";
+    exit 0;
+fi
+
+TIME=$(ffmpeg -i "$2" |& awk '/Duration/ { sub(/,/,""); print $2 }')
+
+ffmpeg -loop 1 -i "$1" -i "$2" -acodec copy -y -t $TIME "$3"
 read -p "Message body? " message
 
 at "$time" "$date" << EOF
-echo "$message" | mailx -s "REMINDER" jasonwryan@gmail.com
+echo "$message" | mailx -s "REMINDER" jasonryan@fastmail.fm
 EOF
 
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.