diff --git a/bash_aliases b/bash_aliases new file mode 100644 index 0000000..200c6e2 --- /dev/null +++ b/bash_aliases @@ -0,0 +1,14 @@ +export PATH=~/bin:$PATH +export EDITOR=emacs -nw +alias emacs="emacs -nw" + +function fancy_ps1 () { + local COLOR1="\033[1;32m" + local COLOR2="\033[0;32m" + local NO_COLOR="\033[0m" + + local cur_pwd=${PWD//$HOME/\~} + echo -e "[${COLOR2}${cur_pwd}${NO_COLOR}]" +} + +PS1="\[\033[0;37m\]\342\224\214\342\224\200\$([[ \$? != 0 ]] && echo \"[\[\033[0;31m\]\342\234\227\[\033[0;37m\]]\342\224\200\")[$(if [[ ${EUID} == 0 ]]; then echo '\[\033[0;31m\]\h'; else echo '\[\033[0;33m\]\u\[\033[0;37m\]@\[\033[0;96m\]\h'; fi)\[\033[0;37m\]]\342\224\200\$(fancy_ps1)\[\033[0;37m\]\n\[\033[0;37m\]\342\224\224\342\224\200\342\224\200\342\225\274 \[\033[0m\]" diff --git a/lxpanel/default/config b/lxpanel/default/config new file mode 100644 index 0000000..777995d --- /dev/null +++ b/lxpanel/default/config @@ -0,0 +1,3 @@ +[Command] +FileManager=pcmanfm %s +Terminal=lxterminal diff --git a/lxpanel/default/panels/panel b/lxpanel/default/panels/panel new file mode 100644 index 0000000..2b5abd4 --- /dev/null +++ b/lxpanel/default/panels/panel @@ -0,0 +1,69 @@ +# lxpanel config file. Manually editing is not recommended. +# Use preference dialog in lxpanel to adjust config when you can. + +Global { + edge=bottom + allign=right + margin=0 + widthtype=percent + width=40 + height=30 + transparent=0 + tintcolor=#000000 + alpha=0 + autohide=0 + heightwhenhidden=2 + setdocktype=1 + setpartialstrut=1 + usefontcolor=1 + fontsize=10 + fontcolor=#ffffff + usefontsize=0 + background=1 + backgroundfile=/usr/share/lxpanel/images/background.png + iconsize=24 + loglevel=2 +} + +Plugin { + type = taskbar + expand=1 + Config { + tooltips=1 + IconsOnly=0 + ShowAllDesks=0 + UseMouseWheel=1 + UseUrgencyHint=1 + FlatButton=0 + MaxTaskWidth=150 + spacing=1 + GroupedTasks=0 + } +} + +Plugin { + type = pager +} + +Plugin { + type = tray +} + +Plugin { + type = space + Config { + Size=2 + } +} + +Plugin { + type = dclock + Config { + ClockFmt=%F %R + TooltipFmt=%A + BoldFont=0 + IconOnly=0 + CenterText=0 + } +} + diff --git a/sawfish/rc b/sawfish/rc new file mode 100644 index 0000000..6cd3f78 --- /dev/null +++ b/sawfish/rc @@ -0,0 +1,150 @@ +(require 'sawfish.wm.defaults) + +;;; Programs to run on startup +(system "setxkbmap dvorak") +(system "setxkbmap -option compose:caps") +(system "xscreensaver &") +(system "lxpanel &") + + +;;; Custom functions + +(defun launch-app (app) + (case app + ('chrome (system "google-chrome --disable-gpu-compositing &")) + ('term-code (system "gnome-terminal -t Code &")) + ('term-quick (system "gnome-terminal -t Quick &")) + ('term-std (system "gnome-terminal &")) )) + +; Note that the documentation for 'insert-workspace' is wrong, and we insert +; *after* the provided value, not before +(defun launch-app-in-new-workspace (app) + (progn + (select-workspace (insert-workspace (cdr (workspace-limits)))) + (launch-app app) )) + +(defun send-to-new-workspace () + (progn + (set 'space current-workspace) + (set 'window (input-focus)) + (move-window-to-workspace + window + space + (insert-workspace (cdr (workspace-limits))) + t ) + (select-workspace (cdr (workspace-limits))) )) + +(defun send-workspace-to-top () + (move-workspace current-workspace (- (cdr (workspace-limits)) current-workspace)) ) + +(defun configure-basic-terminal (window) + (progn + (resize-window-to window 1350 800) + (move-window-to window (- (screen-width) 1355) (- (screen-height) 855)) )) + +(defun configure-quick-terminal (window) + (move-window-to window 1811 0) ) + +(defun configure-code-terminal (window) + (progn + (resize-window-to window 1600 1024) + (move-window-to window (- (screen-width) 1605) (- (screen-height) 1074)) )) + +(defun build-new-workspace () + (progn + (launch-app-in-new-workspace 'chrome) + (launch-app 'term-code))) + +(defun destroy-workspace () + (progn + (mapcar + (lambda (win) + (if (not (equal "panel" win)) (destroy-window win)) ) + (workspace-windows) ) + (remove-workspace) + (previous-workspace 1) )) + + +;;; Keybinds +(define apps-keymap (make-keymap)) + +(bind-keys apps-keymap + "t" '(launch-app 'term-std) + "q" '(launch-app 'term-quick) + "o" '(launch-app 'term-code) + "c" '(launch-app 'chrome) ) + +(unbind-keys global-keymap + "W-Left" + "W-Right" + "M-Up" + "M-Down") + +; Workspace bindings +(bind-keys global-keymap + "M-C-Delete" 'restart + "Super-Left" '(previous-workspace 1) + "Super-Right" '(next-workspace 1) + "Super-Up" '(select-workspace (cdr (workspace-limits))) ; top of stack + "Super-Down" '(select-workspace (car (workspace-limits))) ; bottom of stack + "Super-Next" 'move-workspace-forwards + "Super-Prior" 'move-workspace-backwards + "Super-Shift-Next" send-workspace-to-top + "Super-End" destroy-workspace + "M-F1" '(select-workspace 0) + "M-F2" '(select-workspace 1) + "M-F3" '(select-workspace 2) + "M-F4" '(select-workspace 3) + "M-F5" '(select-workspace 4) + "M-F6" '(select-workspace 5) + "M-F7" '(select-workspace 6) + "M-F8" '(select-workspace 7) +) + +; Window-specific workspace bindings +(bind-keys window-keymap + "Super-Shift-Left" 'send-to-previous-workspace + "Super-Shift-Right" 'send-to-next-workspace + "Super-Shift-Up" send-to-new-workspace ) + +; General bindings +(bind-keys global-keymap + "M-TAB" 'cycle-windows + "M-Shift-TAB" 'cycle-windows-backward + "Super-l" '(system "xscreensaver-command -lock") + "Super-x" apps-keymap + "Super-n" build-new-workspace +) + +; Mouse bindings +(bind-keys root-window-keymap + "Button4-Click1" '(previous-workspace 1) + "Button5-Click1" '(next-workspace 1) ) + +; Given a list of paired letter-command items, returns a new list of paired +; letter-function items, where each anonymous function calls the passed +; function with the original string as its argument +; 'function' should be a function, 'map' should be a list of strings +; +; This is currently unused, because my needs changed, but it's an excellent idea. +(defun funcmap (function map) + (mapcar + (lambda (item) + (if (= (length item) 1) + item + (lambda () (function item)) )) + map) ) + + +;;; Custom variables +(set 'lock-first-workspace nil) + +;;; Hooks +(add-hook 'idle-hook delete-empty-workspaces) + +(add-hook 'after-add-window-hook + (lambda (window) + (if (string-match "Terminal" (window-name window)) (configure-basic-terminal window)) + (if (string-match "Quick" (window-name window)) (configure-quick-terminal window)) + (if (string-match "Code" (window-name window)) (configure-code-terminal window)) +))