Преглед на файлове

Merge branch 'master' of github.com:10sr/dotfiles

Conflicts:
	_keysnail.js
pull/1/head
10sr преди 12 години
родител
ревизия
28105065e6
променени са 9 файла, в които са добавени 889 реда и са изтрити 871 реда
  1. +15
    -12
      README.txt
  2. +60
    -27
      _keysnail.js
  3. +253
    -206
      bashrc
  4. +73
    -0
      conkyrc
  5. +40
    -0
      conkyrc.2
  6. +394
    -603
      emacs.el
  7. +7
    -23
      profile
  8. +21
    -0
      xinitrc
  9. +26
    -0
      xprograms

+ 15
- 12
README.txt Целия файл

@@ -1,13 +1,16 @@
~/.xsessionrc <= graphical login
~/.bash_profile <= console login
|
`-- ~/.profile <= text login
|
|-- ~/.dotfiles/profile
|
* if shell is bash
|
`-- ~/.bashrc <= run bash
|
`-- ~/.dotfiles/bashrc
|
`-- /etc/bashrc
|--~/.dotfiles/profile
|
`--~/.bashrc
|
`--~/.dotfiles/bashrc

~/.xinitrc <= startx
|
`--openbox-session
|
|--~/.dotfiles/xprofile
|
`--~/.dotfiles/xprograms


+ 60
- 27
_keysnail.js Целия файл

@@ -27,25 +27,6 @@ function ignore(k, i) [k, null];
//// firefox
// style.register("#bookmarksPanel > hbox,#history-panel > hbox {display: none !important;} //#urlbar-container{max-width: 500px !important;}");

util.setPrefs(
{
"browser.tabs.loadDivertedInBackground": true,
"dom.disable_window_open_feature.location": false,
"dom.max_script_run_time": 30,
"browser.bookmarks.max_backups":0,
"browser.urlbar.autocomplete.enabled":false,
"browser.cache.memory.capacity":16384,
"browser.sessionhistory.max_total_viewers":8,
"browser.download.manager.closeWhenDone":true,
"browser.download.useDownloadDir":false,
"browser.tabs.closeWindowWithLastTab":false,
"network.dns.disableIPv6":true,
"browser.urlbar.trimURLs":false,
"browser.fullscreen.autohide":false,
"keyword.URL":"http://www.bing.com/search?q=",
}
);

///////////////////////////////////
//検索エンジン
plugins.options["search-url-list"] = [
@@ -177,16 +158,67 @@ plugins.options["twitter_client.use_jmp"] = true;
////////////////////////////////////////////
// エクステ

ext.add("my-setpref2", function(){
// navigator.platform
util.setPrefs(
{
"browser.cache.disk.parent_directory":"/tmp"
}
);
}, "my setpref2");

ext.add('my-setpref', function(){
util.setPrefs(
{
"browser.bookmarks.max_backups":0,
"browser.cache.memory.capacity":16384,
"browser.download.manager.closeWhenDone":true,
"browser.download.useDownloadDir":false,
"browser.fullscreen.autohide":false,
"browser.search.openintab":true,
"browser.sessionhistory.max_total_viewers":8,
"browser.sessionstore.restore_on_demand":true,
"browser.tabs.closeWindowWithLastTab":false,
"browser.tabs.loadDivertedInBackground": true,
"browser.urlbar.autocomplete.enabled":false,
"browser.urlbar.trimURLs":false,
"dom.disable_window_open_feature.location": false,
"dom.max_script_run_time": 30,
"extensions.chaika.bbsmenu.open_new_tab":true,
"extensions.chaika.bbsmenu.open_single_click":false,
"extensions.chaika.board.open_new_tab":true,
"extensions.chaika.board.open_single_click":false,
"extensions.foxage2ch.openThreadInTab":true,
"extensions.saveimageinfolder.general-duplicatefilenamevalue":1,
"extensions.saveimageinfolder.general-fileprefixvalue":"%yyyy%%MM%%dd%-%hh%%mm%%ss%_",
"extensions.saveimageinfolder.usecache":true,
"extensions.tabutils.openTabNext":1,
"extensions.tabutils.styles.current":"{\"bold\":false,\"italic\":false,\"underline\":true,\"strikethrough\":false,\"color\":true,\"colorCode\":\"#EEEEEE\",\"bgColor\":true,\"bgColorCode\":\"#000000\",\"outline\":false,\"outlineColorCode\":\"#000000\"}",
"extensions.yass.edgetype":0,
"extensions.yass.selectedpreset":"red",
"font.default.x-western":"sans-serif",
"general.warnOnAboutConfig":false,
"keyword.URL":"http://www.bing.com/search?q=",
"network.dns.disableIPv6":true,
"refcontrol.actions":"@DEFAULT=@FORGE",
"scrapbook.tabs.open":true
}
);
display.showPopup("Keysnail", "My prefs done.");
}, 'my setpref');

ext.add('auto-install-plugins', function(ev, arg){
var urls = [
'https://github.com/mooz/keysnail/raw/master/plugins/yet-another-twitter-client-keysnail.ks.js',
'https://github.com/mooz/keysnail/raw/master/plugins/site-local-keymap.ks.js',
'https://github.com/azu/KeySnail-Plugins/raw/master/JSReference/js-referrence.ks.js',
'https://raw.github.com/mooz/keysnail/master/plugins/yet-another-twitter-client-keysnail.ks.js',
'https://raw.github.com/mooz/keysnail/master/plugins/site-local-keymap.ks.js',
'https://raw.github.com/azu/KeySnail-Plugins/master/JSReference/js-referrence.ks.js',
'https://raw.github.com/gongo/keysnail_plugin/master/linksnail.ks.js',
'https://github.com/tkosaka/keysnail-plugin/raw/master/nicontroller.ks.js',
'https://raw.github.com/tkosaka/keysnail-plugin/master/nicontroller.ks.js',
'https://raw.github.com/10sr/keysnail-plugin/master/shiitake.ks.js',
'https://raw.github.com/10sr/keysnail-plugin/master/dig-url.ks.js',
'https://raw.github.com/10sr/keysnail-plugin/master/instapaper.ks.js',
'https://raw.github.com/gist/1976942/firefox-addon-manager.ks.js',
'https://raw.github.com/gist/1450594/mstranslator.ks.js'
];

function inst(a){
@@ -249,6 +281,7 @@ ext.add("close-and-next-tab", function (ev, arg) {

/////////////////////////////////////
// google itranslate
// use mstranslator instead
(function(){
let targetLang = "ja"; // target lang to translate into
let alternativeLang = "en"; // if given word is in targetLang, use this instead as a target lang
@@ -641,10 +674,6 @@ key.setViewKey('z', function (ev, arg) {
ext.exec("keysnail-setting-menu", arg, ev);
}, 'open keysnail setting menu', true);

key.setViewKey('T', function (ev, arg) {
ext.exec("google-itranslate", arg, ev);
}, 'google itranslate', true);

key.setViewKey('C-SPC', function (ev, arg) {
MultipleTabService.toggleSelection(gBrowser.selectedTab);
}, 'タブの選択をトグル');
@@ -743,3 +772,7 @@ key.setViewKey('I', function (ev, arg) {
key.setEditKey('C-<tab>', function (ev) {
command.walkInputElement(command.elementsRetrieverTextarea, true, true);
}, '次のテキストエリアへフォーカス');

key.setViewKey('T', function (ev, arg) {
ext.exec('mstranslator-open-prompt', arg, ev);
}, 'MSTranslator - Open prompt', true);

+ 253
- 206
bashrc Целия файл

@@ -1,149 +1,195 @@
#!/bin/bash

test -r /etc/bashrc && . /etc/bashrc

##########################
# system type
# $OSTYPEとか使えるのかな

if uname | grep -E "^MINGW32" >/dev/null 2>&1
then
alias ismsys=true
else
alias ismsys=false
fi

if uname | grep -E "^CYGWIN" >/dev/null 2>&1
then
alias iscygwin=true
else
alias iscygwin=false
fi

alias ismsys=false
alias iscygwin=false
alias iswindows="iscygwin || ismsys"
alias isdarwin=false
alias islinux=false

if uname | grep -E 'Darwin' >/dev/null 2>&1
then
alias isdarwin=true
else
alias isdarwin=false
fi
case `uname` in
(MINGW32*) alias ismsys=true ;;
(CYGWIN*) alias iscygwin=true ;;
(Darwin*) alias isdarwin=true ;;
(Linux*) alias islinux=true ;;
esac

##########################################
null(){
"$@" >/dev/null 2>&1
}
safe-cmd(){
__try_exec(){
type $1 >/dev/null 2>&1 && "$@"
}
replace-cmd(){
type $1 1>/dev/null || alias $1=true
}

export PS1="\$(__my_prompt_function)\$ "
# PROMPT_COMMAND=prompt_function
if false # iswindows
if false iswindows
then
export PAGER='tr -d \\r | less'
else
export PAGER="less"
fi

if type vim >/dev/null 2>&1
if false null type vim
then
export EDITOR=vim
else
export EDITOR=vi
fi
export LC_MESSAGES=C
export CDPATH=".:~"
export VISUAL="$EDITOR"
export LESS="-iRMX"
# export LC_MESSAGES="C"
# export LANG=ja_JP.UTF-8
# export CDPATH=".:~" # 使い方がよく分からない
export GIT_PAGER="$PAGER"
export GIT_EDITOR="$EDITOR"

alias ls="ls -hCFG $(test "$TERM" == dumb || echo --color=auto) --time-style=long-iso"
null type stty && {
stty stop undef # unbind C-s to stop displaying output
stty erase '^h'
}

if iswindows; then
# export TMP=/tmp
# export TEMP=/tmp
# export PS1=" \[\e[32m\]\u@\H \[\e[33m\]\w\[\e[0m\] \d \t\n\s \# \j \$ "
# export PS1=" [\[\e[33m\]\w\[\e[0m\]]\n\[\e[32m\]\u@\H\[\e[0m\] \d \t \s.\v\nhist:\# jobs:\j \$ "
export USER=$USERNAME
fi

#######################

uname -a

if [ "${EMACS}" = "t" ]; then # for emacs shell
true export PS1="\u@\H \d \t \w\nemacs shell\$ "
elif echo "$EMACS" | grep term >/dev/null 2>&1; then # for emacs term
echo "Emacs Term"
fi

# if test -f /etc/issue
# then
# cat /etc/issue
# fi

###################################
# some aliases and functions

test "$TERM" == dumb || _ENABLECOLOR="--color=always "

export LESS="-iRMX"
export GREP_OPTIONS="${_ENABLECOLOR}"
alias ls="ls -hCF ${_ENABLECOLOR}--time-style=long-iso"
# alias ll="ls -l"
# alias la="ls -A"
# alias lla="ls -Al"
# alias less=""
alias vl=/usr/share/vim/vimcurrent/macros/less.sh
alias em="emacs -nw"
alias pstree="LANG=C pstree"
# alias apt-get="sudo apt-get"
alias aptin="apt-get install"
alias aptsearch="apt-cache search"
alias aptshow="apt-cache show"
alias ut="ssh t110414@un001.ecc.u-tokyo.ac.jp"
alias ut="ssh 6365454829@un001.ecc.u-tokyo.ac.jp"
alias rand="echo \$RANDOM"
alias xunp="file-roller -h"
alias pacome="sudo \paco -D"
alias destroy="rm -rf"
alias psall="ps auxww"
alias g=git
alias q=exit
alias p="$PAGER"
alias c=cat
alias pcalc="python -i -c 'from math import *' "
alias reloadrc="test -f ~/.bashrc && source ~/.bashrc"
alias py3=python3
alias _reloadrc="test -f ~/.bashrc && source ~/.bashrc"
alias sudo="sudo " # use aliases through sudo
alias e3=e3em
alias mytime="date +%Y%m%d-%H%M%S"
alias sh="ENV=$HOME/.shrc sh"
if isdarwin
alias sh="ENV=$HOME/.shrc PS1=\$\ sh"
alias halt="sudo halt"
alias reboot="sudo reboot"
# type trash >/dev/null 2>&1 && alias rm=trash

alias aptin="apt-get install"
alias aptsearch="apt-cache search"
alias aptshow="apt-cache show"

alias yt=yaourt
null type pacman-color && {
alias pacman=pacman-color
export pacman_program=pacman-color # used by pacmatic
export PACMAN=pacman-color # used by yaourt
}
null type pacmatic && {
alias pacman=pacmatic
export PACMAN=pacmatic
}

alias ubuntu-upgrade="sudo apt-get autoremove --yes && sudo apt-get update --yes && sudo apt-get upgrade --yes"
alias arch-upgrade="yaourt -Syu"
alias port-upgrade="port selfupdate && port sync && port upgrade installed"

if iscygwin; then
null type windate || alias windate="/c/Windows/System32/cmd.exe //c 'echo %DATE%-%TIME%'"
alias cygsu="cygstart /cygwinsetup.exe"
alias emacs="CYGWIN=tty emacs -nw"
alias ls="ls -CFG $(test "$TERM" == dumb || echo --color=auto)"
fi

alias g=git
if null type _git # enable programmable completion for g
then
alias upgrade="port selfupdate && port sync && port upgrade installed"
else
alias upgrade="sudo apt-get autoremove --yes && sudo apt-get update --yes && sudo apt-get upgrade --yes"
complete -o bashdefault -o default -o nospace -F _git g 2>/dev/null \
|| complete -o default -o nospace -F _git g
fi
# alias diff="$(type colordiff >/dev/null 2>&1 && test $TERM != dumb && echo color)diff -u"
# type trash >/dev/null 2>&1 && alias rm=trash

export __MYGITBAREREP="${HOME}/dbx/.git-bare"
git-make-bare-rep(){
test $# -eq 0 && {
echo "specify repository name." 1>&2
return 1
showinfo(){
echo "Japanese letters are 表示可能"

__try_exec diskinfo

! isdarwin && test -n "${DISPLAY}" && {
__try_exec xrandr | grep --color=never ^Screen
}

dir="${__MYGITBAREREP}/$1.git"
iswindows || __try_exec finger $USER
LANG=C __try_exec id
__try_exec xset q
}

if test -d "$dir"
then
echo "dir $dir already exist!" 1>&2
x(){
if [[ -z $DISPLAY ]] && ! [[ -e /tmp/.X11-unix/X0 ]] && (( EUID )); then
nohup startx >~/.backup/log/xorg.log 2>&1 &
else
mkdir -p "$dir" &&
pushd "$dir" &&
git init --bare --shared=all
popd
echo "X cant be started! Maybe another X is already running!" 1>&2
fi
}

git-add-bare-rep(){
test $# -ne 2 && {
echo "specify repository name and shortname." 1>&2
export __MYGITBAREREP="${HOME}/dbx/.git-bare"
git-make-local-rep(){
test $# -eq 0 && {
echo "specify repository name." 1>&2
return 1
}

dir="${__MYGITBAREREP}/$2.git"

# git-make-bare-rep $2 &&
# git remote add $1 "$dir"
# git remote -v
dir="${__MYGITBAREREP}/$1.git"
cdir=$PWD

if test -d "$dir"
then
git remote add $1 "$dir"
git remote -v
echo "dir $dir already exist!" 1>&2
else
echo "dir $dir does not exist!" 1>&2
mkdir -p "$dir" && {
cd "$dir" &&
git init --bare --shared=all
}
fi

cd ${cdir}
}

bak(){
for file in "$@"
do
cp ${file} ${file}.bak
mv -v ${file} ${file}.bak
done
}
di(){
@@ -155,17 +201,11 @@ di(){
fi
${diffcmd} -u "$@" | ${PAGER}
}
memo(){
__MYMEMO="# $*\n"
}
rmmemo(){
__MYMEMO=""
}
throw-away(){
mkdir -p ~/bu/tb
mkdir -p ~/.backup/tb
for file in "$@"
do
mv $file ~/bu/tb
mv $file ~/.backup/tb
done
}
mkcd(){
@@ -211,8 +251,11 @@ o(){
elif isdarwin
then
open "$f"
elif type pcmanfm >/dev/null 2>&1
then
LC_MESSAGES= pcmanfm "$f"
else
xdg-open "$f"
LC_MESSAGES= xdg-open "$f"
fi
}
convmv-sjis2utf8-test(){
@@ -221,25 +264,6 @@ convmv-sjis2utf8-test(){
convmv-sjis2utf8-notest(){
convmv -r -f sjis -t utf8 * --notest
}
_my-dl-init-files(){
for file in .bashrc .vimrc .emacs
do
local flag=0
if test -f ~/${file}.new
then
mv ~/${file}.new ~/${file}.old
echo "${file}.new already exist. Rename it to ${file}.old."
flag=1
fi
wget https://dl.dropbox.com/u/1751156/${file} -O ~/${file}.new
local wgetreturn=$?
if test ${flag} -eq 1 -a ${wgetreturn} -eq 0
then
rm ~/${file}.old
echo "${file}.old deleted."
fi
done
}
_mygitconfig(){
git config --global user.name '10sr'
git config --global user.email '8slashes+git@gmail.com'
@@ -253,7 +277,7 @@ _mygitconfig(){
git config --global alias.ci "commit --verbose"
git config --global alias.co "checkout"
git config --global alias.cim "commit --verbose -m"
git config --global alias.di "diff"
git config --global alias.di "diff --color"
git config --global alias.me "merge --no-ff --stat -v"
git config --global alias.ls "ls-files -v --full-name"
git config --global alias.sl "!sl"
@@ -265,12 +289,6 @@ _mygitconfig(){
fi
}

if type _git >/dev/null 2>&1 # enable programmable completion of g
then
complete -o bashdefault -o default -o nospace -F _git g 2>/dev/null \
|| complete -o default -o nospace -F _git g
fi

__my_parse_svn_branch() {
local LANG=C
local svn_url=$(svn info 2>/dev/null | sed -ne 's#^URL: ##p')
@@ -279,60 +297,13 @@ __my_parse_svn_branch() {
}

__my_svn_ps1(){
local svn_branch=$(__my_parse_svn_branch)
test -n "${svn_branch}" && printf "$1" "{$svn_branch}"
}

__my_prompt_function(){ # used by PS1
local lastreturn=$?
if test "${TERM}" == dumb
if svn status >/dev/null 2>&1
then
local c1=
local c2=
local c3=
local cdef=
else
local c1="\e[33m"
local c2="\e[36m"
local c3="\e[37m"
local cdef="\e[0m"
local svn_branch=$(__my_parse_svn_branch)
test -n "${svn_branch}" && printf "$1" "{$svn_branch}"
fi
if iswindows
then
local pwd=$PWD
local oldpwd=$OLDPWD
local jobnum=
if git branch >/dev/null 2>&1
then
local git="[GIT]"
else
local git=
fi
local date=$(/c/Windows/System32/cmd.exe //c 'echo %DATE%-%TIME%')
:
else
local pwd=$(echo "${PWD}/" | sed -e "s#${HOME}#~#")
local oldpwd=$(echo "${OLDPWD}/" | sed -e "s#${HOME}#~#")
local jobnum=$(jobs | wc -l)
local git=$(safe-cmd __git_ps1 [GIT:%s])
local date=$(LANG=C safe-cmd date +"%a, %d %b %Y %T %z")
fi
local svn=$(type svn >/dev/null 2>&1 && safe-cmd __my_svn_ps1 [SVN:%s])
printf "${_MEMO}"
printf "$(test -f ~/.prompt.sh && bash ~/.prompt.sh)\n"
printf " [${c1}${pwd}${cdef}<${c3}${oldpwd}${cdef}]${git}${svn}\n"
printf "${c2}${USER}@${HOSTNAME}${cdef} ${date} ${BASH} ${BASH_VERSION}\n"
printf "shlv:${SHLVL} jobs:${jobnum} last:${lastreturn} "
}

# type date >/dev/null 2>&1 || alias date=":" # "cmd /c echo %time%"

if [ "${EMACS}" = "t" ]; then # emacs shell用
: export PS1="\u@\H \d \t \w\nemacs shell\$ "
elif echo "$EMACS" | grep term >/dev/null 2>&1; then # emacs term用
echo "emacs term"
fi

#Change ANSI Colors
_chengecolors(){
echo -e \
@@ -356,36 +327,41 @@ _chengecolors(){

# printf "\e]P7353535" \

_echocolors(){
_colors(){
echo -e \
"\e[30mBlack\n" \
"\e[31mRed\n" \
"\e[32mGreen\n" \
"\e[33mYellow\n" \
"\e[34mBlue\n" \
"\e[35mMagenta\n" \
"\e[36mCyan\n" \
"\e[37mWhite\n" \
"\e[30;1mBright Black\n" \
"\e[31;1mBright Red\n" \
"\e[32;1mBright Green\n" \
"\e[33;1mBright Yellow\n" \
"\e[34;1mBright Blue\n" \
"\e[35;1mBright Magenta\n" \
"\e[36;1mBright Cyan\n" \
"\e[30mBlack" \
"\e[31mRed" \
"\e[32mGreen" \
"\e[33mYellow" \
"\e[34mBlue" \
"\e[35mMagenta" \
"\e[36mCyan" \
"\e[37mWhite"
echo -e \
"\e[30;1mBright Black" \
"\e[31;1mBright Red" \
"\e[32;1mBright Green" \
"\e[33;1mBright Yellow" \
"\e[34;1mBright Blue" \
"\e[35;1mBright Magenta" \
"\e[36;1mBright Cyan" \
"\e[37;1mBright White\n" \
"\e[0m"
}
# http://www.frexx.de/xterm-256-notes/data/colortable16.sh

null type stty && {
stty stop undef # unbind C-s to stop displaying output
stty erase '^h'
_install_script(){
mkdir -p $HOMO/bin/
for f in "$@"
do
bn=$(basename "$f")
type ${bn} >/dev/null 2>&1 || wget "$f" -P "$HOME/bin/"
chmod u+x "$HOME/bin/${bn}"
done
}

#########################
# for windose

winln(){
# for windose make link (actually junction)
if test $# -eq 0
then
{
@@ -399,39 +375,110 @@ winln(){
fi
}

########################
battery-status(){
local dir=/sys/class/power_supply/BAT0
if test -d $dir
then
local st=$(cat $dir/status)
local full=$(cat $dir/charge_full)
local now=$(cat $dir/charge_now)
local rate=$(expr $now \* 100 / $full)
printf "$1" "${st}:${rate}%"
fi
}
alias bat='battery-status %s\\n'

if iscygwin; then
alias cygsu="cygstart /cygwinsetup.exe"
alias emacs="CYGWIN=tty emacs -nw"
echo "cygwin bash"
fi
battery-status2(){
local dir=/sys/class/power_supply/BAT0
. $dir/uevent
local rate=$(expr $POWER_SUPPLY_CHARGE_NOW \* 100 / $POWER_SUPPLY_CHARGE_FULL)
echo ${POWER_SUPPLY_STATUS}:${rate}%
}

if iswindows; then
# export TMP=/tmp
# export TEMP=/tmp
# export PS1=" \[\e[32m\]\u@\H \[\e[33m\]\w\[\e[0m\] \d \t\n\s \# \j \$ "
# export PS1=" [\[\e[33m\]\w\[\e[0m\]]\n\[\e[32m\]\u@\H\[\e[0m\] \d \t \s.\v\nhist:\# jobs:\j \$ "
alias ls="ls -CFG $(test "$TERM" == dumb || echo --color=auto)"
export USER=$USERNAME
fi
ip-address(){
local ip=$(LANG=C ifconfig | grep "inet " | grep -v "127.0.0.1" | awk '{print $2}')
test -n "$ip" && printf $1 $ip
}

#######################
__my_prompt_function(){ # used by PS1
local lastreturn=$?
if test "${TERM}" == dumb
then
local c1=
local c2=
local c3=
local cdef=
else
local c1="\e[33m"
local c2="\e[36m"
local c3="\e[37m"
local cdef="\e[0m"
fi
if iswindows
then
local pwd=$PWD
local oldpwd=$OLDPWD
git branch >/dev/null 2>&1 && local git="[GIT]"
local date=$(/c/Windows/System32/cmd.exe //c 'echo %DATE%-%TIME%')
else
local pwd=$(echo "${PWD}/" | sed -e "s#${HOME}#~#")
local oldpwd=$(echo "${OLDPWD}/" | sed -e "s#${HOME}#~#")
local jobnum=$(jobs | wc -l)
local git=$(__try_exec __git_ps1 [GIT:%s])
local date=$(LANG=C __try_exec date +"%a, %d %b %Y %T %z")
fi
# local svn=$(type svn >/dev/null 2>&1 && __try_exec __my_svn_ps1 [SVN:%s])
if test -z "$DISPLAY"
then
local ip=$(ip-address [Addr:%s])
test -f /tmp/batterystatus && local battery="[Battery:$(sed -e 's`%`%%`g' /tmp/batterystatus)]"
battery-status %s >/tmp/batterystatus &
fi
local tty=$(__try_exec tty | sed -e 's:/dev/::')
# local battery=$(battery-state [%s] | sed -e 's`%`%%`g') # very slow
printf " [${c1}${pwd}${cdef}<${c3}${oldpwd}${cdef}]${git}${svn}${battery}${ip}\n"
printf "${c2}${USER}@${HOSTNAME}${cdef} ${tty} ${date} ${BASH} ${BASH_VERSION}\n"
printf "shlv:${SHLVL} jobs:${jobnum} last:${lastreturn} "

_testjp(){
echo "Japanese letters are 表示可能"
}
_testjp

uname -a
test -f /etc/issue.net && cat /etc/issue.net
# from https://wiki.archlinux.org/index.php/X_resources
invader(){
# ANSI color scheme script featuring Space Invaders
#
# Original: http://crunchbanglinux.org/forums/post/126921/#p126921
# Modified by lolilolicon
#

f=3 b=4
for j in f b; do
for i in {0..7}; do
printf -v $j$i %b "\e[${!j}${i}m"
done
done
bld=$'\e[1m'
rst=$'\e[0m'

safe-cmd diskinfo
cat << EOF

! isdarwin && test -n "${DESKTOP_SESSION}" && type xrandr >/dev/null 2>&1 && {
xrandr | grep --color=never ^Screen
}
$f1 ▀▄ ▄▀ $f2 ▄▄▄████▄▄▄ $f3 ▄██▄ $f4 ▀▄ ▄▀ $f5 ▄▄▄████▄▄▄ $f6 ▄██▄ $rst
$f1 ▄█▀███▀█▄ $f2███▀▀██▀▀███ $f3▄█▀██▀█▄ $f4 ▄█▀███▀█▄ $f5███▀▀██▀▀███ $f6▄█▀██▀█▄$rst
$f1█▀███████▀█ $f2▀▀███▀▀███▀▀ $f3▀█▀██▀█▀ $f4█▀███████▀█ $f5▀▀███▀▀███▀▀ $f6▀█▀██▀█▀$rst
$f1▀ ▀▄▄ ▄▄▀ ▀ $f2 ▀█▄ ▀▀ ▄█▀ $f3▀▄ ▄▀ $f4▀ ▀▄▄ ▄▄▀ ▀ $f5 ▀█▄ ▀▀ ▄█▀ $f6▀▄ ▄▀$rst

iswindows || safe-cmd finger $USER
LANG=C safe-cmd id
$bld$f1▄ ▀▄ ▄▀ ▄ $f2 ▄▄▄████▄▄▄ $f3 ▄██▄ $f4▄ ▀▄ ▄▀ ▄ $f5 ▄▄▄████▄▄▄ $f6 ▄██▄ $rst
$bld$f1█▄█▀███▀█▄█ $f2███▀▀██▀▀███ $f3▄█▀██▀█▄ $f4█▄█▀███▀█▄█ $f5███▀▀██▀▀███ $f6▄█▀██▀█▄$rst
$bld$f1▀█████████▀ $f2▀▀▀██▀▀██▀▀▀ $f3▀▀█▀▀█▀▀ $f4▀█████████▀ $f5▀▀▀██▀▀██▀▀▀ $f6▀▀█▀▀█▀▀$rst
$bld$f1 ▄▀ ▀▄ $f2▄▄▀▀ ▀▀ ▀▀▄▄ $f3▄▀▄▀▀▄▀▄ $f4 ▄▀ ▀▄ $f5▄▄▀▀ ▀▀ ▀▀▄▄ $f6▄▀▄▀▀▄▀▄$rst


$f7▌$rst

$f7▌$rst

$f7 ▄█▄ $rst
$f7▄█████████▄$rst
$f7▀▀▀▀▀▀▀▀▀▀▀$rst

EOF
}

+ 73
- 0
conkyrc Целия файл

@@ -0,0 +1,73 @@
# ~/.conkyrc
#
double_buffer yes
background no

use_xft yes
xftfont DejaVu Sans Mono:size=10
xftalpha 0.8

update_interval 1.0
total_run_times 0

own_window yes
own_window_type override
own_window_transparent yes
own_window_colour hotpink
own_window_hints undecorated,below,skip_taskbar,sticky,skip_pager

minimum_size 200
draw_shades no
draw_outline no
draw_borders no
stippled_borders 0
border_width 1
alignment top_right
gap_x 20
gap_y 40

default_color green # slategrey
default_shade_color lightgrey
default_outline_color black
color0 white
color1 white
color2 green

no_buffers yes
uppercase no
format_human_readable yes

TEXT
${color0}${alignr}${conky_build_arch}
${color0}${alignr}${execi 30000 whoami}@${nodename}
${color0}${hr}
#${color2}host ${color1}|${color0} ${nodename}
${color2}uptm ${color1}|${color0} ${uptime}
${color2}lgin ${color1}|${color0} ${uptime}
#${color2}os ${color1}|${color0} ${sysname} ${kernel}
${color0}${stippled_hr}
${color2}cpu ${color1}|${color0} ${cpu}% ${cpubar}
${color2}freq ${color1}|${color0} ${freq 1}Mhz | ${freq 2}Mhz
#${color2}btry ${color1}|${color0} ${battery}
#${color2}btime${color1}|${color0} ${battery_time}
${color0}${hr}
${color2}ram ${color1}|${color0} ${memperc}% ${membar}
${color2}swap ${color1}|${color0} ${if_match "${swapperc}" == "No swap"}None${else}${swapperc} ${swapbar}${endif}
${color0}${stippled_hr}
${color2}root ${color1}|${color0} ${fs_used /} #/${fs_size /}
${fs_bar /}
${color2}/tmp ${color1}|${color0} ${fs_used /tmp} #/${fs_size /tmp}
${fs_bar /tmp}
${color2}dio ${color1}|${color0} ${diskio}
${color0}${hr}
${color2}${gw_iface} ${color1}|${color0} ${addr}
${color2}ssid ${color1}|${color0} ${wireless_essid}
${color0}${stippled_hr}
${color2}down ${color1}|${color0} ${downspeed}/s
${color #888888}${downspeedgraph ff0000 0000ff}
${color2}up ${color1}|${color0} ${upspeed}/s
${color #888888}${upspeedgraph 0000ff ff0000}
${color0}${hr}
${alignr}conky ${conky_version} on Page${desktop}
#${color0}${alignr}${execi 900 cal -1}

+ 40
- 0
conkyrc.2 Целия файл

@@ -0,0 +1,40 @@
# ~/.conkyrc
#
double_buffer yes
background no

use_xft yes
xftfont DejaVu Sans Mono:size=10
xftalpha 0.8

update_interval 1.0
total_run_times 0

own_window yes
own_window_type override
own_window_transparent yes
own_window_colour hotpink
own_window_hints undecorated,below,skip_taskbar,sticky,skip_pager

minimum_size 200
#maximum_width 1000
draw_shades no
draw_outline no
draw_borders no
stippled_borders 0
border_width 1
default_color green # slategrey
default_shade_color lightgrey
default_outline_color black
alignment bottom_left
gap_x 20
gap_y 20
no_buffers yes
uppercase no
format_human_readable yes

TEXT
${color yellow}$$ tail -f -n 12 /var/log/everything.log
${color white}${tail /var/log/everything.log 12}
${time %b %d %T}

+ 394
- 603
emacs.el
Файловите разлики са ограничени, защото са твърде много
Целия файл


+ 7
- 23
profile Целия файл

@@ -1,32 +1,15 @@
#!/bin/sh
env > $HOME/.env.txt

if [ -n "${DESKTOP_SESSION}" ]; then
xmodmap -e 'keycode 135 = Alt_R Meta_R' # menu key as alt
xmodmap -e 'keycode 101 = Alt_R Meta_R' # hiragana key as alt
xmodmap -e 'remove Lock = Caps_Lock'
xmodmap -e 'add Control = Caps_Lock'

synclient VertEdgeScroll=0
synclient HorizEdgeScroll=0
synclient MaxTapTime=0
synclient MaxSpeed=0.4
synclient MinSpeed=0.2

test -f "$HOME/.fehbg" &&
type feh >/dev/null 2>&1 &&
sh "$HOME/.fehbg"
else
export LANG=C
fi

# export PS1="\$ "
# export LANG=ja_JP.UTF-8
export LC_TIME=C
export TERMCAP="${TERMCAP}:vb="
export HOSTNAME
export BROWSER=firefox
export ENV=~/.shrc
# export TMP=/tmp
# export TEMP=/tmp
test -f "${HOME}/.pythonrc" && export PYTHONSTARTUP="${HOME}/.pythonrc"
export PYTHONPATH=~/.py

addtopath(){
for p in "$@"
@@ -37,6 +20,7 @@ addtopath(){
# export PATH="${PATH}:${HOME}/bin"
addtopath ${HOME}/bin

test -f "${HOME}/.pythonrc" && export PYTHONSTARTUP="${HOME}/.pythonrc"
export PYTHONPATH=~/.py
type setterm >/dev/null 2>&1 && setterm -blank 30 -powersave on # -powerdown 10
# in my environment powerdown does not work

mkdir -p ~/.backup/log

+ 21
- 0
xinitrc Целия файл

@@ -0,0 +1,21 @@
setxkbmap -model "acer_laptop" -layout "jp" -option "ctrl:nocaps" # this line must comes first
xmodmap -e 'keycode 135 = Alt_R Meta_R' # menu key as alt
xmodmap -e 'keycode 101 = Alt_R Meta_R' # hiragana key as alt
#xmodmap -e 'remove Lock = Caps_Lock'
#xmodmap -e 'add Control = Caps_Lock'

type synclient >/dev/null 2>&1 && {
synclient VertEdgeScroll=0
synclient HorizEdgeScroll=0
synclient MaxTapTime=0
synclient MaxSpeed=2.0
synclient MinSpeed=0.2
}

xset s 1800 # go blank after 30 min
xset dpms 1810 1820 1830 # standby, suspend and off seem to be not different for my environment

unset LC_MESSAGES
export LANG=ja_JP.utf8
export BROWSER=firefox


+ 26
- 0
xprograms Целия файл

@@ -0,0 +1,26 @@
#!/bin/sh
# Programs run in background when starting x.
# 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"

tint2 &

#dropboxd & # done by ~/.config/autostart/dropbox.desktop

volumeicon &

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

# 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 &


Зареждане…
Отказ
Запис