From 29d14f09f8e2c19366a7b0378cbbfc49cfed34f0 Mon Sep 17 00:00:00 2001 From: Collin Doering Date: Sun, 5 Jun 2011 10:42:52 -0400 Subject: [PATCH] Random changes specific to desktop Main changes are just some alias' to easily access rekahsoft-mini thorugh port-knocking + ssh As well as a xbindkeys configuration setup for most generic keyboards and the HHKB2 --- .bash_profile | 3 ++ .bashrc | 5 +++ .emacs | 45 ++++++++++++++++++++ .screenrc | 11 +++-- .xbindkeysrc | 114 ++++++++++++++++++++++++++++++++++++++++++++++++++ .xmobarrc | 4 +- .zshrc | 5 +++ 7 files changed, 182 insertions(+), 5 deletions(-) create mode 100644 .xbindkeysrc diff --git a/.bash_profile b/.bash_profile index c49349b..282ff5d 100644 --- a/.bash_profile +++ b/.bash_profile @@ -1 +1,4 @@ . $HOME/.bashrc + +# Create variable GENERAL_SCREEN which is the pid of one or more screens called "general" +export GENERAL_SCREEN=`screen -ls | grep general | cut -f1 -d'.' | sed 's/\W//g'` diff --git a/.bashrc b/.bashrc index ac5dc71..4f47f28 100644 --- a/.bashrc +++ b/.bashrc @@ -8,6 +8,8 @@ alias grep='grep --color=auto' alias fgrep='fgrep --color-auto' alias egrep='egrep --color-auto' alias ncmpc='ncmpc -c' +alias knk='knock rekahsoft-mini 7713:tcp 1377:udp && sleep 3s && ' +alias knkc='knk ssh rekahsoft-mini ' export GREP_COLOR="1;33" alias grep='grep --color=auto' @@ -17,6 +19,9 @@ PS1='[\u@\h: \w]\$ ' # Turn off noscroll stty stop undef +# Modify path variable to allow execution of mathematica and tools +export PATH=${PATH}:/usr/local/bin + # start keychain eval `keychain --eval --timeout 10 --quiet --agents ssh id_rsa` diff --git a/.emacs b/.emacs index 14ff2bc..12aa0c7 100644 --- a/.emacs +++ b/.emacs @@ -209,6 +209,51 @@ (add-hook 'python-mode-hook 'hs-org/minor-mode) (add-hook 'scheme-mode-hook 'hs-org/minor-mode) +;; Enable autoinsert feature to automagically insert +(require 'autoinsert) +(auto-insert-mode) ;;; Adds hook to find-files-hook +(setq auto-insert-directory "~/.emacs.d/templates/") ;;; Or use custom, *NOTE* Trailing slash important +(setq auto-insert-query nil) ;;; If you don't want to be prompted before insertion + +;; auto-insert options template and auto-completion +(add-hook 'find-file-hooks 'auto-insert) +(setq auto-insert-directory (concat (getenv "HOME") "/.emacs.d/templates/")) +(setq auto-insert-alist + '(("\\.c$" . ["c-template.c" auto-update-generic-template]) + ("\\.\(cc\|cpp\)$" . ["cpp-template.c" auto-update-generic-template]) + ("\\.sh$" . ["shell-template.sh" auto-update-generic-template]) + ("\\.rkt$" . ["racket-template.rkt" auto-update-generic-template]) + ("\\.hs$" . ["haskell-template.rkt" auto-update-generic-template]) + ("\\.py$" . ["python-template.py" auto-update-generic-template]))) +(setq auto-insert 'other) + +(defun auto-update-generic-template () + (save-excursion + ;; Replace @!@FILENAME@!@ with file name sans suffix + (while (search-forward "@!@FILENAME@!@" nil t) + (save-restriction + (narrow-to-region (match-beginning 0) (match-end 0)) + (replace-match (file-name-sans-extension (file-name-nondirectory buffer-file-name)) t)))) + (save-excursion + ;; Replace @!@FILE@!@ with file name + (while (search-forward "@!@FILE@!@" nil t) + (save-restriction + (narrow-to-region (match-beginning 0) (match-end 0)) + (replace-match (file-name-nondirectory buffer-file-name) t)))) + (save-excursion + ;; replace @!@DATE@!@ with today's date + (while (search-forward "@!@DATE@!@" nil t) + (save-restriction + (narrow-to-region (match-beginning 0) (match-end 0)) + (replace-match "") + (insert-date)))) + (save-excursion + ;; Replace @!@YEAR@!@ with the current year + (while (search-forward "@!@YEAR@!@" nil t) + (save-restriction + (narrow-to-region (match-beginning 0) (match-end 0)) + (replace-match (format-time-string "%Y" (current-time))))))) + ;; Insert current date at cursor in the currently active buffer (defun insert-date () "Insert today's date into buffer" diff --git a/.screenrc b/.screenrc index 874cfc6..cd615de 100644 --- a/.screenrc +++ b/.screenrc @@ -1,7 +1,12 @@ # Open several named screens at startup and run different commands in each -screen -t bash 0 bash -screen -t alsamixer 1 alsamixer -#screen -t mc 2 mc *BROKEN* +screen -t zsh 0 zsh +screen -t irssi 1 irssi +screen -t ncmpcpp 2 ncmpcpp +screen -t alsamixer 3 alsamixer +screen -t mc 4 mc + +# Switch to window 1 (irssi) +#screen -p irssi # Set hard status line hardstatus alwayslastline '%{gk}[ %{G}%H %{g}][%= %{wk}%?%-Lw%?%{=b kR}[%{W}%n%f %t%?(%u)%?%{=b kR}]%{= kw}%?%+Lw%?%?%=%{g}][%{Y}%l%{g}]%{=b C}[ %D %m/%d %C%a ]%{W}' diff --git a/.xbindkeysrc b/.xbindkeysrc new file mode 100644 index 0000000..c39ec15 --- /dev/null +++ b/.xbindkeysrc @@ -0,0 +1,114 @@ +# File: .xbindkeysrc +# Date: Sept 23, 2010 +# Author: Collin J. Doering +# Description: File that contains key bindings independant of any DE (using xbindkeys). This file is in the following format: + +## () +# = +#" + c: +#< keycode name> +## END of + +## Multimedia keys (top of keyboard) + +# play/pause key = toggle play pause +#"~/.bin/toggle-pp.py" +"mpc toggle" + m:0x10 + c:172 + XF86AudioPlay +"mpc toggle" + m:0x58 + c:33 + Alt+Mod2+Mod4 + p + +# next key = next song +"mpc next" + m:0x10 + c:171 + XF86AudioNext +"mpc next" + m:0x58 + c:60 + Alt+Mod2+Mod4 + period + +# prev key = previous song +"mpc prev" + m:0x10 + c:173 + XF86AudioPrev +"mpc prev" + m:0x58 + c:59 + Alt+Mod2+Mod4 + comma + +# volume up key = Master volume up 1 +"amixer set Master 1+" + m:0x10 + c:123 + XF86AudioRaiseVolume +"amixer set Master 1+" + m:0x58 + c:30 + Alt+Mod2+Mod4 + u + +# volume down key = Master volume down 1 +"amixer set Master 1-" + m:0x10 + c:122 + XF86AudioLowerVolume +"amixer set Master 1-" + m:0x58 + c:40 + Alt+Mod2+Mod4 + d + +# mute volume key = mute alsa Master channel +"amixer set Master toggle" + m:0x10 + c:121 + XF86AudioMute +"amixer set Master toggle" + m:0x58 + c:58 + Alt+Mod2+Mod4 + m + +## End of Multimedia keys + +## Random keys (F* line of keys) +# Super + Calculator = (speed crunch) +"speedcrunch" + m:0x10 + c:148 + XF86Calculator + +# Super + Calculator = mathematica +"mathematica" + m:0x50 + c:148 + XF86Calculator + +# Sleep key = lock screen with xscreensaver +"xscreensaver-command -lock" + m:0x10 + c:150 + XF86Sleep +## End of F* line of keys + +## Left side of keyboard +# WWW key +"firefox" + m:0x10 + c:158 + XF86WWW + +# Search PC key +#"" +#m:0x10 + c:225 +#XF86Search + +# Search pics key (unknown) + +# Close key +#"" +#m:0x10 + c:214 +#XF86Close + +# Roatate windows key +"tuxcmd" +m:0x10 + c:162 +XF86RotateWindows +# End of left side of keyboard + +## Bottom right keys + +# VOIP end call +#"" +#m:0x10 + c:231 +#Cancel + +## End of Bottom right keys \ No newline at end of file diff --git a/.xmobarrc b/.xmobarrc index 775b861..e26de12 100644 --- a/.xmobarrc +++ b/.xmobarrc @@ -4,8 +4,8 @@ Config { font = "-*-terminus-*-*-*-*-35-*-*-*-*-*-*-u" , position = TopW L 96 , lowerOnStart = True , commands = [ Run Network "eth0" ["-L","0","-H","32","-l", "green", "--normal","orange","--high","red"] 40 - , Run Com "$HOME/.bin/vol.sh" [] "vol" 15 - , Run MultiCpu ["-t","Cpu ","-L","3","-H","50","--high","#f0c040"] 10 + , Run Com "/home/collin/.bin/vol.sh" [] "vol" 15 + , Run MultiCpu ["-t","Cpu | cpu0: | cpu1: | cpu2: | cpu3: ","-L","3","-H","50","--high","#f0c040"] 10 , Run Memory ["-t","Mem: %", "-l", "green", "--normal","orange","--high","red"] 40 , Run Date "%a %b %_d %l:%M %p" "date" 60 , Run CpuFreq ["-t","Freq: | GHz","-L","0","-H","2","-l","green","-n","orange","-h","red"] 50 diff --git a/.zshrc b/.zshrc index d0bb3ee..d0de3d4 100644 --- a/.zshrc +++ b/.zshrc @@ -22,6 +22,8 @@ alias grep='grep --color=auto' alias fgrep='fgrep --color-auto' alias egrep='egrep --color-auto' alias ncmpc='ncmpc -c' +alias knk='knock rekahsoft-mini 7713:tcp 1377:udp && sleep 3s && ' +alias knkc='knk ssh rekahsoft-mini ' export GREP_COLOR="1;33" alias grep='grep --color=auto' @@ -31,6 +33,9 @@ PS1="[%n@%M: %~]%% " # Turn off noscroll stty stop undef +# Modify path variable to allow execution of mathematica and tools +export PATH=${PATH}:/usr/local/bin + # start keychain eval `keychain --eval --timeout 10 --quiet --agents ssh id_rsa`