diff --git a/20-keyboard.conf b/20-keyboard.conf new file mode 100644 index 0000000..b34b743 --- /dev/null +++ b/20-keyboard.conf @@ -0,0 +1,9 @@ +# ln -s this /etc/X11/xorg.conf.d + +Section "InputClass" + Identifier "Keyboard Defaults" + MatchIsKeyboard "yes" +# Option "XkbModel" "acer_laptop" +# Option "XkbLayout" "jp" + Option "XkbOptions" "ctrl:nocaps,ctrl:menu_rctrl" +EndSection diff --git a/_keysnail.js b/_keysnail.js index 4898c0c..1b359af 100644 --- a/_keysnail.js +++ b/_keysnail.js @@ -158,6 +158,10 @@ plugins.options["twitter_client.use_jmp"] = true; //////////////////////////////////////////// // my ext +ext.add('view-page-source', function(){ + window.content.location.href = "view-source:" + window.content.location.href; +}, 'view page source'); + ext.add('my-setpref', function(){ util.setPrefs( { @@ -192,7 +196,7 @@ ext.add('my-setpref', function(){ "general.warnOnAboutConfig":false, "keyword.URL":"http://www.bing.com/search?q=", "network.dns.disableIPv6":true, - "refcontrol.actions":"@DEFAULT=@FORGE", + "refcontrol.actions":"@DEFAULT=@FORGE www.heartrails.com=@NORMAL www.pixiv.net=@NORMAL", "scrapbook.tabs.open":true } ); @@ -474,7 +478,7 @@ ext.add("list-tab-history", function () { // ========================= Special key settings ========================== // -key.quitKey = ""; +key.quitKey = "ESC"; key.helpKey = ""; key.escapeKey = "C-q"; key.macroStartKey = ""; @@ -546,14 +550,29 @@ key.setGlobalKey('C-', function () { } }, '選択中のタブを左へ'); -key.setGlobalKey('M-:', function (ev) { - command.interpreter(); -}, 'JavaScript のコードを評価'); - key.setGlobalKey('C-h', function (ev, arg) { return; }, 'ignore'); +key.setViewKey('L', function (ev, arg) { + ext.exec("hok-start-foreground-mode", arg, ev); +}, 'Start Hit a Hint foreground mode', true); + +key.setGlobalKey('', function (ev, arg) { + let (elem = document.commandDispatcher.focusedElement) elem && elem.blur(); + gBrowser.focus(); + content.focus(); +}, 'コンテンツへフォーカス', true); + +key.setGlobalKey('C-p', function (ev, arg) { + return !document.getElementById("keysnail-prompt").hidden && + document.getElementById("keysnail-prompt-textbox").focus(); +}, 'KeySnail のプロンプトへフォーカス', true); + +key.setViewKey('c', function (ev) { + command.interpreter(); +}, 'JavaScript のコードを評価'); + key.setViewKey('D', function (ev, arg) { ext.exec("dig-url", arg, ev); }, 'dig url with selector', true); @@ -644,10 +663,6 @@ key.setViewKey('!', function (ev, arg) { shell.input(); }, 'Command system'); -key.setViewKey('b', function (ev, arg) { - BarTap.putOnTap(gBrowser.mCurrentTab, gBrowser); -}, 'bartab put on tab'); - key.setViewKey('R', function () { BrowserReloadSkipCache(); }, '更新(キャッシュを無視)'); @@ -688,7 +703,7 @@ key.setViewKey([[''], ['']], function (ev, arg) { return; }, 'ignore'); -key.setViewKey([[':'], ['P']], function (ev, arg) { +key.setViewKey(':', function (ev, arg) { return !document.getElementById("keysnail-prompt").hidden && document.getElementById("keysnail-prompt-textbox").focus(); }, 'KeySnail のプロンプトへフォーカス', true); @@ -697,10 +712,6 @@ key.setViewKey('H', function (ev, arg) { ext.exec("open-hatebu-comment", arg, ev); }, 'hatebu', true); -key.setViewKey('l', function (ev) { - command.focusToById("urlbar"); -}, 'ロケーションバーへフォーカス', true); - key.setViewKey('0', function (ev) { BrowserCloseTabOrWindow(); }, 'タブ / ウィンドウを閉じる'); @@ -724,3 +735,35 @@ key.setViewKey('T', function (ev, arg) { key.setEditKey('C-', function (ev) { command.walkInputElement(command.elementsRetrieverTextarea, true, true); }, '次のテキストエリアへフォーカス'); + +key.setViewKey('j', function (ev) { + key.generateKey(ev.originalTarget, KeyEvent.DOM_VK_DOWN, true); +}, '一行スクロールダウン'); + +key.setViewKey('k', function (ev) { + key.generateKey(ev.originalTarget, KeyEvent.DOM_VK_UP, true); +}, '一行スクロールアップ'); + +key.setViewKey('J', function (ev) { + getBrowser().mTabContainer.advanceSelectedTab(1, true); +}, 'ひとつ右のタブへ'); + +key.setViewKey('K', function (ev) { + getBrowser().mTabContainer.advanceSelectedTab(-1, true); +}, 'ひとつ左のタブへ'); + +key.setViewKey('b', function (ev) { + BrowserBack(); +}, '戻る'); + +key.setViewKey('B', function (ev) { + BrowserForward(); +}, '進む'); + +key.setViewKey('l', function (ev) { + goDoCommand("cmd_scrollPageDown"); +}, '一画面スクロールダウン'); + +key.setViewKey('h', function (ev) { + goDoCommand("cmd_scrollPageUp"); +}, '一画面分スクロールアップ'); diff --git a/bashrc b/bashrc index 029ae53..cd58a08 100755 --- a/bashrc +++ b/bashrc @@ -114,8 +114,8 @@ alias sh="ENV=$HOME/.shrc PS1=\$\ sh" # type trash >/dev/null 2>&1 && alias rm=trash alias wic=wicd-curses -alias wlist="wicd-cli -y -l" -alias wcn="wicd-cli -y -c -n" +alias wil="wicd-cli -y -l | head" +alias wicn="wicd-cli -y -c -n" alias aptin="apt-get install" alias aptsearch="apt-cache search" @@ -150,6 +150,29 @@ then || complete -o default -o nospace -F _git g fi +mcrypt-stream(){ + test $# -eq 2 || return 1 + case $1 in + en) + mcrypt --key $2 | base64 ;; + de) + base64 -d | mcrypt -d --key $2 ;; + esac +} + +gpg-stream(){ + test $# -eq 2 || return 1 + case $1 in + en) + gpg --passphrase $2 -c --batch |base64 ;; + de) + base64 -d|gpg --passphrase $2 -d --batch ;; + esac +} + +alias enst="gpg-stream en" +alias dest="gpg-stream de" + showinfo(){ echo "Japanese letters are 表示可能" @@ -169,7 +192,7 @@ x(){ #mkdir -p ~/.backup/log # nohup startx >~/.backup/log/xorg.log 2>&1 & # exit - startx + exec startx else echo "X cant be started! Maybe another X is already running or something." 1>&2 fi @@ -280,8 +303,9 @@ _my_git_config(){ git config --global color.ui auto git config --global status.relativePaths false git config --global status.showUntrackedFiles normal + git config --global log.date iso git config --global alias.graph "log --graph --date-order -C -M --pretty=tformat:\"<%h> %ad [%an] %Cgreen%d%Creset %s\" --all --date=iso" - git config --global alias.st "status -s" + git config --global alias.st "status -s -b" git config --global alias.b "branch" git config --global alias.ci "commit --verbose" git config --global alias.co "checkout" @@ -451,15 +475,15 @@ __my_prompt_function(){ # used by PS1 __my_set_title(){ title="$(echo $@)" case $TERM in - (rxvt*|xterm*|aterm) + (rxvt*|xterm*|aterm|screen*) test -t 1 && test -n "$DISPLAY" && test -z "$EMACS" && - echo -n -e "\033]0;${1}\007" + echo -n -e "\033]0;${title}\007" ;; esac } -# export PROMPT_COMMAND="__my_set_title \${USER}@\${HOSTNAME}\ \${PWD};${PROMPT_COMMAND}" +export PROMPT_COMMAND="__my_set_title \${USER}@\${HOSTNAME}\ \${PWD};" # copied from https://wiki.archlinux.org/index.php/X_resources invader(){ diff --git a/conkyrc b/conkyrc index 9d35811..8c55169 100644 --- a/conkyrc +++ b/conkyrc @@ -40,6 +40,8 @@ no_buffers yes uppercase no format_human_readable yes +if_up_strictness link + TEXT ${color0}${alignr}${sysname} ${kernel} (${machine}) ${color0}${alignr}${execi 30000 whoami}@${nodename} @@ -61,14 +63,39 @@ ${fs_bar /tmp} ${color2}i/o ${color1}|${color0} ${diskio} ${color0}${hr} ${if_up wlan0}\ -${color2}if ${color1}|${color0} wlan:${addr wlan0} +${color2}if ${color1}|${color0} wlan0:${addr wlan0} ${color2}ssid ${color1}|${color0} ${wireless_essid wlan0} ${wireless_link_qual_perc wlan0}% +${color0}${stippled_hr} +${color2}down ${color1}|${color0} ${downspeed wlan0}/s +${color4}${downspeedgraph wlan0 ff0000 0000ff} +${color2}up ${color1}|${color0} ${upspeed wlan0}/s +${color4}${upspeedgraph wlan0 0000ff ff0000} +${endif}\ +${if_up wlan2}\ +${color2}if ${color1}|${color0} wlan0:${addr wlan2} +${color2}ssid ${color1}|${color0} ${wireless_essid wlan2} ${wireless_link_qual_perc wlan2}% +${color0}${stippled_hr} +${color2}down ${color1}|${color0} ${downspeed wlan2}/s +${color4}${downspeedgraph wlan2 ff0000 0000ff} +${color2}up ${color1}|${color0} ${upspeed wlan2}/s +${color4}${upspeedgraph wlan2 0000ff ff0000} ${endif}\ +${if_up eth0}\ +${color2}if ${color1}|${color0} eth0:${addr eth0} ${color0}${stippled_hr} -${color2}down ${color1}|${color0} ${downspeed}/s -${color4}${downspeedgraph ff0000 0000ff} -${color2}up ${color1}|${color0} ${upspeed}/s -${color4}${upspeedgraph 0000ff ff0000} +${color2}down ${color1}|${color0} ${downspeed eth0}/s +${color4}${downspeedgraph eth0 ff0000 0000ff} +${color2}up ${color1}|${color0} ${upspeed eth0}/s +${color4}${upspeedgraph eth0 0000ff ff0000} +${endif}\ +${if_up eth2}\ +${color2}if ${color1}|${color0} eth2:${addr eth2} +${color0}${stippled_hr} +${color2}down ${color1}|${color0} ${downspeed eth2}/s +${color4}${downspeedgraph eth2 ff0000 0000ff} +${color2}up ${color1}|${color0} ${upspeed eth2}/s +${color4}${upspeedgraph eth2 0000ff ff0000} +${endif}\ ${color0}${alignr}conky ${conky_version} ${color0}${hr} ${color3}${alignr}${texeci 10 bash -c 'xrandr|grep " connected "|cut -f 1,3 -d " "'} diff --git a/emacs.el b/emacs.el index 6add480..3bc6cd5 100644 --- a/emacs.el +++ b/emacs.el @@ -11,14 +11,14 @@ (require 'cl nil t) -(progn ; hook run when directory changed - (defvar buffer-file-changed-function nil "Hook run when buffer file changed. +(progn + (defvar buffer-file-changed-functions nil "Hook run when buffer file changed. Each function is called with two args, the filename before changing and after changing.") - (declare-function run-buffer-file-change-function "emacs.el") + (declare-function run-buffer-file-changed-functions "emacs.el") (add-hook 'post-command-hook - 'run-buffer-file-changed-function) + 'run-buffer-file-changed-functions) (lexical-let (previous-file) - (defun run-buffer-file-changed-function () + (defun run-buffer-file-changed-functions () "" (unless (and previous-file (equal previous-file @@ -28,8 +28,8 @@ Each function is called with two args, the filename before changing and after ch (cfile (expand-file-name (or buffer-file-name default-directory)))) (setq previous-file cfile) - (run-hook-with-args 'directory-changed-function pfile cfile))))) - ;; (add-hook 'directory-changed-function + (run-hook-with-args 'buffer-file-changed-functions pfile cfile))))) + ;; (add-hook 'buffer-file-changed-function ;; (lambda (pdir cdir) ;; (message "dir changed %s to %s !" pdir cdir))) ) @@ -39,10 +39,11 @@ Each function is called with two args, the filename before changing and after ch (require 'url) -(defun dllib-if-unfound (lib url &optional bite-compile-p force-download-p) - "if LIB does not exist, download it from URL and locate it to \"~/emacs.d/lisp/LIB.el\". -return nil if LIB unfound and downloading failed, otherwise the path of LIB." +(defun dllib-if-unfound (url &optional byte-compile-p force-download-p) + "If library does not exist, download it from URL and locate it in \"~/emacs.d/lisp/\". +Return nil if library unfound and failed to download, otherwise the path where the library installed." (let* ((dir (expand-file-name (concat user-emacs-directory "lisp/"))) + (lib (file-name-sans-extension (file-name-nondirectory url))) (lpath (concat dir lib ".el")) (locate-p (locate-library lib))) (if (or force-download-p (not locate-p)) @@ -51,9 +52,13 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (url-copy-file url lpath t) - (when bite-compile-p - (byte-compile-file lpath))) - (error (and (file-readable-p lpath) + (when (and byte-compile-p + (require 'bytecomp nil t)) + (and (file-exists-p (byte-compile-dest-file lpath)) + (delete-file (byte-compile-dest-file lpath))) + (byte-compile-file lpath)) + ) + (error (and (file-writable-p lpath) (delete-file lpath)) (message "downloading %s...something wrong happened!" url) nil)) @@ -76,18 +81,18 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." "] " '(:eval (symbol-name last-command)))) +(setq set-terminal-title-regexp "^\\(rxvt\\|xterm\\|aterm$\\|screen\\)") (defun set-terminal-title (&rest args) "" (interactive "sString to set as title: ") (let ((tty (frame-parameter nil 'tty-type))) (when (and tty - (eq t (compare-strings "xterm" 0 5 - tty 0 5))) + (string-match set-terminal-title-regexp + tty)) (send-string-to-terminal (apply 'concat "\033]0;" `(,@args "\007")))))) - (defun my-set-terminal-title () "" (set-terminal-title "[" @@ -98,7 +103,7 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (symbol-name system-type) "] " (abbreviate-file-name (or buffer-file-name default-directory)))) -(add-hook 'directory-changed-function +(add-hook 'buffer-file-changed-functions (lambda (p c) (my-set-terminal-title))) (add-hook 'suspend-resume-hook @@ -124,6 +129,7 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (add-to-list 'default-frame-alist '(foreground-color . "gray10")) ;; (add-to-list 'default-frame-alist '(alpha . (80 100 100 100))) ; does not work? ) +;; (add-to-list 'default-frame-alist '(cursor-type . box)) (if window-system (menu-bar-mode 1) (menu-bar-mode 0)) (tool-bar-mode 0) (set-scroll-bar-mode nil) @@ -177,14 +183,14 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; global keys -(and (dllib-if-unfound "drill-instructor" - "https://raw.github.com/k1LoW/emacs-drill-instructor/master/drill-instructor.el" +(and (dllib-if-unfound "https://raw.github.com/k1LoW/emacs-drill-instructor/master/drill-instructor.el" t) (require 'drill-instructor nil t) (setq drill-instructor-global t) (let ((map drill-instructor-key-map)) (define-key map (kbd "RET") nil) - (define-key map (kbd "DEL") nil))) + (define-key map (kbd "DEL") nil) + (define-key map (kbd "C-h") nil))) '(mapc (lambda (key) (global-set-key (read-kbd-macro key) 'ignore)) '("" "" "" "")) @@ -311,19 +317,19 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (standard-display-ascii ?\n "$\n") -(standard-display-ascii ?\f "---------------------------------------------------------------------------------------^L") -(defface my-pagebreak-face - '((t (:foreground "gray"))) - "pagebreak.") - (defvar my-eol-face '(("\n" . (0 font-lock-comment-face t nil))) ) -(defvar my-pagebreak-face - '(("\f" . 'my-pagebreak-face))) -(defvar my-highlight-face - '(("\t" . '(0 highlight t nil)) - (" " . '(0 highlight t nil)))) +(defvar my-tab-face + '(("\t" . '(0 highlight t nil)))) +(defvar my-jspace-face + '(("\u3000" . '(0 highlight t nil)))) + +(add-hook 'font-lock-mode-hook + (lambda () + (font-lock-add-keywords nil my-eol-face) + (font-lock-add-keywords nil my-jspace-face) + )) ;; highlight current line ;; http://wiki.riywo.com/index.php?Meadow @@ -348,12 +354,6 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." '(not term-mode)) -(add-hook 'font-lock-mode-hook - (lambda () - (font-lock-add-keywords nil my-eol-face) - ;; (font-lock-add-keywords nil my-highlight-face) - )) - (set-face-foreground 'font-lock-regexp-grouping-backslash "#666") (set-face-foreground 'font-lock-regexp-grouping-construct "#f60") @@ -392,16 +392,15 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." ;; (my-set-ascii-and-jp-font-with-size '("ProggyCleanTTSZ" 120 "takaogothic" 11)) ;; あ a -(and (dllib-if-unfound "set-modeline-color" - "https://raw.github.com/10sr/emacs-lisp/master/set-modeline-color.el" +(and (dllib-if-unfound "https://raw.github.com/10sr/emacs-lisp/master/set-modeline-color.el" t) - (progn (set-face-background 'mode-line "white") - ;(set-face-bold-p 'modeline-buffer-id t) - (require 'set-modeline-color nil t))) - -(set-face-background 'mode-line-inactive (if (face-inverse-video-p 'mode-line) "white" "black")) -(set-face-foreground 'mode-line-inactive (if (face-inverse-video-p 'mode-line) "black" "white")) + (progn + (require 'set-modeline-color nil t))) +(let ((fg (face-foreground 'default)) + (bg (face-background 'default))) + (set-face-background 'mode-line-inactive (if (face-inverse-video-p 'mode-line) fg bg)) + (set-face-foreground 'mode-line-inactive (if (face-inverse-video-p 'mode-line) bg fg))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; file handling @@ -452,6 +451,7 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." ;(pc-selection-mode 1) ; this make some already defined keybind back to default (delete-selection-mode 1) (cua-mode 0) +(setq line-move-visual nil) ;; key bindings ;; moving around @@ -506,6 +506,8 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; buffer killing +(defun my-delete-window-killing-buffer () nil) + (defun my-query-kill-this-buffer () "" (interactive) @@ -514,6 +516,8 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (substitute-key-definition 'kill-buffer 'my-query-kill-this-buffer global-map) ;;(global-set-key "\C-xk" 'my-query-kill-this-buffer) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; package '(setq package-archives '(("ELPA" . "http://tromey.com/elpa/") ("gnu" . "http://elpa.gnu.org/packages/") @@ -525,7 +529,7 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (require 'simple nil t) (and window-system - (dllib-if-unfound "save-window-size" "https://raw.github.com/10sr/emacs-lisp/master/save-window-size.el" t) + (dllib-if-unfound "https://raw.github.com/10sr/emacs-lisp/master/save-window-size.el" t) (require 'save-window-size nil t)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -544,7 +548,7 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (and (not x-select-enable-clipboard) (getenv "DISPLAY") (executable-find "xclip") - (dllib-if-unfound "xclip" "http://www.emacswiki.org/emacs/download/xclip.el" t) + (dllib-if-unfound "http://www.emacswiki.org/emacs/download/xclip.el" t) (require 'xclip nil t) (turn-on-xclip)) @@ -641,8 +645,7 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (add-to-list 'auto-mode-alist (cons "\\.md\\'" 'outline-mode)) (setq markdown-command (or (executable-find "markdown") (executable-find "markdown.pl"))) -(when (dllib-if-unfound "markdown-mode" - "http://jblevins.org/projects/markdown-mode/markdown-mode.el" +(when (dllib-if-unfound "http://jblevins.org/projects/markdown-mode/markdown-mode.el" t) (add-to-list 'auto-mode-alist (cons "\\.md\\'" 'markdown-mode)) (autoload 'markdown-mode "markdown-mode" "Major mode for editing Markdown files." nil) @@ -663,8 +666,7 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (c-toggle-hungry-state 1) )) -(when (dllib-if-unfound "js2-mode" - "https://raw.github.com/mooz/js2-mode/master/js2-mode.el" +(when (dllib-if-unfound "https://raw.github.com/mooz/js2-mode/master/js2-mode.el" t) (autoload 'js2-mode "js2-mode" nil t) (add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode)) @@ -726,18 +728,21 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (require 'session nil t) -(and (dllib-if-unfound "gtkbm" - "https://raw.github.com/10sr/emacs-lisp/master/gtkbm.el" +(and (dllib-if-unfound "https://raw.github.com/10sr/emacs-lisp/master/gtkbm.el" t) (require 'gtkbm nil t) (global-set-key (kbd "C-x C-d") 'gtkbm)) +(and (dllib-if-unfound "https://raw.github.com/10sr/emacs-lisp/master/git-command.el" + t) + (require 'git-command nil t) + (define-key ctl-x-map "g" 'git-command)) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; term mode ;; (setq multi-term-program shell-file-name) -(and (dllib-if-unfound "multi-term" - "http://www.emacswiki.org/emacs/download/multi-term.el" +(and (dllib-if-unfound "http://www.emacswiki.org/emacs/download/multi-term.el" t) (require 'multi-term nil t) (setq multi-term-switch-after-close nil)) @@ -856,8 +861,6 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." ;; (require 'vc) (setq vc-handled-backends '()) -(and (executable-find "git") - (add-to-list 'vc-handled-backends 'GIT)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; gauche-mode @@ -903,8 +906,7 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." ;; http://d.hatena.ne.jp/kobapan/20090305/1236261804 ;; http://www.katch.ne.jp/~leque/software/repos/gauche-mode/gauche-mode.el -(when (dllib-if-unfound "gauche-mode" - "http://www.katch.ne.jp/~leque/software/repos/gauche-mode/gauche-mode.el" +(when (dllib-if-unfound "http://www.katch.ne.jp/~leque/software/repos/gauche-mode/gauche-mode.el" t) (setq auto-mode-alist (cons '("\.gosh\\'" . gauche-mode) auto-mode-alist)) @@ -936,8 +938,7 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (recentf-mode 1) ;; (add-to-list 'recentf-filename-handlers 'abbreviate-file-name) (add-to-list 'recentf-exclude (regexp-quote recentf-save-file)) - (and (dllib-if-unfound "recentf-show" - "https://raw.github.com/10sr/emacs-lisp/master/recentf-show.el" + (and (dllib-if-unfound "https://raw.github.com/10sr/emacs-lisp/master/recentf-show.el" t) (require 'recentf-show nil t) (define-key ctl-x-map (kbd "C-r") 'recentf-show))) @@ -1120,16 +1121,14 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (when (file-readable-p file) (delete-file file))))) -(and (dllib-if-unfound "pack" - "https://raw.github.com/10sr/emacs-lisp/master/pack.el" +(and (dllib-if-unfound "https://raw.github.com/10sr/emacs-lisp/master/pack.el" t) (require 'pack nil t) (add-hook 'dired-mode-hook (lambda () (define-key dired-mode-map "P" 'dired-do-pack-or-unpack)))) -(and (dllib-if-unfound "dired-list-all-mode" - "https://raw.github.com/10sr/emacs-lisp/master/dired-list-all-mode.el" +(and (dllib-if-unfound "https://raw.github.com/10sr/emacs-lisp/master/dired-list-all-mode.el" t) (require 'dired-list-all-mode nil t) (setq dired-listing-switches "-lhFG") @@ -1554,34 +1553,17 @@ when SEC is nil, stop auto save if enabled." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; misc funcs -(defalias 'qcalc 'quick-calc) - -;; (when (require 'ansi-color nil t) -;; (ansi-color-for-comint-mode-on)) -(defvar git-command-history nil - "History list for git command.") -(defun my-git-shell-command (cmd) - "" - (interactive (list (read-shell-command (format "[%s] $ git : " - (abbreviate-file-name default-directory)) - nil - 'git-command-history))) - (let ((dir default-directory) - (bf (get-buffer-create "*Git Output*")) - ) - (delete-windows-on bf t) - (shell-command (concat "git " - cmd) - bf) +(defun dir-show (&optional dir) + (interactive) + (let ((bf (get-buffer-create "*dir show*")) + (list-directory-brief-switches "-C")) (with-current-buffer bf - (cd dir) - (and (require 'ansi-color nil t) - (ansi-color-apply-on-region (point-min) - (point-max))) - (setq buffer-read-only t) - (view-mode 1) - ))) -(define-key ctl-x-map "g" 'my-git-shell-command) + (list-directory (or nil + default-directory) + nil)) + )) + +(defalias 'qcalc 'quick-calc) (defun my-kill-buffers () "" diff --git a/fonts.conf b/fonts.conf index 8d6178e..5c07a84 100644 --- a/fonts.conf +++ b/fonts.conf @@ -2,14 +2,19 @@ - + serif DejaVu Serif - monapo + serif + + monapo + + + sans-serif DejaVu Sans diff --git a/tmux.conf b/tmux.conf index 58e2dd4..0ca4267 100644 --- a/tmux.conf +++ b/tmux.conf @@ -1,9 +1,12 @@ unbind C-b set -g prefix C-z bind-key C-z send-prefix +bind-key C command-prompt "new-window '%%'" set -g default-command /bin/bash set -g default-terminal screen-256color #set -g status-left "" #set -g status-right "#H | %a, %d %b %Y %T %z #(tmux -V)" set -g status-right "#H | #(tmux -V) " +set -g set-titles on +setw -g mode-keys vi diff --git a/xinitrc b/xinitrc index 316ecb2..de31f75 100644 --- a/xinitrc +++ b/xinitrc @@ -1,8 +1,7 @@ test "`hostname`" == "arch-aspireone" && setxkbmap -model "acer_laptop" -layout "jp" # this line must comes first -setxkbmap -option "ctrl:nocaps" -xmodmap -e 'keycode 135 = Alt_R Meta_R' # menu key as alt +setxkbmap -option "ctrl:nocaps,ctrl:menu_rctrl" xmodmap -e 'keycode 101 = Alt_R Meta_R' # hiragana key as alt #xmodmap -e 'remove Lock = Caps_Lock' #xmodmap -e 'add Control = Caps_Lock' @@ -19,6 +18,7 @@ xset dpms 1810 1820 1830 # standby, suspend and off seem not to be differ unset LC_MESSAGES export LANG=ja_JP.utf8 export BROWSER=firefox +export DMENU_FONT='-*-dejavu sans mono-*-r-*-*-11-*-*-*-*-*-*-*' __upper(){ echo $1 | tr '[:lower:]' '[:upper:]' diff --git a/xprograms b/xprograms index 9baa426..6842ade 100755 --- a/xprograms +++ b/xprograms @@ -3,28 +3,62 @@ # These programs are basically for Openbox Window Manager. # Japanese IM settings are not included in this list. -test -f "$HOME/.fehbg" && -type feh >/dev/null 2>&1 && -sh "$HOME/.fehbg" +_feh(){ + test -f "$HOME/.fehbg" && + type feh >/dev/null 2>&1 && + sh "$HOME/.fehbg" +} +_tint2(){ #tint2 -c ~/.dotfiles/tint2rc & -tint2 & + tint2 & +} -dropboxd & # done by ~/.config/autostart/dropbox.desktop +_dropbox(){ + dropboxd & # done by ~/.config/autostart/dropbox.desktop +} -volumeicon & +_volumeicon(){ + volumeicon & +} -conky -c ~/.dotfiles/conkyrc >~/.backup/log/conky.log 2>&1 & -conky -c ~/.dotfiles/conkyrc.2 >~/.backup/log/conky.2.log 2>&1 & +_conky(){ + conky -c ~/.dotfiles/conkyrc >~/.backup/log/conky.log 2>&1 & + conky -c ~/.dotfiles/conkyrc.2 >~/.backup/log/conky.2.log 2>&1 & +} -#wicd-client --tray & # done by /etc/xdg/autostart/wicd-client.desktop +_wicd(){ +# done by /etc/xdg/autostart/wicd-client.desktop + wicd-client --tray & +} +_udisksvm(){ # Detection of insertion of an optical disk -if ! pgrep -lf "udisks-daemon: polling /dev/sr0"; then - udisks --poll-for-media /dev/sr0 -fi -udisksvm >/dev/null & + if ! pgrep -lf "udisks-daemon: polling /dev/sr0"; then + udisks --poll-for-media /dev/sr0 + fi + udisksvm >/dev/null & +} -xcompmgr -c & +_xcompmgr(){ + xcompmgr -c & +} + +_saku(){ + (cd ~/src/saku-3.11.1/ && python2 saku.py) & +} + +_gkeyring(){ + /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1 & + eval $(gnome-keyring-daemon -s) & +} + +_nmapplet(){ + nm-applet & +} + +for p in $@ +do + _$p +done -(cd ~/src/saku-3.11.1/ && python2 saku.py) &