From 25b947edf445a96db335fe285a8b253b214649ff Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Wed, 6 Jan 2016 22:59:26 +0800 Subject: Rename .* => _*; Move out private contents. --- .Xmodmap | 18 - .bash_aliases | 9 - .bash_completion.d/todo_completion | 113 - .bash_logout | 7 - .bash_profile | 5 - .bashrc | 130 -- .calendar/calendar | 33 - .calendar/nomail | 0 .conky/cronograph/accuweather/accuweather.sh | 172 -- .conky/cronograph/accuweather/curr_cond | 5 - .conky/cronograph/accuweather/curr_cond_raw | 1646 -------------- .conky/cronograph/accuweather/last_days | 25 - .conky/cronograph/accuweather/last_days_raw | 82 - .conky/cronograph/accuweather/tod_ton | 25 - .conky/cronograph/accuweather/tod_ton_raw | 81 - .conky/cronograph/conky_start.sh | 10 - .conky/cronograph/conkyrc | 89 - .conky/cronograph/images/Blank.png | Bin 11356 -> 0 bytes .conky/cronograph/images/Blue.png | Bin 11605 -> 0 bytes .conky/cronograph/images/Dark_Green.png | Bin 12198 -> 0 bytes .conky/cronograph/images/Dark_Purple.png | Bin 11429 -> 0 bytes .conky/cronograph/images/Green.png | Bin 11963 -> 0 bytes .conky/cronograph/images/Orange.png | Bin 11767 -> 0 bytes .conky/cronograph/images/Pink.png | Bin 11514 -> 0 bytes .conky/cronograph/images/Purple.png | Bin 11335 -> 0 bytes .conky/cronograph/images/Red.png | Bin 11470 -> 0 bytes .conky/cronograph/images/Yellow.png | Bin 11889 -> 0 bytes .conky/cronograph/scripts/blinkingLED | 3 - .conky/cronograph/scripts/clock_rings.lua | 358 --- .conky/cronograph/scripts/multi_rings.lua | 375 ---- .conkyrc | 89 - .ds9.prf | 115 - .ds9_7.prf | 115 - .gitignore | 78 +- .gnupg/dirmngr.conf | 21 - .gnupg/gpg-agent.conf | 21 - .gnupg/gpg.conf | 130 -- .gnupg/sks-keyservers.netCA.pem | 32 - .gtk-bookmarks | 5 - .gtkrc-2.0 | 8 - .gtkrc.mine | 25 - .i3/config | 386 ---- .i3/i3blocks.conf | 101 - .i3/i3status.conf | 76 - .i3/images/wallpaper.png | Bin 87684 -> 0 bytes .i3/scripts/i3exit.sh | 43 - .inputrc | 30 - .lftp/rc | 112 - .msmtprc | 79 - .mutt/attachments | 64 - .mutt/colors | 129 -- .mutt/compose.rc | 15 - .mutt/compose.sh | 14 - .mutt/excel2text.sh | 31 - .mutt/gpg.rc | 108 - .mutt/mailcap | 119 - .mutt/mailinglists | 19 - .mutt/mutt-notmuch.py | 120 - .mutt/mutt-xlabel.py | 164 -- .mutt/mutt_bgrun.sh | 118 - .mutt/mutt_octet_view.sh | 278 --- .mutt/muttrc | 251 --- .mutt/muttrc.bak | 172 -- .mutt/ppt2text.sh | 23 - .mutt/word2text.sh | 67 - .ncmpcpp/config | 523 ----- .ncmpcpp/keys | 199 -- .notmuch-config | 93 - .npmrc | 7 - .offlineimap/offlineimap.py | 68 - .offlineimap/postsync.sh | 26 - .offlineimaprc | 218 -- .profile | 56 - .rtorrent.rc | 193 -- .sbclrc | 23 - .screenrc | 83 - .tmux.conf | 133 -- .todo/config | 95 - .todo/todo.sh | 1431 ------------ .urxvt/ext/LICENSE | 339 --- .urxvt/ext/README.md | 107 - .urxvt/ext/clipboard | 109 - .urxvt/ext/keyboard-select | 567 ----- .urxvt/ext/url-select | 375 ---- .vifm/colors/Default | 52 - .vifm/colors/alycolors | 60 - .vifm/colors/dmilith-root | 21 - .vifm/colors/dmilith-user | 21 - .vifm/colors/istib-solarized-dark | 25 - .vifm/colors/juef-zenburn | 21 - .vifm/colors/reicheltd-light | 26 - .vifm/vifm-help.txt | 3099 -------------------------- .vifm/vifmrc | 314 --- .xbindkeysrc | 104 - .xinitrc | 25 - .xprofile | 7 - .xspec/Xspec.init | 166 -- .zshrc | 86 - .zshrc.local | 113 - _Xmodmap | 18 + _bash_aliases | 9 + _bash_completion.d/todo_completion | 113 + _bash_logout | 7 + _bash_profile | 5 + _bashrc | 130 ++ _calendar/calendar | 33 + _calendar/nomail | 0 _config/gtk-3.0/bookmarks | 4 +- _config/gtk-3.0/settings.ini | 22 +- _config/htop/htoprc | 25 - _config/user-dirs.dirs | 14 +- _conky/cronograph/accuweather/accuweather.sh | 172 ++ _conky/cronograph/accuweather/curr_cond | 5 + _conky/cronograph/accuweather/curr_cond_raw | 1646 ++++++++++++++ _conky/cronograph/accuweather/last_days | 25 + _conky/cronograph/accuweather/last_days_raw | 82 + _conky/cronograph/accuweather/tod_ton | 25 + _conky/cronograph/accuweather/tod_ton_raw | 81 + _conky/cronograph/conky_start.sh | 10 + _conky/cronograph/conkyrc | 89 + _conky/cronograph/images/Blank.png | Bin 0 -> 11356 bytes _conky/cronograph/images/Blue.png | Bin 0 -> 11605 bytes _conky/cronograph/images/Dark_Green.png | Bin 0 -> 12198 bytes _conky/cronograph/images/Dark_Purple.png | Bin 0 -> 11429 bytes _conky/cronograph/images/Green.png | Bin 0 -> 11963 bytes _conky/cronograph/images/Orange.png | Bin 0 -> 11767 bytes _conky/cronograph/images/Pink.png | Bin 0 -> 11514 bytes _conky/cronograph/images/Purple.png | Bin 0 -> 11335 bytes _conky/cronograph/images/Red.png | Bin 0 -> 11470 bytes _conky/cronograph/images/Yellow.png | Bin 0 -> 11889 bytes _conky/cronograph/scripts/blinkingLED | 3 + _conky/cronograph/scripts/clock_rings.lua | 358 +++ _conky/cronograph/scripts/multi_rings.lua | 375 ++++ _conkyrc | 89 + _gnupg/dirmngr.conf | 21 + _gnupg/gpg-agent.conf | 21 + _gnupg/gpg.conf | 130 ++ _gnupg/sks-keyservers.netCA.pem | 32 + _gtkrc-2.0 | 8 + _gtkrc.mine | 25 + _i3/config | 386 ++++ _i3/i3blocks.conf | 101 + _i3/i3status.conf | 76 + _i3/images/wallpaper.png | Bin 0 -> 87684 bytes _i3/scripts/i3exit.sh | 43 + _inputrc | 30 + _lftprc | 112 + _mpdconf | 1 + _mutt/attachments | 64 + _mutt/colors | 129 ++ _mutt/compose.rc | 15 + _mutt/compose.sh | 14 + _mutt/excel2text.sh | 31 + _mutt/gpg.rc | 108 + _mutt/mailcap | 119 + _mutt/mutt-notmuch.py | 120 + _mutt/mutt-xlabel.py | 164 ++ _mutt/mutt_bgrun.sh | 118 + _mutt/mutt_octet_view.sh | 278 +++ _mutt/muttrc | 251 +++ _mutt/ppt2text.sh | 23 + _mutt/word2text.sh | 67 + _ncmpcpp/config | 523 +++++ _ncmpcpp/keys | 199 ++ _notmuch-config | 93 + _npmrc | 7 + _offlineimap/offlineimap.py | 68 + _offlineimap/postsync.sh | 26 + _profile | 56 + _rtorrent.rc | 193 ++ _sbclrc | 23 + _screenrc | 83 + _tmux.conf | 133 ++ _todo/config | 95 + _todo/todo.sh | 1431 ++++++++++++ _urxvt/ext/LICENSE | 339 +++ _urxvt/ext/README.md | 107 + _urxvt/ext/clipboard | 109 + _urxvt/ext/keyboard-select | 567 +++++ _urxvt/ext/url-select | 375 ++++ _vifm/colors/Default | 52 + _vifm/colors/alycolors | 60 + _vifm/colors/dmilith-root | 21 + _vifm/colors/dmilith-user | 21 + _vifm/colors/istib-solarized-dark | 25 + _vifm/colors/juef-zenburn | 21 + _vifm/colors/reicheltd-light | 26 + _vifm/vifmrc | 314 +++ _xbindkeysrc | 104 + _xinitrc | 25 + _xprofile | 7 + _xspec/Xspec.init | 166 ++ _zshrc | 86 + _zshrc.local | 113 + 194 files changed, 11250 insertions(+), 15174 deletions(-) delete mode 100644 .Xmodmap delete mode 100644 .bash_aliases delete mode 100644 .bash_completion.d/todo_completion delete mode 100644 .bash_logout delete mode 100644 .bash_profile delete mode 100644 .bashrc delete mode 100644 .calendar/calendar delete mode 100644 .calendar/nomail delete mode 100755 .conky/cronograph/accuweather/accuweather.sh delete mode 100644 .conky/cronograph/accuweather/curr_cond delete mode 100644 .conky/cronograph/accuweather/curr_cond_raw delete mode 100644 .conky/cronograph/accuweather/last_days delete mode 100644 .conky/cronograph/accuweather/last_days_raw delete mode 100644 .conky/cronograph/accuweather/tod_ton delete mode 100644 .conky/cronograph/accuweather/tod_ton_raw delete mode 100755 .conky/cronograph/conky_start.sh delete mode 100644 .conky/cronograph/conkyrc delete mode 100644 .conky/cronograph/images/Blank.png delete mode 100644 .conky/cronograph/images/Blue.png delete mode 100644 .conky/cronograph/images/Dark_Green.png delete mode 100644 .conky/cronograph/images/Dark_Purple.png delete mode 100644 .conky/cronograph/images/Green.png delete mode 100644 .conky/cronograph/images/Orange.png delete mode 100644 .conky/cronograph/images/Pink.png delete mode 100644 .conky/cronograph/images/Purple.png delete mode 100644 .conky/cronograph/images/Red.png delete mode 100644 .conky/cronograph/images/Yellow.png delete mode 100755 .conky/cronograph/scripts/blinkingLED delete mode 100755 .conky/cronograph/scripts/clock_rings.lua delete mode 100755 .conky/cronograph/scripts/multi_rings.lua delete mode 100644 .conkyrc delete mode 100644 .ds9.prf delete mode 100644 .ds9_7.prf delete mode 100644 .gnupg/dirmngr.conf delete mode 100644 .gnupg/gpg-agent.conf delete mode 100644 .gnupg/gpg.conf delete mode 100644 .gnupg/sks-keyservers.netCA.pem delete mode 100644 .gtk-bookmarks delete mode 100644 .gtkrc-2.0 delete mode 100644 .gtkrc.mine delete mode 100644 .i3/config delete mode 100644 .i3/i3blocks.conf delete mode 100644 .i3/i3status.conf delete mode 100644 .i3/images/wallpaper.png delete mode 100755 .i3/scripts/i3exit.sh delete mode 100644 .inputrc delete mode 100644 .lftp/rc delete mode 100644 .msmtprc delete mode 100644 .mutt/attachments delete mode 100644 .mutt/colors delete mode 100644 .mutt/compose.rc delete mode 100755 .mutt/compose.sh delete mode 100755 .mutt/excel2text.sh delete mode 100644 .mutt/gpg.rc delete mode 100644 .mutt/mailcap delete mode 100644 .mutt/mailinglists delete mode 100755 .mutt/mutt-notmuch.py delete mode 100755 .mutt/mutt-xlabel.py delete mode 100755 .mutt/mutt_bgrun.sh delete mode 100755 .mutt/mutt_octet_view.sh delete mode 100644 .mutt/muttrc delete mode 100644 .mutt/muttrc.bak delete mode 100755 .mutt/ppt2text.sh delete mode 100755 .mutt/word2text.sh delete mode 100644 .ncmpcpp/config delete mode 100644 .ncmpcpp/keys delete mode 100644 .notmuch-config delete mode 100644 .npmrc delete mode 100644 .offlineimap/offlineimap.py delete mode 100755 .offlineimap/postsync.sh delete mode 100644 .offlineimaprc delete mode 100644 .profile delete mode 100644 .rtorrent.rc delete mode 100644 .sbclrc delete mode 100644 .screenrc delete mode 100644 .tmux.conf delete mode 100644 .todo/config delete mode 100755 .todo/todo.sh delete mode 100644 .urxvt/ext/LICENSE delete mode 100644 .urxvt/ext/README.md delete mode 100644 .urxvt/ext/clipboard delete mode 100644 .urxvt/ext/keyboard-select delete mode 100644 .urxvt/ext/url-select delete mode 100644 .vifm/colors/Default delete mode 100644 .vifm/colors/alycolors delete mode 100644 .vifm/colors/dmilith-root delete mode 100644 .vifm/colors/dmilith-user delete mode 100644 .vifm/colors/istib-solarized-dark delete mode 100644 .vifm/colors/juef-zenburn delete mode 100644 .vifm/colors/reicheltd-light delete mode 100644 .vifm/vifm-help.txt delete mode 100644 .vifm/vifmrc delete mode 100644 .xbindkeysrc delete mode 100644 .xinitrc delete mode 100644 .xprofile delete mode 100644 .xspec/Xspec.init delete mode 100644 .zshrc delete mode 100644 .zshrc.local create mode 100644 _Xmodmap create mode 100644 _bash_aliases create mode 100644 _bash_completion.d/todo_completion create mode 100644 _bash_logout create mode 100644 _bash_profile create mode 100644 _bashrc create mode 100644 _calendar/calendar create mode 100644 _calendar/nomail delete mode 100644 _config/htop/htoprc create mode 100755 _conky/cronograph/accuweather/accuweather.sh create mode 100644 _conky/cronograph/accuweather/curr_cond create mode 100644 _conky/cronograph/accuweather/curr_cond_raw create mode 100644 _conky/cronograph/accuweather/last_days create mode 100644 _conky/cronograph/accuweather/last_days_raw create mode 100644 _conky/cronograph/accuweather/tod_ton create mode 100644 _conky/cronograph/accuweather/tod_ton_raw create mode 100755 _conky/cronograph/conky_start.sh create mode 100644 _conky/cronograph/conkyrc create mode 100644 _conky/cronograph/images/Blank.png create mode 100644 _conky/cronograph/images/Blue.png create mode 100644 _conky/cronograph/images/Dark_Green.png create mode 100644 _conky/cronograph/images/Dark_Purple.png create mode 100644 _conky/cronograph/images/Green.png create mode 100644 _conky/cronograph/images/Orange.png create mode 100644 _conky/cronograph/images/Pink.png create mode 100644 _conky/cronograph/images/Purple.png create mode 100644 _conky/cronograph/images/Red.png create mode 100644 _conky/cronograph/images/Yellow.png create mode 100755 _conky/cronograph/scripts/blinkingLED create mode 100755 _conky/cronograph/scripts/clock_rings.lua create mode 100755 _conky/cronograph/scripts/multi_rings.lua create mode 100644 _conkyrc create mode 100644 _gnupg/dirmngr.conf create mode 100644 _gnupg/gpg-agent.conf create mode 100644 _gnupg/gpg.conf create mode 100644 _gnupg/sks-keyservers.netCA.pem create mode 100644 _gtkrc-2.0 create mode 100644 _gtkrc.mine create mode 100644 _i3/config create mode 100644 _i3/i3blocks.conf create mode 100644 _i3/i3status.conf create mode 100644 _i3/images/wallpaper.png create mode 100755 _i3/scripts/i3exit.sh create mode 100644 _inputrc create mode 100644 _lftprc create mode 120000 _mpdconf create mode 100644 _mutt/attachments create mode 100644 _mutt/colors create mode 100644 _mutt/compose.rc create mode 100755 _mutt/compose.sh create mode 100755 _mutt/excel2text.sh create mode 100644 _mutt/gpg.rc create mode 100644 _mutt/mailcap create mode 100755 _mutt/mutt-notmuch.py create mode 100755 _mutt/mutt-xlabel.py create mode 100755 _mutt/mutt_bgrun.sh create mode 100755 _mutt/mutt_octet_view.sh create mode 100644 _mutt/muttrc create mode 100755 _mutt/ppt2text.sh create mode 100755 _mutt/word2text.sh create mode 100644 _ncmpcpp/config create mode 100644 _ncmpcpp/keys create mode 100644 _notmuch-config create mode 100644 _npmrc create mode 100755 _offlineimap/offlineimap.py create mode 100755 _offlineimap/postsync.sh create mode 100644 _profile create mode 100644 _rtorrent.rc create mode 100644 _sbclrc create mode 100644 _screenrc create mode 100644 _tmux.conf create mode 100644 _todo/config create mode 100755 _todo/todo.sh create mode 100644 _urxvt/ext/LICENSE create mode 100644 _urxvt/ext/README.md create mode 100644 _urxvt/ext/clipboard create mode 100644 _urxvt/ext/keyboard-select create mode 100644 _urxvt/ext/url-select create mode 100644 _vifm/colors/Default create mode 100644 _vifm/colors/alycolors create mode 100644 _vifm/colors/dmilith-root create mode 100644 _vifm/colors/dmilith-user create mode 100644 _vifm/colors/istib-solarized-dark create mode 100644 _vifm/colors/juef-zenburn create mode 100644 _vifm/colors/reicheltd-light create mode 100644 _vifm/vifmrc create mode 100644 _xbindkeysrc create mode 100644 _xinitrc create mode 100644 _xprofile create mode 100644 _xspec/Xspec.init create mode 100644 _zshrc create mode 100644 _zshrc.local diff --git a/.Xmodmap b/.Xmodmap deleted file mode 100644 index e6e0ef0..0000000 --- a/.Xmodmap +++ /dev/null @@ -1,18 +0,0 @@ -!! ~/.Xmodmap -!! -!! Custom keymaps -!! -!! Aaron LI -!! 2015/06/15 -!! - -!! Swap 'Caps Lock' with 'Left Control' -!! Reference: http://c2.com/cgi/wiki?RemapCapsLock -remove Lock = Caps_Lock -remove Control = Control_L -keysym Caps_Lock = Control_L -!! If don't want a 'Caps Lock' at all, just comment the following *1* line. -!keysym Control_L = Caps_Lock -add Control = Control_L -add Lock = Caps_Lock - diff --git a/.bash_aliases b/.bash_aliases deleted file mode 100644 index 7d25ed6..0000000 --- a/.bash_aliases +++ /dev/null @@ -1,9 +0,0 @@ -# ~/.bash_aliases -# - -### sbcl ### -#export CL_BREAK_CHARS="\"#'(),;\`\\|!?[]{}" -#alias sbcl="rlwrap -b \${CL_BREAK_CHARS} sbcl" -alias sbcl='sbcl --no-inform' - -# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=sh: # diff --git a/.bash_completion.d/todo_completion b/.bash_completion.d/todo_completion deleted file mode 100644 index f443acb..0000000 --- a/.bash_completion.d/todo_completion +++ /dev/null @@ -1,113 +0,0 @@ -#!/bin/bash source-this-script -[ "$BASH_VERSION" ] || return - -_todo() -{ - local cur prev opts - COMPREPLY=() - cur="${COMP_WORDS[COMP_CWORD]}" - prev="${COMP_WORDS[COMP_CWORD-1]}" - - local -r OPTS="-@ -@@ -+ -++ -d -f -h -p -P -PP -a -n -t -v -vv -V -x" - local -r COMMANDS="\ - add a addto addm append app archive command del \ - rm depri dp do help list ls listaddons listall lsa listcon \ - lsc listfile lf listpri lsp listproj lsprj move \ - mv prepend prep pri p replace report shorthelp" - local -r MOVE_COMMAND_PATTERN='^(move|mv)$' - - local _todo_sh=${_todo_sh:-todo.sh} - local completions - if [ $COMP_CWORD -eq 1 ]; then - completions="$COMMANDS $(eval TODOTXT_VERBOSE=0 $_todo_sh command listaddons) $OPTS" - elif [[ $COMP_CWORD -gt 2 && ( \ - "${COMP_WORDS[COMP_CWORD-2]}" =~ $MOVE_COMMAND_PATTERN || \ - "${COMP_WORDS[COMP_CWORD-3]}" =~ $MOVE_COMMAND_PATTERN ) ]]; then - # "move ITEM# DEST [SRC]" has file arguments on positions 2 and 3. - completions=$(eval TODOTXT_VERBOSE=0 $_todo_sh command listfile) - else - case "$prev" in - command) - completions=$COMMANDS;; - help) - completions="$COMMANDS $(eval TODOTXT_VERBOSE=0 $_todo_sh command listaddons)";; - addto|listfile|lf) - completions=$(eval TODOTXT_VERBOSE=0 $_todo_sh command listfile);; - -*) completions="$COMMANDS $(eval TODOTXT_VERBOSE=0 $_todo_sh command listaddons) $OPTS";; - *) case "$cur" in - +*) completions=$(eval TODOTXT_VERBOSE=0 $_todo_sh command listproj) - COMPREPLY=( $( compgen -W "$completions" -- $cur )) - [ ${#COMPREPLY[@]} -gt 0 ] && return 0 - # Fall back to projects extracted from done tasks. - completions=$(eval 'TODOTXT_VERBOSE=0 TODOTXT_SOURCEVAR=\$DONE_FILE' $_todo_sh command listproj) - ;; - @*) completions=$(eval TODOTXT_VERBOSE=0 $_todo_sh command listcon) - COMPREPLY=( $( compgen -W "$completions" -- $cur )) - [ ${#COMPREPLY[@]} -gt 0 ] && return 0 - # Fall back to contexts extracted from done tasks. - completions=$(eval 'TODOTXT_VERBOSE=0 TODOTXT_SOURCEVAR=\$DONE_FILE' $_todo_sh command listcon) - ;; - *) if [[ "$cur" =~ ^[0-9]+$ ]]; then - # Remove the (padded) task number; we prepend the - # user-provided $cur instead. - # Remove the timestamp prepended by the -t option, - # and the done date (for done tasks); there's no - # todo.txt option for that yet. - # But keep priority and "x"; they're short and may - # provide useful context. - # Remove any trailing whitespace; the Bash - # completion inserts a trailing space itself. - # Finally, limit the output to a single line just as - # a safety check of the ls action output. - local todo=$( \ - eval TODOTXT_VERBOSE=0 $_todo_sh '-@ -+ -p -x command ls "^ *${cur} "' | \ - sed -e 's/^ *[0-9]\{1,\} //' -e 's/^\((.) \)\{0,1\}[0-9]\{2,4\}-[0-9]\{2\}-[0-9]\{2\} /\1/' \ - -e 's/^\([xX] \)\([0-9]\{2,4\}-[0-9]\{2\}-[0-9]\{2\} \)\{1,2\}/\1/' \ - -e 's/[[:space:]]*$//' \ - -e '1q' \ - ) - # Append task text as a shell comment. This - # completion can be a safety check before a - # destructive todo.txt operation. - [ "$todo" ] && COMPREPLY[0]="$cur # $todo" - return 0 - else - return 0 - fi - ;; - esac - ;; - esac - fi - - COMPREPLY=( $( compgen -W "$completions" -- $cur )) - return 0 -} -complete -F _todo todo.sh - -# If you define an alias (e.g. "t") to todo.sh, you need to explicitly enable -# completion for it, too: -#complete -F _todo t -# It is recommended to put this line next to your alias definition in your -# ~/.bashrc (or wherever else you're defining your alias). If you simply -# uncomment it here, you will need to redo this on every todo.txt update! - -# If you have renamed the todo.sh executable, or if it is not accessible through -# PATH, you need to add and use a wrapper completion function, like this: -#_todoElsewhere() -#{ -# local _todo_sh='/path/to/todo2.sh' -# _todo "$@" -#} -#complete -F _todoElsewhere /path/to/todo2.sh - -# If you use aliases to use different configuration(s), you need to add and use -# a wrapper completion function for each configuration if you want to complete -# fron the actual configured task locations: -#alias todo2='todo.sh -d "$HOME/todo2.cfg"' -#_todo2() -#{ -# local _todo_sh='todo.sh -d "$HOME/todo2.cfg"' -# _todo "$@" -#} -#complete -F _todo2 todo2 diff --git a/.bash_logout b/.bash_logout deleted file mode 100644 index de4f5f7..0000000 --- a/.bash_logout +++ /dev/null @@ -1,7 +0,0 @@ -# ~/.bash_logout: executed by bash(1) when login shell exits. - -# when leaving the console clear the screen to increase privacy - -if [ "$SHLVL" = 1 ]; then - [ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q -fi diff --git a/.bash_profile b/.bash_profile deleted file mode 100644 index 94a6622..0000000 --- a/.bash_profile +++ /dev/null @@ -1,5 +0,0 @@ -# /etc/skel/.bash_profile - -# This file is sourced by bash for login shells. The following line -# runs your .bashrc and is recommended by the bash info pages. -[[ -f ~/.bashrc ]] && . ~/.bashrc diff --git a/.bashrc b/.bashrc deleted file mode 100644 index a962229..0000000 --- a/.bashrc +++ /dev/null @@ -1,130 +0,0 @@ -# ~/.bashrc: executed by bash(1) for non-login shells. -# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) -# for examples - -# If not running interactively, don't do anything -case $- in - *i*) ;; - *) return;; -esac - -# don't put duplicate lines or lines starting with space in the history. -# See bash(1) for more options -HISTCONTROL=ignoreboth - -# append to the history file, don't overwrite it -shopt -s histappend - -# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) -HISTSIZE=1000 -HISTFILESIZE=2000 - -# Vi key bindings -set -o vi - -# check the window size after each command and, if necessary, -# update the values of LINES and COLUMNS. -shopt -s checkwinsize - -# If set, the pattern "**" used in a pathname expansion context will -# match all files and zero or more directories and subdirectories. -#shopt -s globstar - -# make less more friendly for non-text input files, see lesspipe(1) -#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" - -# set variable identifying the chroot you work in (used in the prompt below) -if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then - debian_chroot=$(cat /etc/debian_chroot) -fi - -# set a fancy prompt (non-color, unless we know we "want" color) -case "$TERM" in - xterm-color|*-256color) color_prompt=yes;; -esac - -# uncomment for a colored prompt, if the terminal has the capability; turned -# off by default to not distract the user: the focus in a terminal window -# should be on the output of commands, not on the prompt -force_color_prompt=yes - -if [ -n "$force_color_prompt" ]; then - if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then - # We have color support; assume it's compliant with Ecma-48 - # (ISO/IEC-6429). (Lack of such support is extremely rare, and such - # a case would tend to support setf rather than setaf.) - color_prompt=yes - else - color_prompt= - fi -fi - -if [ "$color_prompt" = yes ]; then - PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' -else - PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' -fi -unset color_prompt force_color_prompt - -# If this is an xterm set the title to user@host:dir -case "$TERM" in -xterm*|rxvt*) - PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" - ;; -*) - ;; -esac - -# enable color support of ls and also add handy aliases -if [ -x /usr/bin/dircolors ]; then - test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" - alias ls='ls --color=auto' - alias dir='dir --color=auto' - alias vdir='vdir --color=auto' - - alias grep='grep --color=auto' - alias fgrep='fgrep --color=auto' - alias egrep='egrep --color=auto' -fi - -# colored GCC warnings and errors -export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' - -# Alias definitions. -# You may want to put all your additions into a separate file like -# ~/.bash_aliases, instead of adding them here directly. -# See /usr/share/doc/bash-doc/examples in the bash-doc package. - -if [ -f ~/.bash_aliases ]; then - . ~/.bash_aliases -fi - -# enable programmable completion features (you don't need to enable -# this, if it's already enabled in /etc/bash.bashrc and /etc/profile -# sources /etc/bash.bashrc). -if ! shopt -oq posix; then - if [ -f /usr/share/bash-completion/bash_completion ]; then - . /usr/share/bash-completion/bash_completion - elif [ -f /etc/bash_completion ]; then - . /etc/bash_completion - fi -fi - - -### environment variables {{{ -export EDITOR=vim -### }}} - - -### aliases {{{ -alias ll='ls -l' -alias lf='ls -F' -alias la='ls -A' -alias l='ls -CF' - -# ~/.bash_aliases -[ -f ~/.bash_aliases ] && . ~/.bash_aliases -### aliases }}} - - -# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=sh: # diff --git a/.calendar/calendar b/.calendar/calendar deleted file mode 100644 index 6f7b320..0000000 --- a/.calendar/calendar +++ /dev/null @@ -1,33 +0,0 @@ -/* - * $HOME/.calendar/calendar - * - * LY4ever - * April 8, 2011 - */ - -LANG=C - -ChineseNewYear=XinNian - -#include - -XinNian-1 Chu Xi -XinNian Xin Nian -XinNian+14 Yuan Xiao - -/* birthday */ -2011/5/27 SanSan's father's birthday -2011/7/20 *** SanSan's birthday *** -2011/8/6 Qi Xi -2011/9/12 Zhong Qiu - -/* arrangement */ -5/28 Hostizzle.com -6/27 Hostizzle.com -7/26 Hostizzle.com -8/25 Hostizzle.com -9/24 Hostizzle.com -10/23 Hostizzle.com -11/22 Hostizzle.com -12/21 Hostizzle.com - diff --git a/.calendar/nomail b/.calendar/nomail deleted file mode 100644 index e69de29..0000000 diff --git a/.conky/cronograph/accuweather/accuweather.sh b/.conky/cronograph/accuweather/accuweather.sh deleted file mode 100755 index fe6a407..0000000 --- a/.conky/cronograph/accuweather/accuweather.sh +++ /dev/null @@ -1,172 +0,0 @@ -#!/bin/sh - -## get the directory of this script -SCRIPT_PATH=`readlink -f $0` -SCRIPT_DIR=`dirname ${SCRIPT_PATH}` - -## address (Accuweather url) -address="http://www.accuweather.com/en/cn/shanghai/106577/weather-forecast/106577" # Shanghai - - -## function: test_image() -test_image() { - case $1 in - 1) - echo a - ;; - 2|3) - echo b - ;; - 4|5) - echo c - ;; - 6) - echo d - ;; - 7) - echo e - ;; - 8) - echo f - ;; - 11) - echo 0 - ;; - 12) - echo h - ;; - 13|14) - echo g - ;; - 15) - echo m - ;; - 16|17) - echo k - ;; - 18) - echo i - ;; - 19) - echo q - ;; - 20|21|23) - echo o - ;; - 22) - echo r - ;; - 24|31) - echo E - ;; - 25) - echo v - ;; - 26) - echo x - ;; - 29) - echo y - ;; - 30) - echo 5 - ;; - 32) - echo 6 - ;; - 33) - echo A - ;; - 34|35) - echo B - ;; - 36|37) - echo C - ;; - 38) - echo D - ;; - 39|40) - echo G - ;; - 41|42) - echo K - ;; - 43|44) - echo O - ;; - *) - echo - - ;; - esac -} - - -#kill -STOP $(pidof conky) -#killall wget - -## urls and wget weather data -loc_id=$(echo ${address} | sed 's/\/weather-forecast.*$//' | sed 's/^.*\///') -last_number=$(echo ${address} | sed 's/^.*\///') - -curr_addr="$(echo ${address} | sed 's/weather-forecast.*$//')current-weather/${last_number}" -wget -O ${SCRIPT_DIR}/curr_cond_raw "${curr_addr}" - -addr1="$(echo ${address} | sed 's/weather-forecast.*$//')daily-weather-forecast/${last_number}" -wget -O ${SCRIPT_DIR}/tod_ton_raw "${addr1}" - -addr2="${addr1}?day=6" -wget -O ${SCRIPT_DIR}/last_days_raw "${addr2}" - -## current conditions -if [ -s ${SCRIPT_DIR}/curr_cond_raw ]; then - sed -i '/detail-now/,/#details/!d' ${SCRIPT_DIR}/curr_cond_raw - egrep -i '"cond"|icon i-|detail-tab-panel' ${SCRIPT_DIR}/curr_cond_raw > ${SCRIPT_DIR}/curr_cond - sed -i -e 's/^.*detail-tab-panel //g' -e 's/^.*icon i-//g' -e 's/"><\/div>.*$//g' ${SCRIPT_DIR}/curr_cond - sed -i -e 's/^.*"cond">//g' -e 's/°/\n/g' -e 's/<\/span>.*"temp">/\n/g' -e 's/<.*>//g' ${SCRIPT_DIR}/curr_cond - sed -i -e 's/">//g' -e 's/-->//g' -e 's/\r$//g' -e 's/ i-alarm.*$//g' -e 's/-[a-z].*$//g' ${SCRIPT_DIR}/curr_cond - image=$(sed -n 2p ${SCRIPT_DIR}/curr_cond) - sed -i 2s/${image}/$(test_image ${image})/ ${SCRIPT_DIR}/curr_cond -fi - -## First 5 days -if [ -s ${SCRIPT_DIR}/tod_ton_raw ]; then - sed -i '/feed-tabs/,/\.feed-tabs/!d' ${SCRIPT_DIR}/tod_ton_raw - egrep -i 'Early AM|Today|Tonight|Overnight|icon i-|cond|temp|Mon|Tue|Wed|Thu|Fri|Sat|Sun' ${SCRIPT_DIR}/tod_ton_raw > ${SCRIPT_DIR}/tod_ton - sed -i -e 's/^.*#">//g' -e 's/^.*icon i-//g' -e 's/^.*cond">//g' -e 's/^.*temp">//g' ${SCRIPT_DIR}/tod_ton - sed -i -e 's/Lo<\/span> /\n/g' -e 's/<\/a>.*$//g' -e 's/ "><.*$//g' -e 's/&#.*$//g' -e 's/teo//g' ${SCRIPT_DIR}/tod_ton - sed -i -e 's/.*$//g' -e 's/<\/span>//g' -e 's/\r$//g' -e 's/ i-alarm.*$//g' ${SCRIPT_DIR}/tod_ton - sed -i -e 's/Early AM/EARLY AM/' -e 's/Today/TODAY/' -e 's/Tonight/TONIGHT/' -e 's/Overnight/OVERNIGHT/' -e 's/Mon/MON/' -e 's/Tue/TUE/' -e 's/Wed/WED/' -e 's/Thu/THU/' -e 's/Fri/FRI/' -e 's/Sat/SAT/' -e 's/Sun/SUN/' -e 's/-[a-z]*$//g' ${SCRIPT_DIR}/tod_ton - time=$(sed -n 1p ${SCRIPT_DIR}/tod_ton) - image=$(sed -n 2p ${SCRIPT_DIR}/tod_ton) - # - if [ "${time}" = "TODAY" ]; then - sed -i 2s/${image}/$(test_image ${image})/ ${SCRIPT_DIR}/tod_ton - elif [ "${time}" = "TONIGHT" -o "${time}" = "OVERNIGHT" -o "${time}" = "EARLY AM" ]; then - sed -i 2s/${image}/$(test_image ${image})/ ${SCRIPT_DIR}/tod_ton - sed -i 3a- ${SCRIPT_DIR}/tod_ton - fi - # - for i in $(seq 7 5 22); do - image=$(sed -n "${i}"p ${SCRIPT_DIR}/tod_ton) - sed -i ${i}s/${image}/$(test_image ${image})/ ${SCRIPT_DIR}/tod_ton - done -fi - -## Next 5 days -if [ -s ${SCRIPT_DIR}/last_days_raw ]; then - sed -i '/feed-tabs/,/\.feed-tabs/!d' ${SCRIPT_DIR}/last_days_raw - egrep -i 'icon i-|cond|temp|Mon|Tue|Wed|Thu|Fri|Sat|Sun' ${SCRIPT_DIR}/last_days_raw > ${SCRIPT_DIR}/last_days - sed -i -e 's/^.*#">//g' -e 's/^.*icon i-//g' -e 's/^.*cond">//g' -e 's/^.*temp">//g' ${SCRIPT_DIR}/last_days - sed -i -e 's/Lo<\/span> /\n/g' -e 's/<\/a>.*$//g' -e 's/ "><.*$//g' -e 's/&#.*$//g' -e 's/teo//g' ${SCRIPT_DIR}/last_days - sed -i -e 's/.*$//g' -e 's/<\/span>//g' -e 's/\r$//g' -e 's/ i-alarm.*$//g' ${SCRIPT_DIR}/last_days - sed -i -e 's/Mon/MON/' -e 's/Tue/TUE/' -e 's/Wed/WED/' -e 's/Thu/THU/' -e 's/Fri/FRI/' -e 's/Sat/SAT/' -e 's/Sun/SUN/' -e 's/-[a-z]*$//g' ${SCRIPT_DIR}/last_days - # - for i in $(seq 7 5 22); do - image=$(sed -n "${i}"p ${SCRIPT_DIR}/last_days) - sed -i ${i}s/${image}/$(test_image ${image})/ ${SCRIPT_DIR}/last_days - done -fi - -#kill -CONT $(pidof conky) - diff --git a/.conky/cronograph/accuweather/curr_cond b/.conky/cronograph/accuweather/curr_cond deleted file mode 100644 index f5d92e6..0000000 --- a/.conky/cronograph/accuweather/curr_cond +++ /dev/null @@ -1,5 +0,0 @@ -night -A -Clear -18 - diff --git a/.conky/cronograph/accuweather/curr_cond_raw b/.conky/cronograph/accuweather/curr_cond_raw deleted file mode 100644 index 9f2b26c..0000000 --- a/.conky/cronograph/accuweather/curr_cond_raw +++ /dev/null @@ -1,1646 +0,0 @@ - - - - Shanghai Current Weather - AccuWeather Forecast for Shanghai China - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- -
-
- - - - - - - - - - - - - - -
- -
-
- - - - - - -
- -
-
-
- - - - - -
- -
- - - -
-
- - - - - - - - - - - - -
-
- -
-
-
-
- -
-
-
- - -
- 1 - 5 of 45 days | All 45 days - -
- - -
- Next 5 Days - -
    -
  • -
    -
    -

    Today

    -

    May 10

    -
    -
    - Rain and drizzle this morning - 22°Lo 19° -
    - -
    - -
  • -
  • -
    -
    -

    Sun

    -

    May 11

    -
    -
    - Humid with heavy rain - 23°Lo 17° -
    - - more -
    - -
  • -
  • -
    -
    -

    Mon

    -

    May 12

    -
    -
    - Nice and warm with sunshine - 26°Lo 16° -
    - - more -
    - -
  • -
  • -
    -
    -

    Tue

    -

    May 13

    -
    -
    - Rather cloudy and warm - 26°Lo 18° -
    - - more -
    - -
  • -
  • -
    -
    -

    Wed

    -

    May 14

    -
    -
    - Showers around in the morning - 25°Lo 18° -
    - - more -
    - -
  • -
-
- - - - -
- - -
-
-
-
-
Light fog 19° RealFeel® 20°
- -
- -
- -
-
-

N

-

E

-

S

-

W

- -
- - -
    -
  • Humidity: 88%
  • -
  • Pressure: 1014.00 mb
  • -
  • UV Index: 4
  • -
  • Cloud Cover: 20%
  • -
  • Ceiling: 549 m
  • -
  • Dew Point: 17° C
  • -
  • Visibility: 3 km
  • -
- -
- - -
17 km/h
- -
- -
- -
- - - - -
-
-

Sunrise/Sunset

-
- - - Sunrise / Sunset Illustration - -

- Rises at - 5:03 AM - with - - 13:36 - - of sunlight, then sets at - 6:39 PM -

- -
- - -
-
-

Moonrise/Moonset

- Astronomy > -
- - - Moonrise / Moonset Illustration - -

- Rises at - 2:18 PM - with - 12:14 - of moolight, then sets at - 2:32 AM -

- -
- - - -
-
-

Temperature Summary - 10:58 AM

-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 Temp (°C)
Now19°
Yesterday21°
RealFeel®20°
RealFeel® Shade18°
Wind Chill19°
Dew Point17°
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 Hi / Lo
Previous 6 Hours20°
 18°
Previous 12 Hours20°
 17°
Previous 24 Hours22°
 17°
-
-
-
-
- -
-
-

Temperature History - May 10

- more Historical Weather Data > - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 TodayNormalRecord5/10/2013
High22°23°N/A24°
Low19°16°N/A18°
-
- - -
-
-

Precipitation Summary - 10:58 AM

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 Amount (mm)
Previous 1 Hour0
Previous 3 Hours0
Previous 6 Hours1
Previous 9 Hours1
Previous 12 Hours1
Previous 18 Hours1
Previous 24 Hours1
-
-
- -
-
-
- -
-
-
-
-
-
- - - -
-
-
-
-
-
-
-
-
-
- Top Story -

Shanghai Weather Report

-
- - - -
-

Rainfall Tops 400 mm Near Hong Kong, More to Come

-
May 9, 2014; 10:05 PM ET
-

Hong Kong has already endured flooding rain, and more is on the way for this weekend. more >

-
-
-
-
-
-
-
-
-
-
-
-
- -
- - - - - -
- - - -
-
-
-
-
-
- -
-
-
-
- -
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
- - - -
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
- -
- - - - - - - -
- -
- - - - - - - -
- -
- - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - diff --git a/.conky/cronograph/accuweather/last_days b/.conky/cronograph/accuweather/last_days deleted file mode 100644 index 75a56d9..0000000 --- a/.conky/cronograph/accuweather/last_days +++ /dev/null @@ -1,25 +0,0 @@ -WED -12 -Showers around in the morning -25 -17 -THU -d -Mostly cloudy -26 -18 -FRI -b -Partly sunny -23 -15 -SAT -i -Cooler with rain -17 -16 -SUN -i -Periods of rain -21 -17 diff --git a/.conky/cronograph/accuweather/last_days_raw b/.conky/cronograph/accuweather/last_days_raw deleted file mode 100644 index 6ac7def..0000000 --- a/.conky/cronograph/accuweather/last_days_raw +++ /dev/null @@ -1,82 +0,0 @@ -
- Previous 5 Days - Next 5 Days - -
    -
  • -
    -
    -

    Wed

    -

    May 14

    -
    -
    - Showers around in the morning - 25°Lo 17° -
    - -
    - -
  • -
  • -
    -
    -

    Thu

    -

    May 15

    -
    -
    - Mostly cloudy - 26°Lo 18° -
    - - more -
    - -
  • -
  • -
    -
    -

    Fri

    -

    May 16

    -
    -
    - Partly sunny - 23°Lo 15° -
    - - more -
    - -
  • -
  • -
    -
    -

    Sat

    -

    May 17

    -
    -
    - Cooler with rain - 17°Lo 16° -
    - - more -
    - -
  • -
  • -
    -
    -

    Sun

    -

    May 18

    -
    -
    - Periods of rain - 21°Lo 17° -
    - - more -
    - -
  • -
-
- diff --git a/.conky/cronograph/accuweather/tod_ton b/.conky/cronograph/accuweather/tod_ton deleted file mode 100644 index a839d7e..0000000 --- a/.conky/cronograph/accuweather/tod_ton +++ /dev/null @@ -1,25 +0,0 @@ -TONIGHT -h -Rain and drizzle late -- -17 -SAT -e -Cloudy and breezy -21 -18 -SUN -i -Humid with heavy rain -23 -16 -MON -a -Nice and warm with sunshine -26 -16 -TUE -d -Rather cloudy and warm -26 -17 diff --git a/.conky/cronograph/accuweather/tod_ton_raw b/.conky/cronograph/accuweather/tod_ton_raw deleted file mode 100644 index 2976b86..0000000 --- a/.conky/cronograph/accuweather/tod_ton_raw +++ /dev/null @@ -1,81 +0,0 @@ -
- Next 5 Days - -
    -
  • -
    -
    -

    Tonight

    -

    May 9

    -
    -
    - Rain and drizzle late - Lo 17° -
    - -
    - -
  • -
  • -
    -
    -

    Sat

    -

    May 10

    -
    -
    - Cloudy and breezy - 21°Lo 18° -
    - - more -
    - -
  • -
  • -
    -
    -

    Sun

    -

    May 11

    -
    -
    - Humid with heavy rain - 23°Lo 16° -
    - - more -
    - -
  • -
  • -
    -
    -

    Mon

    -

    May 12

    -
    -
    - Nice and warm with sunshine - 26°Lo 16° -
    - - more -
    - -
  • -
  • -
    -
    -

    Tue

    -

    May 13

    -
    -
    - Rather cloudy and warm - 26°Lo 17° -
    - - more -
    - -
  • -
-
- diff --git a/.conky/cronograph/conky_start.sh b/.conky/cronograph/conky_start.sh deleted file mode 100755 index 98dbb27..0000000 --- a/.conky/cronograph/conky_start.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -CONKYRC="$HOME/.conky/cronograph/conkyrc" - -sleep 5 - -conky -d -c ${CONKYRC} "$@" - -exit 0 - diff --git a/.conky/cronograph/conkyrc b/.conky/cronograph/conkyrc deleted file mode 100644 index 3a54030..0000000 --- a/.conky/cronograph/conkyrc +++ /dev/null @@ -1,89 +0,0 @@ -# — Conky settings — # - -background yes - -update_interval 1 -total_run_times 0 -net_avg_samples 2 - -override_utf8_locale yes - -double_buffer yes -no_buffers yes - -text_buffer_size 2048 -imlib_cache_size 0 - -temperature_unit celsius - -# — Window specifications — # - -own_window_class Conky -own_window yes -own_window_type desktop -own_window_transparent yes -own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager - -border_inner_margin 0 -border_outer_margin 0 - -minimum_size 300 330 -maximum_width 300 - -alignment top_right - -gap_x 30 -gap_y 75 - - -# — Graphics settings — # -draw_shades no -draw_outline no -draw_borders no -draw_graph_borders no - -# — Text settings — # -use_xft yes -xftfont hooge 05_53:size=6 -xftalpha 0.5 - -default_color FFFFFF - -uppercase no -use_spacer right - -color0 white -color1 orange -color2 green - -# — Lua Load — # - -lua_load $HOME/.conky/cronograph/scripts/clock_rings.lua -lua_draw_hook_pre clock_rings -lua_load $HOME/.conky/cronograph/scripts/multi_rings.lua -lua_draw_hook_post main - -TEXT -${execi 600 sh $HOME/.conky/cronograph/accuweather/accuweather.sh} -#${voffset 29}${offset 120}BAT: -${voffset 29}${goto 109}GENTOO${goto 157}Linux -${voffset 17}${goto 65}${font hooge 05_53:size=12}${time %H:%M}${font}${goto 185}UPTIME: -${voffset 2}${goto 65}${time %a %d %b}${goto 185}${uptime} -${voffset 2}${goto 65}${time %Y} -${voffset -6}${goto 145}HD -${voffset 12}${alignc}${fs_free}/${fs_size} -${voffset 36}${goto 91}${cpu cpu0}%${goto 221}${memperc}% -${voffset 10}${goto 76}CPU${goto 205}MEM -${voffset 16}${goto 82}${font hooge 05_53:size=12}${execpi 600 sed -n '4p' $HOME/.conky/cronograph/accuweather/curr_cond}°C${font}${voffset -30}${goto 125}${font ConkyWeather:size=40}${execpi 600 sed -n '2p' $HOME/.conky/cronograph/accuweather/curr_cond}${font}${voffset -16}${goto 185}${execpi 600 sed -n '3p' $HOME/.conky/cronograph/accuweather/curr_cond}${voffset 12}${goto 185}${font ConkyWeather:size=20}${voffset 1}${goto 80}${execpi 600 sed -n '7p' $HOME/.conky/cronograph/accuweather/tod_ton}${goto 135}${execpi 600 sed -n '12p' $HOME/.conky/cronograph/accuweather/tod_ton}${goto 185}${execpi 600 sed -n '17p' $HOME/.conky/cronograph/accuweather/tod_ton}${font}${voffset 6}${goto 84}${execpi 600 sed -n '9p' $HOME/.conky/cronograph/accuweather/tod_ton}°/${execpi 600 sed -n '10p' $HOME/.conky/cronograph/accuweather/tod_ton}°${goto 140}${execpi 600 sed -n '14p' $HOME/.conky/cronograph/accuweather/tod_ton}°/${execpi 600 sed -n '15p' $HOME/.conky/cronograph/accuweather/tod_ton}°${goto 190}${execpi 600 sed -n '19p' $HOME/.conky/cronograph/accuweather/tod_ton}°/${execpi 600 sed -n '20p' $HOME/.conky/cronograph/accuweather/tod_ton}°${voffset 7}${goto 85}${execpi 600 sed -n '6p' $HOME/.conky/cronograph/accuweather/tod_ton}${goto 140}${execpi 600 sed -n '11p' $HOME/.conky/cronograph/accuweather/tod_ton}${goto 190}${execpi 600 sed -n '16p' $HOME/.conky/cronograph/accuweather/tod_ton} -${if_match ${battery_percent BAT0}>0}${if_match ${battery_percent BAT0}<=15}${image $HOME/.conky/cronograph/images/Red.png -p 129,18 -s 40x40}${endif}${endif} -${if_match ${battery_percent BAT0}>15}${if_match ${battery_percent BAT0}<=20}${image $HOME/.conky/cronograph/images/Orange.png -p 129,18 -s 40x40}${endif}${endif} -${if_match ${battery_percent BAT0}>20}${if_match ${battery_percent BAT0}<=35}${image $HOME/.conky/cronograph/images/Yellow.png -p 129,18 -s 40x40}${endif}${endif} -${if_match ${battery_percent BAT0}>35}${if_match ${battery_percent BAT0}<=100}${image $HOME/.conky/cronograph/images/Dark_Green.png -p 129,18 -s 40x40}${endif}${endif} -${execpi 30 cat $HOME/.conky/cronograph/scripts/blinkingLED} -## mpd ## -${if_mpd_playing}${voffset 6}${goto 10}${font Sans:size=8:bold}${mpd_artist}${font}${voffset -5}${font Sans:size=8} - ${mpd_title}${font} -${voffset 4}${goto 10}${mpd_bar 5,220}${alignr 10}${mpd_elapsed}/${mpd_length} -${else}${voffset 6}${goto 10}${font hooge 05_53:size=8}MPD: stopped${font} -${endif} - -# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=conkyrc: # diff --git a/.conky/cronograph/images/Blank.png b/.conky/cronograph/images/Blank.png deleted file mode 100644 index a8adf65..0000000 Binary files a/.conky/cronograph/images/Blank.png and /dev/null differ diff --git a/.conky/cronograph/images/Blue.png b/.conky/cronograph/images/Blue.png deleted file mode 100644 index 2407cbe..0000000 Binary files a/.conky/cronograph/images/Blue.png and /dev/null differ diff --git a/.conky/cronograph/images/Dark_Green.png b/.conky/cronograph/images/Dark_Green.png deleted file mode 100644 index d40bcc4..0000000 Binary files a/.conky/cronograph/images/Dark_Green.png and /dev/null differ diff --git a/.conky/cronograph/images/Dark_Purple.png b/.conky/cronograph/images/Dark_Purple.png deleted file mode 100644 index bb5da19..0000000 Binary files a/.conky/cronograph/images/Dark_Purple.png and /dev/null differ diff --git a/.conky/cronograph/images/Green.png b/.conky/cronograph/images/Green.png deleted file mode 100644 index 602ad43..0000000 Binary files a/.conky/cronograph/images/Green.png and /dev/null differ diff --git a/.conky/cronograph/images/Orange.png b/.conky/cronograph/images/Orange.png deleted file mode 100644 index 7574f9c..0000000 Binary files a/.conky/cronograph/images/Orange.png and /dev/null differ diff --git a/.conky/cronograph/images/Pink.png b/.conky/cronograph/images/Pink.png deleted file mode 100644 index 6d2d973..0000000 Binary files a/.conky/cronograph/images/Pink.png and /dev/null differ diff --git a/.conky/cronograph/images/Purple.png b/.conky/cronograph/images/Purple.png deleted file mode 100644 index e8c58e7..0000000 Binary files a/.conky/cronograph/images/Purple.png and /dev/null differ diff --git a/.conky/cronograph/images/Red.png b/.conky/cronograph/images/Red.png deleted file mode 100644 index d2673e6..0000000 Binary files a/.conky/cronograph/images/Red.png and /dev/null differ diff --git a/.conky/cronograph/images/Yellow.png b/.conky/cronograph/images/Yellow.png deleted file mode 100644 index 8e2f62c..0000000 Binary files a/.conky/cronograph/images/Yellow.png and /dev/null differ diff --git a/.conky/cronograph/scripts/blinkingLED b/.conky/cronograph/scripts/blinkingLED deleted file mode 100755 index 3f4c814..0000000 --- a/.conky/cronograph/scripts/blinkingLED +++ /dev/null @@ -1,3 +0,0 @@ -${image $HOME/.conky/cronograph/images/Blank.png -p 129, 241 -s 40x40}${if_match ${execi 1 num=$(date +%-S);rem=$(( num % 2 ));if [ $rem -eq 0 ] ; then echo 0 ; else echo 1 ; fi}==0}${image $HOME/.conky/cronograph/images/Blue.png -p 129, 241 -s 40x40}${endif} -${image $HOME/.conky/cronograph/images/Blank.png -p 19, 129 -s 40x40}${if_match ${execi 1 num=$(date +%-S);rem=$(( num % 2 ));if [ $rem -eq 0 ] ; then echo 0 ; else echo 1 ; fi}==0}${image $HOME/.conky/cronograph/images/Blue.png -p 19, 129 -s 40x40}${endif} -${image $HOME/.conky/cronograph/images/Blank.png -p 240, 129 -s 40x40}${if_match ${execi 1 num=$(date +%-S);rem=$(( num % 2 ));if [ $rem -eq 0 ] ; then echo 0 ; else echo 1 ; fi}==0}${image $HOME/.conky/cronograph/images/Blue.png -p 240, 129 -s 40x40}${endif} diff --git a/.conky/cronograph/scripts/clock_rings.lua b/.conky/cronograph/scripts/clock_rings.lua deleted file mode 100755 index fb6a838..0000000 --- a/.conky/cronograph/scripts/clock_rings.lua +++ /dev/null @@ -1,358 +0,0 @@ ---[[ -Clock Rings by londonali1010 (2009) - -This script draws percentage meters as rings, and also draws clock hands if you want! It is fully customisable; all options are described in the script. This script is based off a combination of my clock.lua script and my rings.lua script. - -IMPORTANT: if you are using the 'cpu' function, it will cause a segmentation fault if it tries to draw a ring straight away. The if statement near the end of the script uses a delay to make sure that this doesn't happen. It calculates the length of the delay by the number of updates since Conky started. Generally, a value of 5s is long enough, so if you update Conky every 1s, use update_num > 5 in that if statement (the default). If you only update Conky every 2s, you should change it to update_num > 3; conversely if you update Conky every 0.5s, you should use update_num > 10. ALSO, if you change your Conky, is it best to use "killall conky; conky" to update it, otherwise the update_num will not be reset and you will get an error. - -To call this script in Conky, use the following (assuming that you save this script to ~/scripts/rings.lua): - lua_load ~/scripts/clock_rings-v1.1.1.lua - lua_draw_hook_pre clock_rings - -Changelog: -+ v1.1.1 -- Fixed minor bug that caused the script to crash if conky_parse() returns a nil value (20.10.2009) -+ v1.1 -- Added colour option for clock hands (07.10.2009) -+ v1.0 -- Original release (30.09.2009) -]] - -settings_table = { - { - -- Edit this table to customise your rings. - -- You can create more rings simply by adding more elements to settings_table. - -- "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'. - name='time', - -- "arg" is the argument to the stat type, e.g. if in Conky you would write ${cpu cpu0}, 'cpu0' would be the argument. If you would not use an argument in the Conky variable, use ''. - arg='%I.%M', - -- "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100. - max=12, - -- "bg_colour" is the colour of the base ring. - bg_colour=0xFFFFFF, - -- "bg_alpha" is the alpha value of the base ring. - bg_alpha=0.1, - -- "fg_colour" is the colour of the indicator part of the ring. - fg_colour=0xFFFFFF, - -- "fg_alpha" is the alpha value of the indicator part of the ring. - fg_alpha=0.5, - -- "x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky window. - x=150, y=150, - -- "radius" is the radius of the ring. - radius=135, - -- "thickness" is the thickness of the ring, centred around the radius. - thickness=4, - -- "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative. - start_angle=0, - -- "end_angle" is the ending angle of the ring, in degrees, clockwise from top. Value can be either positive or negative, but must be larger than start_angle. - end_angle=360 - }, - { - name='time', - arg='%M.%S', - max=60, - bg_colour=0xFFFFFF, - bg_alpha=0.1, - fg_colour=0xFFFFFF, - fg_alpha=0.5, - x=150, y=150, - radius=140, - thickness=4, - start_angle=0, - end_angle=360 - }, - { - name='time', - arg='%S', - max=60, - bg_colour=0xFFFFFF, - bg_alpha=0.1, - fg_colour=0xFFFFFF, - fg_alpha=0.5, - x=150, y=150, - radius=145, - thickness=4, - start_angle=0, - end_angle=360 - }, - { - name='', - arg='', - max=100, - bg_colour=0x000000, - bg_alpha=0.1, - fg_colour=0xFFFFFF, - fg_alpha=0.0, - x=150, y=150, - radius=66, - thickness=130, - start_angle=0, - end_angle=360 - }, - { - name='', - arg='', - max=100, - bg_colour=0xFFFFFF, - bg_alpha=1.0, - fg_colour=0xFFFFFF, - fg_alpha=0.0, - x=150, y=150, - radius=1, - thickness=10, - start_angle=0, - end_angle=360 - }, - { - name='', - arg='', - max=100, - bg_colour=0xFFFFFF, - bg_alpha=1.0, - fg_colour=0xFFFFFF, - fg_alpha=0.0, - x=85, y=150, - radius=30, - thickness=1, - start_angle=0, - end_angle=360 - }, - { - name='', - arg='', - max=100, - bg_colour=0x000000, - bg_alpha=0.3, - fg_colour=0xFFFFFF, - fg_alpha=0.0, - x=85, y=150, - radius=15, - thickness=27, - start_angle=0, - end_angle=360 - }, - { - name='', - arg='', - max=100, - bg_colour=0xFFFFFF, - bg_alpha=1.0, - fg_colour=0xFFFFFF, - fg_alpha=0.0, - x=85, y=150, - radius=1, - thickness=2, - start_angle=0, - end_angle=360 - }, - { - name='', - arg='', - max=100, - bg_colour=0xFFFFFF, - bg_alpha=1.0, - fg_colour=0xFFFFFF, - fg_alpha=0.0, - x=215, y=150, - radius=30, - thickness=1, - start_angle=0, - end_angle=360 - }, - { - name='', - arg='', - max=100, - bg_colour=0x000000, - bg_alpha=0.3, - fg_colour=0xFFFFFF, - fg_alpha=0.0, - x=215, y=150, - radius=15, - thickness=27, - start_angle=0, - end_angle=360 - }, - { - name='', - arg='', - max=100, - bg_colour=0xFFFFFF, - bg_alpha=1.0, - fg_colour=0xFFFFFF, - fg_alpha=0.0, - x=215, y=150, - radius=1, - thickness=2, - start_angle=0, - end_angle=360 - }, - { - name='', - arg='', - max=100, - bg_colour=0xFFFFFF, - bg_alpha=1.0, - fg_colour=0xFFFFFF, - fg_alpha=0.0, - x=150, y=75, - radius=25, - thickness=1, - start_angle=0, - end_angle=360 - }, - { - name='', - arg='', - max=100, - bg_colour=0x000000, - bg_alpha=0.3, - fg_colour=0xFFFFFF, - fg_alpha=0.0, - x=150, y=75, - radius=13, - thickness=22, - start_angle=0, - end_angle=360 - }, - { - name='', - arg='', - max=100, - bg_colour=0xFFFFFF, - bg_alpha=1.0, - fg_colour=0xFFFFFF, - fg_alpha=0.0, - x=150, y=75, - radius=1, - thickness=2, - start_angle=0, - end_angle=360 - }, - } - --- Use these settings to define the origin and extent of your clock. - -clock_r=127 - --- "clock_x" and "clock_y" are the coordinates of the centre of the clock, in pixels, from the top left of the Conky window. - -clock_x=150 -clock_y=150 - --- Colour & alpha of the clock hands - -clock_colour=0xFFFFFF -clock_alpha=1 - --- Do you want to show the seconds hand? - -show_seconds=true - -require 'cairo' - -function rgb_to_r_g_b(colour,alpha) - return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha -end - -function draw_ring(cr,t,pt) - local w,h=conky_window.width,conky_window.height - - local xc,yc,ring_r,ring_w,sa,ea=pt['x'],pt['y'],pt['radius'],pt['thickness'],pt['start_angle'],pt['end_angle'] - local bgc, bga, fgc, fga=pt['bg_colour'], pt['bg_alpha'], pt['fg_colour'], pt['fg_alpha'] - - local angle_0=sa*(2*math.pi/360)-math.pi/2 - local angle_f=ea*(2*math.pi/360)-math.pi/2 - local t_arc=t*(angle_f-angle_0) - - -- Draw background ring - - cairo_arc(cr,xc,yc,ring_r,angle_0,angle_f) - cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga)) - cairo_set_line_width(cr,ring_w) - cairo_stroke(cr) - - -- Draw indicator ring - - cairo_arc(cr,xc,yc,ring_r,angle_0,angle_0+t_arc) - cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga)) - cairo_stroke(cr) -end - -function draw_clock_hands(cr,xc,yc) - local secs,mins,hours,secs_arc,mins_arc,hours_arc - local xh,yh,xm,ym,xs,ys - - secs=os.date("%S") - mins=os.date("%M") - hours=os.date("%I") - - secs_arc=(2*math.pi/60)*secs - mins_arc=(2*math.pi/60)*mins+secs_arc/60 - hours_arc=(2*math.pi/12)*hours+mins_arc/12 - - -- Draw hour hand - - xh=xc+0.7*clock_r*math.sin(hours_arc) - yh=yc-0.7*clock_r*math.cos(hours_arc) - cairo_move_to(cr,xc,yc) - cairo_line_to(cr,xh,yh) - - cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND) - cairo_set_line_width(cr,5) - cairo_set_source_rgba(cr,rgb_to_r_g_b(clock_colour,clock_alpha)) - cairo_stroke(cr) - - -- Draw minute hand - - xm=xc+clock_r*math.sin(mins_arc) - ym=yc-clock_r*math.cos(mins_arc) - cairo_move_to(cr,xc,yc) - cairo_line_to(cr,xm,ym) - - cairo_set_line_width(cr,3) - cairo_stroke(cr) - - -- Draw seconds hand - - if show_seconds then - xs=xc+clock_r*math.sin(secs_arc) - ys=yc-clock_r*math.cos(secs_arc) - cairo_move_to(cr,xc,yc) - cairo_line_to(cr,xs,ys) - - cairo_set_line_width(cr,1) - cairo_stroke(cr) - end -end - -function conky_clock_rings() - local function setup_rings(cr,pt) - local str='' - local value=0 - - str=string.format('${%s %s}',pt['name'],pt['arg']) - str=conky_parse(str) - - value=tonumber(str) - if value == nil then value = 0 end - pct=value/pt['max'] - - draw_ring(cr,pct,pt) - end - - -- Check that Conky has been running for at least 5s - - if conky_window==nil then return end - local cs=cairo_xlib_surface_create(conky_window.display,conky_window.drawable,conky_window.visual, conky_window.width,conky_window.height) - - local cr=cairo_create(cs) - - local updates=conky_parse('${updates}') - update_num=tonumber(updates) - - if update_num>5 then - for i in pairs(settings_table) do - setup_rings(cr,settings_table[i]) - end - end - - draw_clock_hands(cr,clock_x,clock_y) -end diff --git a/.conky/cronograph/scripts/multi_rings.lua b/.conky/cronograph/scripts/multi_rings.lua deleted file mode 100755 index b9735b2..0000000 --- a/.conky/cronograph/scripts/multi_rings.lua +++ /dev/null @@ -1,375 +0,0 @@ ---============================================================================== --- multi_rings.lua --- --- author : SLK --- version : v2011011601 --- license : Distributed under the terms of GNU GPL version 2 or later --- ---============================================================================== - -require 'cairo' - --------------------------------------------------------------------------------- --- clock DATA --- HOURS -clock_h = { - { - name='time', arg='%H', max_value=12, - x=150, y=150, - graph_radius=140, - graph_thickness=3, - graph_unit_angle=30, graph_unit_thickness=5, - graph_bg_colour=0xffffff, graph_bg_alpha=0.0, - graph_fg_colour=0xFFFFFF, graph_fg_alpha=0.0, - txt_radius=100, - txt_weight=1, txt_size=10.0, - txt_fg_colour=0xFFFFFF, txt_fg_alpha=0.0, - graduation_radius=125, - graduation_thickness=10, graduation_mark_thickness=2, - graduation_unit_angle=30, - graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=1.0, - }, -} --- MINUTES -clock_m = { - { - name='time', arg='%M', max_value=60, - x=150, y=150, - graph_radius=100, - graph_thickness=3, - graph_unit_angle=6, graph_unit_thickness=3, - graph_bg_colour=0xffffff, graph_bg_alpha=0.0, - graph_fg_colour=0xFFFFFF, graph_fg_alpha=0.0, - txt_radius=100, - txt_weight=0, txt_size=9.0, - txt_fg_colour=0xFFFFFF, txt_fg_alpha=0.0, - graduation_radius=57, - graduation_thickness=0, graduation_mark_thickness=2, - graduation_unit_angle=30, - graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.0, - }, -} --- SECONDS -clock_s = { - { - name='time', arg='%S', max_value=60, - x=150, y=150, - graph_radius=50, - graph_thickness=3, - graph_unit_angle=6, graph_unit_thickness=3, - graph_bg_colour=0xffffff, graph_bg_alpha=0.0, - graph_fg_colour=0xFFFFFF, graph_fg_alpha=0.0, - txt_radius=100, - txt_weight=0, txt_size=12.0, - txt_fg_colour=0xFFFFFF, txt_fg_alpha=0.0, - graduation_radius=0, - graduation_thickness=0, graduation_mark_thickness=0, - graduation_unit_angle=0, - graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.0, - }, -} - --------------------------------------------------------------------------------- --- gauge DATA -gauge = { -{ - name='cpu', arg='cpu0', max_value=100, - x=85, y=150, - graph_radius=14, - graph_thickness=27, - graph_start_angle=0, - graph_unit_angle=3.5, graph_unit_thickness=3.0, - graph_bg_colour=0xFFFFFF, graph_bg_alpha=0.0, - graph_fg_colour=0xFFFFFF, graph_fg_alpha=0.0, - hand_fg_colour=0xFFFFFF, hand_fg_alpha=1.0, - txt_radius=1, - txt_weight=0, txt_size=8.0, - txt_fg_colour=0xFFFFFF, txt_fg_alpha=0.0, - graduation_radius=27, - graduation_thickness=4, graduation_mark_thickness=4, - graduation_unit_angle=30, - graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=1.0, - caption='', - caption_weight=1, caption_size=8.0, - caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.0, -}, -{ - name='memperc', arg='', max_value=100, - x=215, y=150, - graph_radius=14, - graph_thickness=27, - graph_start_angle=0, - graph_unit_angle=3.5, graph_unit_thickness=3.0, - graph_bg_colour=0xFFFFFF, graph_bg_alpha=0.0, - graph_fg_colour=0xFFFFFF, graph_fg_alpha=0.0, - hand_fg_colour=0xFFFFFF, hand_fg_alpha=1.0, - txt_radius=1, - txt_weight=0, txt_size=8.0, - txt_fg_colour=0xFFFFFF, txt_fg_alpha=0.0, - graduation_radius=27, - graduation_thickness=4, graduation_mark_thickness=4, - graduation_unit_angle=30, - graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=1.0, - caption='', - caption_weight=1, caption_size=8.0, - caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.0, -}, -{ - name='fs_used_perc', arg='/', max_value=100, - x=150, y=75, - graph_radius=10, - graph_thickness=23, - graph_start_angle=0, - graph_unit_angle=3.5, graph_unit_thickness=3.0, - graph_bg_colour=0xFFFFFF, graph_bg_alpha=0.0, - graph_fg_colour=0xFFFFFF, graph_fg_alpha=0.0, - hand_fg_colour=0xFFFFFF, hand_fg_alpha=1.0, - txt_radius=1, - txt_weight=0, txt_size=8.0, - txt_fg_colour=0xFFFFFF, txt_fg_alpha=0.0, - graduation_radius=22, - graduation_thickness=4, graduation_mark_thickness=4, - graduation_unit_angle=30, - graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=1.0, - caption='', - caption_weight=1, caption_size=8.0, - caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.0, -}, -} - -------------------------------------------------------------------------------- --- rgb_to_r_g_b --- converts color in hexa to decimal --- -function rgb_to_r_g_b(colour, alpha) - return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha -end - -------------------------------------------------------------------------------- --- angle_to_position --- convert degree to rad and rotate (0 degree is top/north) --- -function angle_to_position(start_angle, current_angle) - local pos = current_angle + start_angle - return ( ( pos * (2 * math.pi / 360) ) - (math.pi / 2) ) -end - -------------------------------------------------------------------------------- --- draw_clock_ring --- displays clock --- -function draw_clock_ring(display, data, value) - local max_value = data['max_value'] - local x, y = data['x'], data['y'] - local graph_radius = data['graph_radius'] - local graph_thickness, graph_unit_thickness = data['graph_thickness'], data['graph_unit_thickness'] - local graph_unit_angle = data['graph_unit_angle'] - local graph_bg_colour, graph_bg_alpha = data['graph_bg_colour'], data['graph_bg_alpha'] - local graph_fg_colour, graph_fg_alpha = data['graph_fg_colour'], data['graph_fg_alpha'] - - -- background ring - cairo_arc(display, x, y, graph_radius, 0, 2 * math.pi) - cairo_set_source_rgba(display, rgb_to_r_g_b(graph_bg_colour, graph_bg_alpha)) - cairo_set_line_width(display, graph_thickness) - cairo_stroke(display) - - -- arc of value - local val = (value % max_value) - local i = 1 - while i <= val do - cairo_arc(display, x, y, graph_radius,( ((graph_unit_angle * i) - graph_unit_thickness)*(2*math.pi/360) )-(math.pi/2),((graph_unit_angle * i) * (2*math.pi/360))-(math.pi/2)) - cairo_set_source_rgba(display,rgb_to_r_g_b(graph_fg_colour,graph_fg_alpha)) - cairo_stroke(display) - i = i + 1 - end - local angle = (graph_unit_angle * i) - graph_unit_thickness - - -- graduations marks - local graduation_radius = data['graduation_radius'] - local graduation_thickness, graduation_mark_thickness = data['graduation_thickness'], data['graduation_mark_thickness'] - local graduation_unit_angle = data['graduation_unit_angle'] - local graduation_fg_colour, graduation_fg_alpha = data['graduation_fg_colour'], data['graduation_fg_alpha'] - if graduation_radius > 0 and graduation_thickness > 0 and graduation_unit_angle > 0 then - local nb_graduation = 360 / graduation_unit_angle - local i = 1 - while i <= nb_graduation do - cairo_set_line_width(display, graduation_thickness) - cairo_arc(display, x, y, graduation_radius, (((graduation_unit_angle * i)-(graduation_mark_thickness/2))*(2*math.pi/360))-(math.pi/2),(((graduation_unit_angle * i)+(graduation_mark_thickness/2))*(2*math.pi/360))-(math.pi/2)) - cairo_set_source_rgba(display,rgb_to_r_g_b(graduation_fg_colour,graduation_fg_alpha)) - cairo_stroke(display) - cairo_set_line_width(display, graph_thickness) - i = i + 1 - end - end - - -- text - local txt_radius = data['txt_radius'] - local txt_weight, txt_size = data['txt_weight'], data['txt_size'] - local txt_fg_colour, txt_fg_alpha = data['txt_fg_colour'], data['txt_fg_alpha'] - local movex = txt_radius * (math.cos((angle * 2 * math.pi / 360)-(math.pi/2))) - local movey = txt_radius * (math.sin((angle * 2 * math.pi / 360)-(math.pi/2))) - cairo_select_font_face (display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, txt_weight); - cairo_set_font_size (display, txt_size); - cairo_set_source_rgba (display, rgb_to_r_g_b(txt_fg_colour, txt_fg_alpha)); - cairo_move_to (display, x + movex - (txt_size / 2), y + movey + 3); - cairo_show_text (display, value); - cairo_stroke (display); -end - -------------------------------------------------------------------------------- --- draw_gauge_ring --- displays gauges --- -function draw_gauge_ring(display, data, value) - local max_value = data['max_value'] - local x, y = data['x'], data['y'] - local graph_radius = data['graph_radius'] - local graph_thickness, graph_unit_thickness = data['graph_thickness'], data['graph_unit_thickness'] - local graph_start_angle = data['graph_start_angle'] - local graph_unit_angle = data['graph_unit_angle'] - local graph_bg_colour, graph_bg_alpha = data['graph_bg_colour'], data['graph_bg_alpha'] - local graph_fg_colour, graph_fg_alpha = data['graph_fg_colour'], data['graph_fg_alpha'] - local hand_fg_colour, hand_fg_alpha = data['hand_fg_colour'], data['hand_fg_alpha'] - local graph_end_angle = (max_value * graph_unit_angle) % 360 - - -- background ring - cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, 0), angle_to_position(graph_start_angle, graph_end_angle)) - cairo_set_source_rgba(display, rgb_to_r_g_b(graph_bg_colour, graph_bg_alpha)) - cairo_set_line_width(display, graph_thickness) - cairo_stroke(display) - - -- arc of value - local val = value % (max_value + 1) - local start_arc = 0 - local stop_arc = 0 - local i = 1 - while i <= val do - start_arc = (graph_unit_angle * i) - graph_unit_thickness - stop_arc = (graph_unit_angle * i) - cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc)) - cairo_set_source_rgba(display, rgb_to_r_g_b(graph_fg_colour, graph_fg_alpha)) - cairo_stroke(display) - i = i + 1 - end - local angle = start_arc - - -- hand - start_arc = (graph_unit_angle * val) - (graph_unit_thickness * 2) - stop_arc = (graph_unit_angle * val) - cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc)) - cairo_set_source_rgba(display, rgb_to_r_g_b(hand_fg_colour, hand_fg_alpha)) - cairo_stroke(display) - - -- graduations marks - local graduation_radius = data['graduation_radius'] - local graduation_thickness, graduation_mark_thickness = data['graduation_thickness'], data['graduation_mark_thickness'] - local graduation_unit_angle = data['graduation_unit_angle'] - local graduation_fg_colour, graduation_fg_alpha = data['graduation_fg_colour'], data['graduation_fg_alpha'] - if graduation_radius > 0 and graduation_thickness > 0 and graduation_unit_angle > 0 then - local nb_graduation = graph_end_angle / graduation_unit_angle - local i = 0 - while i < nb_graduation do - cairo_set_line_width(display, graduation_thickness) - start_arc = (graduation_unit_angle * i) - (graduation_mark_thickness / 2) - stop_arc = (graduation_unit_angle * i) + (graduation_mark_thickness / 2) - cairo_arc(display, x, y, graduation_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc)) - cairo_set_source_rgba(display,rgb_to_r_g_b(graduation_fg_colour,graduation_fg_alpha)) - cairo_stroke(display) - cairo_set_line_width(display, graph_thickness) - i = i + 1 - end - end - - -- text - local txt_radius = data['txt_radius'] - local txt_weight, txt_size = data['txt_weight'], data['txt_size'] - local txt_fg_colour, txt_fg_alpha = data['txt_fg_colour'], data['txt_fg_alpha'] - local movex = txt_radius * math.cos(angle_to_position(graph_start_angle, angle)) - local movey = txt_radius * math.sin(angle_to_position(graph_start_angle, angle)) - cairo_select_font_face (display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, txt_weight) - cairo_set_font_size (display, txt_size) - cairo_set_source_rgba (display, rgb_to_r_g_b(txt_fg_colour, txt_fg_alpha)) - cairo_move_to (display, x + movex - (txt_size / 2), y + movey + 3) - cairo_show_text (display, value) - cairo_stroke (display) - - -- caption - local caption = data['caption'] - local caption_weight, caption_size = data['caption_weight'], data['caption_size'] - local caption_fg_colour, caption_fg_alpha = data['caption_fg_colour'], data['caption_fg_alpha'] - local tox = graph_radius * (math.cos((graph_start_angle * 2 * math.pi / 360)-(math.pi/2))) - local toy = graph_radius * (math.sin((graph_start_angle * 2 * math.pi / 360)-(math.pi/2))) - cairo_select_font_face (display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, caption_weight); - cairo_set_font_size (display, caption_size) - cairo_set_source_rgba (display, rgb_to_r_g_b(caption_fg_colour, caption_fg_alpha)) - cairo_move_to (display, x + tox + 5, y + toy + 1) - -- bad hack but not enough time ! - if graph_start_angle < 105 then - cairo_move_to (display, x + tox - 30, y + toy + 1) - end - cairo_show_text (display, caption) - cairo_stroke (display) -end - -------------------------------------------------------------------------------- --- go_clock_rings --- loads data and displays clock --- -function go_clock_rings(display) - local function load_clock_rings(display, data) - local str, value = '', 0 - str = string.format('${%s %s}',data['name'], data['arg']) - str = conky_parse(str) - value = tonumber(str) - draw_clock_ring(display, data, value) - end - - for i in pairs(clock_h) do - load_clock_rings(display, clock_h[i]) - end - for i in pairs(clock_m) do - load_clock_rings(display, clock_m[i]) - end - for i in pairs(clock_s) do - load_clock_rings(display, clock_s[i]) - end -end - -------------------------------------------------------------------------------- --- go_gauge_rings --- loads data and displays gauges --- -function go_gauge_rings(display) - local function load_gauge_rings(display, data) - local str, value = '', 0 - str = string.format('${%s %s}',data['name'], data['arg']) - str = conky_parse(str) - value = tonumber(str) - draw_gauge_ring(display, data, value) - end - - for i in pairs(gauge) do - load_gauge_rings(display, gauge[i]) - end -end - -------------------------------------------------------------------------------- --- MAIN -function conky_main() - if conky_window == nil then - return - end - - local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height) - local display = cairo_create(cs) - - local updates = conky_parse('${updates}') - update_num = tonumber(updates) - - if update_num > 5 then - go_clock_rings(display) - go_gauge_rings(display) - end - -end - diff --git a/.conkyrc b/.conkyrc deleted file mode 100644 index 3a54030..0000000 --- a/.conkyrc +++ /dev/null @@ -1,89 +0,0 @@ -# — Conky settings — # - -background yes - -update_interval 1 -total_run_times 0 -net_avg_samples 2 - -override_utf8_locale yes - -double_buffer yes -no_buffers yes - -text_buffer_size 2048 -imlib_cache_size 0 - -temperature_unit celsius - -# — Window specifications — # - -own_window_class Conky -own_window yes -own_window_type desktop -own_window_transparent yes -own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager - -border_inner_margin 0 -border_outer_margin 0 - -minimum_size 300 330 -maximum_width 300 - -alignment top_right - -gap_x 30 -gap_y 75 - - -# — Graphics settings — # -draw_shades no -draw_outline no -draw_borders no -draw_graph_borders no - -# — Text settings — # -use_xft yes -xftfont hooge 05_53:size=6 -xftalpha 0.5 - -default_color FFFFFF - -uppercase no -use_spacer right - -color0 white -color1 orange -color2 green - -# — Lua Load — # - -lua_load $HOME/.conky/cronograph/scripts/clock_rings.lua -lua_draw_hook_pre clock_rings -lua_load $HOME/.conky/cronograph/scripts/multi_rings.lua -lua_draw_hook_post main - -TEXT -${execi 600 sh $HOME/.conky/cronograph/accuweather/accuweather.sh} -#${voffset 29}${offset 120}BAT: -${voffset 29}${goto 109}GENTOO${goto 157}Linux -${voffset 17}${goto 65}${font hooge 05_53:size=12}${time %H:%M}${font}${goto 185}UPTIME: -${voffset 2}${goto 65}${time %a %d %b}${goto 185}${uptime} -${voffset 2}${goto 65}${time %Y} -${voffset -6}${goto 145}HD -${voffset 12}${alignc}${fs_free}/${fs_size} -${voffset 36}${goto 91}${cpu cpu0}%${goto 221}${memperc}% -${voffset 10}${goto 76}CPU${goto 205}MEM -${voffset 16}${goto 82}${font hooge 05_53:size=12}${execpi 600 sed -n '4p' $HOME/.conky/cronograph/accuweather/curr_cond}°C${font}${voffset -30}${goto 125}${font ConkyWeather:size=40}${execpi 600 sed -n '2p' $HOME/.conky/cronograph/accuweather/curr_cond}${font}${voffset -16}${goto 185}${execpi 600 sed -n '3p' $HOME/.conky/cronograph/accuweather/curr_cond}${voffset 12}${goto 185}${font ConkyWeather:size=20}${voffset 1}${goto 80}${execpi 600 sed -n '7p' $HOME/.conky/cronograph/accuweather/tod_ton}${goto 135}${execpi 600 sed -n '12p' $HOME/.conky/cronograph/accuweather/tod_ton}${goto 185}${execpi 600 sed -n '17p' $HOME/.conky/cronograph/accuweather/tod_ton}${font}${voffset 6}${goto 84}${execpi 600 sed -n '9p' $HOME/.conky/cronograph/accuweather/tod_ton}°/${execpi 600 sed -n '10p' $HOME/.conky/cronograph/accuweather/tod_ton}°${goto 140}${execpi 600 sed -n '14p' $HOME/.conky/cronograph/accuweather/tod_ton}°/${execpi 600 sed -n '15p' $HOME/.conky/cronograph/accuweather/tod_ton}°${goto 190}${execpi 600 sed -n '19p' $HOME/.conky/cronograph/accuweather/tod_ton}°/${execpi 600 sed -n '20p' $HOME/.conky/cronograph/accuweather/tod_ton}°${voffset 7}${goto 85}${execpi 600 sed -n '6p' $HOME/.conky/cronograph/accuweather/tod_ton}${goto 140}${execpi 600 sed -n '11p' $HOME/.conky/cronograph/accuweather/tod_ton}${goto 190}${execpi 600 sed -n '16p' $HOME/.conky/cronograph/accuweather/tod_ton} -${if_match ${battery_percent BAT0}>0}${if_match ${battery_percent BAT0}<=15}${image $HOME/.conky/cronograph/images/Red.png -p 129,18 -s 40x40}${endif}${endif} -${if_match ${battery_percent BAT0}>15}${if_match ${battery_percent BAT0}<=20}${image $HOME/.conky/cronograph/images/Orange.png -p 129,18 -s 40x40}${endif}${endif} -${if_match ${battery_percent BAT0}>20}${if_match ${battery_percent BAT0}<=35}${image $HOME/.conky/cronograph/images/Yellow.png -p 129,18 -s 40x40}${endif}${endif} -${if_match ${battery_percent BAT0}>35}${if_match ${battery_percent BAT0}<=100}${image $HOME/.conky/cronograph/images/Dark_Green.png -p 129,18 -s 40x40}${endif}${endif} -${execpi 30 cat $HOME/.conky/cronograph/scripts/blinkingLED} -## mpd ## -${if_mpd_playing}${voffset 6}${goto 10}${font Sans:size=8:bold}${mpd_artist}${font}${voffset -5}${font Sans:size=8} - ${mpd_title}${font} -${voffset 4}${goto 10}${mpd_bar 5,220}${alignr 10}${mpd_elapsed}/${mpd_length} -${else}${voffset 6}${goto 10}${font hooge 05_53:size=8}MPD: stopped${font} -${endif} - -# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=conkyrc: # diff --git a/.ds9.prf b/.ds9.prf deleted file mode 100644 index db9ce9c..0000000 --- a/.ds9.prf +++ /dev/null @@ -1,115 +0,0 @@ -global ds9 -global prefs -set prefs(version) 7.2 -# this is a check for to ensure a match between the -# current ds9 version matches the prefs version -if {[string compare $prefs(version) [lindex $ds9(version) 0]] == 1} { - tk_messageBox -type ok -icon warning -message "[msgcat::mc {DS9 has detected a newer version of a preferences file and therefore will not process this file.}]" - return -} -global pds9 -array set pds9 { nan,msg White dialog motif text,font courier samp 1 font,msg Helvetica threads 8 font,weight normal automarker 1 bg,msg White language locale text,font,weight normal dialog,all 0 nan white font,slant roman confirm 1 backup 1 language,dir {} font helvetica language,name English bg white xpa 1 text,font,msg Courier theme native tcl 0 dialog,center 0 font,size 9 text,font,slant roman text,font,size 9 } -global current -global pcurrent -array set pcurrent { orient none zoom { 1 1 } mode pointer display tile align 0 rotate 0 } -array set current [array get pcurrent] -global view -global pview -array set pview { info,wcss 0 info,wcsc 0 info,wcst 0 info,wcsd 0 graph,horz 0 info,wcsu 0 info,wcse 0 magnifier 1 info,lowhigh 0 info,wcsf 0 info,frame 1 info,image 1 info,wcsv 0 colorbar 1 info 1 info,wcsg 0 info,wcsw 0 info,wcs 1 info,wcsh 0 info,wcsx 0 info,physical 1 info,wcsi 0 info,wcsy 0 info,object 1 buttons 1 info,wcsj 0 info,wcsz 0 info,wcsk 0 info,filename 1 info,wcsl 0 info,amplifier 0 info,minmax 0 info,wcsm 0 info,detector 0 info,wcsn 0 panner 1 info,wcso 0 info,wcsp 0 layout horizontal info,wcsa 0 info,wcsq 0 graph,vert 0 info,wcsb 0 info,wcsr 0 } -array set view [array get pview] -global phttp -array set phttp { auth,passwd {} proxy,host {} auth,user {} auth 0 proxy 0 proxy,port {} } -global pbuttons -array set pbuttons { color,he 1 frame,lock,frame,physical 0 view,lowhigh 0 frame,single 1 major,color 1 view,wcs 0 bin,in 1 view,buttons 1 help,release 1 file,open 1 edit,crosshair 1 view,panner 1 frame,lock,scale 0 help,story 0 help,new 0 frame,match,color 0 view,amplifier 0 scale,params 0 region,dissolve 0 major,zoom 1 frame,lock,cube 0 frame,newrgb 1 major,file 1 bin,512x 0 file,console 0 bin,8192x 0 edit,prefs 0 frame,match,smooth 0 bin,2048x 0 zoom,i2 1 edit,colorbar 1 zoom,i4 1 scale,minmax 1 scale,asinh 1 color,numerics 0 view,horizontal 0 major,wcs 1 zoom,i8 1 view,colorbar 1 color,sls 1 frame,match,crop,wcs 0 frame,clear 1 bin,1 1 bin,2 1 frame,new3d 1 zoom,16 0 edit,rotate 1 file,page 1 bin,4 1 zoom,none 0 region,list 1 file,pspage 0 frame,lock,crop,none 0 frame,lock,frame,detector 0 bin,8 1 scale,zscale 1 region,centroid 0 region,autocentroid 0 frame,size 0 zoom,270 0 scale,pow 1 frame,match,crop,image 0 scale,90 0 wcs,fk4 1 zoom,32 0 wcs,fk5 1 frame,blink 1 frame,match,cube 0 color,cool 1 frame,match,frame,amplifier 0 bin,average 0 bin,128x 0 frame,lock,crosshair,image 0 color,staircase 0 view,image 0 frame,reset 0 scale,95 0 file,save 1 scale,96 0 scale,97 0 major,scale 1 scale,98 0 region,showtext 0 file,exit 1 scale,99 0 frame,first 1 frame,lock,crop,physical 0 help,ref 1 color,grey 1 frame,lock,crop,amplifier 0 frame,lock,crosshair,none 0 view,filename 0 view,magnifier 1 file,backup 0 region,vector 0 frame,lock,crosshair,wcs 0 color,vert 0 color,green 0 file,header 1 edit,crop 1 edit,cut 0 frame,lock,crop,image 0 frame,match,scale 0 region,all 1 scale,user 0 file,samp,image 0 color,params 0 zoom,in 1 frame,movelast 0 edit,pointer 1 region,deleteall 0 color,standard 0 frame,match,frame,physical 0 help,faq 0 frame,lock,frame,image 0 region,load 1 frame,match,frame,image 0 region,savetemplate 0 region,loadtemplate 0 scale,925 0 color,rainbow 1 zoom,params 0 frame,refresh 0 zoom,i16 0 zoom,90 0 region,delete 1 edit,copy 0 region,annulus 0 frame,lock,crosshair,amplifier 0 bin,fit 1 region,ruler 0 region,circle 0 frame,match,crosshair,amplifier 0 view,physical 0 color,a 1 color,b 1 frame,lock,crop,detector 0 scale,sqrt 1 zoom,i32 0 major,view 1 view,vertical 0 region,point 0 region,group 0 frame,movenext 0 frame,match,crosshair,physical 0 bin,128 0 file,print 1 frame,lock,crop,wcs 0 frame,delete 1 frame,lock,frame,none 0 frame,match,crop,physical 0 frame,movefirst 0 color,red 0 region,none 1 region,polygon 0 bin,params 0 frame,last 1 scale,zmax 0 edit,catalog 1 frame,tile 1 major,help 1 region,compass 0 edit,paste 0 frame,match,crosshair,wcs 0 help,about 1 region,back 1 file,samp,table 0 frame,match,frame,detector 0 scale,squared 1 scale,datasec 0 help,desk 1 region,ellipse 0 frame,cube 0 view,graphvert 1 edit,none 1 major,edit 1 frame,lock,crosshair,physical 0 color,blue 0 file,psprint 0 wcs,ecliptic 1 color,horz 0 region,save 1 region,newgroup 0 color,aips0 1 wcs,galactic 1 region,front 1 zoom,0 0 zoom,1 1 frame,moveprev 0 zoom,2 1 scale,995 0 frame,match,frame,wcs 0 scale,hist 1 zoom,4 1 color,reset 0 color,numspace 0 region,show 0 view,minmax 0 view,detector 0 frame,new 1 frame,match,crop,amplifier 0 zoom,8 1 zoom,center 0 region,ellipseannulus 0 zoom,fit 1 major,bin 1 frame,next 1 edit,pan 1 view,info 1 frame,match,crosshair,detector 0 frame,lock,frame,amplifier 0 bin,1024x 0 file,xpa,info 0 bin,out 1 view,object 0 frame,lock,smooth 0 frame,match,crop,detector 0 color,invert 0 region,create 0 region,info 1 frame,match,crosshair,image 0 scale,sinh 1 color,bb 1 file,tcl 0 wcs,sexagesimal 1 region,panda 0 region,boxannulus 0 wcs,degrees 1 region,box 0 wcs,icrs 1 view,frame 0 frame,lock,color 0 bin,16 1 frame,lock,bin 0 frame,3d 0 major,frame 1 file,restore 0 frame,lock,crosshair,detector 0 frame,match,bin 0 color,color 0 help,ack 1 color,i8 1 frame,prev 1 color,heat 1 edit,zoom 1 region,invert 0 edit,examine 1 bin,32 1 frame,deleteall 0 region,text 0 region,projection 0 zoom,crop 0 help,keyboard 1 scale,log 1 frame,lock,frame,wcs 0 bin,4096x 0 zoom,align 0 scale,linear 1 edit,undo 0 major,region 1 zoom,x 0 frame,rgb 0 bin,256 0 zoom,y 0 zoom,xy 0 zoom,180 0 color,hsv 0 view,graphhorz 1 region,line 0 color,numvalue 0 region,epanda 0 zoom,out 1 bin,sum 0 bin,256x 1 help,user 1 file,movie 0 region,bpanda 0 bin,64 1 } -global ppanner -array set ppanner { compass 1 } -global pmagnifier -array set pmagnifier { region 1 zoom 4 color,msg White cursor 1 color white } -global ps -global pps -array set pps { scale 100 orient portrait height 11 size letter resolution 150 filename,txt ds9.txt dest printer level 2 width 8.5 filename ds9.ps cmd lp color rgb } -array set ps [array get pps] -global pr -global ppr -array set ppr { } -array set pr [array get ppr] -global blink -global pblink -array set pblink { interval 500 } -array set blink [array get pblink] -global tile -global ptile -array set ptile { grid,col 10 mode grid grid,row 10 grid,gap 4 grid,mode automatic } -array set tile [array get ptile] -global threed -global pthreed -array set pthreed { highlite,color,msg Cyan border,color,msg Blue scale 1 method mip highlite,color cyan border,color blue compass,color green highlite 1 border 1 compass 0 } -array set threed [array get pthreed] -global bin -global pbin -array set pbin { wheel,factor 1.2 wheel 1 lock 0 depth 1 buffersize 1024 function sum factor { 1 1 } } -array set bin [array get pbin] -global panzoom -global ppanzoom -array set ppanzoom { wheel,factor 1.2 preserve 0 wheel 1 mode click } -array set panzoom [array get ppanzoom] -global scale -global pscale -array set pscale { preserve 0 datasec 1 mode minmax scope local log 1000 type linear } -array set scale [array get pscale] -global minmax -global pminmax -array set pminmax { mode auto sample 25 } -array set minmax [array get pminmax] -global zscale -global pzscale -array set pzscale { line 120 contrast .25 sample 600 } -array set zscale [array get pzscale] -global marker -global pmarker -array set pmarker { panda,ang2 360 bpanda,ang1 0 shape circle show 1 bpanda,ang2 360 boxannulus,annuli 1 delete 1 centroid,radius 10 dformat degrees annulus,inner 15 panda,angnum 4 show,text 1 epanda,angnum 4 centroid,iteration 30 plot2d 0 font,size 10 rotate 1 move 1 fixed 0 ellipseannulus,radius1 40 ellipseannulus,radius2 20 ellipseannulus,radius3 60 plot3d 1 epanda,radius1 40 panda,outer 30 panda,annuli 1 epanda,radius2 20 epanda,radius3 60 source 1 bpanda,radius1 80 bpanda,radius2 40 epanda,annuli 1 bpanda,radius3 120 color green format ciao annulus,outer 30 font,weight normal polygon,width 20 font,slant roman edit 1 font helvetica bpanda,angnum 4 dash 0 projection,thick 0 boxannulus,radius1 80 dashlist {8 3} polygon,height 20 boxannulus,radius2 40 boxannulus,radius3 120 box,radius1 80 box,radius2 40 point,size 11 annulus,annuli 1 compass,radius 40 include 1 epanda,ang1 0 centroid,auto 0 epanda,ang2 360 circle,radius 20 width 1 bpanda,annuli 1 ellipse,radius1 40 preserve 0 panda,inner 15 ellipse,radius2 20 panda,ang1 0 ellipseannulus,annuli 1 } -array set marker [array get pmarker] -global wcs -global pwcs -array set pwcs { skyformat sexagesimal system wcs sky fk5 } -array set wcs [array get pwcs] -global pgraph -array set pgraph { horz,log false horz,grid 1 vert,log false vert,grid 1 } -global pcoord -array set pcoord { wcss 0 wcsc 0 wcst 0 wcsd 0 wcsu 0 wcse 0 wcsv 0 wcsf 0 image 1 wcsw 0 wcsg 0 wcsx 0 wcsh 0 physical 0 wcs 1 wcsy 0 wcsi 0 wcsz 0 wcsj 0 wcsk 0 wcsl 0 filename 0 amplifier 0 wcsm 0 detector 0 wcsn 0 wcso 0 wcsp 0 value 1 wcsq 0 wcsa 0 wcsr 0 wcsb 0 } -global pexamine -array set pexamine { zoom 4 mode new } -global pixel -global ppixel -array set ppixel { size 5 } -array set pixel [array get ppixel] -global mask -global pmask -array set pmask { transparency 0 color red mark 1 } -array set mask [array get pmask] -global contour -global pcontour -array set pcontour { numlevel 5 dash 0 width 1 method block color,msg Green smooth 4 color green } -array set contour [array get pcontour] -global smooth -global psmooth -array set psmooth { radius 3 lock 0 function gaussian view 0 } -array set smooth [array get psmooth] -global nres -global pnres -array set nres { server simbad-cds } -array set nres [array get pnres] -global pcat -array set pcat { sym,units physical sym,font,weight normal vot 1 loc 500 server cds sym,color,msg Green sym,font,msg Helvetica sym,font,slant roman sym,font,size 10 sym,font,weight, {} sym,color green sym,font helvetica sym,shape {circle point} } -global pvo -array set pvo { method mime hv 1 delay 15 server http://cxc.harvard.edu/chandraed/list.txt } -global pap -array set pap { textlabSlant roman quadratic 0 textlabFont,msg Helvetica numlabWeight normal quadratic,dash no textlabWeight normal graph,y,grid 1 quadratic,color black discrete,color,msg Red error 1 discrete,color red step,color black linear,color,msg Black discrete 0 graph,x,log 0 titleSize 12 error,color red bar 0 graph,y,flip 0 linear,color black step,dash no titleFont helvetica titleWeight normal linear 1 discrete,fill 1 textlabSize 9 graph,x,grid 1 numlabSlant roman quadratic,width 1 textlabFont helvetica titleSlant roman step 0 quadratic,color,msg Black discrete,symbol circle linear,dash no step,width 1 numlabFont,msg Helvetica numlabSize 9 step,color,msg Black graph,x,flip 0 numlabFont helvetica error,width 1 linear,width 1 bar,color black error,color,msg Red titleFont,msg Helvetica graph,y,log 0 } -global panalysis -array set panalysis { user2 {} autoload 1 user3 {} log 0 user4 {} user {} } - -# Colorbar prefs -global colorbar -global pcolorbar -array set pcolorbar { invert 0 lock 0 size 20 font,weight normal space 0 tag red font,slant roman map he numerics 1 font helvetica orientation horizontal font,size 9 ticks 11 tag,msg Red } -array set colorbar [array get pcolorbar] diff --git a/.ds9_7.prf b/.ds9_7.prf deleted file mode 100644 index 8af9ba9..0000000 --- a/.ds9_7.prf +++ /dev/null @@ -1,115 +0,0 @@ -global ds9 -global prefs -set prefs(version) 7.2 -# this is a check for to ensure a match between the -# current ds9 version matches the prefs version -if {[string compare $prefs(version) [lindex $ds9(version) 0]] == 1} { - tk_messageBox -type ok -icon warning -message "[msgcat::mc {DS9 has detected a newer version of a preferences file and therefore will not process this file.}]" - return -} -global pds9 -array set pds9 { nan,msg White dialog motif text,font courier samp 1 font,msg Helvetica threads 8 font,weight normal automarker 1 bg,msg White language locale text,font,weight normal dialog,all 0 nan white font,slant roman confirm 1 backup 1 language,dir {} font helvetica language,name English bg white xpa 1 text,font,msg Courier theme native tcl 0 dialog,center 0 font,size 9 text,font,slant roman text,font,size 9 } -global current -global pcurrent -array set pcurrent { orient none zoom { 1 1 } mode pointer display tile align 0 rotate 0 } -array set current [array get pcurrent] -global view -global pview -array set pview { info,wcss 0 info,wcsc 0 info,wcst 0 info,wcsd 0 graph,horz 0 info,wcsu 0 info,wcse 0 magnifier 1 info,lowhigh 0 info,wcsf 0 info,frame 1 info,image 1 info,wcsv 0 colorbar 1 info 1 info,wcsg 0 info,wcsw 0 info,wcs 1 info,wcsh 0 info,wcsx 0 info,physical 1 info,wcsi 0 info,wcsy 0 info,object 1 buttons 1 info,wcsj 0 info,wcsz 0 info,wcsk 0 info,filename 1 info,wcsl 0 info,amplifier 0 info,minmax 0 info,wcsm 0 info,detector 0 info,wcsn 0 panner 1 info,wcso 0 info,wcsp 0 layout vertical info,wcsa 0 info,wcsq 0 graph,vert 0 info,wcsb 0 info,wcsr 0 } -array set view [array get pview] -global phttp -array set phttp { auth,passwd {} proxy,host {} auth,user {} auth 0 proxy 0 proxy,port {} } -global pbuttons -array set pbuttons { color,he 1 frame,lock,frame,physical 0 view,lowhigh 0 frame,single 1 major,color 1 view,wcs 0 bin,in 1 view,buttons 1 help,release 1 file,open 1 edit,crosshair 1 view,panner 1 frame,lock,scale 0 help,story 0 help,new 0 frame,match,color 0 view,amplifier 0 scale,params 0 region,dissolve 0 major,zoom 1 frame,lock,cube 0 frame,newrgb 1 major,file 1 bin,512x 0 file,console 0 bin,8192x 0 edit,prefs 0 frame,match,smooth 0 bin,2048x 0 zoom,i2 1 edit,colorbar 1 zoom,i4 1 scale,minmax 1 scale,asinh 1 color,numerics 0 view,horizontal 0 major,wcs 1 zoom,i8 1 view,colorbar 1 color,sls 1 frame,match,crop,wcs 0 frame,clear 1 bin,1 1 bin,2 1 frame,new3d 1 zoom,16 0 edit,rotate 1 file,page 1 bin,4 1 zoom,none 0 region,list 1 file,pspage 0 frame,lock,crop,none 0 frame,lock,frame,detector 0 bin,8 1 scale,zscale 1 region,centroid 0 region,autocentroid 0 frame,size 0 zoom,270 0 scale,pow 1 frame,match,crop,image 0 scale,90 0 wcs,fk4 1 zoom,32 0 wcs,fk5 1 frame,blink 1 frame,match,cube 0 color,cool 1 frame,match,frame,amplifier 0 bin,average 0 bin,128x 0 frame,lock,crosshair,image 0 color,staircase 0 view,image 0 frame,reset 0 scale,95 0 file,save 1 scale,96 0 scale,97 0 major,scale 1 scale,98 0 region,showtext 0 file,exit 1 scale,99 0 frame,first 1 frame,lock,crop,physical 0 help,ref 1 color,grey 1 frame,lock,crop,amplifier 0 frame,lock,crosshair,none 0 view,filename 0 view,magnifier 1 file,backup 0 region,vector 0 frame,lock,crosshair,wcs 0 color,vert 0 color,green 0 file,header 1 edit,crop 1 edit,cut 0 frame,lock,crop,image 0 color,match 0 frame,match,scale 0 file,savefits 0 region,all 1 scale,user 0 file,samp,image 0 file,saveimage 1 color,params 0 zoom,in 1 frame,movelast 0 edit,pointer 1 region,deleteall 0 color,standard 0 frame,match,frame,physical 0 help,faq 0 frame,lock,frame,image 0 region,load 1 frame,match,frame,image 0 region,savetemplate 0 region,loadtemplate 0 scale,925 0 color,rainbow 1 zoom,params 0 frame,refresh 0 zoom,i16 0 zoom,90 0 region,delete 1 file,xpa 0 edit,copy 0 region,annulus 0 frame,lock,crosshair,amplifier 0 bin,fit 1 bin,match 0 region,ruler 0 region,circle 0 frame,match,crosshair,amplifier 0 view,physical 0 color,a 1 color,b 1 frame,lock,crop,detector 0 scale,sqrt 1 zoom,i32 0 major,view 1 view,vertical 0 region,point 0 region,group 0 frame,movenext 0 frame,match,crosshair,physical 0 bin,128 0 scale,match 0 file,print 1 frame,lock,crop,wcs 0 frame,delete 1 frame,lock,frame,none 0 frame,match,crop,physical 0 frame,movefirst 0 color,red 0 region,none 1 region,polygon 0 bin,params 0 frame,last 1 scale,zmax 0 edit,catalog 1 frame,tile 1 major,help 1 region,compass 0 edit,paste 0 frame,match,crosshair,wcs 0 help,about 1 region,back 1 file,samp,table 0 frame,match,frame,detector 0 scale,squared 1 scale,datasec 0 help,desk 1 region,ellipse 0 frame,cube 0 view,graphvert 1 edit,none 1 major,edit 1 frame,lock,crosshair,physical 0 color,blue 0 file,psprint 0 wcs,ecliptic 1 color,horz 0 region,save 1 region,newgroup 0 color,aips0 1 wcs,galactic 1 region,front 1 zoom,0 0 zoom,1 1 frame,moveprev 0 zoom,2 1 scale,995 0 frame,match,frame,wcs 0 scale,hist 1 zoom,4 1 color,reset 0 file,about 1 color,numspace 0 region,show 0 view,minmax 0 view,detector 0 frame,new 1 frame,match,crop,amplifier 0 zoom,8 1 zoom,center 0 region,ellipseannulus 0 zoom,fit 1 major,bin 1 frame,next 1 edit,pan 1 view,info 1 frame,match,crosshair,detector 0 frame,lock,frame,amplifier 0 bin,1024x 0 file,xpa,info 0 bin,out 1 view,object 0 frame,lock,smooth 0 frame,match,crop,detector 0 color,invert 0 region,create 0 region,info 1 frame,match,crosshair,image 0 scale,sinh 1 color,bb 1 file,tcl 0 graphics 0 region,circle3d 0 wcs,sexagesimal 1 region,panda 0 region,boxannulus 0 wcs,degrees 1 region,box 0 wcs,icrs 1 view,frame 0 frame,lock,color 0 bin,16 1 frame,lock,bin 0 frame,3d 0 major,frame 1 file,restore 0 frame,lock,crosshair,detector 0 frame,match,bin 0 color,color 0 help,ack 1 color,i8 1 frame,prev 1 color,heat 1 edit,zoom 1 region,invert 0 edit,examine 1 bin,32 1 frame,deleteall 0 region,text 0 region,projection 0 zoom,crop 0 help,keyboard 1 scale,log 1 frame,lock,frame,wcs 0 bin,4096x 0 file,savempeg 0 zoom,align 0 help,home 1 scale,linear 1 edit,undo 0 major,region 1 zoom,x 0 frame,rgb 0 bin,256 0 zoom,y 0 zoom,xy 0 zoom,180 0 color,hsv 0 view,graphhorz 1 file,export 0 region,line 0 color,numvalue 0 region,epanda 0 zoom,out 1 bin,sum 0 bin,256x 0 help,user 1 file,movie 0 region,bpanda 0 bin,64 1 } -global ppanner -array set ppanner { compass 1 compass,wcs 1 } -global pmagnifier -array set pmagnifier { region 1 zoom 4 color,msg White cursor 1 color white } -global ps -global pps -array set pps { scale 100 orient portrait height 11 size a4 resolution 300 filename,txt ds9.txt dest printer level 2 width 8.5 color2 color filename ds9.ps cmd lp color rgb } -array set ps [array get pps] -global pr -global ppr -array set ppr { } -array set pr [array get ppr] -global blink -global pblink -array set pblink { interval 500 } -array set blink [array get pblink] -global tile -global ptile -array set ptile { grid,col 10 mode grid grid,row 10 grid,gap 4 grid,mode automatic } -array set tile [array get ptile] -global threed -global pthreed -array set pthreed { highlite,color,msg Cyan border,color,msg Blue scale 1 method mip highlite,color cyan border,color blue compass,color green highlite 1 border 1 compass 0 } -array set threed [array get pthreed] -global bin -global pbin -array set pbin { wheel,factor 1.2 wheel 1 lock 0 depth 1 buffersize 1024 function sum factor { 1 1 } } -array set bin [array get pbin] -global panzoom -global ppanzoom -array set ppanzoom { wheel,factor 1.2 preserve 0 wheel 1 mode click } -array set panzoom [array get ppanzoom] -global scale -global pscale -array set pscale { preserve 0 datasec 1 mode minmax scope local log 1000 type linear } -array set scale [array get pscale] -global minmax -global pminmax -array set pminmax { mode auto sample 26 } -array set minmax [array get pminmax] -global zscale -global pzscale -array set pzscale { line 120 contrast .25 sample 600 } -array set zscale [array get pzscale] -global marker -global pmarker -array set pmarker { panda,ang2 360 bpanda,ang1 0 shape circle show 1 bpanda,ang2 360 boxannulus,annuli 1 delete 1 centroid,radius 10 dformat degrees annulus,inner 15 panda,angnum 4 show,text 1 epanda,angnum 4 centroid,iteration 30 circle3d,radius 20 plot2d 0 font,size 10 rotate 1 move 1 fixed 0 ellipseannulus,radius1 40 ellipseannulus,radius2 20 ellipseannulus,radius3 60 plot3d 1 epanda,radius1 40 panda,outer 30 panda,annuli 1 epanda,radius2 20 epanda,radius3 60 source 1 bpanda,radius1 80 bpanda,radius2 40 epanda,annuli 1 bpanda,radius3 120 sky fk5 color green format ciao annulus,outer 30 font,weight normal polygon,width 20 font,slant roman edit 1 font helvetica bpanda,angnum 4 dash 0 projection,thick 0 boxannulus,radius1 80 dashlist {8 3} polygon,height 20 boxannulus,radius2 40 boxannulus,radius3 120 box,radius1 80 box,radius2 40 point,size 11 annulus,annuli 1 compass,radius 40 include 1 epanda,ang1 0 centroid,auto 0 epanda,ang2 360 circle,radius 20 width 1 bpanda,annuli 1 projection,method 1 ellipse,radius1 40 preserve 0 panda,inner 15 ellipse,radius2 20 circle3d,method 1 panda,ang1 0 ellipseannulus,annuli 1 } -array set marker [array get pmarker] -global wcs -global pwcs -array set pwcs { align,system wcs skyformat sexagesimal system wcs align,sky fk5 align 0 sky fk5 } -array set wcs [array get pwcs] -global pgraph -array set pgraph { horz,log false horz,grid 1 vert,log false vert,grid 1 } -global pcoord -array set pcoord { wcss 0 wcsc 0 wcst 0 wcsd 0 wcsu 0 wcse 0 wcsv 0 wcsf 0 image 1 wcsw 0 wcsg 0 wcsx 0 wcsh 0 physical 0 wcs 1 wcsy 0 wcsi 0 wcsz 0 wcsj 0 wcsk 0 wcsl 0 filename 0 amplifier 0 wcsm 0 detector 0 wcsn 0 wcso 0 wcsp 0 value 1 wcsq 0 wcsa 0 wcsr 0 wcsb 0 } -global pexamine -array set pexamine { zoom 4 mode new } -global pixel -global ppixel -array set ppixel { size 5 } -array set pixel [array get ppixel] -global mask -global pmask -array set pmask { transparency 0 color red mark 1 } -array set mask [array get pmask] -global contour -global pcontour -array set pcontour { numlevel 5 dash 0 width 1 method block color,msg Green smooth 4 color green } -array set contour [array get pcontour] -global smooth -global psmooth -array set psmooth { radius 3 lock 0 function gaussian view 0 } -array set smooth [array get psmooth] -global nres -global pnres -array set nres { server simbad-cds } -array set nres [array get pnres] -global pcat -array set pcat { sym,units physical sym,font,weight normal vot 1 loc 500 server cds sym,color,msg Green sym,font,msg Helvetica sym,font,slant roman sym,font,size 10 sym,font,weight, {} sym,color green sym,font helvetica sym,shape {circle point} } -global pvo -array set pvo { method xpa hv 1 delay 15 server http://cxc.harvard.edu/chandraed/list.txt } -global pap -array set pap { textlabSlant roman quadratic 0 textlabFont,msg Helvetica numlabWeight normal quadratic,dash no textlabWeight normal graph,y,grid 1 quadratic,color black discrete,color,msg Red error 1 discrete,color red step,color black linear,color,msg Black discrete 0 graph,x,log 0 titleSize 12 error,color red bar 0 graph,y,flip 0 linear,color black error,style 1 step,dash no titleFont helvetica titleWeight normal linear 1 discrete,fill 1 textlabSize 9 graph,x,grid 1 numlabSlant roman quadratic,width 1 textlabFont helvetica titleSlant roman step 0 quadratic,color,msg Black discrete,symbol circle linear,dash no step,width 1 numlabFont,msg Helvetica numlabSize 9 step,color,msg Black graph,x,flip 0 numlabFont helvetica error,width 1 grid 1 linear,width 1 bar,color black error,color,msg Red titleFont,msg Helvetica grid,log linearlinear graph,y,log 0 } -global panalysis -array set panalysis { user2 {} autoload 1 user3 {} log 0 user4 {} user {} } - -# Colorbar prefs -global colorbar -global pcolorbar -array set pcolorbar { invert 0 lock 0 size 20 font,weight normal space 0 tag red font,slant roman map he numerics 1 font helvetica orientation horizontal font,size 9 ticks 11 tag,msg Red } -array set colorbar [array get pcolorbar] diff --git a/.gitignore b/.gitignore index abd7817..c2ccd82 100644 --- a/.gitignore +++ b/.gitignore @@ -1,41 +1,16 @@ ## .gitignore +PRIVATE/ + *~ *.swp *.orig *.bak *_bak -## vifm -.vifm/Trash/ -.vifm/vifminfo - -## mpd -.mpd/ - -## ncmpcpp -.ncmpcpp/*.log - -## lftp -.lftp/*_history -.lftp/*_log - -## urxvt -.urxvt/*urxvtd* - -## i3 -.i3/*.sock - -### .config {{{ -# .config/fcitx -.config/fcitx/clipboard/ -.config/fcitx/data -.config/fcitx/dbus -.config/fcitx/log -.config/fcitx/pinyin -.config/fcitx/table - -### .config }}} +### python +__pycache__/ +*.py[cod] ### C {{{ # Object files @@ -63,46 +38,3 @@ *.hex ### C }}} -### python -__pycache__/ -*.py[cod] - -### private {{{ -# ssh -.ssh/ - -# abook -.abook/address* - -# msmtp -.msmtp/ - -# offlineimap -.offlineimap/Account-* -.offlineimap/Repository-* -.offlineimap/*.gpg -.offlineimap/*.log -.offlineimap/*.crt -.offlineimap/*pid -.offlineimap/*lock - -# mutt -.mutt/aliases -.mutt/certificates -.mutt/xlabels -.mutt/*history -.mutt/mailboxes* -.mutt/signature -.mutt/accounts/ -.mutt/cache/ -.mutt/tmp/ - -# todo -.todo/todo.txt -.todo/todo.txt.bak -.todo/done.txt -.todo/report.txt - -.netrc -### private }}} - diff --git a/.gnupg/dirmngr.conf b/.gnupg/dirmngr.conf deleted file mode 100644 index 7696da9..0000000 --- a/.gnupg/dirmngr.conf +++ /dev/null @@ -1,21 +0,0 @@ -##################################################################### -# GnuPG configuration file -# -# dirmngr: CRL and OCSP daemon (GnuPG >= 2.1) -# ~/.gnupg/dirmngr.conf -# -# Ref: -# [1] SKS Keyservers: Overview of the pools -# https://sks-keyservers.net/overview-of-pools.php -# -# Weitian LI -# 2015/01/16 -##################################################################### - -# keyserver hkps://hkps.pool.sks-keyservers.net -# This pool only contains servers available using hkps. -# keyserver-options ca-cert-file' is obsolete! (GnuPG >= 2.1) -# NOTE: cannot use '~' or '$HOME' in path ?? -hkp-cacert /home/aly/dotfiles/.gnupg/sks-keyservers.netCA.pem - -# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=gpg: # diff --git a/.gnupg/gpg-agent.conf b/.gnupg/gpg-agent.conf deleted file mode 100644 index 35d2924..0000000 --- a/.gnupg/gpg-agent.conf +++ /dev/null @@ -1,21 +0,0 @@ -##################################################################### -# GnuPG Agent configuration file -# ~/.gnupg/gpg-agent.conf -# -# Ref: -# Gentoo wiki: GnuPG -# -# Weitian LI -# 2014/06/12 -##################################################################### - -pinentry-program /usr/bin/pinentry-gtk-2 -#pinentry-program /usr/bin/pinentry-qt4 -#pinentry-program /usr/bin/pinentry-curses - -no-grab - -# default timeout of the passphrase (60 minutes) -default-cache-ttl 3600 - -# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=gpg: # diff --git a/.gnupg/gpg.conf b/.gnupg/gpg.conf deleted file mode 100644 index 258c10e..0000000 --- a/.gnupg/gpg.conf +++ /dev/null @@ -1,130 +0,0 @@ -##################################################################### -# GnuPG configuration file -# ~/.gnupg/gpg.conf -# -# Based on Github: ioerror/duraconf's configuration: -# https://github.com/ioerror/duraconf/blob/master/configs/gnupg/gpg.conf -# -# Reference: -# [1] Riseup: OpenPGP Best Practices -# https://help.riseup.net/en/gpg-best-practices -# [2] Secure GnuPG configuration -# http://sparkslinux.wordpress.com/2013/07/09/secure-gnupg-configuration -# -# Weitian LI -# Created: 2014/06/12 -# Updated: 2015/08/19 -##################################################################### - -#----------------------------- -# default key -#----------------------------- - -# The default key to sign with. If this option is not used, the default key is -# the first key found in the secret keyring -default-key 0xAC3464FADAAE632186099CA6240E2A635D72729A - -#----------------------------- -# behavior -#----------------------------- - -# Uncomment the following option to get rid of the copyright notice -no-greeting - -# create ASCII armored output (default is binary OpenPGP format) -#armor - -# If you do not use the Latin-1 (ISO-8859-1) charset, you should tell -# GnuPG which is the native character set. Please check the man page -# for supported character sets. This character set is only used for -# metadata and not for the actual message which does not undergo any -# translation. Note that future version of GnuPG will change to UTF-8 -# as default character set. -charset utf-8 - -# Disable inclusion of the version string in ASCII armored output -no-emit-version - -# Disable comment string in clear text signatures and ASCII armored messages -no-comments - -# Display long key IDs -keyid-format 0xlong - -# List all keys (or the specified ones) along with their fingerprints -with-fingerprint - -# Display the calculated validity of user IDs during key listings -list-options show-uid-validity -verify-options show-uid-validity - -# Try to use the GnuPG-Agent. With this option, GnuPG first tries to connect to -# the agent before it asks for a passphrase. -use-agent - -#----------------------------- -# keyserver -#----------------------------- - -# This is the server that --recv-keys, --send-keys, and --search-keys will -# communicate with to receive keys from, send keys to, and search for keys on -#keyserver hkp://pool.sks-keyservers.net -keyserver hkps://hkps.pool.sks-keyservers.net - -# Provide a certificate store to override the system default -# Get this from https://sks-keyservers.net/sks-keyservers.netCA.pem -# option 'ca-cert-file' is obsolete. (GnuPG >= 2.1) -#keyserver-options ca-cert-file=~/dotfiles/.gnupg/sks-keyservers.netCA.pem - -# Set the proxy to use for HTTP and HKP keyservers - default to the standard -# local Tor socks proxy -# It is encouraged to use Tor for improved anonymity. Preferrably use either a -# dedicated SOCKSPort for GnuPG and/or enable IsolateDestPort and -# IsolateDestAddr -#keyserver-options http-proxy=socks5-hostname://127.0.0.1:9050 -# Don't leak DNS, see https://trac.torproject.org/projects/tor/ticket/2846 -# XXX: unknown to gnupg 2.1.7 -#keyserver-options no-try-dns-srv - -# When using --refresh-keys, if the key in question has a preferred keyserver -# URL, then disable use of that preferred keyserver to refresh the key from -keyserver-options no-honor-keyserver-url - -# When searching for a key with --search-keys, include keys that are marked on -# the keyserver as revoked -keyserver-options include-revoked - -# Automatic retrieve keys from a keyserver when verifying signatures made by -# keys that are not on the local keyring. -# NOTE: This option makes a "web bug" like behavior possible. -# Keyserver operators can see which keys you rquest, so by sending -# you a message signed by a brand new key (which you naturally will -# not have on your local keyring), the operator can tell both your -# IP address and the time when you verified the signature. -keyserver-options auto-key-retrieve - -#----------------------------- -# algorithm and ciphers -#----------------------------- - -# list of personal digest preferences. When multiple digests are supported by -# all recipients, choose the strongest one -#personal-cipher-preferences AES256 TWOFISH AES192 AES -personal-cipher-preferences AES256 AES192 AES CAST5 - -# list of personal digest preferences. When multiple ciphers are supported by -# all recipients, choose the strongest one -personal-digest-preferences SHA512 SHA384 SHA256 SHA224 - -# list of personal compress preferences -personal-compress-preferences ZLIB BZIP2 ZIP - -# message digest algorithm used when signing a key -cert-digest-algo SHA512 - -# This preference list is used for new keys and becomes the default for -# "setpref" in the edit menu -#default-preference-list SHA512 SHA384 SHA256 SHA224 AES256 TWOFISH AES192 AES ZLIB BZIP2 ZIP Uncompressed -default-preference-list SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed - -# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=gpg: # diff --git a/.gnupg/sks-keyservers.netCA.pem b/.gnupg/sks-keyservers.netCA.pem deleted file mode 100644 index 24a2ad2..0000000 --- a/.gnupg/sks-keyservers.netCA.pem +++ /dev/null @@ -1,32 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIFizCCA3OgAwIBAgIJAK9zyLTPn4CPMA0GCSqGSIb3DQEBBQUAMFwxCzAJBgNV -BAYTAk5PMQ0wCwYDVQQIDARPc2xvMR4wHAYDVQQKDBVza3Mta2V5c2VydmVycy5u -ZXQgQ0ExHjAcBgNVBAMMFXNrcy1rZXlzZXJ2ZXJzLm5ldCBDQTAeFw0xMjEwMDkw -MDMzMzdaFw0yMjEwMDcwMDMzMzdaMFwxCzAJBgNVBAYTAk5PMQ0wCwYDVQQIDARP -c2xvMR4wHAYDVQQKDBVza3Mta2V5c2VydmVycy5uZXQgQ0ExHjAcBgNVBAMMFXNr -cy1rZXlzZXJ2ZXJzLm5ldCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoC -ggIBANdsWy4PXWNUCkS3L//nrd0GqN3dVwoBGZ6w94Tw2jPDPifegwxQozFXkG6I -6A4TK1CJLXPvfz0UP0aBYyPmTNadDinaB9T4jIwd4rnxl+59GiEmqkN3IfPsv5Jj -MkKUmJnvOT0DEVlEaO1UZIwx5WpfprB3mR81/qm4XkAgmYrmgnLXd/pJDAMk7y1F -45b5zWofiD5l677lplcIPRbFhpJ6kDTODXh/XEdtF71EAeaOdEGOvyGDmCO0GWqS -FDkMMPTlieLA/0rgFTcz4xwUYj/cD5e0ZBuSkYsYFAU3hd1cGfBue0cPZaQH2HYx -Qk4zXD8S3F4690fRhr+tki5gyG6JDR67aKp3BIGLqm7f45WkX1hYp+YXywmEziM4 -aSbGYhx8hoFGfq9UcfPEvp2aoc8u5sdqjDslhyUzM1v3m3ZGbhwEOnVjljY6JJLx -MxagxnZZSAY424ZZ3t71E/Mn27dm2w+xFRuoy8JEjv1d+BT3eChM5KaNwrj0IO/y -u8kFIgWYA1vZ/15qMT+tyJTfyrNVV/7Df7TNeWyNqjJ5rBmt0M6NpHG7CrUSkBy9 -p8JhimgjP5r0FlEkgg+lyD+V79H98gQfVgP3pbJICz0SpBQf2F/2tyS4rLm+49rP -fcOajiXEuyhpcmzgusAj/1FjrtlynH1r9mnNaX4e+rLWzvU5AgMBAAGjUDBOMB0G -A1UdDgQWBBTkwyoJFGfYTVISTpM8E+igjdq28zAfBgNVHSMEGDAWgBTkwyoJFGfY -TVISTpM8E+igjdq28zAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4ICAQAR -OXnYwu3g1ZjHyley3fZI5aLPsaE17cOImVTehC8DcIphm2HOMR/hYTTL+V0G4P+u -gH+6xeRLKSHMHZTtSBIa6GDL03434y9CBuwGvAFCMU2GV8w92/Z7apkAhdLToZA/ -X/iWP2jeaVJhxgEcH8uPrnSlqoPBcKC9PrgUzQYfSZJkLmB+3jEa3HKruy1abJP5 -gAdQvwvcPpvYRnIzUc9fZODsVmlHVFBCl2dlu/iHh2h4GmL4Da2rRkUMlbVTdioB -UYIvMycdOkpH5wJftzw7cpjsudGas0PARDXCFfGyKhwBRFY7Xp7lbjtU5Rz0Gc04 -lPrhDf0pFE98Aw4jJRpFeWMjpXUEaG1cq7D641RpgcMfPFvOHY47rvDTS7XJOaUT -BwRjmDt896s6vMDcaG/uXJbQjuzmmx3W2Idyh3s5SI0GTHb0IwMKYb4eBUIpQOnB -cE77VnCYqKvN1NVYAqhWjXbY7XasZvszCRcOG+W3FqNaHOK/n/0ueb0uijdLan+U -f4p1bjbAox8eAOQS/8a3bzkJzdyBNUKGx1BIK2IBL9bn/HravSDOiNRSnZ/R3l9G -ZauX0tu7IIDlRCILXSyeazu0aj/vdT3YFQXPcvt5Fkf5wiNTo53f72/jYEJd6qph -WrpoKqrwGwTpRUCMhYIUt65hsTxCiJJ5nKe39h46sg== ------END CERTIFICATE----- diff --git a/.gtk-bookmarks b/.gtk-bookmarks deleted file mode 100644 index 8af8f6f..0000000 --- a/.gtk-bookmarks +++ /dev/null @@ -1,5 +0,0 @@ -file:///home/aly/Documents -file:///home/aly/Music -file:///home/aly/Pictures -file:///home/aly/Videos -file:///home/aly/Downloads diff --git a/.gtkrc-2.0 b/.gtkrc-2.0 deleted file mode 100644 index dc786c3..0000000 --- a/.gtkrc-2.0 +++ /dev/null @@ -1,8 +0,0 @@ -## -## ~/.gtkrc-2.0 -## - -## NOTE: cannot use `~' and `$HOME' here - -include "/home/aly/.gtkrc.mine" - diff --git a/.gtkrc.mine b/.gtkrc.mine deleted file mode 100644 index 0927f91..0000000 --- a/.gtkrc.mine +++ /dev/null @@ -1,25 +0,0 @@ -## -## ~/.gtkrc.mine -## - -## font -gtk-font-name = "Sans 10" - -## theme -gtk-theme-name = "Clearlooks" -#gtk-theme-name = "FlatStudioLight" -#gtk-theme-name = "FlatStudioGray" -#gtk-theme-name = "FlatStudioDark" - -## icon -#gtk-icon-theme-name = "AwOken" -gtk-icon-theme-name = "AwOkenWhite" -#gtk-icon-theme-name = "AwOkenDark" - -## toolbar -# GTK_TOOLBAR_ICONS: only icons -# GTK_TOOLBAR_TEXT: only text -# GTK_TOOLBAR_BOTH: both icon and text -# GTK_TOOLBAR_BOTH_HORIZ: icon and text next to the icon -gtk-toolbar-style = GTK_TOOLBAR_ICONS - diff --git a/.i3/config b/.i3/config deleted file mode 100644 index 1e274bb..0000000 --- a/.i3/config +++ /dev/null @@ -1,386 +0,0 @@ -########################################################### -## ~/.i3/config -## -## i3 config file (v4) -## -## References: -## [1] http://i3wm.org/docs/userguide.html -## -## Credits: -## [1] https://github.com/Airblader/dotfiles-manjaro -## [2] https://github.com/Remedan/dotfiles -## -## Aaron LI -## Created: 2014-05-10 -## Updated: 2015-12-18 -########################################################### - -###### NOTES ###### {{{ -# To get a config file with the same key positions, but for your current -# layout, use the `i3-config-wizard' -###### NOTES ###### }}} - -###### variables ###### {{{ -## modifier -# Mod1: Alt -# Mod4: Win -set $mod Mod1 -set $sup Mod4 - -# variables used in this config -set $i3_scripts ~/.i3/scripts -set $i3_images ~/.i3/images - -# screenshots directory -set $shots_dir ~/pictures/screenshots -###### variables ###### }}} - -###### settings ###### {{{ -# Font for window titles. (also for bar if not specified) -# ISO 10646: Unicode -# Use pango to choose FreeType fonts -#font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1 -#font pango:DejaVu Sans Mono 10 -font pango:Terminus, WenQuanYi Bitmap Song, FontAwesome, 10 - -# use `Mouse+$mod' to drag floating windows -floating_modifier $mod - -# focus follows mouse (default yes) -#focus_follows_mouse no - -# timeout of urgency hint on workspace change (default 500ms) -force_display_urgency_hint 1000 ms - -# do not focus the activated window, always mark urgent (default: smart) -focus_on_window_activation urgent - -# ipc (`i3-msg' to run i3 commands) -ipc-socket ~/.i3/i3-ipc.sock -###### settings ###### }}} - -###### appearance ###### {{{ -# border style -#new_window 1pixel -bindsym $mod+t border normal -bindsym $mod+y border pixel 3 -bindsym $mod+u border none - -# 2 pixel border by default -for_window [class="^.*"] border pixel 2 - -# orientation for new workspaces -default_orientation auto - -# hide vertical borders adjacent to the screen edge -#hide_edge_borders vertical - -### colors -# molokai -set $black #1b1d1e -set $white #f8f8f2 -set $dark_gray #303030 -set $light_gray #9999aa -set $red #b60050 -set $light_red #f92672 -set $green #88bb22 -set $light_green #80ff00 -set $brown #c47f2c -set $yellow #ffba68 -set $blue #30309b -set $light_blue #7070f0 -set $purple #7e40a5 -set $light_purple #bb88dd -set $cyan #4699af -set $light_cyan #66d9ef - -# BORDER BACKGROUND TEXT INDICATOR -client.focused $green $green $black $green -client.unfocused $black $black $white $black -client.focused_inactive $black $black $white $black -client.urgent $red $red $black $red -client.background $black -###### appearance ###### }}} - -###### workspace ###### {{{ -# name workspace -set $ws1 "1: " -set $ws2 "2: " -set $ws3 "3: " -set $ws4 "4: " -set $ws5 "5: ??" -set $ws6 "6: ??" -set $ws7 "7: " -set $ws8 "8:  " -set $ws9 "9: " -set $ws0 "10: " - -# switch to workspace -bindsym $mod+1 workspace $ws1 -bindsym $mod+2 workspace $ws2 -bindsym $mod+3 workspace $ws3 -bindsym $mod+4 workspace $ws4 -bindsym $mod+5 workspace $ws5 -bindsym $mod+6 workspace $ws6 -bindsym $mod+7 workspace $ws7 -bindsym $mod+8 workspace $ws8 -bindsym $mod+9 workspace $ws9 -bindsym $mod+0 workspace $ws0 - -# auto back-and-forth when switched to the current workspace -workspace_auto_back_and_forth yes - -# move focused container to workspace -bindsym $mod+Shift+1 move container to workspace $ws1 -bindsym $mod+Shift+2 move container to workspace $ws2 -bindsym $mod+Shift+3 move container to workspace $ws3 -bindsym $mod+Shift+4 move container to workspace $ws4 -bindsym $mod+Shift+5 move container to workspace $ws5 -bindsym $mod+Shift+6 move container to workspace $ws6 -bindsym $mod+Shift+7 move container to workspace $ws7 -bindsym $mod+Shift+8 move container to workspace $ws8 -bindsym $mod+Shift+9 move container to workspace $ws9 -bindsym $mod+Shift+0 move container to workspace $ws0 -# move to provided workspace -bindsym $mod+Shift+m exec i3-input -F 'move container to workspace "%s"' -P 'move to workspace: ' - -# switch workspace -bindsym $mod+Tab workspace back_and_forth -bindsym $mod+Ctrl+Left workspace prev -bindsym $mod+Ctrl+Right workspace next -# also bind ThinkPad 'XF86Back' and 'XF86Forward' keys -#bindsym XF86Back workspace prev -#bindsym XF86Forward workspace next -###### workspace ###### }}} - -###### key bindings ###### {{{ -# start a terminal -bindsym $mod+Return exec urxvtc || i3-sensible-terminal - -# kill focused window -bindsym $mod+Shift+q kill -bindsym $mod+F4 kill - -# change focus (h/j/k/l) -bindsym $mod+h focus left -bindsym $mod+j focus down -bindsym $mod+k focus up -bindsym $mod+l focus right - -# alternatively, you can use the cursor keys: -bindsym $mod+Left focus left -bindsym $mod+Down focus down -bindsym $mod+Up focus up -bindsym $mod+Right focus right - -# move focused window (h/j/k/l) -bindsym $mod+Shift+h move left -bindsym $mod+Shift+j move down -bindsym $mod+Shift+k move up -bindsym $mod+Shift+l move right - -# alternatively, you can use the cursor keys: -bindsym $mod+Shift+Left move left -bindsym $mod+Shift+Down move down -bindsym $mod+Shift+Up move up -bindsym $mod+Shift+Right move right - -# split in horizontal orientation -bindsym $mod+Shift+v split h -# split in vertical orientation -bindsym $mod+v split v - -# enter fullscreen mode for the focused container -bindsym $mod+f fullscreen - -# change container layout (stacked, tabbed, toggle split) -bindsym $mod+s layout stacking -bindsym $mod+w layout tabbed -bindsym $mod+e layout toggle split - -# toggle tiling / floating -bindsym $mod+Shift+space floating toggle - -# change focus between tiling / floating windows -bindsym $mod+space focus mode_toggle - -# focus the parent container -bindsym $mod+a focus parent - -# focus the child container -bindsym $mod+c focus child - -## scratchpad -# move the currently focused window to the scratchpad -bindsym $mod+Shift+minus move scratchpad -# Show the next scratchpad window or hide the focused scratchpad window. -# If there are multiple scratchpad windows, this command cycles through them. -bindsym $mod+minus scratchpad show - -# toggle whether to stick a window to the screen (regardless of workspaces) -bindsym $mod+Shift+s sticky toggle - -# reload the configuration file -bindsym $mod+Shift+c reload -# restart i3 inplace (preserves layout/session, can be used to upgrade i3) -bindsym $mod+Shift+r restart -# exit i3 (logs you out of your X session) -bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'" -###### key bindings ###### }}} - -###### i3 modes ###### {{{ -# resize window (you can also use the mouse for that) -mode "resize" { - # These bindings trigger as soon as you enter the resize mode - # Pressing left will shrink the window's width. - # Pressing right will grow the window's width. - # Pressing up will shrink the window's height. - # Pressing down will grow the window's height. - bindsym h resize shrink width 10 px or 10 ppt - bindsym j resize grow height 10 px or 10 ppt - bindsym k resize shrink height 10 px or 10 ppt - bindsym l resize grow width 10 px or 10 ppt - # same bindings, but for the arrow keys - bindsym Left resize shrink width 10 px or 10 ppt - bindsym Down resize grow height 10 px or 10 ppt - bindsym Up resize shrink height 10 px or 10 ppt - bindsym Right resize grow width 10 px or 10 ppt - # back to normal: Enter or Escape - bindsym Return mode "default" - bindsym Escape mode "default" -} -bindsym $mod+r mode "resize" - -# mode_system: prompt for lock, logout, suspend, shutdown, etc. -set $mode_system System (l) lock, (e) logout, (s) suspend, (r) reboot, (Shift+s) shutdown -mode "$mode_system" { - bindsym l exec --no-startup-id $i3_scripts/i3exit.sh lock, mode "default" - bindsym e exec --no-startup-id $i3_scripts/i3exit.sh logout, mode "default" - bindsym s exec --no-startup-id $i3_scripts/i3exit.sh suspend, mode "default" - bindsym r exec --no-startup-id $i3_scripts/i3exit.sh reboot, mode "default" - bindsym Shift+s exec --no-startup-id $i3_scripts/i3exit.sh shutdown, mode "default" - # back to normal: Enter or Escape - bindsym Return mode "default" - bindsym Escape mode "default" -} -bindsym $mod+Ctrl+Delete mode "$mode_system" -###### i3 modes ###### }}} - -###### application bindings ###### {{{ -## NOTE: (Mod4: Win) -## Some Mod4-keys binded for urxvt (~/.Xresources) -## Mod4-c, Mod4-v, Mod4-Shift-v -## Mod4-Escape, Mode4-s, Mod4-u - -## program launcher -#bindsym $mod+d exec --no-startup-id dmenu_run -#bindsym $mod+F2 exec --no-startup-id dmenu_run -# use 'rofi' instead of 'dmenu' -bindsym $mod+d exec --no-startup-id rofi -show run -bindsym $mod+F2 exec --no-startup-id rofi -show run -# `i3-dmenu-desktop' only displays applications with a .desktop file -bindsym $mod+p exec --no-startup-id i3-dmenu-desktop - -# lock screen (i3lock) -bindsym $mod+Ctrl+l exec --no-startup-id $i3_scripts/i3exit.sh lock -bindsym $sup+l exec --no-startup-id $i3_scripts/i3exit.sh lock -# turn off display -bindsym $mod+Ctrl+b exec --no-startup-id sleep 1 && xset dpms force off - -# screenshots -bindsym --release Print exec --no-startup-id scrot -e 'mv $f $shots_dir/' -bindsym --release $mod+Print exec --no-startup-id scrot -s -e 'mv $f $shots_dir/' - -# terminal -bindsym $sup+t exec urxvtc || urxvt || i3-sensible-terminal -bindsym $sup+Enter exec urxvtc || urxvt || i3-sensible-terminal -# file manager -bindsym $sup+f exec thunar -# web browser -bindsym $sup+w exec ~/bin/firefox || firefox - -## dropdown terminal -# auto start urxvt if closed -exec --no-startup-id "while true; do urxvt -name 'dropdown_term'; done" -#for_window [instance="dropdown_term"] floating enable, border 1pixel -#for_window [instance="dropdown_term"] move scratchpad; [instance="dropdown_term"] scratchpad show; resize shrink height 100px; resize grow width 626px; move position 1px 20px; move scratchpad -for_window [instance="dropdown_term"] floating enable, border 1pixel, resize shrink height 100px, resize grow width 626px, move position 1px 20px -for_window [instance="dropdown_term"] move scratchpad -bindsym $mod+backslash [instance="dropdown_term"] scratchpad show -###### applications bindings ###### }}} - -###### window control ###### {{{ -## floating -for_window [window_role="pop-up"] floating enable -for_window [window_role="bubble"] floating enable -for_window [window_role="task_dialog"] floating enable -for_window [window_role="Preferences"] floating enable - -for_window [window_type="dialog"] floating enable -for_window [window_type="menu"] floating enable - -for_window [class="(?i)Arandr"] floating enable -for_window [class="Xscreensaver-demo"] floating enable - -for_window [title="^XBindKey:.*Hit.*"] floating enable - -for_window [class="(?i)Xfce4-notifyd"] floating enable, border none - -# assign workspace for applications -assign [class="(?i)firefox"] $ws1 -###### window control ###### }}} - -###### i3bar ###### {{{ -bar { - #status_command i3status -c ~/.i3/i3status.conf - status_command i3blocks -c ~/.i3/i3blocks.conf - position top - # whether show the current binding mode indicator (default yes) - #binding_mode_indicator no - font pango:Terminus, WenQuanYi Bitmap Song, FontAwesome, 11 - tray_output primary - separator_symbol " " - # disable scroll on workspace buttons - bindsym button4 nop - bindsym button5 nop - # disable tray padding (default: 2) - tray_padding 0 - # display workspace of name "[n]:[NAME]" with only the "[NAME]" - strip_workspace_numbers yes - - colors { - statusline $white - background $black - separator $green - # BORDER BACKGROUND TEXT - focused_workspace $light_green $light_green $black - active_workspace $black $black $white - inactive_workspace $black $black $white - urgent_workspace $light_red $light_red $white - binding_mode $black $black $yellow - } -} -###### i3bar ###### }}} - -###### autostart ###### {{{ -## run applications on startup -## if need to run command when restarting i3, use `exec_always' -exec --no-startup-id xset b off -exec --no-startup-id xrdb -load ~/.Xresources -#exec --no-startup-id feh --bg-fill $i3_images/wallpaper.png -exec --no-startup-id sh ~/.fehbg -#exec --no-startup-id xcompmgr -exec --no-startup-id compton -b -exec --no-startup-id redshift -exec --no-startup-id xbindkeys -exec --no-startup-id urxvtd -q -o -f -exec --no-startup-id parcellite -exec --no-startup-id fcitx -exec --no-startup-id nm-applet -exec --no-startup-id xbacklight -set 80 -exec --no-startup-id xscreensaver -no-splash -exec --no-startup-id xfce4-power-manager -exec --no-startup-id mpd -###### autostart ###### }}} - -# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=conf: # diff --git a/.i3/i3blocks.conf b/.i3/i3blocks.conf deleted file mode 100644 index 28b79a6..0000000 --- a/.i3/i3blocks.conf +++ /dev/null @@ -1,101 +0,0 @@ -# -# i3blocks config file -# -# Aaron LI -# 2015-12-18 -# - - -# List of valid properties: -# -# align -# color -# command -# full_text -# instance -# interval -# label -# min_width -# name -# separator -# separator_block_width -# short_text -# signal -# urgent - -# Global properties -# -# The top properties below are applied to every block, but can be overridden. -# Each block command defaults to the script name to avoid boilerplate. -command=$SCRIPT_DIR/$BLOCK_NAME -separator_block_width=15 -markup=none - -# Volume indicator -# -# The first parameter sets the step (and units to display) -# The second parameter overrides the mixer selection -# See the script for details. -[volume] -label=VOL -#label=♪ -instance=Master -#instance=PCM -interval=once -signal=10 - -# Memory usage -# -# The type defaults to "mem" if the instance is not specified. -[memory] -label=MEM -separator=false -interval=30 - -# Network interface monitoring -# -# If the instance is not specified, use the interface used for default route. -# The address can be forced to IPv4 or IPv6 with -4 or -6 switches. -[iface] -#instance=wlan0 -color=#00FF00 -interval=10 -separator=false - -[wifi] -#instance=wlp3s0 -interval=10 -separator=false - -[bandwidth] -#instance=eth0 -interval=5 - -# CPU usage -# -# The script may be called with -w and -c switches to specify thresholds, -# see the script for details. -[cpu_usage] -label=CPU -interval=10 -min_width=CPU: 100.00% -#separator=false - -#[load_average] -#interval=10 - -# Battery indicator -# -# The battery instance defaults to 0. -[battery] -label=BAT -#label=⚡ -#instance=1 -interval=30 - -# Date Time -# -[time] -command=date '+%Y-%m-%d %H:%M:%S' -interval=5 - diff --git a/.i3/i3status.conf b/.i3/i3status.conf deleted file mode 100644 index 9a41923..0000000 --- a/.i3/i3status.conf +++ /dev/null @@ -1,76 +0,0 @@ -# ~/.i3status.conf -# i3status configuration file. -# see "man i3status" for documentation. - -# It is important that this file is edited as UTF-8. -# The following line should contain a sharp s: -# ß -# If the above line is not correctly displayed, fix your editor first! - -general { - colors = true - color_good = '#88b090' - color_degraded = '#ccdc90' - color_bad = '#e89393' - interval = 3 - # output format (i3bar|dzen2|xmobar|none) - output_format = 'i3bar' -} - -order += "volume master" -#order += "ipv6" -order += "disk /" -#order += "run_watch DHCP" -#order += "run_watch VPN" -#order += "wireless wlp3s0" -order += "ethernet eth0" -order += "battery 0" -order += "load" -order += "tztime local" - -volume master { - format = "%volume" - device = "default" - mixer = "Master" - mixer_idx = 0 -} - -#wireless wlp3s0 { -# #format_up = "W: (%quality at %essid) %ip" -# format_up = "%essid(%ip)" -# format_down = "down" -#} - -ethernet eth0 { - # if you use %speed, i3status requires root privileges - format_up = "E: %ip" - format_down = "E: down" -} - -battery 0 { - format = "%status %percentage %remaining" -} - -run_watch DHCP { - #pidfile = "/var/run/dhclient*.pid" - pidfile = "/var/run/dhcpd*.pid" -} - -run_watch VPN { - pidfile = "/var/run/vpnc/pid" -} - -tztime local { - #format = "%Y-%m-%d %H:%M:%S" - format = "%m-%d|%H:%M" -} - -load { - format = "%1min" -} - -disk "/" { - format = "%free" -} - -# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=conf: # diff --git a/.i3/images/wallpaper.png b/.i3/images/wallpaper.png deleted file mode 100644 index 468b1a9..0000000 Binary files a/.i3/images/wallpaper.png and /dev/null differ diff --git a/.i3/scripts/i3exit.sh b/.i3/scripts/i3exit.sh deleted file mode 100755 index 3616139..0000000 --- a/.i3/scripts/i3exit.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh -# -# exit script used in i3 wm -# - -PNG_IMAGE="~/.i3/images/wallpaper.png" - -lock() { - if [ -f ${PNG_IMAGE} ]; then - i3lock -d -ti "${PNG_IMAGE}" - else - i3lock -d -c 000000 - fi -} - -case "$1" in - lock) - lock - ;; - logout) - i3-msg exit - ;; - suspend) - lock - dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Suspend - ;; - hibernate) - lock - dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Hibernate - ;; - reboot) - dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart - ;; - shutdown) - dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop - ;; - *) - echo "Usage: $0 {lock|logout|suspend|hibernate|reboot|shutdown}" - exit 2 -esac - -exit 0 - diff --git a/.inputrc b/.inputrc deleted file mode 100644 index 7d93f5d..0000000 --- a/.inputrc +++ /dev/null @@ -1,30 +0,0 @@ -# -# ~/.inputrc -# -# readline configurations -# -# Reference: -# [1] ArchWiki - Readline -# https://wiki.archlinux.org/index.php/Readline -# -# Aaron LI -# 2015-09-26 -# - -#$include /etc/inputrc - -# vi mode -set editing-mode vi -$if mode=vi -set keymap vi-command -# these are for vi-command mode -"\e[A": history-search-backward -"\e[B": history-search-forward -set keymap vi-insert -# these are for vi-insert mode -"\e[A": history-search-backward -"\e[B": history-search-forward -$endif - - -# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=readline: # diff --git a/.lftp/rc b/.lftp/rc deleted file mode 100644 index 199415d..0000000 --- a/.lftp/rc +++ /dev/null @@ -1,112 +0,0 @@ -## -## lftp config file -## ~/.lftp/rc -## ~/.lftprc -## -## LIweitiaNux -## August 16, 2012 -## -## Ref: http://ihavanna.org/linux/225 -## - - -## debug -#debug 3 - -## character settings {{{ -set ftp:charset GBK -set sftp:charset UTF-8 -set file:charset UTF-8 -## charset }}} - -## alias {{{ -alias nocharset "set ftp:charset; set file:charset" -alias gbk "set ftp:charset GBK; set file:charset UTF-8" -alias utf8 "set ftp:charset UTF-8; set file:charset UTF-8" - -alias reconnect "close; cache flush; cd ." -alias passive "set ftp:passive-mode" -## alias }}} - -## settings {{{ -# history -set cmd:csh-history on - -# default protocol selection -set default-protocol/ftp.* ftp -set default-protocol/www.* http -set default-protocol/localhost file - -# passive mode -set ftp:passive-mode yes - -# pget -set pget:default-n 5 - -# makes lftp faster but doesn't work with some sites/routers -# set ftp:sync-mode off - -# ssl -set ftp:ssl-protect-data yes -#set ftp:ssl-allow no -#set ftp:ssl-force no -# for sites use ssl, but NOT purchase a proper SSL -# NOTE: Middle-man attacks -# Ref: http://rajaseelan.com/2011/12/18/lftp-fatal-error-certificate-verification-not-trusted/ -set ssl:verify-certificate no - -## settings }}} - -## appearance {{{ -# make prompt look better -# colors (contributed by Matthew ) -set prompt "\[\e[0;33m\][\[\e[0;34m\]f\[\e[1m\]t\[\e[37m\]p\[\e[0;33m\]] \[\e[1;32m\]\u\[\e[0;33m\]\@\[\e[1;31m\]\h\[\e[0;33m\]:\[\e[1;34m\]\w\[\e[0;33m\] >\[\e[0m\] " -# Uncomment the following two lines to make switch cls and ls, making -# cls the default. -alias ls command cls -alias hostls command 'ls --color' - -# Terminal strings to set titlebars for terminals that don't -# properly specify tsl and fsl capabilities. -# Use cmd:set-term-status to enable this. -set cmd:term-status/*screen* "\e_\T\e\\" -set cmd:term-status/*xterm* "\e[11;0]\e]2;\T\007\e[11]" -set cmd:term-status/*rxvt* "\e[11;0]\e]2;\T\007\e[11]" -set cmd:set-term-status on -## appearance }}} - -## proxy {{{ -# Proxy can help to pass a firewall -# Environment variables ftp_proxy, http_proxy and no_proxy are used to -# initialize the below variables automatically. You can set them here too. -# -# ftp:proxy must communicate with client over ftp protocol, squid won't do. -# This can be e.g. TIS-FWTK or rftpd. User and password are optional. -# set ftp:proxy ftp://[user:pass@]your_ftp_proxy:port -# ...but squid still can be used to access ftp servers, using hftp protocol: -# set ftp:proxy http://your.squid.address:port -# ...if squid allows CONNECT to arbitrary ports, then you can use CONNECT -# instead of hftp: -# set ftp:use-hftp no - -# no proxy for host -# set ftp:proxy/local_host "" -# or domain -# set ftp:proxy/*.domain.com ... - -# http:proxy must communicate with client over http protocol, e.g. squid. -# Default port is 3128. -# set http:proxy your_http_proxy[:port] -# hftp:proxy must also be an http proxy. It is used for FTP over HTTP access. -# set hftp:proxy your_http_proxy[:port] - -# net:no-proxy disables proxy usage for list of domains. -# set net:no-proxy .domain.com,.otherdom.net - -# If you don't have direct ftp access, this setting can be useful to select -# hftp instead of ftp automatically. -# set ftp:proxy http://your.http.proxy:port -## proxy }}} - - -# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=lftp: # diff --git a/.msmtprc b/.msmtprc deleted file mode 100644 index 9c08789..0000000 --- a/.msmtprc +++ /dev/null @@ -1,79 +0,0 @@ -## -## msmtp configuration -## ~/.msmtprc -## -## Weitian LI -## 2015/02/01 -## -## Reference: -## [1] ArchWiki - msmtp -## https://wiki.archlinux.org/index.php/Msmtp -## - -# SMTP: 25 -# SSL: 465 -# TLS: 587 - -### Set default values for all following accounts. -defaults -auth on -port 587 -tls on -tls_starttls on -tls_certcheck on -tls_trust_file ~/.offlineimap/ca-certificates.crt -logfile ~/.msmtp/msmtp.log - - -### Gmail - aaronly.me ### -account gmail-aly -host smtp.gmail.com -from aaronly.me@gmail.com -user aaronly.me@gmail.com -passwordeval gpg2 --quiet --for-your-eyes-only --no-tty --decrypt ~/.offlineimap/gmail-aly.gpg - - -### Outlook - aaronly.me ### -account outlook-aly -host smtp-mail.outlook.com -from aaronly.me@outlook.com -user aaronly.me@outlook.com -passwordeval gpg2 --quiet --for-your-eyes-only --no-tty --decrypt ~/.offlineimap/outlook-aly.gpg - - -### Outlook - liweitianux ### -account outlook-li -host smtp-mail.outlook.com -from liweitianux@live.com -user liweitianux@live.com -passwordeval gpg2 --quiet --for-your-eyes-only --no-tty --decrypt ~/.offlineimap/outlook-li.gpg - - -### SJTU - liweitianux ### -account sjtu -host smtp.sjtu.edu.cn -from liweitianux@sjtu.edu.cn -user liweitianux@sjtu.edu.cn -passwordeval gpg2 --quiet --for-your-eyes-only --no-tty --decrypt ~/.offlineimap/sjtu.gpg - - -### Gmail - liweitianux ### -account gmail-li -host smtp.gmail.com -from liweitianux@gmail.com -user liweitianux@gmail.com -passwordeval gpg2 --quiet --for-your-eyes-only --no-tty --decrypt ~/.offlineimap/gmail-li.gpg - - -### Autistici ### -account autistici -host smtp.autistici.org -tls_trust_file ~/.offlineimap/autistici_ca.crt -from liweitianux@autistici.org -user liweitianux@autistici.org -passwordeval gpg2 --quiet --for-your-eyes-only --no-tty --decrypt ~/.offlineimap/autistici.gpg - - -### Set the default account ### -account default : outlook-aly - diff --git a/.mutt/attachments b/.mutt/attachments deleted file mode 100644 index 74575de..0000000 --- a/.mutt/attachments +++ /dev/null @@ -1,64 +0,0 @@ -## -## Mutt attchment searching and counting configuration -## -## Weitian Li -## 2012/02/08 -## -## Ref: file:///usr/local/share/doc/mutt/html/mimesupport.html -## - -# Removing a pattern from a list removes that pattern literally. It -# does not remove any type matching the pattern. -# -# attachments +A */.* -# attachments +A image/jpeg -# unattachments +A */.* -# -# This leaves "attached" image/jpeg files on the allowed attachments -# list. It does not remove all items, as you might expect, because the -# second */.* is not a matching expression at this time. -# -# Remember: "unattachments" only undoes what "attachments" has done! -# It does not trigger any matching on actual messages. - -# Qualify any MIME part with an "attachment" disposition, EXCEPT for -# text/x-vcard and application/pgp parts. (PGP parts are already known -# to mutt, and can be searched for with ~g, ~G, and ~k.) -# -# I've added x-pkcs7 to this, since it functions (for S/MIME) -# analogously to PGP signature attachments. S/MIME isn't supported -# in a stock mutt build, but we can still treat it specially here. -# - -attachments +A */.* -attachments -A text/x-vcard application/pgp.* -attachments -A application/x-pkcs7-.* - - -# Discount all MIME parts with an "inline" disposition, unless they're -# text/plain. (Why inline a text/plain part unless it's external to the -# message flow?) - -attachments +I text/plain - - -# These two lines make Mutt qualify MIME containers. (So, for example, -# a message/rfc822 forward will count as an attachment.) The first -# line is unnecessary if you already have "attach-allow */.*", of -# course. These are off by default! The MIME elements contained -# within a message/* or multipart/* are still examined, even if the -# containers themselves don't qualify. - -#attachments +A message/.* multipart/.* -#attachments +I message/.* multipart/.* - - -## You probably don't really care to know about deleted attachments. -attachments -A message/external-body -attachments -I message/external-body - -## Then entering the command “attachments ?” as a command will list -## your current settings in Muttrc format, so that it can be pasted -## elsewhere. - -# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=muttrc: # diff --git a/.mutt/colors b/.mutt/colors deleted file mode 100644 index de2f902..0000000 --- a/.mutt/colors +++ /dev/null @@ -1,129 +0,0 @@ -## -## Color settings for mutt. -## -## Weitian LI -## 2015/02/02 -## -## Ref: http://aperiodic.net/phil/configs/mutt/colors -## - -# Default color definitions -color normal white default -color hdrdefault green default -color quoted green default -color quoted1 yellow default -color quoted2 blue default -color signature cyan default -color indicator brightwhite blue -color error brightred default -color status brightblue black -color tree brightmagenta default -color tilde blue default -color attachment brightyellow default -color markers brightblue default -color message white default -color search brightwhite magenta -color bold brightyellow default - -# Color definitions when on a mono screen -mono bold bold -mono underline underline -mono indicator reverse -mono error bold - -# Colors for items in the header -color header brightmagenta default "^(From|Subject):" -color header brightyellow default "^Date:" -color header brightblue default "^To:" -color header brightcyan default "^Cc:" -color header brightblue default "^X-Label:" -mono header bold "^(From|Subject):" - - -# Many of these formulas were stolen from Jeremy Blosser -# These would be much simpler if colors were additive. - -# regular new messages -color index brightwhite default "~N !~T !~F !~p !~P" -# regular tagged messages -color index brightcyan default "~T !~F !~p !~P" -# regular flagged messages -color index brightblue default "~F !~p !~P" -# messages to me -color index yellow default "~p !~N !~T !~F !~P" -color index brightblue default "~p ~N !~T !~F !~P" -color index black cyan "~p ~T !~F !~P" -color index black magenta "~p ~F !~P" -# messages from me -color index green default "~P !~N !~T !~F" -color index brightblue default "~P ~N !~T !~F" -color index black cyan "~P ~T !~F" -color index black magenta "~P ~F" -# messages which mention my name in the body -#color index yellow default "~b \"([Ww]eitian|[Aa]ly|ly)\" !~N !~T !~F !~p !~P" -#color index brightyellow white "~b \"([Ww]eitian|[Aa]ly|ly)\" ~N !~T !~F !~p !~P" -#color index yellow cyan "~b \"([Ww]eitian|[Aa]ly|ly)\" ~T !~F !~p !~P" -#color index yellow red "~b \"([Ww]eitian|[Aa]ly|ly)\" ~F !~p !~P" -# messages which are in reference to my mails -#color index magenta default "~x \"(liweitianux|aaronly.me)@\" !~N !~T !~F !~p !~P" -#color index magenta white "~x \"(liweitianux|aaronly.me)@\" ~N !~T !~F !~p !~P" -#color index magenta cyan "~x \"(liweitianux|aaronly.me)@\" ~T !~F !~p !~P" -#color index magenta blue "~x \"(liweitianux|aaronly.me)@\" ~F !~p !~P" -# messages to root, etc. -color index cyan default "~C \"(root|postmaster|abuse|mailer-daemon)@\" !~N !~P !~p" -color index cyan white "~C \"(root|postmaster|abuse|mailer-daemon)@\" ~N !~P !~p" -# big messages -color index red default "!~N ~z 10485760-" -color index red cyan "~T !~F !~p !~P ~z 10485760-" -color index red white "~N ~z 10485760-" - -# deleted messages -color index brightred default "!~N ~D" -color index brightred white "~N ~D" - - -## Highlights inside the body of a message. - -# Attribution lines -color body magenta default "\\* [^<]+ <[^>]+> \\[[^]]+\\]:" -color body magenta default "(^|[^[:alnum:]])on [a-z0-9 ,]+( at [a-z0-9:,. +-]+)? wrote:" - -# URLs -color body brightyellow default "([a-z][a-z0-9+-]*://(((([a-z0-9_.!~*'();:&=+$,-]|%[0-9a-f][0-9a-f])*@)?((([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?|[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)(:[0-9]+)?)|([a-z0-9_.!~*'()$,;:@&=+-]|%[0-9a-f][0-9a-f])+)(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?(#([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?|(www|ftp)\\.(([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?(:[0-9]+)?(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?(#([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?)[^].,:;!)? \t\r\n<>\"]" - -# email addresses -color body brightmagenta default "((@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\]),)*@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\]):)?[0-9a-z_.+%$-]+@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\])" - -# PGP messages -color body brightblue default "^gpg: Good signature .*" -color body white default "^gpg: " -color body brightwhite red "^gpg: BAD signature from.*" -mono body bold "^gpg: Good signature" -mono body bold "^gpg: BAD signature from.*" - -# *bold* -color body brightblue default "(^|[[:space:][:punct:]])\\*[^*]+\\*([[:space:][:punct:]]|$)" -mono body bold "(^|[[:space:][:punct:]])\\*[^*]+\\*([[:space:][:punct:]]|$)" -# _underline_ -color body brightblue default "(^|[[:space:][:punct:]])_[^_]+_([[:space:][:punct:]]|$)" -mono body underline "(^|[[:space:][:punct:]])_[^_]+_([[:space:][:punct:]]|$)" -# /italic/ (sometimes gets directory names) -color body brightblue default "(^|[[:space:][:punct:]])/[^/]+/([[:space:][:punct:]]|$)" -mono body underline "(^|[[:space:][:punct:]])/[^/]+/([[:space:][:punct:]]|$)" - -# Various smilies and the like -color body brightwhite default "<[Gg]>" # -color body brightwhite default "<[Bb][Gg]>" # -color body brightwhite default " [;:]-*[})>{(<|]" # :-) etc... - -# Border lines. -color body blue default "( *[-+=#*~_]){6,}" - -## Custom highlights -# arXiv number -color body brightyellow default "(^|[[:space:]])arXiv:[[:space:]0-9\.]+$" -# arXiv title -color body brightwhite default "(^|[[:space:]])Title:\ .+$" - - -# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=muttrc: # diff --git a/.mutt/compose.rc b/.mutt/compose.rc deleted file mode 100644 index f2645d8..0000000 --- a/.mutt/compose.rc +++ /dev/null @@ -1,15 +0,0 @@ -# read main config -source ~/.mutt/muttrc - -# remove hooks, headers and sig, they are already in the draft -unhook send-hook -unset signature -unmy_hdr * - -set edit_headers # show headers when composing - -# call the right editor immediately -set autoedit -set editor = "vim +/^$/+1 -c 'set ft=mail enc=utf-8 tw=72'" - -# vim: set ts=8 sw=4 tw=0 fenc= ft=muttrc: # diff --git a/.mutt/compose.sh b/.mutt/compose.sh deleted file mode 100755 index 9172421..0000000 --- a/.mutt/compose.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# -# Compose mail in new tmux/screen window. -# -# Reference: -# [1] Multi-window Mutt with Screen -# http://op-co.de/blog/posts/mulit-window_mutt/ -# - -# set the screen window title to the message receiver -#awk -F 'To: ' '/^To:/ { print "\033k" $2 "\033\\" }' "$1" - -mutt -F ~/.mutt/compose.rc -H "$1" -rm "$1" diff --git a/.mutt/excel2text.sh b/.mutt/excel2text.sh deleted file mode 100755 index c3d0f14..0000000 --- a/.mutt/excel2text.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# -# excel2text - convert MS Excel files to ASCII text -# -# Written by Gary Johnson . -# -# Modification History: -# 2003-02-19 -# Changed the name xlHtml to xlhtml to match the xlhtml-0.5 -# release. - -prog=${0##*/} - -if [ $# -ne 1 ] -then - echo "Usage: $prog file" >&2 - exit 2 -fi - -xlhtml -te "$1" | -perl -pe 's/>-{21,}
tags so - # that these lines adapt to the - # width of the cell. "21" is a - # value that works for the - # tables I'm sent. -w3m -dump -T text/html | -perl -pe ' - s/\xa0/ /gs; # Change A0 spaces to ASCII - # spaces. -' diff --git a/.mutt/gpg.rc b/.mutt/gpg.rc deleted file mode 100644 index e918768..0000000 --- a/.mutt/gpg.rc +++ /dev/null @@ -1,108 +0,0 @@ -## -## Mutt GPG configuration -## -*-muttrc-*- -## -## Weitian LI -## 2015/02/02 -## -## Reference: -## [1] A Quick Guide to Mutt #GPG -## http://srobb.net/mutt.html#GPG -## [2] Encrypting Mutt -## http://jasonwryan.com/blog/2013/07/20/gnupg/ -## - -# %p The empty string when no passphrase is needed, -# the string "PGPPASSFD=0" if one is needed. -# -# %f Most PGP commands operate on a single file or a file -# containing a message. %f expands to this file's name. -# -# %s When verifying signatures, there is another temporary file -# containing the detached signature. %s expands to this -# file's name. -# -# %a In "signing" contexts, this expands to the value of the -# configuration variable $pgp_sign_as. You probably need to -# use this within a conditional % sequence. -# -# %r In many contexts, mutt passes key IDs to pgp. %r expands to -# a list of key IDs. - -# Note that we explicitly set the comment armor header since GnuPG, -# when used in some localiaztion environments, generates 8bit data -# in that header, thereby breaking PGP/MIME. - -# Decode application/pgp -set pgp_decode_command="gpg2 --status-fd=2 %?p?--passphrase-fd 0? --no-verbose --quiet --batch --output - %f" - -# Verify a pgp/mime signature -set pgp_verify_command="gpg2 --status-fd=2 --no-verbose --quiet --batch --output - --verify %s %f" - -# Decrypt a pgp/mime attachment -set pgp_decrypt_command="gpg2 --status-fd=2 %?p?--passphrase-fd 0? --no-verbose --quiet --batch --output - %f" - -# Create a pgp/mime signed attachment -set pgp_sign_command="gpg2 --no-verbose --batch --quiet --output - %?p?--passphrase-fd 0? --armor --detach-sign --textmode %?a?-u %a? %f" - -# Create a application/pgp signed (old-style) message -set pgp_clearsign_command="gpg2 --no-verbose --batch --quiet --output - %?p?--passphrase-fd 0? --armor --textmode --clearsign %?a?-u %a? %f" - -# Create a pgp/mime encrypted attachment -set pgp_encrypt_only_command="pgpewrap gpg2 --batch --quiet --no-verbose --output - --encrypt --textmode --armor --always-trust -- -r %r -- %f" - -# Create a pgp/mime encrypted and signed attachment -set pgp_encrypt_sign_command="pgpewrap gpg2 %?p?--passphrase-fd 0? --batch --quiet --no-verbose --textmode --output - --encrypt --sign %?a?-u %a? --armor --always-trust -- -r %r -- %f" - -# Import a key into the public key ring -set pgp_import_command="gpg2 --no-verbose --import %f" - -# Export a key from the public key ring -set pgp_export_command="gpg2 --no-verbose --export --armor %r" - -# Verify a key -set pgp_verify_key_command="gpg2 --verbose --batch --fingerprint --check-sigs %r" - -# Read in the public key ring -set pgp_list_pubring_command="gpg2 --no-verbose --batch --quiet --with-colons --list-keys %r" - -# Read in the secret key ring -set pgp_list_secring_command="gpg2 --no-verbose --batch --quiet --with-colons --list-secret-keys %r" - -# Fetch keys -# set pgp_getkeys_command="pkspxycwrap %r" - -# Use gpg-agent -set pgp_use_gpg_agent - -# This set the number of seconds to keep in memory the passpharse -# used to encrypt/sign the more the less secure it will be -set pgp_timeout=1800 - -# Pattern for good signature - may need to be adapted to locale! -# -# It's a regexp used against the GPG output: if it matches some line of the output -# then mutt considers the message a good signed one (ignoring the GPG exit code) -set pgp_good_sign="^gpg: Good signature from" -# set pgp_good_sign="^gpgv?: Good signature from " -# OK, here's a version which uses gnupg's message catalog: -# set pgp_good_sign="`gettext -d gnupg -s 'Good signature from "' | tr -d '"'`" -# This version uses --status-fd messages -# set pgp_good_sign="^\\[GNUPG:\\] GOODSIG" - -# Automatically sign all outcoming messages -set crypt_autosign -# Sign only replies to signed messages -#set crypt_replysign - -# Automatically encrypt outcoming messages -#set crypt_autoencrypt -# Encrypt only replies to signed messages -set crypt_replyencrypt -# encrypt and sign replies to encrypted messages -#set crypt_replysignencrypted - -# Automatically verify the sign of a message when opened -set crypt_verify_sig - -# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=muttrc: # diff --git a/.mutt/mailcap b/.mutt/mailcap deleted file mode 100644 index ef8857c..0000000 --- a/.mutt/mailcap +++ /dev/null @@ -1,119 +0,0 @@ -# -# mailcap - MIME configuration file -# -# Reference: -# [1] Gray Johnson's Mutt Page -# http://www.spocom.com/users/gjohnson/mutt/ -# -# Modified: 2015/02/02 -# - - -# From the attachment menu, if X is running, HTML attachments are sent -# to netscape for viewing; otherwise, they are sent to w3m. For -# in-line viewing, the HTML is converted to text. -# -# [Comment-out next line so that we can use w3m even within X.] -#text/html; mutt_netscape %s; test=RunningX -text/html; w3m -T text/html -I %{charset} -dump %s; \ - nametemplate=%s.html; copiousoutput - -# Add capability to edit attachments from the compose menu. -# -# Mutt can only edit attachments if they have a mailcap edit entry. -# (This would be a good thing to fix.) However, a mailcap entry -# apparently must include the display function--it can't be defaulted. -# The combination "cat; copiousoutput" comes close to the default in -# that in invokes the default pager on the output of cat. However, -# there is apparently no way to specify the default editor--a shell -# environment variable such as $VISUAL or $EDITOR is as close as we can -# get. -# -text/plain; ~/.mutt/mutt_bgrun.sh gvim -f %s; \ - test=sh -c 'test -n "${DISPLAY}"' -text/plain; vim %s -text/*; cat; copiousoutput; edit=$EDITOR %s - -message/rfc822; cat; copiousoutput; edit=$EDITOR %s - -# The following Microsoft application MIME attachments are viewed from -# the attachment menu using LibreOffice. -# -application/msword; ~/.mutt/mutt_bgrun.sh libreoffice %s; \ - test=sh -c 'test -n "${DISPLAY}"' -application/msword; word2text %s; copiousoutput -application/vnd.msword; ~/.mutt/mutt_bgrun.sh libreoffice %s; \ - test=sh -c 'test -n "${DISPLAY}"' -application/vnd.msword; word2text %s; copiousoutput -application/vnd.openxmlformats-officedocument.wordprocessingml.document; \ - ~/.mutt/mutt_bgrun.sh libreoffice %s; \ - test=sh -c 'test -n "${DISPLAY}"' -# -application/excel; ~/.mutt/mutt_bgrun.sh libreoffice %s; \ - test=sh -c 'test -n "${DISPLAY}"' -application/excel; excel2text %s; copiousoutput -application/msexcel; ~/.mutt/mutt_bgrun.sh libreoffice %s; \ - test=sh -c 'test -n "${DISPLAY}"' -application/msexcel; excel2text %s; copiousoutput -application/vnd.ms-excel; ~/.mutt/mutt_bgrun.sh libreoffice %s; \ - test=sh -c 'test -n "${DISPLAY}"' -application/vnd.ms-excel; excel2text %s; copiousoutput -application/x-excel; ~/.mutt/mutt_bgrun.sh libreoffice %s; \ - test=sh -c 'test -n "${DISPLAY}"' -application/x-excel; excel2text %s; copiousoutput -application/x-msexcel; ~/.mutt/mutt_bgrun.sh libreoffice %s; \ - test=sh -c 'test -n "${DISPLAY}"' -application/x-msexcel; excel2text %s; copiousoutput -application/ms-Excel; ~/.mutt/mutt_bgrun.sh libreoffice %s; \ - test=sh -c 'test -n "${DISPLAY}"' -application/ms-Excel; excel2text %s; copiousoutput -# -application/vnd.ms-powerpoint; ~/.mutt/mutt_bgrun.sh libreoffice %s; \ - test=sh -c 'test -n "${DISPLAY}"' -application/vnd.ms-powerpoint; ppt2text %s; copiousoutput -application/x-mspowerpoint; ~/.mutt/mutt_bgrun.sh libreoffice %s; \ - test=sh -c 'test -n "${DISPLAY}"' -application/x-mspowerpoint; ppt2text %s; copiousoutput -application/ppt; ~/.mutt/mutt_bgrun.sh libreoffice %s; \ - test=sh -c 'test -n "${DISPLAY}"' -application/ppt; ppt2text %s; copiousoutput - - -application/pdf; ~/.mutt/mutt_bgrun.sh evince %s; \ - test=sh -c 'test -n "${DISPLAY}"' -application/pdf; pdftotext %s -; copiousoutput - -application/postscript; ~/.mutt/mutt_bgrun.sh evince %s; \ - test=sh -c 'test -n "${DISPLAY}"' -application/postscript; ps2ascii %s; copiousoutput - -application/rtf; ~/.mutt/mutt_bgrun.sh libreoffice %s; \ - test=sh -c 'test -n "${DISPLAY}"' -application/rtf; rtf2text %s; copiousoutput - -#application/ms-tnef; tnef -w %s - -#application/octet-stream; mutt_octet_view -x %s; test=RunningX -#application/octet-stream; mutt_octet_view -v %s -#application/octet-stream; mutt_octet_view %s; copiousoutput - -image/*; ~/.mutt/mutt_bgrun.sh feh %s; \ - test=sh -c 'test -n "${DISPLAY}"' - -video/*; ~/.mutt/mutt_bgrun.sh vlc %s; \ - test=sh -c 'test -n "${DISPLAY}"' - -# Open scripts -application/x-shellscript; ~/.mutt/mutt_bgrun.sh gvim -f %s; \ - test=sh -c 'test -n "${DISPLAY}"' -application/x-shellscript; vim %s - -# Show archive conents. -# -application/x-compressed-tar; tar -tf %s; copiousoutput -application/x-bzip-compressed-tar; \ - bunzip2 -c %s | tar -tf -; copiousoutput -application/x-tar-gz; gunzip -c %s | tar -tf -; copiousoutput -application/x-7z-compressed; 7z l %s; copiousoutput - -# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=mailcap: # diff --git a/.mutt/mailinglists b/.mutt/mailinglists deleted file mode 100644 index 0732d11..0000000 --- a/.mutt/mailinglists +++ /dev/null @@ -1,19 +0,0 @@ -## -## Mailing lists management -## -## Weitian LI -## 2015/02/02 -## - -## lists -lists no-reply@arxiv.org -lists rabble@arxiv.org - -## subscribe -subscribe freebsd-current@freebsd.org -subscribe current@freebsd.org -subscribe freebsd-x11@freebsd.org -subscribe tech@openbsd.org -subscribe misc@openbsd.org - -# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=muttrc: # diff --git a/.mutt/mutt-notmuch.py b/.mutt/mutt-notmuch.py deleted file mode 100755 index 880b987..0000000 --- a/.mutt/mutt-notmuch.py +++ /dev/null @@ -1,120 +0,0 @@ -#!/usr/bin/env python3 -""" -mutt-notmuch-py - -This is a Gmail-only version of the original mutt-notmuch script. - -It will interactively ask you for a search query and then symlink the matching -messages to $HOME/.cache/mutt_results. - -Add this to your muttrc. - -macro index / "unset wait_keymutt-notmuch-py~/.cache/mutt_results" \ - "search mail (using notmuch)" - -This script overrides the $HOME/.cache/mutt_results each time you run a query. - -Install this by adding this file somewhere on your PATH. - -Tested on OSX Lion and Arch Linux. - -(c) 2012 - Honza Pokorny -Licensed under BSD -""" - -""" -ChangeLogs: -2015/02/02: Weitian LI - * replaced 'commands.getoutput' with 'subprocess' - * replaced 'raw_input' with 'input' - * fixed digest() with an Unicode encoding bug - * updated to use python 3.x -""" - -import os -import hashlib -import subprocess - -from mailbox import Maildir -from optparse import OptionParser -from collections import defaultdict - - -def digest(filename): - # Require python 3.x - with open(filename) as f: - return hashlib.sha1(f.read().encode('utf-8')).hexdigest() - - -def pick_all_mail(messages): - for m in messages: - if 'All Mail' in m: - return m - - -def empty_dir(directory): - box = Maildir(directory) - box.clear() - - -def command(cmd): - return subprocess.check_output(cmd, shell=True) - - -def main(dest_box, is_gmail): - query = input('Query: ') - - command('test -d %s/cur || mkdir -p %s/cur' % (dest_box, dest_box)) - command('test -d %s/new || mkdir -p %s/new' % (dest_box, dest_box)) - - empty_dir(dest_box) - - output = command('notmuch search --output=files %s' % query) - files = output.decode(encoding='UTF-8').split('\n') - - data = defaultdict(list) - messages = [] - - for f in files: - if not f: - continue - - try: - sha = digest(f) - data[sha].append(f) - except IOError: - print('File %s does not exist' % f) - - for sha in data: - if is_gmail and len(data[sha]) > 1: - messages.append(pick_all_mail(data[sha])) - else: - messages.append(data[sha][0]) - - for m in messages: - if not m: - continue - - target = os.path.join(dest_box, 'cur', os.path.basename(m)) - if not os.path.exists(target): - os.symlink(m, target) - - -if __name__ == '__main__': - p = OptionParser("usage: %prog [OPTIONS] [RESULTDIR]") - p.add_option('-g', '--gmail', dest='gmail', - action='store_true', default=True, - help='gmail-specific behavior') - p.add_option('-G', '--not-gmail', dest='gmail', - action='store_false', - help='gmail-specific behavior') - (options, args) = p.parse_args() - - if args: - dest = args[0] - else: - dest = '~/.cache/mutt_results' - - # Use expanduser() so that os.symlink() won't get weirded out by tildes. - main(os.path.expanduser(dest).rstrip('/'), options.gmail) - diff --git a/.mutt/mutt-xlabel.py b/.mutt/mutt-xlabel.py deleted file mode 100755 index ea96e37..0000000 --- a/.mutt/mutt-xlabel.py +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/bin/env python3 -# -# Add/Modify 'X-Label' header for mutt. -# Label mails with mutt. -# -# Reference: -# [1] GTD (Getting Things Done) and Mutt -# https://docwhat.org/gtd-and-mutt/ -# -# muttrc settings: -# unignore X-Label: -# macro index,pager x 'set my_oldeditor=$editorset editor="~/.mutt/mutt-xlabel.py"Nset editor=$my_oldeditor' \ -# "edit X-Label" -# macro index \Cx "~y " \ -# "limit view to label" -# -# Weitian LI -# 2015/02/06 -# - -import sys -import os -import email -import readline - - -# Settings -HISTFILE = os.path.join(os.environ["HOME"], ".mutt/xlabel_history") -LABELFILE = os.path.join(os.environ["HOME"], ".mutt/xlabels") - - -class MyCompleter(object): - """ - Comstom completer for readline. - - Reference: - [1] autocomplete - How to code autocompletion in python? - http://stackoverflow.com/a/7821956 - """ - def __init__(self, options): - self.options = sorted(options) - - def complete(self, text, state): - if state == 0: # on first trigger, build possible matches - if text: # cache matches (entries that start with entered text) - self.matches = [s for s in self.options - if s and s.startswith(text)] - else: # no text entered, all matches possible - self.matches = self.options[:] - - # return match indexed by state - try: - return self.matches[state] - except IndexError: - return None - - -def my_input(prompt, default=None, completer=None): - if default is not None: - def pre_input_hook(): - readline.insert_text(default) - readline.redisplay() - readline.set_pre_input_hook(pre_input_hook) - # completer - if completer: - readline.set_completer(completer) - readline.parse_and_bind('tab: complete') - return input(prompt) - - -def load_labels(labelfile): - """ - Load saved labels from given labelfile, - return a list of labels. - """ - try: - with open(labelfile, 'r') as f: - label_list = f.read().split() - label_list = list(set(label_list)) - except FileNotFoundError: - label_list = [] - return label_list - - -def update_labels(labelfile, label_list, new_label_list): - """ - Save labels for later autocompletion. - """ - labels = sorted(list(set(label_list).union(set(new_label_list)))) - with open(labelfile, 'w') as f: - f.write(' '.join(labels)) - - -def get_xlabel(message): - """ - Get 'X-Label:' values from given Message object. - """ - labels = message.get_all('X-Label') - if labels: - label_str = ' '.join(labels) - else: - label_str = '' - # remove duplicates and sort - label_list = sorted(list(set(label_str.split()))) - return label_list - - -def write_xlabel(message, old_label_list, new_label_list, outfile): - """ - Update 'X-Label' value of given Message object; - then write Message object to outfile. - """ - # remove duplicates and sort - new_label_list = sorted(list(set(new_label_list))) - if set(old_label_list) != set(new_label_list): - # delete original 'X-Label' header (all occurences) - del message['X-Label'] - # add new 'X-Label' header - message['X-Label'] = ' '.join(new_label_list) - # write to outfile (Just OVERWRITE, OK??) - fp_out = open(outfile, 'w') - fp_out.write(message.as_string()) - fp_out.close() - - -def main(): - if len(sys.argv) != 2 and len(sys.argv) != 3: - print("Usage: %s [ outmail ]" % sys.argv[0]) - sys.exit(1) - - inmail = sys.argv[1] - if len(sys.argv) == 3: - outmail = sys.argv[2] - else: - outmail = inmail - - if hasattr(readline, 'read_history_file'): - try: - readline.read_history_file(HISTFILE) - except IOError: - pass - - # get all recorded labels for readline autocompletion - all_labels = load_labels(LABELFILE) - completer = MyCompleter(all_labels) - - # open mail and create email.message.Message object - msg = email.message_from_file(open(inmail, 'r')) - # get original labels - label_list = get_xlabel(msg) - # get user provided labels - new_label = my_input(prompt='X-Label: ', default=' '.join(label_list), - completer=completer.complete) - # write new labels to mail - write_xlabel(msg, label_list, new_label.split(), outmail) - # save readline history - readline.write_history_file(HISTFILE) - # save labels - update_labels(LABELFILE, all_labels, new_label.split()) - - -if "__main__" == __name__: - main() - diff --git a/.mutt/mutt_bgrun.sh b/.mutt/mutt_bgrun.sh deleted file mode 100755 index 0b2c651..0000000 --- a/.mutt/mutt_bgrun.sh +++ /dev/null @@ -1,118 +0,0 @@ -#!/bin/sh -# @(#) mutt_bgrun $Revision: 1.4 $ - -# mutt_bgrun - run an attachment viewer from mutt in the background -# Copyright (C) 1999-2002 Gary A. Johnson -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -# SYNOPSIS -# mutt_bgrun viewer [viewer options] file -# -# DESCRIPTION -# Mutt invokes external attachment viewers by writing the -# attachment to a temporary file, executing the pipeline specified -# for that attachment type in the mailcap file, waiting for the -# pipeline to terminate, writing nulls over the temporary file, -# then deleting it. This causes problems when using graphical -# viewers such as qvpview and acroread to view attachments. -# -# If qvpview, for example, is executed in the foreground, the mutt -# user interface is hung until qvpview exits, so the user can't do -# anything else with mutt until he or she finishes reading the -# attachment and exits qvpview. This is especially annoying when -# a message contains several MS Office attachments--one would like -# to have them all open at once. -# -# If qvpview is executed in the background, it must be given -# enough time to completely read the file before returning control -# to mutt, since mutt will then obliterate the file. Qvpview is -# so slow that this time can exceed 20 seconds, and the bound is -# unknown. So this is again annoying. -# -# The solution provided here is to invoke the specified viewer -# from this script after first copying mutt's temporary file to -# another temporary file. This script can then quickly return -# control to mutt while the viewer can take as much time as it -# needs to read and render the attachment. -# -# EXAMPLE -# To use qvpview to view MS Office attachments from mutt, add the -# following lines to mutt's mailcap file. -# -# application/msword; mutt_bgrun qvpview %s -# application/vnd.ms-excel; mutt_bgrun qvpview %s -# application/vnd.ms-powerpoint; mutt_bgrun qvpview %s -# -# AUTHOR -# Gary A. Johnson -# -# -# ACKNOWLEDGEMENTS -# My thanks to the people who have commented on this script and -# offered solutions to shortcomings and bugs, especially Edmund -# GRIMLEY EVANS and Andreas Somogyi -# . - -prog=${0##*/} - -# Check the arguments first. - -if [ "$#" -lt "2" ] -then - echo "usage: $prog viewer [viewer options] file" >&2 - exit 1 -fi - -# Separate the arguments. Assume the first is the viewer, the last is -# the file, and all in between are options to the viewer. - -viewer="$1" -shift - -while [ "$#" -gt "1" ] -do - options="$options $1" - shift -done - -file="$1" - -# Create a temporary directory for our copy of the temporary file. -# -# This is more secure than creating a temporary file in an existing -# directory. - -tmpdir=/tmp/$LOGNAME$$ -umask 077 -mkdir "$tmpdir" || exit 1 -tmpfile="$tmpdir/${file##*/}" -#echo "file: ${file}" > ~/debug.$$.log -#echo "tmpfile: ${tmpfile}" >> ~/debug.$$.log - -# Copy mutt's temporary file to our temporary directory so that we can -# let mutt overwrite and delete it when we exit. - -cp "$file" "$tmpfile" - -# Run the viewer in the background and delete the temporary files when done. - -( - "$viewer" $options "$tmpfile" > /dev/null 2>&1 - rm -f "$tmpfile" - rmdir "$tmpdir" -) & - -# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=sh: # diff --git a/.mutt/mutt_octet_view.sh b/.mutt/mutt_octet_view.sh deleted file mode 100755 index a1e6c6f..0000000 --- a/.mutt/mutt_octet_view.sh +++ /dev/null @@ -1,278 +0,0 @@ -#!/bin/sh -# @(#) mutt_octet_view $Revision: 1.1 $ - -# mutt_octet_view - select octet-stream e-mail attachment viewer -# Copyright (C) 1997,1998,1999,2000 David A Pearson -# Copyright (C) 2000-2001 Gary A. Johnson -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -# Mutt_octet_view is derived from Dave Pearson's mutt.octet.filter -# script (http://www.hagbard.demon.co.uk/archives/mutt.octet.filter). -# Mutt.octet.filter was designed to convert octet-stream e-mail -# attachments to text for use with mutt's auto_view feature. -# Mutt_octet_view extends this capability to use different viewers from -# mutt's attachment menu, including graphical viewers if X is available. -# -# To use mutt_octet_view, put the following lines in your mailcap file: -# -# application/octet-stream; mutt_octet_view -x %s; test=RunningX -# application/octet-stream; mutt_octet_view -v %s -# application/octet-stream; mutt_octet_view %s; copiousoutput -# -# and the following line in your muttrc file: -# -# auto_view application/octet-stream -# -# Mutt_octet_view is not a viewer itself; it only selects external -# viewers based on the attachments' file name suffixes (extensions). -# In addition to any viewers, you will need a copy of the author's -# mutt_bgrun script in order to run X viewers in the background. -# -# Please direct any comments to: -# -# Gary Johnson -# - - -ShowTAR() -{ - tar tvvf "$1" 2> /dev/null -} - -ShowTGZ() -{ - tar tzvvf "$1" 2> /dev/null -} - -ShowTBZ() -{ - bzip2 -dc "$1" | tar -tvv -f- 2> /dev/null -} - -ShowGZIP() -{ - gzip -dc "$1" 2> /dev/null -} - -ShowZIP() -{ - unzip -l "$1" 2> /dev/null -} - -ShowARJ() -{ - unarj l "$1" 2> /dev/null -} - -ShowVCard() -{ - cat "$1" | mutt.vcard.filter -} - -ShowTIF() -{ - tiffinfo "$1" -} - -ShowObject() -{ - nm "$1" -} - -ShowHTML() -{ - w3m -dump "$1" -} - -ShowPDF() -{ - pdftotext "$1" - -} - -Show() -{ - case "$Mode" in - SHOW) - if [ "$2" ] - then - $2 "$1" - elif [ "$3" -o "$4" ] - then - echo "[-- $Prog: file type is unsupported for autoview (use 'v' to view this part) --]" - else - echo "[-- $Prog: file type is unsupported --]" - fi - ;; - VIEW) - if [ "$3" ] - then - $3 "$1" - elif [ "$2" ] - then - $2 "$1" - else - echo "$Prog: file type is unsupported" >&2 - exit 1 - fi - ;; - XVIEW) - if [ "$4" ] - then - mutt_bgrun $4 "$1" || $4 "$1" - elif [ "$3" ] - then - $3 "$1" - elif [ "$2" ] - then - $2 "$1" - else - echo "$Prog: file type is unsupported" >&2 - exit 1 - fi - ;; - *) echo "$Prog: internal error: invalid Mode $Mode" >&2 - exit 2;; - esac -} - -# Initialize variables - -Prog=$(basename "$0") -Mode=SHOW - -# Check option arguments - -while [ $# -gt 0 ] -do - case "$1" in - -t) Mode=SHOW; shift;; - -v) Mode=VIEW; shift;; - -x) Mode=XVIEW; shift;; - -*) echo "$Prog: invalid option $1" >&2; exit 2;; - *) break;; - esac -done - -# Check file argument - -if [ $# -ne 1 ] -then - echo "usage: $Prog [-t|-v|-x] file" - exit 2 -fi - -File=$1 - -# Process file - -# The behavior of mutt_octet_view is governed primarily by the 'Show' -# function, the option argument, and the table below. 'Show' searches -# its arguments for a command that it can use to display File. It -# begins in the table column specified by the option argument -t (the -# default), -v or -x, and searches to the left until it finds a command -# (non-empty string), which it executes. Commands in the right-most -# column are executed in the background and are left to handle their own -# output. Commands in the other two columns are executed in the -# foreground and send their output to stdout. -# -# Here are some examples. -# -# Autoview Text View X View -# (from (from (from -# index attachment attachment -# menu, menu, menu, -# in-line) foreground) background) -# (-t) (-v) (-x) -# ----------- ----------- ----------- -# Func1 "" "" Func1 will be used to display -# file in all cases. This is -# useful when all that is -# required to display the file is -# a simple text transformation. -# -# "" Func2 "" The file will not be displayed -# in the pager output from the -# index menu. Func2 will be used -# to display the file from the -# attachment menu. This is -# useful when the file is to be -# displayed as text, but is not -# normally desired to view it -# along with the rest of the -# message. -# -# "" "" Func3 The file contains graphical -# material that cannot be viewed -# as text. Func3 will be used to -# display the file only from the -# attachment menu and only when X is -# available. Func3 will be run in -# the background so that the user -# can continue to use the mailer -# while the file is displayed. -# -# "" Func2 Func3 The file contents are not -# displayed in-line along with -# the rest of the message because -# the file is typically large. -# Func2 has only text output and -# is used when only a terminal is -# available for output. Func3 -# produces a nicer display when X -# is available. - -case "$File" in - # Autoview Text View X View - # (from (from (from - # index attachment attachment - # menu, menu, menu, - # in-line) foreground) background) - # (-t) (-v) (-x) - # ----------- ----------- ------------- -*.arj | *.ARJ ) Show "$File" "" ShowARJ "" ;; -*.doc | *.DOC ) Show "$File" word2text word2text qvpview ;; -*.gif | *.GIF ) Show "$File" "" "" xv ;; -*.htm | *.HTM ) Show "$File" ShowHTML w3m mutt_netscape ;; -*.html | *.HTML ) Show "$File" ShowHTML w3m mutt_netscape ;; -*.jpeg | *.JPEG ) Show "$File" "" "" xv ;; -*.jpg | *.JPG ) Show "$File" "" "" xv ;; -*.log | *.LOG ) Show "$File" cat less "" ;; -*.o ) Show "$File" "" ShowObject "" ;; -*.pdf | *.PDF ) Show "$File" "" ShowPDF acroread ;; -*.ppt | *.PPT ) Show "$File" "" "" qvpview ;; -*.ps | *.PS ) Show "$File" "" "" ghostview ;; -*.rtf | *.RTF ) Show "$File" "" rtf2text qvpview ;; -*.tar ) Show "$File" "" ShowTAR "" ;; -*.tar.bz2 ) Show "$File" "" ShowTBZ "" ;; -*.tar.gz ) Show "$File" "" ShowTGZ "" ;; -*.tar.Z ) Show "$File" "" ShowTGZ "" ;; -*.tar.z ) Show "$File" "" ShowTGZ "" ;; -*.tbz2 ) Show "$File" "" ShowTBZ "" ;; -*.tgz ) Show "$File" "" ShowTGZ "" ;; -*.tif | *.TIF ) Show "$File" "" ShowTIF xv ;; -*.txt | *.TXT ) Show "$File" cat less "" ;; -*.url | *.URL ) Show "$File" cat w3m "" ;; -*.vcf ) Show "$File" "" ShowVCard "" ;; -*.xls | *.XLS ) Show "$File" excel2text excel2text qvpview ;; -*.Z ) Show "$File" "" ShowGZIP "" ;; -*.z ) Show "$File" "" ShowGZIP "" ;; -*.zip | *.ZIP ) Show "$File" "" ShowZIP "" ;; -*.gz ) Show "$File" "" ShowGZIP "" ;; - # The *.gz entry must follow any other entries ending in - # .gz. -* ) echo "$Prog: file type is unsupported" >&2; exit 1 ;; - -esac diff --git a/.mutt/muttrc b/.mutt/muttrc deleted file mode 100644 index 6b369bb..0000000 --- a/.mutt/muttrc +++ /dev/null @@ -1,251 +0,0 @@ -## -## Mutt configuration -## -## Weitian LI -## 2015/02/02 -## -## Reference: -## [1] The Homely Mutt -## http://stevelosh.com/blog/2012/10/the-homely-mutt/ -## [2] Mutt + offlineimap + notmuch + nottoomuch -## http://blog.tshirtman.fr/2013/3/17/mutt-offlineimap-notmuch-nottoomuch -## [3] ArchWiki - Mutt -## https://wiki.archlinux.org/index.php/Mutt -## [4] Using Two IMAP Accounts in Mutt -## http://pbrisbin.com/posts/two_accounts_in_mutt -## [5] The Mutt E-Mail Client -## http://www.mutt.org/doc/devel/manual.html -## [6] A Quick Guide to Mutt -## http://srobb.net/mutt.html -## [7] Multi-window Mutt with Screen -## http://op-co.de/blog/posts/mulit-window_mutt/ -## [8] Github - proycon/dotfiles - mutt with tmux -## https://github.com/proycon/dotfiles -## - -### Mail boxes -source ~/.mutt/mailboxes # Generated by OfflineIMAP - -### Mail accounts -folder-hook . source ~/.mutt/accounts/default -folder-hook 'gmail-aly.*' source ~/.mutt/accounts/gmail-aly -folder-hook 'gmail-li.*' source ~/.mutt/accounts/gmail-li -folder-hook 'outlook-aly.*' source ~/.mutt/accounts/outlook-aly -folder-hook 'outlook-li.*' source ~/.mutt/accounts/outlook-li -folder-hook 'sjtu.*' source ~/.mutt/accounts/sjtu -folder-hook 'autistici.*' source ~/.mutt/accounts/autistici -# Default account -source ~/.mutt/accounts/default - -### Files and directories -set alias_file = ~/.mutt/aliases -set certificate_file = ~/.mutt/certificates -set mailcap_path = ~/.mutt/mailcap -set history_file = ~/.mutt/history -set header_cache = ~/.mutt/cache/headers -set message_cachedir = ~/.mutt/cache/bodies -set tmpdir = ~/.mutt/tmp - -### General settings -set mbox_type = Maildir -set folder = ~/Mail -set timeout = 3 -set mail_check = 0 -set beep_new -set wrap_search # searches wrap around the end -set copy # always save a copy of outgoing messages -set delete # purge deleted messages without asking -set use_from # always generate the `From:' header field -set quit = ask-no # ask for confirmation when quit mutt -set history = 256 -set save_history = 256 -set sendmail_wait = 0 # Wait forever for sendmail to finish -unset wait_key -unset move -unset confirmappend -unset mark_old - -### Compose view -set editor = "vim +/^$/+1 -c 'set ft=mail enc=utf-8 tw=72'" -set envelope_from # which from? -set sig_dashes # dashes before my 'signature' -set autoedit # go to the editor right away when composing - # set, cannot use 'send-hooks' depend on recipients -set edit_headers # show headers when composing -set askcc # ask for CC: -set fcc_attach # save attachments with the body -set forward_format = "Fwd: %s" -set forward_quote # include message in forwards -set forward_decode # decode when forwarding -set attribution = "On %d, %n wrote:" -set fast_reply # skip to compose when replying -set reply_to # reply to 'Reply to:' field -set reverse_name # reply as whomever it was to -set include # include message in replies -#set postpone # auto postpone message not sent when exit -#set recall # prompt to recall postponed messages -unset mime_forward # forward attachments as part of body - -### Headers -ignore * -unignore from: to: cc: bcc: date: subject: X-Label: -unhdr_order * -hdr_order from: to: cc: date: subject: X-Label: - -### Encoding -set send_charset = "us-ascii:utf-8" -# if no charset given on incoming messages -set assumed_charset = "iso-8859-1:gb2312:gbk:gb18030:utf-8" -set rfc2047_parameters # to fix attachment filename encoding - -### Index view -# first bang ("!") to expand month week names in the C locale -set date_format = "!%a %m/%d %I:%M" -set index_format = "[%Z] %d %2M %-15.15L %4c%?X?[%X]& ? %s" -set folder_format = "%2C %t %N %8s %f" -set sort = threads -set sort_aux = reverse-last-date-received -set uncollapse_jump # don't collapse on an unread message -set sort_re # thread based on regex -set reply_regexp = "^(([Rr][Ee]?(\[[0-9]+\])?: *)?(\[[^]]+\] *)?)*" - -### Status bar -set status_chars = " *%A" -set status_format = "---[ Folder: %f %r ]---[ Msgs:%?M?%M/?%m%?n? New:%n?%?o? Old:%o?%?d? Del:%d?%?F? Flag:%F?%?t? Tag:%t?%?p? Post:%p?%?b? Inc:%b?%?l? %l? ]---%>-(%P)---" - -### Pager -set pager_format = "[%Z] %C/%m: %-20.20n | %s%* -- (%P)" -set pager_index_lines = 8 # number of index lines to show -set pager_context = 8 # number of context lines to show -set pager_stop # don't go to next message automatically -set menu_scroll # scroll in menus -set smart_wrap # don't split words -set tilde # show tildes like in vim -set quote_regexp = "^( {0,4}[>|:#%]| {0,4}[a-z0-9]+[>|]+)+" -unset markers # no ugly '+' signs for wrapped lines -alternative_order text/plain text/enriched text/html - -### Key bindings -bind index i noop -bind index collapse-thread -bind index p recall-message -bind index K previous-unread -bind index J next-unread -bind index,browser gg first-entry -bind index,browser G last-entry -#bind index,pager D delete-message -bind index,pager R group-reply -bind index,pager N search-opposite -bind index,pager \# noop -bind index,pager sync-mailbox -bind pager i exit -bind pager / search -bind pager previous-line -bind pager next-line -bind pager k previous-line -bind pager j next-line -bind pager gg top -bind pager G bottom -bind pager K previous-undeleted -bind pager J next-undeleted -bind pager \Cj next-unread -bind attach view-mailcap -bind compose p pgp-menu -bind editor complete-query -bind editor ^T complete - -### Macros -macro index q "?" \ - "Leaves Index to folder list" -macro index \Cr "N" \ - "mark tagged messages as read" -macro index C "?" \ - "copy a message to a mailbox" -macro index S "?" \ - "copy a message to a mailbox" -macro index B "~b " \ - "search message bodies" -macro index I "!" \ - "go to Inbox" -# Save a decoded copy in ~/ -macro index,pager > "cat > ~/" \ - "save message as" -# Open in vim -macro index,pager V "vim -c 'setlocal ft=mail buftype=nofile' -" \ - "open in vim" -# Sync mails with offlineimap -macro index,browser Z "offlineimap -o -u ttyui" \ - "offlineimap sync ..." -macro browser q "" \ - "Exit mutt" -macro browser "" \ - "Check New" -macro compose Y pfy \ - "send mail without GPG" -# urlview -macro pager \Cu "urlview" \ - "Follow links with urlview" -macro pager ';' "" \ - "q+ ;" -# notmuch -macro index s "unset wait_key~/.mutt/mutt-notmuch.py -G $folder/search+search" \ - "search mail (using notmuch)" -# labels -macro index,pager x 'set my_oldeditor=$editorset editor="~/.mutt/mutt-xlabel.py"Nset editor=$my_oldeditor' \ - "edit X-Label" -macro index \Cx "~y " \ - "limit view to label" - -### aliases -set sort_alias = alias # sort alias file by alias -set reverse_alias # show names from alias file in index -source $alias_file # enable auto-completion - -### abook -set query_command = "abook --mutt-query '%s'" -macro generic,index,pager \Ca "abook" "launch abook" -macro index,pager A "abook --add-email" "add the sender address to abook" - -### Misc settings -## Mailing lists: lists and subscribe -set followup_to # generate 'Mail-Followup-To:' header field -set honor_followup_to # 'Mail-Followup-To' header is honored -source ~/.mutt/mailinglists - -## Multiplexing using tmux -# compose mail in tmux window -macro index,pager M 'set my_oldeditor=$editorset editor="cp %s %s.2; tmux new-window -a -t mutt \"~/.mutt/compose.sh %s.2\""unset recallset editor=$my_oldeditor' \ - "mail in new tmux window" -#unset wait_key # already set above -# forward messages -# override the hotkey -macro index,pager P "tmux new-window -a -t mutt 'mutt -F ~/.mutt/compose.rc -p'" \ - "recall postponed message in new tmux window" -# Set the editor for for editing messages in-place, -# allows re-editing before sending, e.g. for use in forwarding messages. -macro compose E 'set my_oldeditor=$editorset editor="vim"set editor=$my_oldeditor' \ - "edit message in-place" -# open mailbox listing in a new window -macro index,pager Y 'tmux new-window -a -t mutt "mutt -y"' \ - "open mailbox listing in new tmux window" - -## Attachment searching and counting -source ~/.mutt/attachments - -## Colors -source ~/.mutt/colors - -## GnuPG -source ~/.mutt/gpg.rc - -## auto view -auto_view text/html application/x-tar-gz application/x-compressed-tar \ - application/x-bzip-compressed-tar - -## MIME types that should *not* be treated according to their mailcap entry -mime_lookup application/octet-stream application/X-Lotus-Manuscript - -### Local Settings -source `FILE=$HOME/.muttrc.local; if [ ! -s "$FILE" ]; then FILE=/dev/null; fi; echo "$FILE"` - -# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=muttrc: # diff --git a/.mutt/muttrc.bak b/.mutt/muttrc.bak deleted file mode 100644 index 7cca10c..0000000 --- a/.mutt/muttrc.bak +++ /dev/null @@ -1,172 +0,0 @@ -# $Id$ -# -########################################## -## mutt configuration file ## -## ## -## LIweitiaNux ## -## February 6, 2012 ## -########################################## - -### files and directories -set alias_file = ~/.mutt/aliases -#set header_cache = ~/.mutt/cache/headers # needs external db lib -set message_cachedir = ~/.mutt/cache -set certificate_file = ~/.mutt/certificates -set mailcap_path = ~/.mutt/mailcap -set signature = ~/.mutt/signature -set history_file = ~/.mutt/history -set tmpdir = ~/.mutt/tmp - -### settings -set mbox_type = Maildir -set folder = ~/Maildir -set mail_check = 300 # how often (in s) look for new mail -set timeout = 15 # prompt timeout until abort waiting for input -#set sendmail_wait = -1 # always put sendmail in the bkg without waiting -set sleep_time = 0 # time to pause while displaying certain info msgs -set history = 128 # control the size of the string history buffer -set save_history = 128 # control the size of the 'history_file' -unset confirmappend # don't ask me if i want to append to mailboxes -set beep_new # beep when receive a new msg while mailbox open -set copy # always save a copy of outgoing messages -set delete # purge deleted messages without asking -set quit = ask-yes # ask for confirmation when quit mutt -#set date_format = "%m/%d/%y at %I:%M" -set wrap_search # searches wrap around the end -set help # show the help lines -set use_from # always generate the `From:' header field -set read_inc = 25 # specify at which rate to update progress counters -set write_inc = 25 -set print = ask-yes # ask me if I really want to print messages -set print_command = /usr/bin/false # how to print things (I like to save trees) - -### index settings -set index_format = "%4C %Z %{%m/%d} %-15.15F (%4c) %s" # format of the index -set sort = threads # primary sorting method -set sort_aux = reverse-date-received -set uncollapse_jump # don't collapse on an unread message -set sort_re # thread based on regex -set reply_regexp = "^(([Rr][Ee]?(\[[0-9]+\])?: *)?(\[[^]]+\] *)?)*" - -### pager settings -set pager_format="-%S- %-20.20f %s" # format of the pager status bar -set pager_index_lines = 5 # number of index lines to show -set pager_context = 5 # number of context lines to show -set pager_stop # don't go to next message automatically -set menu_scroll # scroll in menus -set smart_wrap # don't split words -set tilde # show tildes like in vim -unset markers # no ugly '+' signs for wrapped lines -set noprompt_after # ask me for a command after the external pager exits -set quote_regexp = "^( {0,4}[>|:#%]| {0,4}[a-z0-9]+[>|]+)+" - -### composing mail -set editor = "vim +/^$" -set visual = "vim +/^$" -set realname = "LIweitiaNux" -set envelope_from # which from? -set sig_dashes # dashes before my 'signature' -set autoedit # go to the editor right away when composing - # set, cannot use 'send-hooks' depend on recipients -set edit_headers # show headers when composing -set askcc # ask for CC: -set askbcc # ask for BCC: -set fcc_attach # save attachments with the body -unset mime_forward # forward attachments as part of body -set forward_format = "Fwd: %s" -set forward_quote # include message in forwards -set forward_decode # decode when forwarding -set attribution = "On %d, %n wrote: " -#set metoo # sends a copy to all recipients and myself -set fast_reply # skip to compose when replying -set reply_to # reply to 'Reply to:' field -set reverse_name # reply as whomever it was to -set nosave_empty # remove files when no messages are left -#set postpone # auto postpone message not sent when exit -#set recall # prompt to recall postponed messages -set include # include message in replies -#set post_indent_string = '---end quoted text---' - -### headers settings -ignore * # ignore all headers -unignore from: to cc bcc date subject # show only these headers -hdr_order from: to cc date subject - -### mailboxes -# from 'offlineimap' -source ~/.mutt/mailboxes - -### gmail, use as default -source ~/.mutt/gmail.muttrc -### account specific sources -folder-hook gmail.* source ~/.mutt/gmail.muttrc -folder-hook lavabit.* source ~/.mutt/lavabit.muttrc - -### aliases -# set alias_file = ~/.mutt/aliases -set sort_alias = alias # sort alias file by alias -set reverse_alias # show names from alias file in index -set alias_format = "%4n %t %-20a %r" -source $alias_file # enable auto-completion - -### bindings -bind index,pager \# noop -bind index i noop -bind pager i exit -bind pager / search -bind pager previous-line -bind pager next-line -bind pager k previous-line -bind pager j next-line -bind pager gg top -bind pager G bottom -bind pager K previous-undeleted -bind pager J next-undeleted -bind index gg first-entry -bind index G last-entry -bind index K previous-unread -bind index J next-unread -bind index,pager R group-reply - -### macros -macro index \Cr "N" "mark tagged messages as read" -macro index B "~b " "search message bodies" -macro index I "!" "go to Inbox" -# save a decoded copy in ~ -macro index P "cat > ~/" "save message as" -# quick-sync with offlineimap -macro index Z "offlineimap -o -q -u ttyui" "offlineimap sync ..." - -### Misc settings -## mutt colors definitions -source ~/.mutt/colors -#set arrow_cursor # use -> instead of hiliting the whole line - -## zh attachment encodeing -set rfc2047_parameters = yes - -## GnuPG -source ~/.mutt/gpg.rc - -## auto view -auto_view text/html application/x-gunzip application/x-tar-gz \ - application/msword application/postscript - -## MIME multipart/alternative -## The 'multipart/alternative' container type only has child MIME parts -## which represent the same content in an alternative way. often used to -## send HTML msgs which contain an alternative plain text representation. -alternative_order text/plain text/enriched text/html application/postscript - -## attachment searching and counting -## attachments { +|- } disposition mime-type -## 'disposition': inline(I), attachment(A) -source ~/.mutt/attachments - -## MIME lookup, mime-lookup -## specifies a list of MIME types that should *not* be treated -## according to their mailcap entry -mime_lookup application/octet-stream application/X-Lotus-Manuscript - -# -# vim: filetype=muttrc diff --git a/.mutt/ppt2text.sh b/.mutt/ppt2text.sh deleted file mode 100755 index 43d22f4..0000000 --- a/.mutt/ppt2text.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -# -# ppt2text - convert MS PowerPoint files to ASCII text -# -# Written by Gary Johnson . -# -# Modification History: -# 2003-02-19 -# Changed the name pptHtml to ppthtml to match the xlhtml-0.5 -# release. - -prog=${0##*/} - -if [ $# -ne 1 ] -then - echo "Usage: $prog file" >&2 - exit 2 -fi - -ppthtml $1 | -w3m -dump -T text/html | -perl -pe 's/\xa0/ /g' # Change A0 spaces to ASCII - # spaces. diff --git a/.mutt/word2text.sh b/.mutt/word2text.sh deleted file mode 100755 index fe9682d..0000000 --- a/.mutt/word2text.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh -# -# word2text - convert MS Word files to ASCII text -# -# SYNOPSIS -# word2text file -# -# DESCRIPTION -# Word2text uses wvHtml, w3m and some perl glue to convert the MS -# Word file specified by the argument to ASCII text on stdout. -# -# wvHtml converts MS Word files to HTML, but is intended to be -# used with a graphical browser such as Netscape Navigator, so it -# converts certain graphical elements to image files and -# corresponding tags that the browser can render. Since -# this script uses a text based browser, it uses perl to eliminate -# these tags. -# -# Compared to Quick View Plus (qvpview), the rendering of MS Word -# documents done by word2text is usually more accurate. Qvpview -# doesn't render unrecognized characters well, if at all. It also -# renders numbered lists as bullet lists. -# -# Compared to the plain text translations that some people include -# in their e-mail along with the original MS Word attachments, the -# rendering done by word2text is usually more readable: vertical -# spacing between paragraphs and list items is better and the -# adjustment of text within paragraphs is better. -# -# BUGS -# wvHtml occasionally dumps core. -# With the wv-0.7.4 release, some unnumbered lists are rendered as -# numbered. -# -# AUTHOR -# Gary A. Johnson -# -# -# REVISION HISTORY -# 2003-05-31 -# Between wv-0.5.42 and wv-0.7.4, wvHtml changed to insert -# a

tag between each

  • tag and the following text, -# causing the list-item text to start on the line -# following the list-item bullet or number. A perl -# expression was added to this script to fix the problem. -# 2003-02-19 -# The command-line arguments to wvHtml changed, requiring -# the output file name as well as the input file name. -# Therefore, '-' (stdout) was added to the command as the -# output file name. - -wvHtml "$1" - 2> /dev/null | -perl -0777 -p -e ' - s|||gs; # Delete img tags. - s|()\s*

    |\1|gs; # Remove

    tags immediately - # following

  • tags. (This - # problem appeared somewhere - # between wv-0.5.42 and - # wv-0.7.4.) -' | -w3m -dump -T text/html | -perl -p -e ' - s/\n\s*\n/\n\n/gs; # Delete extra whitespace - # between lines. - s/\xa0/ /gs; # Change A0 spaces to ASCII - # spaces. -' diff --git a/.ncmpcpp/config b/.ncmpcpp/config deleted file mode 100644 index 5d7fc69..0000000 --- a/.ncmpcpp/config +++ /dev/null @@ -1,523 +0,0 @@ -#################################################### -## this is example configuration file, copy it to ## -## ~/.ncmpcpp/config and set up your preferences ## -#################################################### -# -##### directories ###### -## -## Directory for storing ncmpcpp related files. -## Changing it is useful if you want to store -## everything somewhere else and provide command -## line setting for alternative location to config -## file which defines that while launching ncmpcpp. -## -# -#ncmpcpp_directory = "~/.ncmpcpp" -# -## -## Directory for storing downloaded lyrics. It -## defaults to ~/.lyrics since other MPD clients -## (eg. ncmpc) also use that location. -## -# -lyrics_directory = "~/.lyrics" -# -##### connection settings ##### -# -## set it in order to make tag editor and renaming files work properly -# -#mpd_host = "localhost" -# -#mpd_port = "6600" -# -mpd_music_dir = "~/music" -# -#mpd_connection_timeout = "5" -# -mpd_crossfade_time = "5" -# -#mpd_communication_mode = "notifications" (polling/notifications) -# -##### music visualizer ##### -## -## Note: In order to make music visualizer work you'll -## need to use mpd fifo output, whose format parameter -## has to be set to 44100:16:1 for mono visualization -## or 44100:16:2 for stereo visualization. Example -## configuration (it has to be put into mpd.conf): -## -## audio_output { -## type "fifo" -## name "My FIFO" -## path "/tmp/mpd.fifo" -## format "44100:16:2" -## } -## -# -## -## If you set format to 44100:16:2, make it 'yes'. -## -# -#visualizer_in_stereo = "no" -visualizer_in_stereo = "yes" -# -visualizer_fifo_path = "/tmp/mpd.fifo" -# -## -## Note: Below parameter is needed for ncmpcpp -## to determine which output provides data for -## visualizer and thus allow syncing between -## visualization and sound as currently there -## are some problems with it. -## -# -visualizer_output_name = "My FIFO" -# -## -## Note: Below parameter defines how often ncmpcpp -## has to "synchronize" visualizer and audio outputs. -## 30 seconds is optimal value, but if you experience -## synchronization problems, set it to lower value. -## Keep in mind that sane values start with >=10. -## -# -visualizer_sync_interval = "30" -# -## -## Note: To enable spectrum frequency visualization -## you need to compile ncmpcpp with fftw3 support. -## -# -#visualizer_type = "wave" (spectrum/wave) -visualizer_type = "spectrum" (spectrum/wave) -# -#visualizer_look = "◆│" -visualizer_look = "◆▋" -# -##### system encoding ##### -## -## ncmpcpp should detect your charset encoding -## but if it failed to do so, you can specify -## charset encoding you are using here. -## -## Note: You can see whether your ncmpcpp build -## supports charset detection by checking output -## of `ncmpcpp --version`. -## -## Note: Since MPD uses utf8 by default, setting -## this option makes sense only if your encoding -## is different. -## -# -#system_encoding = "" -# -##### delays ##### -# -## delay after playlist highlighting will be disabled (0 = don't disable) -# -#playlist_disable_highlight_delay = "5" -# -## defines how long various messages are supposed to be visible -# -#message_delay_time = "4" -# -##### song format ##### -## -## for song format you can use: -## -## %l - length -## %f - filename -## %D - directory -## %a - artist -## %A - album artist -## %t - title -## %b - album -## %y - year -## %n - track number (01/12 -> 01) -## %N - full track info (01/12 -> 01/12) -## %g - genre -## %c - composer -## %p - performer -## %d - disc -## %C - comment -## $R - begin right alignment -## -## you can also put them in { } and then it will be displayed -## only if all requested values are available and/or define alternate -## value with { }|{ } eg. {%a - %t}|{%f} -## -## Note: If you want to set limit on maximal length of a tag, just -## put the appropriate number between % and character that defines -## tag type, e.g. to make album take max. 20 terminal cells, use '%20b'. -## -## Note: Format that is similar to "%a - %t" (i.e. without any additional -## braces) is equal to "{%a - %t}", so if one of the tags is missing, -## you'll get nothing. -## -## text can also have different color than the main window has, -## eg. if you want length to be green, write $3%l$9 -## -## available values: -## -## - 0 - default window color (discards all other colors) -## - 1 - black -## - 2 - red -## - 3 - green -## - 4 - yellow -## - 5 - blue -## - 6 - magenta -## - 7 - cyan -## - 8 - white -## - 9 - end of current color -## -## Note: colors can be nested. -## -# -#song_list_format = "{%a - }{%t}|{$8%f$9}$R{$3(%l)$9}" -# -#song_status_format = "{{%a{ \"%b\"{ (%y)}} - }{%t}}|{%f}" -# -#song_library_format = "{%n - }{%t}|{%f}" -# -#tag_editor_album_format = "{(%y) }%b" -# -## -## Note: Below variables are for alternative version of user's interface. -## Their syntax supports all tags and colors listed above plus some extra -## markers used for text attributes. They are followed by character '$'. -## After that you can put: -## -## - b - bold text -## - u - underline text -## - r - reverse colors -## - a - use alternative character set -## -## If you don't want to use an attribute anymore, just put it again, but -## this time insert character '/' between '$' and attribute character, -## e.g. {$b%t$/b}|{$r%f$/r} will display bolded title tag or filename -## with reversed colors. -## -# -#alternative_header_first_line_format = "$b$1$aqqu$/a$9 {%t}|{%f} $1$atqq$/a$9$/b" -# -#alternative_header_second_line_format = "{{$4$b%a$/b$9}{ - $7%b$9}{ ($4%y$9)}}|{%D}" -# -## -## Note: Below variables also supports -## text attributes listed above. -## -# -#now_playing_prefix = "$b" -# -#now_playing_suffix = "$/b" -# -#browser_playlist_prefix = "$2playlist$9 " -# -#selected_item_prefix = "$6" -# -#selected_item_suffix = "$9" -# -## colors are not supported for below variable -# -#song_window_title_format = "{%a - }{%t}|{%f}" -song_window_title_format = "{%a - }{%t}|{%f}" -# -##### columns settings ##### -## -## syntax of song columns list format is "column column etc." -## -## - syntax for each column is: -## -## (width of column)[column's color]{displayed tag} -## -## Note: Width is by default in %, if you want a column to -## have fixed size, add 'f' after the value, e.g. (10)[white]{a} -## will be the column that take 10% of screen (so the real column's -## width will depend on actual screen size), whereas (10f)[white]{a} -## will take 10 terminal cells, no matter how wide the screen is. -## -## - color is optional (if you want the default one, type []) -## -## Note: You can give a column additional attributes by putting appropriate -## character after displayed tag character. Available attributes are: -## -## - r - column will be right aligned -## - E - if tag is empty, empty tag marker won't be displayed -## -## You can also: -## -## - give a column custom name by putting it after attributes, -## separated with character ':', e.g. {lr:Length} gives you -## right aligned column of lengths named "Length". -## -## - define sequence of tags, that have to be displayed in case -## predecessor is empty in a way similar to the one in classic -## song format, i.e. using '|' character, e.g. {a|c|p:Owner} -## creates column named "Owner" that tries to display artist -## tag and then composer and performer if previous ones are -## not available. -## -# -#song_columns_list_format = "(7f)[green]{l} (25)[cyan]{a} (40)[]{t|f} (30)[red]{b}" -song_columns_list_format = "(7f)[green]{l} (25)[cyan]{a} (40)[]{t|f} (30)[magenta]{b}" -# -##### various settings ##### -# -## -## Note: Custom command that will be executed each -## time song changes. Useful for notifications etc. -## -## Attention: It doesn't support song format anymore. -## Use `ncmpcpp --now-playing SONG_FORMAT` instead. -## -#execute_on_song_change = "" -# -#playlist_show_remaining_time = "no" -# -#playlist_shorten_total_times = "no" -# -#playlist_separate_albums = "no" -# -#playlist_display_mode = "classic" (classic/columns) -playlist_display_mode = "columns" (classic/columns) -# -#browser_display_mode = "classic" (classic/columns) -browser_display_mode = "columns" (classic/columns) -# -#search_engine_display_mode = "classic" (classic/columns) -search_engine_display_mode = "columns" (classic/columns) -# -#playlist_editor_display_mode = "classic" (classic/columns) -playlist_editor_display_mode = "columns" (classic/columns) -# -#discard_colors_if_item_is_selected = "yes" -# -#incremental_seeking = "yes" -# -#seek_time = "1" -# -#autocenter_mode = "no" -autocenter_mode = "yes" -# -#centered_cursor = "no" -# -## -## Note: You can specify third character which will -## be used to build 'empty' part of progressbar. -## -#progressbar_look = "=>" -progressbar_look = "▪▪▫" -#progressbar_look = "♪♪ " -#progressbar_look = "=>" -#progressbar_look = "─- " -#progressbar_look = "▒▒░" -#progressbar_look = "┅┅┄" -#progressbar_look = "─⊙┄" -#progressbar_look = "─➞─" -#progressbar_look = "─┅─" -#progressbar_look = "▪▪▪" -#progressbar_look = "───" -#progressbar_look = "▁▁▁" -#progressbar_look = "‒‒‒" -#progressbar_look = "■◣ " -#progressbar_look = "◈◆◇" -# -#default_place_to_search_in = "database" (database/playlist) -# -#user_interface = "classic" (classic/alternative) -user_interface = "alternative" (classic/alternative) -# -#media_library_left_column = "a" (possible values: a,y,g,c,p, legend above) -# -#default_find_mode = "wrapped" (wrapped/normal) -# -#default_space_mode = "add" (add/select) -# -#default_tag_editor_left_col = "albums" (albums/dirs) -# -#default_tag_editor_pattern = "%n - %t" -# -#header_visibility = "yes" -# -#statusbar_visibility = "yes" -# -#titles_visibility = "yes" -titles_visibility = "no" -# -#header_text_scrolling = "yes" -# -#fancy_scrolling = "yes" -# -#cyclic_scrolling = "no" -# -#lines_scrolled = "2" -# -#follow_now_playing_lyrics = "no" -follow_now_playing_lyrics = "yes" -# -#fetch_lyrics_for_current_song_in_background = "no" -# -#store_lyrics_in_song_dir = "no" -# -## -## Note: If you set this variable, ncmpcpp will try to -## get info from last.fm in language you set and if it -## fails, it will fall back to english. Otherwise it will -## use english the first time. -## -## Note: Language has to be expressed as an ISO 639 alpha-2 code. -## -#lastfm_preferred_language = "" -# -#ncmpc_like_songs_adding = "no" (enabled - add/remove, disabled - always add) -# -#show_hidden_files_in_local_browser = "no" -# -#display_screens_numbers_on_start = "yes" -# -## -## How shall key_screen_switcher work? -## -## - "previous" - switch between current and last used screen -## - "sequence: 2 -> 9 -> 5" - switch between given sequence of screens. -## -## Screen numbers you can use after 'sequence' keyword are: -## -## - 1 - help -## - 2 - playlist -## - 3 - browser -## - 4 - search engine -## - 5 - media library -## - 6 - playlist editor -## - 7 - tag editor -## - 8 - outputs -## - 9 - visualizer -## - 10 - clock -## -## As you can see, above example will switch between -## playlist, visualizer and media library screens. -## -#screen_switcher_mode = "sequence: 2 -> 3" -# -## -## Default width of locked screen (in %). -## Acceptable values are from 20 to 80. -## -# -#locked_screen_width_part = "50" -# -#ask_for_locked_screen_width_part = "yes" -# -## -## Note: You can define startup screen for ncmpcpp -## by choosing screen number from the list above. -## -#startup_screen = "2" -# -#jump_to_now_playing_song_at_start = "yes" -# -#ask_before_clearing_main_playlist = "no" -# -#clock_display_seconds = "no" -# -#display_volume_level = "yes" -# -#display_bitrate = "no" -display_bitrate = "yes" -# -#display_remaining_time = "no" -# -#regular_expressions = "basic" (basic/extended) -# -## -## Note: If below is enabled, ncmpcpp will ignore leading -## "The" word while sorting items in browser, tags in -## media library, etc. -## -#ignore_leading_the = "no" -ignore_leading_the = "yes" -# -#block_search_constraints_change_if_items_found = "yes" -# -#mouse_support = "yes" -# -#mouse_list_scroll_whole_page = "yes" -# -#empty_tag_marker = "" -# -#tag_editor_extended_numeration = "no" -# -#media_library_display_date = "yes" -# -#media_library_display_empty_tag = "yes" -# -#media_library_disable_two_column_mode = "no" -# -#enable_window_title = "yes" -# -## -## Note: You can choose default search mode for search -## engine. Available modes are: -## -## - 1 - use mpd built-in searching (no regexes, pattern matching) -## - 2 - use ncmpcpp searching (pattern matching with support for regexes, -## but if your mpd is on a remote machine, downloading big database -## to process it can take a while -## - 3 - match only exact values (this mode uses mpd function for searching -## in database and local one for searching in current playlist) -## -# -#search_engine_default_search_mode = "1" -# -## -## Note: Below variables can allow you to physically -## remove files and directories from your hdd using -## ncmpcpp's browser screen. -## -# -#allow_physical_files_deletion = "no" -# -#allow_physical_directories_deletion = "no" -# -#external_editor = "" -external_editor = "vim" -# -#use_console_editor = "no" (set to yes, if your editor is console app) -use_console_editor = "yes" -# -##### colors definitions ##### -# -#colors_enabled = "yes" -# -#empty_tag_color = "cyan" -# -#header_window_color = "default" -# -#volume_color = "default" -# -#state_line_color = "default" -# -#state_flags_color = "default" -# -#main_window_color = "yellow" -# -#color1 = "white" -# -#color2 = "green" -# -#main_window_highlight_color = "yellow" -# -#progressbar_color = "default" -# -#statusbar_color = "default" -# -#alternative_ui_separator_color = "black" -# -#active_column_color = "red" -# -#visualizer_color = "yellow" -# -#window_border_color = "green" -# -#active_window_border = "red" -# diff --git a/.ncmpcpp/keys b/.ncmpcpp/keys deleted file mode 100644 index 6e06bb4..0000000 --- a/.ncmpcpp/keys +++ /dev/null @@ -1,199 +0,0 @@ -## -## ~/.ncmpcpp/keys -## key configuration file for ncmpcpp -## -## Tips: -## - it's possible to bind maximum two keys to a command -## - keys can be defined with a character or a decimal value -## - a command can be disabled by binding it to 0 -## -## Note: First bind of volume_up/down -## will be used to switch between columns. -## -## Configure ncmpcpp to have vim-like key bindings -## -## Aaron LI -## 2015-12-29 -## -# -key_up = 259 'k' -# -key_down = 258 'j' -# -#key_up_album = '[' -# -#key_down_album = ']' -# -#key_up_artist = '{' -# -#key_down_artist = '}' -# -#key_page_up = 339 -# -#key_page_down = 338 -# -key_home = 262 'g' -# -key_end = 360 'G' -# -#key_space = 32 -# -#key_enter = 10 -# -#key_delete = 330 'd' -# -#key_volume_up = 261 '+' -# -#key_volume_down = 260 '-' -# -#key_prev_column = 260 -key_prev_column = 'h' -# -#key_next_column = 261 -key_next_column = 'l' -# -#key_toggle_space_mode = 't' -# -#key_toggle_add_mode = 'T' -# -#key_toggle_mouse = '|' -# -#key_toggle_bitrate_visibility = '#' -# -#key_screen_switcher = 9 -# -#key_backward_screen_switcher = 353 -# -#key_help = '1' 265 -# -#key_playlist = '2' 266 -# -#key_browser = '3' 267 -# -#key_search_engine = '4' 268 -# -#key_media_library = '5' 269 -# -#key_playlist_editor = '6' 270 -# -#key_tag_editor = '7' 271 -# -#key_outputs = '8' 272 -# -#key_music_visualizer = '9' 273 -# -#key_clock = '0' 274 -# -#key_server_info = '@' -# -#key_stop = 's' -# -#key_pause = 'P' -key_pause = 'p' -# -#key_next = '>' -# -#key_prev = '<' -# -#key_replay = 263 127 -# -#key_seek_forward = 'f' -# -#key_seek_backward = 'b' -# -#key_toggle_repeat = 'r' -# -#key_toggle_random = 'z' -# -#key_toggle_single = 'y' -# -#key_toggle_consume = 'R' -# -#key_toggle_replay_gain_mode = 'Y' -# -#key_shuffle = 'Z' -# -#key_toggle_crossfade = 'x' -# -#key_set_crossfade = 'X' -# -#key_update_db = 'u' -# -#key_sort_playlist = 22 -# -#key_apply_filter = 6 -# -#key_find_forward = '/' -# -#key_find_backward = '?' -# -#key_next_found_position = '.' -key_next_found_position = 'n' -# -#key_prev_found_position = ',' -key_prev_found_position = 'N' -# -#key_toggle_find_mode = 'w' -# -#key_edit_tags = 'e' -# -#key_go_to_position = 'g' -# -#key_song_info = 'i' -# -#key_artist_info = 'I' -# -#key_lyrics = 'l' -key_lyrics = '.' -# -#key_reverse_selection = 'v' -# -#key_deselect_all = 'V' -# -#key_select_album = 'B' -# -#key_add_selected_items = 'A' -# -#key_clear = 'c' -# -#key_crop = 'C' -# -#key_move_song_up = 'm' -key_move_song_up = 'K' -# -#key_move_song_down = 'n' -key_move_song_down = 'J' -# -#key_move_to = 'M' -# -#key_move_before = 0 -# -#key_move_after = 0 -# -#key_add = 'a' -# -#key_save_playlist = 'S' -# -#key_go_to_now_playing = 'o' -# -#key_toggle_auto_center = 'U' -# -#key_toggle_display_mode = 'p' -key_toggle_display_mode = 'P' -# -#key_toggle_separators_in_playlist = '!' -# -#key_toggle_lyrics_db = 'L' -# -#key_toggle_fetching_lyrics_for_current_song_in_background = 'F' -# -#key_go_to_containing_directory = 'G' -# -#key_go_to_media_library = '~' -# -#key_go_to_parent_dir = 263 127 -# -#key_switch_tag_type_list = '`' -# -#key_quit = 'q' 'Q' -# diff --git a/.notmuch-config b/.notmuch-config deleted file mode 100644 index ba7e7b2..0000000 --- a/.notmuch-config +++ /dev/null @@ -1,93 +0,0 @@ -## -## Configuration file for the notmuch mail system -## ~/.notmuch-config -## http://notmuchmail.org -## -## Weitian LI -## 2015/02/02 -## - -# Database configuration -# -# The only value supported here is 'path' which should be the top-level -# directory where your mail currently exists and to where mail will be -# delivered in the future. Files should be individual email messages. -# Notmuch will store its database within a sub-directory of the path -# configured here named ".notmuch". -# -[database] -path=/home/aly/Mail - -# User configuration -# -# Here is where you can let notmuch know how you would like to be -# addressed. Valid settings are -# -# name Your full name. -# primary_email Your primary email address. -# other_email A list (separated by ';') of other email addresses -# at which you receive email. -# -# Notmuch will use the various email addresses configured here when -# formatting replies. It will avoid including your own addresses in the -# recipient list of replies, and will set the From address based on the -# address to which the original email was addressed. -# -[user] -name=Aaron LI -primary_email=aaronly.me@outlook.com -other_email=aaronly.me@gmail.com;liweitianux@autistici.org;liweitianux@gmail.com;liweitianux@live.com; - -# Configuration for "notmuch new" -# -# The following options are supported here: -# -# tags A list (separated by ';') of the tags that will be -# added to all messages incorporated by "notmuch new". -# -# ignore A list (separated by ';') of file and directory names -# that will not be searched for messages by "notmuch new". -# -# NOTE: *Every* file/directory that goes by one of those -# names will be ignored, independent of its depth/location -# in the mail store. -# -[new] -tags=unread;inbox; -ignore= - -# Search configuration -# -# The following option is supported here: -# -# exclude_tags -# A ;-separated list of tags that will be excluded from -# search results by default. Using an excluded tag in a -# query will override that exclusion. -# -[search] -exclude_tags=deleted;spam; - -# Maildir compatibility configuration -# -# The following option is supported here: -# -# synchronize_flags Valid values are true and false. -# -# If true, then the following maildir flags (in message filenames) -# will be synchronized with the corresponding notmuch tags: -# -# Flag Tag -# ---- ------- -# D draft -# F flagged -# P passed -# R replied -# S unread (added when 'S' flag is not present) -# -# The "notmuch new" command will notice flag changes in filenames -# and update tags, while the "notmuch tag" and "notmuch restore" -# commands will notice tag changes and update flags in filenames -# -[maildir] -synchronize_flags=true diff --git a/.npmrc b/.npmrc deleted file mode 100644 index f9e0a43..0000000 --- a/.npmrc +++ /dev/null @@ -1,7 +0,0 @@ -;; -;; npm config -;; - -;; install packages under user home directory -prefix = ${HOME}/npm - diff --git a/.offlineimap/offlineimap.py b/.offlineimap/offlineimap.py deleted file mode 100644 index e3ae422..0000000 --- a/.offlineimap/offlineimap.py +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env python -# -# Add support of encrypting password with gpg2 for OfflineIMAP. -# Provide function 'mailpasswd' to decrypt the password. -# -# Configurations: -# [general] -# pythonfile = ~/.offlineimap/offlineimap.py -# ... -# [Repository ] -# remotepasseval = mailpasswd("") -# ... -# -# Reference: -# [1] Encrypt OfflineIMAP Password -# http://unix.stackexchange.com/questions/44214/encrypt-offlineimap-password -# -# Updated: 2015/02/02 -# - -import os -import subprocess - -def mailpasswd(account): - account = os.path.basename(account) - path = '{0}/.offlineimap/{1}.gpg'.format(os.environ['HOME'], account) - args = ['gpg2', '--for-your-eyes-only', '--no-tty', - '--quiet', '--batch', '--decrypt', path] - try: - return subprocess.check_output(args).strip() - except subprocess.CalledProcessError: - return '' - -# subprocess.check_output() only introduced in python 2.7 -# this version of 'mailpasswd' works with older version of python -#def mailpasswd(account): -# account = os.path.basename(account) -# path = '{0}/.offlineimap/{1}.gpg'.format(os.environ['HOME'], account) -# args = ['gpg2', '--for-your-eyes-only', '--no-tty', -# '--quiet', '--batch', '--decrypt', path] -# proc = subprocess.Popen(args, stdout=subprocess.PIPE) -# output = proc.communicate()[0].strip() -# retcode = proc.wait() -# if retcode == 0: -# return output -# else: -# return '' - - -# If you have several accounts that get checked simultaneously, and you -# use 'gpg-agent', then it will ask for you passphrase for each account. -# I prime the agent by creating a file, and priming the gpg-agent by -# decrypting this file on launch of offlineimap. -def prime_gpg_agent(): - # echo "prime" | gpg -e -r > ~/.offlineimap/prime.gpg - ret = False - i = 1 - while not ret: - ret = (mailpasswd("prime") == "prime") - if i > 2: - from offlineimap.ui import getglobalui - sys.stderr.write("Error reading in passwords. Terminating.\n") - getglobalui().terminate() - i += 1 - return ret - -prime_gpg_agent() - diff --git a/.offlineimap/postsync.sh b/.offlineimap/postsync.sh deleted file mode 100755 index c5a3985..0000000 --- a/.offlineimap/postsync.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh -# -# OfflineIMAP postsynchook -# -# Weitian LI -# 2015/02/02 -# - -## Check new mails & send notification -MAILDIR="${HOME}/Mail/" -newmails=0 -for d in `find ${MAILDIR} -maxdepth 2 -type d -iname '*inbox'`; do - n=`ls ${d}/new/ | wc -l` - newmails=`expr ${newmails} + ${n}` -done - -if [ ${newmails} -gt 0 ] && which notify-send >/dev/null 2>&1; then - export DISPLAY=":0" - export XAUTHORITY="${HOME}/.Xauthority" - notify-send -i 'mail-unread' -a "OfflineIMAP" \ - "OfflineIMAP: Received ${newmails} new mail(s)!" -fi - -## Invoke notmuch to index mails -notmuch new - diff --git a/.offlineimaprc b/.offlineimaprc deleted file mode 100644 index 5293156..0000000 --- a/.offlineimaprc +++ /dev/null @@ -1,218 +0,0 @@ -## -## OfflineIMAP Configuration -## ~/.offlineimaprc -## -## Weitian LI -## 2015/02/03 -## -## Reference: -## [1] ArchWiki - OfflineIMAP -## https://wiki.archlinux.org/index.php/OfflineIMAP -## - -[general] -# Function 'mailpasswd': invoke gpg to decrypt passwords. -pythonfile = ~/.offlineimap/offlineimap.py -# -# List of accounts to be synced, separated by a comma. -accounts = gmail-aly, gmail-li, outlook-aly, outlook-li, sjtu, autistici -#accounts = outlook-aly, outlook-li, sjtu, autistici -# -# Control how many accuonts may be synced simulaneously -# NOTE: if you are using autorefresh and have more than one account, -# your must set this number to be >= to the number of accounts you -# have; since any given sync run never "finishes" due to a timer, -# you will never sync your additional accounts if this is 1. -maxsyncaccounts = 6 -# -# UI: blinkenlights, ttyui, quiet (suppress anything but errors) -ui = ttyui - - -[Account example] -localrepository = example-local -remoterepository = example-remote -# Status cache -status_backend = sqlite -# Minutes between sycns -autorefresh = 15 -# Number of quick-syncs between autorefreshes. -# Quick-syncs do not update if the only changes were to IMAP flags. -quick = 5 -# pre and post sync hook to execute a external command. -#presynchook = imapfilter -#postsynchook = ~/.offlineimap/postsync.sh -# -[Repository example-local] -type = Maildir -localfolders = ~/Mail/example -# -[Repository example-remote] -# Remote repository can be IMAP or Gmail -type = IMAP -remotehost = imap.example.com -ssl = yes -sslcacertfile = ~/.offlineimap/ca-certificates.crt -remoteport = 993 -remoteuser = username@example.com -#remotepass = password -remotepasseval = mailpasswd("example") -# Hold the connection open, instead of closing the connection once -# a sync is complete. (unit: seconds) -keepalive = 60 -# Keep connection open between refreshes. -holdconnectionopen = yes - - -[Account gmail-aly] -localrepository = gmail-aly-local -remoterepository = gmail-aly-remote -status_backend = sqlite -autorefresh = 30 -quick = 5 -#postsynchook = ~/.offlineimap/postsync.sh -# -[Repository gmail-aly-local] -type = Maildir -localfolders = ~/Mail/gmail-aly -# -[Repository gmail-aly-remote] -type = Gmail -remoteuser = aaronly.me@gmail.com -remotepasseval = mailpasswd("gmail-aly") -keepalive = 60 -holdconnectionopen = yes -sslcacertfile = ~/.offlineimap/ca-certificates.crt -# Not sync the 'All Mail' folder -folderfilter = lambda foldername: foldername not in ['[Gmail]/All Mail'] - - -[Account gmail-li] -localrepository = gmail-li-local -remoterepository = gmail-li-remote -status_backend = sqlite -autorefresh = 15 -quick = 5 -postsynchook = ~/.offlineimap/postsync.sh -# -[Repository gmail-li-local] -type = Maildir -localfolders = ~/Mail/gmail-li -# -[Repository gmail-li-remote] -type = Gmail -remoteuser = liweitianux@gmail.com -remotepasseval = mailpasswd("gmail-li") -keepalive = 60 -holdconnectionopen = yes -sslcacertfile = ~/.offlineimap/ca-certificates.crt -# Not sync the 'All Mail' folder -folderfilter = lambda foldername: foldername not in ['[Gmail]/All Mail'] - - -[Account outlook-aly] -localrepository = outlook-aly-local -remoterepository = outlook-aly-remote -status_backend = sqlite -autorefresh = 30 -quick = 5 -#postsynchook = ~/.offlineimap/postsync.sh -# -[Repository outlook-aly-local] -type = Maildir -localfolders = ~/Mail/outlook-aly -# -[Repository outlook-aly-remote] -type = IMAP -remotehost = imap-mail.outlook.com -ssl = yes -sslcacertfile = ~/.offlineimap/ca-certificates.crt -remoteport = 993 -remoteuser = aaronly.me@outlook.com -remotepasseval = mailpasswd("outlook-aly") -keepalive = 60 -holdconnectionopen = yes - - -[Account outlook-li] -localrepository = outlook-li-local -remoterepository = outlook-li-remote -status_backend = sqlite -autorefresh = 15 -quick = 5 -postsynchook = ~/.offlineimap/postsync.sh -# -[Repository outlook-li-local] -type = Maildir -localfolders = ~/Mail/outlook-li -# -[Repository outlook-li-remote] -type = IMAP -remotehost = imap-mail.outlook.com -ssl = yes -sslcacertfile = ~/.offlineimap/ca-certificates.crt -remoteport = 993 -remoteuser = liweitianux@live.com -remotepasseval = mailpasswd("outlook-li") -keepalive = 60 -holdconnectionopen = yes - - -[Account sjtu] -localrepository = sjtu-local -remoterepository = sjtu-remote -status_backend = sqlite -autorefresh = 15 -quick = 5 -postsynchook = ~/.offlineimap/postsync.sh -# -[Repository sjtu-local] -type = Maildir -localfolders = ~/Mail/sjtu -# -[Repository sjtu-remote] -type = IMAP -remotehost = imap.sjtu.edu.cn -ssl = yes -sslcacertfile = ~/.offlineimap/ca-certificates.crt -remoteport = 993 -remoteuser = liweitianux@sjtu.edu.cn -remotepasseval = mailpasswd("sjtu") -keepalive = 60 -holdconnectionopen = yes - - -[Account autistici] -localrepository = autistici-local -remoterepository = autistici-remote -status_backend = sqlite -autorefresh = 60 -quick = 5 -#postsynchook = ~/.offlineimap/postsync.sh -# -[Repository autistici-local] -type = Maildir -localfolders = ~/Mail/autistici -# -[Repository autistici-remote] -type = IMAP -remotehost = mail.autistici.org -ssl = yes -sslcacertfile = ~/.offlineimap/autistici_ca.crt -remoteport = 993 -remoteuser = liweitianux@autistici.org -remotepasseval = mailpasswd("autistici") -keepalive = 60 -holdconnectionopen = yes - - -# Generate a muttrc fragment containing the mailboxes that it syncs. -# NOTE: add "source ~/.mutt/mailboxes" to "muttrc" -[mbnames] -enabled = yes -filename = ~/.mutt/mailboxes.offlineimap -header = "mailboxes " -peritem = "+%(accountname)s/%(foldername)s" -sep = " " -footer = "\n" - diff --git a/.profile b/.profile deleted file mode 100644 index 12b78ae..0000000 --- a/.profile +++ /dev/null @@ -1,56 +0,0 @@ -# ~/.profile: executed by the command interpreter for login shells. -# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login -# exists. -# see /usr/share/doc/bash/examples/startup-files for examples. -# the files are located in the bash-doc package. - -# the default umask is set in /etc/profile; for setting the umask -# for ssh logins, install and configure the libpam-umask package. -#umask 022 - -###### locale ###### -export LANG="en_US.UTF-8" -export LC_CTYPE="zh_CN.UTF-8" -export LC_COLLATE="C" - -###### input method ###### -export XMODIFIERS="@im=fcitx" -export INPUT_METHOD="fcitx" -export GTK_IM_MODULE="fcitx" -export GTK3_IM_MODULE="fcitx" -export QT_IM_MODULE="fcitx" -export QT4_IM_MODULE="fcitx" - - -###### PATH ###### -# admin -if groups | grep -qE '\b(wheel|adm|sudo)\b'; then - export PATH="$PATH:/usr/local/sbin:/usr/sbin:/sbin" -fi -# $HOME/bin -if [ -d "$HOME/bin" ]; then - export PATH="$HOME/bin:$PATH" -fi -# npm -if [ -d "$HOME/npm/bin" ]; then - export PATH="$PATH:$HOME/npm/bin" -fi - - -###### Xmodmap ###### -[ -f ~/.Xmodmap ] && xmodmap ~/.Xmodmap - - -###### ConTeXt ###### -export OSFONTDIR="/usr/local/share/fonts;$HOME/.fonts" - - -###### bash ###### -if [ -n "$BASH_VERSION" ]; then - # include .bashrc if it exists - if [ -f "$HOME/.bashrc" ]; then - . "$HOME/.bashrc" - fi -fi - -# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=sh: # diff --git a/.rtorrent.rc b/.rtorrent.rc deleted file mode 100644 index 339cbeb..0000000 --- a/.rtorrent.rc +++ /dev/null @@ -1,193 +0,0 @@ -# -# rtorrent configure file -# - -### shortcuts ### -# Ctrl-q: closes rTorrent, done twice makes the program shutdown -# without waiting to send stopping information to the trackers -# Left arrow: returns to the previous screen -# Right arrow: goes to the next screen -# a|s|d: increase global upload throttle about 1|5|50 KB/s -# A|S|D: increase global download throttle about 1|5|50 KB/s -# z|x|c: decrease global upload throttle about 1|5|50 KB/s -# Z|X|C: decrease global download throttle about 1|5|50 KB/s -# Ctrl-S: starts download -# Ctrl-D: stops an active download, removes a stopped download -# + or -: changes the download priority of selected torrent -# Backspace: adds the specified .torrent. after pressing this button -# write fuul path or URL of .torrent file - -# This is an example resource file for rTorrent. Copy to -# ~/.rtorrent.rc and enable/modify the options as needed. Remember to -# uncomment the options you wish to enable. - -# Maximum and minimum number of peers to connect to per torrent. -#min_peers = 40 -max_peers = 52 - -# Same as above but for seeding completed torrents (-1 = same as downloading) -#min_peers_seed = 10 -max_peers_seed = 52 - -# Maximum number of simultanious uploads per torrent. -max_uploads = 8 - -# Global upload and download rate in KiB. "0" for unlimited. -download_rate = 0 -upload_rate = 0 - -# Default directory to save the downloaded torrents. -#directory = /home/[user]/torrents/ -#directory = ~/downloads/torrents - -# Default session directory. Make sure you don't run multiple instance -# of rtorrent using the same session directory. Perhaps using a -# relative path? -session = ~/downloads/torrents/.session/ - -# Watch a directory for new torrents, and stop those that have been detected -#schedule = watch_directory,5,5,load_start="~/downloads/torrents/*.torrent" -# stop downloading after the torrent file removed -schedule = untied_directory,5,5,stop_untied= -schedule = tied_directory,5,5,start_tied= - -# Close torrents when diskspace is low. -schedule = low_diskspace,5,60,close_low_diskspace=2000M - -# Stop torrents when reaching upload ratio in percent, -# when also reaching total upload in bytes, or when -# reaching final upload ratio in percent. -# example: stop at ratio 2.0 with at least 200 MB uploaded, or else ratio 20.0 -### error ### -#schedule = ratio,60,60,stop_on_ratio=200,200M,2000 - -# The ip address reported to the tracker. -#ip = 127.0.0.1 -#ip = rakshasa.no - -# The ip address the listening socket and outgoing connections is -# bound to. -#bind = 127.0.0.1 -#bind = rakshasa.no - -# Port range to use for listening. -port_range = 42396-43000 - -# Start opening ports at a random position within the port range. -port_random = yes - -# Encryption options, set to none (default) or any combination of the following: -# allow_incoming, try_outgoing, require, require_RC4, enable_retry, prefer_plaintext -# -# The example value allows incoming encrypted connections, starts unencrypted -# outgoing connections but retries with encryption if they fail, preferring -# plaintext to RC4 encryption after the encrypted handshake -# -# encryption = allow_incoming,enable_retry,prefer_plaintext -encryption = allow_incoming,try_outgoing,enable_retry - -# Enable DHT support for trackerless torrents or when all trackers are down. -# May be set to "disable" (completely disable DHT), "off" (do not start DHT), -# "auto" (start and stop DHT as needed), or "on" (start DHT immediately). -# The default is "off". For DHT to work, a session directory must be defined. -dht = auto - -# UDP port to use for DHT. -dht_port = 6881 - -# Enable peer exchange (for torrents not marked private) -peer_exchange = yes - -# Check hash for finished torrents. Might be usefull until the bug is -# fixed that causes lack of diskspace not to be properly reported. -check_hash = yes - -use_udp_trackers = yes - -# Alternative calls to bind and ip that should handle dynamic ip's. -#schedule = ip_tick,0,1800,ip=rakshasa -#schedule = bind_tick,0,1800,bind=rakshasa - -# for chinese support -encoding_list = UTF-8 - -# press 9 in your rtorrent client to see the changes in action -schedule = filter_active,30,30,"view_filter = active,\"or={d.get_up_rate=,d.get_down_rate=}\"" - -# for remote management -#scgi_port = localhost:5000 - - -#### Automatically Move Completed Torrent Data to 'Completed' Folders - -# location where new torrent data is placed, and where you should place your -# 'complete' data before you place your *.torrent file into the watch folder -directory = ~/downloads/torrents/incomplete - -# schedule a timer event named 'watch_directory_1': -# 1) triggers 10 seconds after rtorrent starts -# 2) triggers at 10 second intervals thereafter -# 3) Upon trigger, attempt to load (and start) new *.torrent files found in /home/user/torrents/watch/ -# 4) set a variable named 'custom1' with the value "/home/user/torrents/complete" -# NOTE: if you don't want it to automatically start the torrent, change 'load_start' to 'load' -schedule = watch_directory_1,10,10,"load_start=~/downloads/torrents/watch/*.torrent,d.set_custom1=~/downloads/torrents/complete" - -# insert a method with the alias 'checkdirs1' -# 1) returns true if the current path of the torrent data is not equal to the value of custom1 -# 2) otherwise, returns false -system.method.insert=checkdirs1,simple,"not=\"$equal={d.get_custom1=,d.get_base_path=}\"" - -# insert a method with the alias 'movecheck1' -# 1) returns true if all 3 commands return true ('result of checkdirs1' && 'torrent is 100% done', 'custom1 variable is set') -# 2) otherwise, returns false -system.method.insert=movecheck1,simple,"and={checkdirs1=,d.get_complete=,d.get_custom1=}" - -# insert a method with the alias 'movedir1' -# (a series of commands, separated by ';') -# 1) "set path of torrent to equal the value of custom1"; -# 2) "mv -u "; -# 3) "clear custom1", "stop the torrent","resume the torrent" -# 4) stop the torrent -# 5) start the torrent (to get the torrent to update the 'base path') -system.method.insert=movedir1,simple,"d.set_directory=$d.get_custom1=;execute=mv,-u,$d.get_base_path=,$d.get_custom1=;d.set_custom1=;d.stop=;d.start=" - -# set a key with the name 'move_hashed1' that is triggered by the hash_done event. -# 1) When hashing of a torrent completes, this custom key will be triggered. -# 2) when triggered, execute the 'movecheck1' method and check the return value. -# 3) if the 'movecheck' method returns 'true', execute the 'movedir1' method we inserted above. -# NOTE: 'branch' is an 'if' conditional statement: if(movecheck1){movedir1} -system.method.set_key=event.download.hash_done,move_hashed1,"branch={$movecheck1=,movedir1=}" - - -# -# Do not modify the following parameters unless you know what you're doing. -# -# Hash read-ahead controls how many MB to request the kernel to read -# ahead. If the value is too low the disk may not be fully utilized, -# while if too high the kernel might not be able to keep the read -# pages in memory thus end up trashing. -#hash_read_ahead = 10 - -# Interval between attempts to check the hash, in milliseconds. -#hash_interval = 100 - -# Number of attempts to check the hash while using the mincore status, -# before forcing. Overworked systems might need lower values to get a -# decent hash checking rate. -#hash_max_tries = 10 - -# Max number of files to keep open simultaniously. -#max_open_files = 128 - -# Number of sockets to simultaneously keep open. -#max_open_sockets = - - -# Example of scheduling commands: Switch between two ip's every 5 -# seconds. -#schedule = "ip_tick1,5,10,ip=torretta" -#schedule = "ip_tick2,10,10,ip=lampedusa" - -# Remove a scheduled event. -#schedule_remove = "ip_tick1" - diff --git a/.sbclrc b/.sbclrc deleted file mode 100644 index d50d88f..0000000 --- a/.sbclrc +++ /dev/null @@ -1,23 +0,0 @@ -;;; ~/.sbclrc - -;;; The following lines added by ql:add-to-init-file: -#-quicklisp -(let ((quicklisp-init (merge-pathnames "~/.quicklisp/setup.lisp" - (user-homedir-pathname)))) - (when (probe-file quicklisp-init) - (load quicklisp-init))) - -;;; http://common-lisp.net/project/linedit/ -;;; Check for --no-linedit command-line option. -(if (member "--no-linedit" sb-ext:*posix-argv* :test 'equal) - (setf sb-ext:*posix-argv* - (remove "--no-linedit" sb-ext:*posix-argv* :test 'equal)) - (when (interactive-stream-p *terminal-io*) - (require :sb-aclrepl) - (require :linedit) - (funcall (intern "INSTALL-REPL" :linedit) :wrap-current t))) - -;;; https://gist.github.com/bdsatish/5403002 -;; Don't break into debugger, but just display error message and return to top-level loop (REPL) -(setf *debugger-hook* #'(lambda (c h) (declare (ignore h)) (print c) (abort))) - diff --git a/.screenrc b/.screenrc deleted file mode 100644 index 66c8e05..0000000 --- a/.screenrc +++ /dev/null @@ -1,83 +0,0 @@ -# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # -# Use this line if you want instant charset mapping from gbk to -# unicode. Conflict with mutt's unicode setting. -#defencoding gbk - -# hardstatus line -hardstatus alwayslastline -#left aligned -#hardstatus string "%{= R}[%{y}%l%{r}][ %{=b b}%-w%{=rb db}%>%n %t%{-}%+w%{-b}%< %=%{R}][%{G}%c %{M}%D %m-%d%{R}]" -#center aligned -hardstatus string "%{= B}:%{= b}: %{= r}[ %{=b G}%H%{= r} ] %= %{=b b}%-w%{=rb db}%>%n %t%{-}%+w %=%{= r}[ %{G}%c %{M}%D %m-%d %{r}] %{= b}:%{B}:" -#caption always "%{= mW} %= %H %=" -#caption always "%{= gk}%-Lw%{= rW}%50> %n%f* %t %{-}%+Lw%< %= %{= Gk} %H %{= rW} %l %{= Gk} %0c:%s %d/%m %{-}" -#new version from vermaden -#hardstatus string '%{= M} %H%{= G} %l %= %{= w}%-w%{+b r}%n*%t%{-b r}%{w}%+w %= %{c}%d %D %{B}%c ' -# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # -## Some general options ## - -# Make the xterm scroller work in screen, also works -# with mouse scrollwheel(does not work...) -terminfo xterm*|rxvt ti@:te@ -#allow bold -#attrcolor b ".I" -## erase background with current bg color -#defbce "on" -#fix rxvt-unicode 256 color problem -terminfo rxvt-unicode 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' -# tell screen how to set colors. AB = background, AF=foreground -#terminfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' -#dynamic title -terminfo xterm* 'XT:hs:ts=\E]2;:fs=\007:ds=\E]2;screen\007' - -# Automatically detach on hangup, or the screen will keep eating your memory after the terminal emulator has been terminated. -autodetach on # default: on - -# Refresh the display when exiting programs like vim, nano, irssi and etc. -altscreen on - -#define a large scrollback buffer -defscrollback 1000 - -# Set messages timeout to 5 second: -msgwait 4 -msgminwait 1 -pow_detach_msg "Screen session of \$LOGNAME \$:cr:\$:nl:ended." -#version -# start message: -startup_message off # default: on - -# use audio bell -vbell off -vbell_msg " Wuff ---- Wuff!! " - -#nethack style messages -nethack on - -#utf-8 handling -defutf8 on - -attrcolor b ".I" - -#use zshell as default shell -#shell zsh -shell /bin/zsh - -# =-=-=-=-=-=-=-=-=-=-=Key bindings-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # -# bind F1 to select 1 -# bind F7 to detach screen session from this terminal -# bind F8 to kill current screen window. -# bind F9 to create a new screen -# bind F10 to rename current screen window -# bind F11 to move to previous window -# bind F12 to move to next window -#bindkey -k k1 select 1 -#bindkey -k k7 detach -#bindkey -k k8 kill -#bindkey -k k9 screen -#bindkey -k k; title -bindkey -k F1 prev -bindkey -k F2 next -# =-=-=-=-=-=-=-=-=-=-=-Sessions=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # -screen -screen diff --git a/.tmux.conf b/.tmux.conf deleted file mode 100644 index 260954e..0000000 --- a/.tmux.conf +++ /dev/null @@ -1,133 +0,0 @@ -######################################################################### -## tmux configuration ## -## ~/.tmux.conf ## -## ## -## Weitian LI ## -## 2015/01/22 ## -## ## -## ChangeLogs: ## -######################################################################### - -## References: -## [1] tmux: Productive Mouse-Free Development (by Brian P. Hogan) -## https://pragprog.com/book/bhtmux/tmux -## [2] Copy and Paste in tmux -## http://dudenbostel.leanside.com/2014/01/copy-paste-in-tmux/ - -## Settings the prefix from 'C-b' to 'C-a' -#set-option -g prefix C-a -#unbind-key C-b -#bind-key C-a send-prefix - -## Settings the delay between prefix and command -set-option -gs escape-time 1 - -## Set the base index for windows to 1 instead of 0 -set-option -g base-index 1 - -## Set the base index for panes to 1 instead of 0 -set-window-option -g pane-base-index 1 - -## Reload the configuration file with 'Prefix-r' -bind r source-file ~/.tmux.conf \; display "Reloaded!" - -## More straightforward key bindings for splitting panes -unbind % -bind | split-window -h -unbind '"' -bind - split-window -v - -## Move between the split panes -bind h select-pane -L -bind j select-pane -D -bind k select-pane -U -bind l select-pane -R - -## C-h/C-l to cycle through windows -bind -r C-h select-window -t :- -bind -r C-l select-window -t :+ - -## Quich cycle through windows -#bind-key -n C-p previous-window -#bind-key -n C-n next-window - -## Pane resizing -bind -r H resize-pane -L 5 -bind -r J resize-pane -D 5 -bind -r K resize-pane -U 5 -bind -r L resize-pane -R 5 - -## Mouse support -#set-window-option -g mode-mouse on -#set-option -g mouse-select-window on -#set-option -g mouse-select-pane on -#set-option -g mouse-resize-pane on - -## Set the default terminal mode -set-option -g default-terminal "screen-256color" - -## Enable activity alerts -set-window-option -g monitor-activity on -set-option -g visual-activity on - -## utf8 -set-option -g status-utf8 on -set-window-option -g utf8 on - -## Vi mode -set-window-option -g mode-keys vi -set-option -g status-keys vi - -## Set copy mode -# start copy mode with 'Prefix-Escape' -bind-key Escape copy-mode -# paste the latest buffer with 'Prefix-p' -bind-key p paste-buffer -# delete the most recently copied buffer -bind-key + delete-buffer - -# vi-copy settings -bind-key -t vi-copy 'v' begin-selection -bind-key -t vi-copy 'y' copy-selection -# change between line- and column-wise selection -bind-key -t vi-copy 'V' rectangle-toggle -bind-key -t vi-copy 'Y' copy-end-of-line - -## Scrollback history -set-option -g history-limit 5000 - -## How long to display messages and other indicators (unit: ms) -set-option -g display-time 3000 - -## Send multiple commands without pressing Prefix again -set-option -g repeat-time 1000 - -## Maximize and restore a pane -unbind Up -bind Up new-window -d -n tmp \; swap-pane -s tmp.1 \; select-window -t tmp -unbind Down -bind Down last-window \; swap-pane -s tmp.1 \; kill-window -t tmp - -## Log output to a text file on demand -bind P pipe-pane -o "cat >> ~/#W.log" \; display "Toggled logging to ~/#W.log" - -### Styles ### - -## Set the status line -set-option -g status-style "bg=default" -set-option -g status-justify centre -set-option -g status-left-length 30 -set-option -g status-right-length 30 -set-option -g status-left " #[fg=yellow,bold]#h:#[fg=blue,bold]#S #[fg=magenta,bold]|#[default]" -set-option -g status-right "#[fg=magenta,bold]| #[fg=yellow,bold]%a %m/%d #[fg=blue,bold]%H:%M " - -set-window-option -g window-status-style "fg=blue,bold" -set-window-option -g window-status-current-style "fg=blue,bold,reverse" -set-window-option -g window-status-format "#I:#{=10:window_name}#F" -set-window-option -g window-status-current-format "#I:#W#F" - -## command/message line style -set-option -g message-style "fg=white,bold,bg=blue" - - -# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=tmux: # diff --git a/.todo/config b/.todo/config deleted file mode 100644 index a60e513..0000000 --- a/.todo/config +++ /dev/null @@ -1,95 +0,0 @@ -########################################################### -## todo.txt-cli configuration -## https://github.com/ginatrapani/todo.txt-cli -########################################################### - -# === EDIT FILE LOCATIONS BELOW === - -# Your todo.txt directory -#export TODO_DIR="/Users/gina/Documents/todo" -#export TODO_DIR=$(dirname "$0") -export TODO_DIR="$HOME/.todo" - -# Your todo/done/report.txt locations -export TODO_FILE="$TODO_DIR/todo.txt" -export DONE_FILE="$TODO_DIR/done.txt" -export REPORT_FILE="$TODO_DIR/report.txt" - -# You can customize your actions directory location -export TODO_ACTIONS_DIR="$HOME/.todo.actions.d" - -# == EDIT FILE LOCATIONS ABOVE === - -# === COLOR MAP === - -## Text coloring and formatting is done by inserting ANSI escape codes. -## If you have re-mapped your color codes, or use the todo.txt -## output in another output system (like Conky), you may need to -## over-ride by uncommenting and editing these defaults. -## If you change any of these here, you also need to uncomment -## the defaults in the COLORS section below. Otherwise, todo.txt -## will still use the defaults! - -export BLACK='\\033[0;30m' -export RED='\\033[0;31m' -export GREEN='\\033[0;32m' -export BROWN='\\033[0;33m' -export BLUE='\\033[0;34m' -export PURPLE='\\033[0;35m' -export CYAN='\\033[0;36m' -export LIGHT_GREY='\\033[0;37m' -export DARK_GREY='\\033[1;30m' -export LIGHT_RED='\\033[1;31m' -export LIGHT_GREEN='\\033[1;32m' -export YELLOW='\\033[1;33m' -export LIGHT_BLUE='\\033[1;34m' -export LIGHT_PURPLE='\\033[1;35m' -export LIGHT_CYAN='\\033[1;36m' -export WHITE='\\033[1;37m' -export DEFAULT='\\033[0m' - -# === COLORS === - -## Uncomment and edit to override these defaults. -## Reference the constants from the color map above, -## or use $NONE to disable highlighting. -# -# Priorities can be any upper-case letter. -# A,B,C are highlighted; you can add coloring for more. -# -export PRI_A=$YELLOW # color for A priority -export PRI_B=$GREEN # color for B priority -export PRI_C=$LIGHT_BLUE # color for C priority -#export PRI_D=... # define your own -export PRI_X=$WHITE # color unless explicitly defined - -# There is highlighting for tasks that have been done, -# but haven't been archived yet. -# -export COLOR_DONE=$LIGHT_GREY - -# There is highlighting for projects and contexts. -# -export COLOR_PROJECT=$RED -export COLOR_CONTEXT=$RED - -# === BEHAVIOR === - -## customize list output -# -# TODOTXT_SORT_COMMAND will filter after line numbers are -# inserted, but before colorization, and before hiding of -# priority, context, and project. -# -#export TODOTXT_SORT_COMMAND='env LC_COLLATE=C sort -f -k2' -# -# Sort by priority, then by number -export TODOTXT_SORT_COMMAND='env LC_COLLATE=C sort -k 2,2 -k 1,1n' - -# TODOTXT_FINAL_FILTER will filter list output after colorization, -# priority hiding, context hiding, and project hiding. That is, -# just before the list output is displayed. -# -# export TODOTXT_FINAL_FILTER='cat' - -# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=sh: # diff --git a/.todo/todo.sh b/.todo/todo.sh deleted file mode 100755 index fbd2725..0000000 --- a/.todo/todo.sh +++ /dev/null @@ -1,1431 +0,0 @@ -#! /usr/bin/env bash - -# === HEAVY LIFTING === -shopt -s extglob extquote - -# NOTE: Todo.sh requires the .todo/config configuration file to run. -# Place the .todo/config file in your home directory or use the -d option for a custom location. - -[ -f VERSION-FILE ] && . VERSION-FILE || VERSION="2.10" -version() { - cat <<-EndVersion - TODO.TXT Command Line Interface v$VERSION - - First release: 5/11/2006 - Original conception by: Gina Trapani (http://ginatrapani.org) - Contributors: http://github.com/ginatrapani/todo.txt-cli/network - License: GPL, http://www.gnu.org/copyleft/gpl.html - More information and mailing list at http://todotxt.com - Code repository: http://github.com/ginatrapani/todo.txt-cli/tree/master - EndVersion - exit 1 -} - -# Set script name and full path early. -TODO_SH=$(basename "$0") -TODO_FULL_SH="$0" -export TODO_SH TODO_FULL_SH - -oneline_usage="$TODO_SH [-fhpantvV] [-d todo_config] action [task_number] [task_description]" - -usage() -{ - cat <<-EndUsage - Usage: $oneline_usage - Try '$TODO_SH -h' for more information. - EndUsage - exit 1 -} - -shorthelp() -{ - cat <<-EndHelp - Usage: $oneline_usage - - Actions: - add|a "THING I NEED TO DO +project @context" - addm "THINGS I NEED TO DO - MORE THINGS I NEED TO DO" - addto DEST "TEXT TO ADD" - append|app ITEM# "TEXT TO APPEND" - archive - command [ACTIONS] - deduplicate - del|rm ITEM# [TERM] - depri|dp ITEM#[, ITEM#, ITEM#, ...] - do ITEM#[, ITEM#, ITEM#, ...] - help [ACTION...] - list|ls [TERM...] - listall|lsa [TERM...] - listaddons - listcon|lsc [TERM...] - listfile|lf [SRC [TERM...]] - listpri|lsp [PRIORITIES] [TERM...] - listproj|lsprj [TERM...] - move|mv ITEM# DEST [SRC] - prepend|prep ITEM# "TEXT TO PREPEND" - pri|p ITEM# PRIORITY - replace ITEM# "UPDATED TODO" - report - shorthelp - - Actions can be added and overridden using scripts in the actions - directory. - EndHelp - - # Only list the one-line usage from the add-on actions. This assumes that - # add-ons use the same usage indentation structure as todo.sh. - addonHelp | grep -e '^ Add-on Actions:' -e '^ [[:alpha:]]' - - cat <<-EndHelpFooter - - See "help" for more details. - EndHelpFooter -} - -help() -{ - cat <<-EndOptionsHelp - Usage: $oneline_usage - - Options: - -@ - Hide context names in list output. Use twice to show context - names (default). - -+ - Hide project names in list output. Use twice to show project - names (default). - -c - Color mode - -d CONFIG_FILE - Use a configuration file other than the default ~/.todo/config - -f - Forces actions without confirmation or interactive input - -h - Display a short help message; same as action "shorthelp" - -p - Plain mode turns off colors - -P - Hide priority labels in list output. Use twice to show - priority labels (default). - -a - Don't auto-archive tasks automatically on completion - -A - Auto-archive tasks automatically on completion - -n - Don't preserve line numbers; automatically remove blank lines - on task deletion - -N - Preserve line numbers - -t - Prepend the current date to a task automatically - when it's added. - -T - Do not prepend the current date to a task automatically - when it's added. - -v - Verbose mode turns on confirmation messages - -vv - Extra verbose mode prints some debugging information and - additional help text - -V - Displays version, license and credits - -x - Disables TODOTXT_FINAL_FILTER - - - EndOptionsHelp - - [ $TODOTXT_VERBOSE -gt 1 ] && cat <<-'EndVerboseHelp' - Environment variables: - TODOTXT_AUTO_ARCHIVE is same as option -a (0)/-A (1) - TODOTXT_CFG_FILE=CONFIG_FILE is same as option -d CONFIG_FILE - TODOTXT_FORCE=1 is same as option -f - TODOTXT_PRESERVE_LINE_NUMBERS is same as option -n (0)/-N (1) - TODOTXT_PLAIN is same as option -p (1)/-c (0) - TODOTXT_DATE_ON_ADD is same as option -t (1)/-T (0) - TODOTXT_VERBOSE=1 is same as option -v - TODOTXT_DISABLE_FILTER=1 is same as option -x - TODOTXT_DEFAULT_ACTION="" run this when called with no arguments - TODOTXT_SORT_COMMAND="sort ..." customize list output - TODOTXT_FINAL_FILTER="sed ..." customize list after color, P@+ hiding - TODOTXT_SOURCEVAR=\$DONE_FILE use another source for listcon, listproj - - - EndVerboseHelp - actionsHelp - addonHelp -} - -actionsHelp() -{ - cat <<-EndActionsHelp - Built-in Actions: - add "THING I NEED TO DO +project @context" - a "THING I NEED TO DO +project @context" - Adds THING I NEED TO DO to your todo.txt file on its own line. - Project and context notation optional. - Quotes optional. - - addm "FIRST THING I NEED TO DO +project1 @context - SECOND THING I NEED TO DO +project2 @context" - Adds FIRST THING I NEED TO DO to your todo.txt on its own line and - Adds SECOND THING I NEED TO DO to you todo.txt on its own line. - Project and context notation optional. - - addto DEST "TEXT TO ADD" - Adds a line of text to any file located in the todo.txt directory. - For example, addto inbox.txt "decide about vacation" - - append ITEM# "TEXT TO APPEND" - app ITEM# "TEXT TO APPEND" - Adds TEXT TO APPEND to the end of the task on line ITEM#. - Quotes optional. - - archive - Moves all done tasks from todo.txt to done.txt and removes blank lines. - - command [ACTIONS] - Runs the remaining arguments using only todo.sh builtins. - Will not call any .todo.actions.d scripts. - - deduplicate - Removes duplicate lines from todo.txt. - - del ITEM# [TERM] - rm ITEM# [TERM] - Deletes the task on line ITEM# in todo.txt. - If TERM specified, deletes only TERM from the task. - - depri ITEM#[, ITEM#, ITEM#, ...] - dp ITEM#[, ITEM#, ITEM#, ...] - Deprioritizes (removes the priority) from the task(s) - on line ITEM# in todo.txt. - - do ITEM#[, ITEM#, ITEM#, ...] - Marks task(s) on line ITEM# as done in todo.txt. - - help [ACTION...] - Display help about usage, options, built-in and add-on actions, - or just the usage help for the passed ACTION(s). - - list [TERM...] - ls [TERM...] - Displays all tasks that contain TERM(s) sorted by priority with line - numbers. Each task must match all TERM(s) (logical AND); to display - tasks that contain any TERM (logical OR), use - "TERM1\|TERM2\|..." (with quotes), or TERM1\\\|TERM2 (unquoted). - Hides all tasks that contain TERM(s) preceded by a - minus sign (i.e. -TERM). If no TERM specified, lists entire todo.txt. - - listall [TERM...] - lsa [TERM...] - Displays all the lines in todo.txt AND done.txt that contain TERM(s) - sorted by priority with line numbers. Hides all tasks that - contain TERM(s) preceded by a minus sign (i.e. -TERM). If no - TERM specified, lists entire todo.txt AND done.txt - concatenated and sorted. - - listaddons - Lists all added and overridden actions in the actions directory. - - listcon [TERM...] - lsc [TERM...] - Lists all the task contexts that start with the @ sign in todo.txt. - If TERM specified, considers only tasks that contain TERM(s). - - listfile [SRC [TERM...]] - lf [SRC [TERM...]] - Displays all the lines in SRC file located in the todo.txt directory, - sorted by priority with line numbers. If TERM specified, lists - all lines that contain TERM(s) in SRC file. Hides all tasks that - contain TERM(s) preceded by a minus sign (i.e. -TERM). - Without any arguments, the names of all text files in the todo.txt - directory are listed. - - listpri [PRIORITIES] [TERM...] - lsp [PRIORITIES] [TERM...] - Displays all tasks prioritized PRIORITIES. - PRIORITIES can be a single one (A) or a range (A-C). - If no PRIORITIES specified, lists all prioritized tasks. - If TERM specified, lists only prioritized tasks that contain TERM(s). - Hides all tasks that contain TERM(s) preceded by a minus sign - (i.e. -TERM). - - listproj [TERM...] - lsprj [TERM...] - Lists all the projects (terms that start with a + sign) in - todo.txt. - If TERM specified, considers only tasks that contain TERM(s). - - move ITEM# DEST [SRC] - mv ITEM# DEST [SRC] - Moves a line from source text file (SRC) to destination text file (DEST). - Both source and destination file must be located in the directory defined - in the configuration directory. When SRC is not defined - it's by default todo.txt. - - prepend ITEM# "TEXT TO PREPEND" - prep ITEM# "TEXT TO PREPEND" - Adds TEXT TO PREPEND to the beginning of the task on line ITEM#. - Quotes optional. - - pri ITEM# PRIORITY - p ITEM# PRIORITY - Adds PRIORITY to task on line ITEM#. If the task is already - prioritized, replaces current priority with new PRIORITY. - PRIORITY must be a letter between A and Z. - - replace ITEM# "UPDATED TODO" - Replaces task on line ITEM# with UPDATED TODO. - - report - Adds the number of open tasks and done tasks to report.txt. - - shorthelp - List the one-line usage of all built-in and add-on actions. - - EndActionsHelp -} - -addonHelp() -{ - if [ -d "$TODO_ACTIONS_DIR" ]; then - didPrintAddonActionsHeader= - for action in "$TODO_ACTIONS_DIR"/* - do - if [ -f "$action" -a -x "$action" ]; then - if [ ! "$didPrintAddonActionsHeader" ]; then - cat <<-EndAddonActionsHeader - Add-on Actions: - EndAddonActionsHeader - didPrintAddonActionsHeader=1 - fi - "$action" usage - elif [ -d "$action" -a -x "$action/$(basename $action)" ]; then - if [ ! "$didPrintAddonActionsHeader" ]; then - cat <<-EndAddonActionsHeader - Add-on Actions: - EndAddonActionsHeader - didPrintAddonActionsHeader=1 - fi - "$action/$(basename $action)" usage - fi - done - fi -} - -actionUsage() -{ - for actionName - do - action="${TODO_ACTIONS_DIR}/${actionName}" - if [ -f "$action" -a -x "$action" ]; then - "$action" usage - elif [ -d "$action" -a -x "$action/$(basename $action)" ]; then - "$action/$(basename $action)" usage - else - builtinActionUsage=$(actionsHelp | sed -n -e "/^ ${actionName//\//\\/} /,/^\$/p" -e "/^ ${actionName//\//\\/}$/,/^\$/p") - if [ "$builtinActionUsage" ]; then - echo "$builtinActionUsage" - echo - else - die "TODO: No action \"${actionName}\" exists." - fi - fi - done -} - -dieWithHelp() -{ - case "$1" in - help) help;; - shorthelp) shorthelp;; - esac - shift - - die "$@" -} -die() -{ - echo "$*" - exit 1 -} - -cleaninput() -{ - # Parameters: When $1 = "for sed", performs additional escaping for use - # in sed substitution with "|" separators. - # Precondition: $input contains text to be cleaned. - # Postcondition: Modifies $input. - - # Replace CR and LF with space; tasks always comprise a single line. - input=${input//$'\r'/ } - input=${input//$'\n'/ } - - if [ "$1" = "for sed" ]; then - # This action uses sed with "|" as the substitution separator, and & as - # the matched string; these must be escaped. - # Backslashes must be escaped, too, and before the other stuff. - input=${input//\\/\\\\} - input=${input//|/\\|} - input=${input//&/\\&} - fi -} - -getPrefix() -{ - # Parameters: $1: todo file; empty means $TODO_FILE. - # Returns: Uppercase FILE prefix to be used in place of "TODO:" where - # a different todo file can be specified. - local base=$(basename "${1:-$TODO_FILE}") - echo "${base%%.[^.]*}" | tr 'a-z' 'A-Z' -} - -getTodo() -{ - # Parameters: $1: task number - # $2: Optional todo file - # Precondition: $errmsg contains usage message. - # Postcondition: $todo contains task text. - - local item=$1 - [ -z "$item" ] && die "$errmsg" - [ "${item//[0-9]/}" ] && die "$errmsg" - - todo=$(sed "$item!d" "${2:-$TODO_FILE}") - [ -z "$todo" ] && die "$(getPrefix "$2"): No task $item." -} -getNewtodo() -{ - # Parameters: $1: task number - # $2: Optional todo file - # Precondition: None. - # Postcondition: $newtodo contains task text. - - local item=$1 - [ -z "$item" ] && die 'Programming error: $item should exist.' - [ "${item//[0-9]/}" ] && die 'Programming error: $item should be numeric.' - - newtodo=$(sed "$item!d" "${2:-$TODO_FILE}") - [ -z "$newtodo" ] && die "$(getPrefix "$2"): No updated task $item." -} - -replaceOrPrepend() -{ - action=$1; shift - case "$action" in - replace) - backref= - querytext="Replacement: " - ;; - prepend) - backref=' &' - querytext="Prepend: " - ;; - esac - shift; item=$1; shift - getTodo "$item" - - if [[ -z "$1" && $TODOTXT_FORCE = 0 ]]; then - echo -n "$querytext" - read input - else - input=$* - fi - - # Retrieve existing priority and prepended date - local -r priAndDateExpr='^\((.) \)\{0,1\}\([0-9]\{2,4\}-[0-9]\{2\}-[0-9]\{2\} \)\{0,1\}' - priority=$(sed -e "$item!d" -e "${item}s/${priAndDateExpr}.*/\\1/" "$TODO_FILE") - prepdate=$(sed -e "$item!d" -e "${item}s/${priAndDateExpr}.*/\\2/" "$TODO_FILE") - - if [ "$prepdate" -a "$action" = "replace" ] && [ "$(echo "$input"|sed -e "s/${priAndDateExpr}.*/\\1\\2/")" ]; then - # If the replaced text starts with a [priority +] date, it will replace - # the existing date, too. - prepdate= - fi - - # Temporarily remove any existing priority and prepended date, perform the - # change (replace/prepend) and re-insert the existing priority and prepended - # date again. - cleaninput "for sed" - sed -i.bak -e "$item s/^${priority}${prepdate}//" -e "$item s|^.*|${priority}${prepdate}${input}${backref}|" "$TODO_FILE" - if [ $TODOTXT_VERBOSE -gt 0 ]; then - getNewtodo "$item" - case "$action" in - replace) - echo "$item $todo" - echo "TODO: Replaced task with:" - echo "$item $newtodo" - ;; - prepend) - echo "$item $newtodo" - ;; - esac - fi -} - -#Preserving environment variables so they don't get clobbered by the config file -OVR_TODOTXT_AUTO_ARCHIVE="$TODOTXT_AUTO_ARCHIVE" -OVR_TODOTXT_FORCE="$TODOTXT_FORCE" -OVR_TODOTXT_PRESERVE_LINE_NUMBERS="$TODOTXT_PRESERVE_LINE_NUMBERS" -OVR_TODOTXT_PLAIN="$TODOTXT_PLAIN" -OVR_TODOTXT_DATE_ON_ADD="$TODOTXT_DATE_ON_ADD" -OVR_TODOTXT_DISABLE_FILTER="$TODOTXT_DISABLE_FILTER" -OVR_TODOTXT_VERBOSE="$TODOTXT_VERBOSE" -OVR_TODOTXT_DEFAULT_ACTION="$TODOTXT_DEFAULT_ACTION" -OVR_TODOTXT_SORT_COMMAND="$TODOTXT_SORT_COMMAND" -OVR_TODOTXT_FINAL_FILTER="$TODOTXT_FINAL_FILTER" - -# Prevent GREP_OPTIONS from malforming grep's output -GREP_OPTIONS="" - -# == PROCESS OPTIONS == -while getopts ":fhpcnNaAtTvVx+@Pd:" Option -do - case $Option in - '@' ) - ## HIDE_CONTEXT_NAMES starts at zero (false); increment it to one - ## (true) the first time this flag is seen. Each time the flag - ## is seen after that, increment it again so that an even - ## number shows context names and an odd number hides context - ## names. - : $(( HIDE_CONTEXT_NAMES++ )) - if [ $(( $HIDE_CONTEXT_NAMES % 2 )) -eq 0 ] - then - ## Zero or even value -- show context names - unset HIDE_CONTEXTS_SUBSTITUTION - else - ## One or odd value -- hide context names - export HIDE_CONTEXTS_SUBSTITUTION='[[:space:]]@[[:graph:]]\{1,\}' - fi - ;; - '+' ) - ## HIDE_PROJECT_NAMES starts at zero (false); increment it to one - ## (true) the first time this flag is seen. Each time the flag - ## is seen after that, increment it again so that an even - ## number shows project names and an odd number hides project - ## names. - : $(( HIDE_PROJECT_NAMES++ )) - if [ $(( $HIDE_PROJECT_NAMES % 2 )) -eq 0 ] - then - ## Zero or even value -- show project names - unset HIDE_PROJECTS_SUBSTITUTION - else - ## One or odd value -- hide project names - export HIDE_PROJECTS_SUBSTITUTION='[[:space:]][+][[:graph:]]\{1,\}' - fi - ;; - a ) - OVR_TODOTXT_AUTO_ARCHIVE=0 - ;; - A ) - OVR_TODOTXT_AUTO_ARCHIVE=1 - ;; - c ) - OVR_TODOTXT_PLAIN=0 - ;; - d ) - TODOTXT_CFG_FILE=$OPTARG - ;; - f ) - OVR_TODOTXT_FORCE=1 - ;; - h ) - # Short-circuit option parsing and forward to the action. - # Cannot just invoke shorthelp() because we need the configuration - # processed to locate the add-on actions directory. - set -- '-h' 'shorthelp' - OPTIND=2 - ;; - n ) - OVR_TODOTXT_PRESERVE_LINE_NUMBERS=0 - ;; - N ) - OVR_TODOTXT_PRESERVE_LINE_NUMBERS=1 - ;; - p ) - OVR_TODOTXT_PLAIN=1 - ;; - P ) - ## HIDE_PRIORITY_LABELS starts at zero (false); increment it to one - ## (true) the first time this flag is seen. Each time the flag - ## is seen after that, increment it again so that an even - ## number shows priority labels and an odd number hides priority - ## labels. - : $(( HIDE_PRIORITY_LABELS++ )) - if [ $(( $HIDE_PRIORITY_LABELS % 2 )) -eq 0 ] - then - ## Zero or even value -- show priority labels - unset HIDE_PRIORITY_SUBSTITUTION - else - ## One or odd value -- hide priority labels - export HIDE_PRIORITY_SUBSTITUTION="([A-Z])[[:space:]]" - fi - ;; - t ) - OVR_TODOTXT_DATE_ON_ADD=1 - ;; - T ) - OVR_TODOTXT_DATE_ON_ADD=0 - ;; - v ) - : $(( TODOTXT_VERBOSE++ )) - ;; - V ) - version - ;; - x ) - OVR_TODOTXT_DISABLE_FILTER=1 - ;; - esac -done -shift $(($OPTIND - 1)) - -# defaults if not yet defined -TODOTXT_VERBOSE=${TODOTXT_VERBOSE:-1} -TODOTXT_PLAIN=${TODOTXT_PLAIN:-0} -TODOTXT_CFG_FILE=${TODOTXT_CFG_FILE:-$HOME/.todo/config} -TODOTXT_FORCE=${TODOTXT_FORCE:-0} -TODOTXT_PRESERVE_LINE_NUMBERS=${TODOTXT_PRESERVE_LINE_NUMBERS:-1} -TODOTXT_AUTO_ARCHIVE=${TODOTXT_AUTO_ARCHIVE:-1} -TODOTXT_DATE_ON_ADD=${TODOTXT_DATE_ON_ADD:-0} -TODOTXT_DEFAULT_ACTION=${TODOTXT_DEFAULT_ACTION:-} -TODOTXT_SORT_COMMAND=${TODOTXT_SORT_COMMAND:-env LC_COLLATE=C sort -f -k2} -TODOTXT_DISABLE_FILTER=${TODOTXT_DISABLE_FILTER:-} -TODOTXT_FINAL_FILTER=${TODOTXT_FINAL_FILTER:-cat} -TODOTXT_GLOBAL_CFG_FILE=${TODOTXT_GLOBAL_CFG_FILE:-/etc/todo/config} - -# Export all TODOTXT_* variables -export ${!TODOTXT_@} - -# Default color map -export NONE='' -export BLACK='\\033[0;30m' -export RED='\\033[0;31m' -export GREEN='\\033[0;32m' -export BROWN='\\033[0;33m' -export BLUE='\\033[0;34m' -export PURPLE='\\033[0;35m' -export CYAN='\\033[0;36m' -export LIGHT_GREY='\\033[0;37m' -export DARK_GREY='\\033[1;30m' -export LIGHT_RED='\\033[1;31m' -export LIGHT_GREEN='\\033[1;32m' -export YELLOW='\\033[1;33m' -export LIGHT_BLUE='\\033[1;34m' -export LIGHT_PURPLE='\\033[1;35m' -export LIGHT_CYAN='\\033[1;36m' -export WHITE='\\033[1;37m' -export DEFAULT='\\033[0m' - -# Default priority->color map. -export PRI_A=$YELLOW # color for A priority -export PRI_B=$GREEN # color for B priority -export PRI_C=$LIGHT_BLUE # color for C priority -export PRI_X=$WHITE # color unless explicitly defined - -# Default project and context colors. -export COLOR_PROJECT=$NONE -export COLOR_CONTEXT=$NONE - -# Default highlight colors. -export COLOR_DONE=$LIGHT_GREY # color for done (but not yet archived) tasks - -# Default sentence delimiters for todo.sh append. -# If the text to be appended to the task begins with one of these characters, no -# whitespace is inserted in between. This makes appending to an enumeration -# (todo.sh add 42 ", foo") syntactically correct. -export SENTENCE_DELIMITERS=',.:;' - -[ -e "$TODOTXT_CFG_FILE" ] || { - CFG_FILE_ALT="$HOME/todo.cfg" - - if [ -e "$CFG_FILE_ALT" ] - then - TODOTXT_CFG_FILE="$CFG_FILE_ALT" - fi -} - -[ -e "$TODOTXT_CFG_FILE" ] || { - CFG_FILE_ALT="$HOME/.todo.cfg" - - if [ -e "$CFG_FILE_ALT" ] - then - TODOTXT_CFG_FILE="$CFG_FILE_ALT" - fi -} - -[ -e "$TODOTXT_CFG_FILE" ] || { - CFG_FILE_ALT=$(dirname "$0")"/todo.cfg" - - if [ -e "$CFG_FILE_ALT" ] - then - TODOTXT_CFG_FILE="$CFG_FILE_ALT" - fi -} - -[ -e "$TODOTXT_CFG_FILE" ] || { - CFG_FILE_ALT="$TODOTXT_GLOBAL_CFG_FILE" - - if [ -e "$CFG_FILE_ALT" ] - then - TODOTXT_CFG_FILE="$CFG_FILE_ALT" - fi -} - - -if [ -z "$TODO_ACTIONS_DIR" -o ! -d "$TODO_ACTIONS_DIR" ] -then - TODO_ACTIONS_DIR="$HOME/.todo/actions" - export TODO_ACTIONS_DIR -fi - -[ -d "$TODO_ACTIONS_DIR" ] || { - TODO_ACTIONS_DIR_ALT="$HOME/.todo.actions.d" - - if [ -d "$TODO_ACTIONS_DIR_ALT" ] - then - TODO_ACTIONS_DIR="$TODO_ACTIONS_DIR_ALT" - fi -} - -# === SANITY CHECKS (thanks Karl!) === -[ -r "$TODOTXT_CFG_FILE" ] || dieWithHelp "$1" "Fatal Error: Cannot read configuration file $TODOTXT_CFG_FILE" - -. "$TODOTXT_CFG_FILE" - -# === APPLY OVERRIDES -if [ -n "$OVR_TODOTXT_AUTO_ARCHIVE" ] ; then - TODOTXT_AUTO_ARCHIVE="$OVR_TODOTXT_AUTO_ARCHIVE" -fi -if [ -n "$OVR_TODOTXT_FORCE" ] ; then - TODOTXT_FORCE="$OVR_TODOTXT_FORCE" -fi -if [ -n "$OVR_TODOTXT_PRESERVE_LINE_NUMBERS" ] ; then - TODOTXT_PRESERVE_LINE_NUMBERS="$OVR_TODOTXT_PRESERVE_LINE_NUMBERS" -fi -if [ -n "$OVR_TODOTXT_PLAIN" ] ; then - TODOTXT_PLAIN="$OVR_TODOTXT_PLAIN" -fi -if [ -n "$OVR_TODOTXT_DATE_ON_ADD" ] ; then - TODOTXT_DATE_ON_ADD="$OVR_TODOTXT_DATE_ON_ADD" -fi -if [ -n "$OVR_TODOTXT_DISABLE_FILTER" ] ; then - TODOTXT_DISABLE_FILTER="$OVR_TODOTXT_DISABLE_FILTER" -fi -if [ -n "$OVR_TODOTXT_VERBOSE" ] ; then - TODOTXT_VERBOSE="$OVR_TODOTXT_VERBOSE" -fi -if [ -n "$OVR_TODOTXT_DEFAULT_ACTION" ] ; then - TODOTXT_DEFAULT_ACTION="$OVR_TODOTXT_DEFAULT_ACTION" -fi -if [ -n "$OVR_TODOTXT_SORT_COMMAND" ] ; then - TODOTXT_SORT_COMMAND="$OVR_TODOTXT_SORT_COMMAND" -fi -if [ -n "$OVR_TODOTXT_FINAL_FILTER" ] ; then - TODOTXT_FINAL_FILTER="$OVR_TODOTXT_FINAL_FILTER" -fi - -ACTION=${1:-$TODOTXT_DEFAULT_ACTION} - -[ -z "$ACTION" ] && usage -[ -d "$TODO_DIR" ] || mkdir -p $TODO_DIR 2> /dev/null || dieWithHelp "$1" "Fatal Error: $TODO_DIR is not a directory" -( cd "$TODO_DIR" ) || dieWithHelp "$1" "Fatal Error: Unable to cd to $TODO_DIR" - -[ -f "$TODO_FILE" -o -c "$TODO_FILE" ] || > "$TODO_FILE" -[ -f "$DONE_FILE" -o -c "$DONE_FILE" ] || > "$DONE_FILE" -[ -f "$REPORT_FILE" -o -c "$REPORT_FILE" ] || > "$REPORT_FILE" - -if [ $TODOTXT_PLAIN = 1 ]; then - for clr in ${!PRI_@}; do - export $clr=$NONE - done - PRI_X=$NONE - DEFAULT=$NONE - COLOR_DONE=$NONE - COLOR_PROJECT=$NONE - COLOR_CONTEXT=$NONE -fi - -[[ "$HIDE_PROJECTS_SUBSTITUTION" ]] && COLOR_PROJECT="$NONE" -[[ "$HIDE_CONTEXTS_SUBSTITUTION" ]] && COLOR_CONTEXT="$NONE" - -_addto() { - file="$1" - input="$2" - cleaninput - - if [[ $TODOTXT_DATE_ON_ADD = 1 ]]; then - now=$(date '+%Y-%m-%d') - input=$(echo "$input" | sed -e 's/^\(([A-Z]) \)\{0,1\}/\1'"$now /") - fi - echo "$input" >> "$file" - if [ $TODOTXT_VERBOSE -gt 0 ]; then - TASKNUM=$(sed -n '$ =' "$file") - echo "$TASKNUM $input" - echo "$(getPrefix "$file"): $TASKNUM added." - fi -} - -shellquote() -{ - typeset -r qq=\'; printf %s\\n "'${1//\'/${qq}\\${qq}${qq}}'"; -} - -filtercommand() -{ - filter=${1:-} - shift - post_filter=${1:-} - shift - - for search_term - do - ## See if the first character of $search_term is a dash - if [ "${search_term:0:1}" != '-' ] - then - ## First character isn't a dash: hide lines that don't match - ## this $search_term - filter="${filter:-}${filter:+ | }grep -i $(shellquote "$search_term")" - else - ## First character is a dash: hide lines that match this - ## $search_term - # - ## Remove the first character (-) before adding to our filter command - filter="${filter:-}${filter:+ | }grep -v -i $(shellquote "${search_term:1}")" - fi - done - - [ -n "$post_filter" ] && { - filter="${filter:-}${filter:+ | }${post_filter:-}" - } - - printf %s "$filter" -} - -_list() { - local FILE="$1" - ## If the file starts with a "/" use absolute path. Otherwise, - ## try to find it in either $TODO_DIR or using a relative path - if [ "${1:0:1}" == / ]; then - ## Absolute path - src="$FILE" - elif [ -f "$TODO_DIR/$FILE" ]; then - ## Path relative to todo.sh directory - src="$TODO_DIR/$FILE" - elif [ -f "$FILE" ]; then - ## Path relative to current working directory - src="$FILE" - elif [ -f "$TODO_DIR/${FILE}.txt" ]; then - ## Path relative to todo.sh directory, missing file extension - src="$TODO_DIR/${FILE}.txt" - else - die "TODO: File $FILE does not exist." - fi - - ## Get our search arguments, if any - shift ## was file name, new $1 is first search term - - _format "$src" '' "$@" - - if [ $TODOTXT_VERBOSE -gt 0 ]; then - echo "--" - echo "$(getPrefix "$src"): ${NUMTASKS:-0} of ${TOTALTASKS:-0} tasks shown" - fi -} -getPadding() -{ - ## We need one level of padding for each power of 10 $LINES uses. - LINES=$(sed -n '$ =' "${1:-$TODO_FILE}") - printf %s ${#LINES} -} -_format() -{ - # Parameters: $1: todo input file; when empty formats stdin - # $2: ITEM# number width; if empty auto-detects from $1 / $TODO_FILE. - # Precondition: None - # Postcondition: $NUMTASKS and $TOTALTASKS contain statistics (unless $TODOTXT_VERBOSE=0). - - FILE=$1 - shift - - ## Figure out how much padding we need to use, unless this was passed to us. - PADDING=${1:-$(getPadding "$FILE")} - shift - - ## Number the file, then run the filter command, - ## then sort and mangle output some more - if [[ $TODOTXT_DISABLE_FILTER = 1 ]]; then - TODOTXT_FINAL_FILTER="cat" - fi - items=$( - if [ "$FILE" ]; then - sed = "$FILE" - else - sed = - fi \ - | sed -e ''' - N - s/^/ / - s/ *\([ 0-9]\{'"$PADDING"',\}\)\n/\1 / - /^[ 0-9]\{1,\} *$/d - ''' - ) - - ## Build and apply the filter. - filter_command=$(filtercommand "${pre_filter_command:-}" "${post_filter_command:-}" "$@") - if [ "${filter_command}" ]; then - filtered_items=$(echo -n "$items" | eval "${filter_command}") - else - filtered_items=$items - fi - filtered_items=$( - echo -n "$filtered_items" \ - | sed ''' - s/^ /00000/; - s/^ /0000/; - s/^ /000/; - s/^ /00/; - s/^ /0/; - ''' \ - | eval ${TODOTXT_SORT_COMMAND} \ - | awk ''' - function highlight(colorVar, color) { - color = ENVIRON[colorVar] - gsub(/\\+033/, "\033", color) - return color - } - { - clr = "" - if (match($0, /^[0-9]+ x /)) { - clr = highlight("COLOR_DONE") - } else if (match($0, /^[0-9]+ \([A-Z]\) /)) { - clr = highlight("PRI_" substr($0, RSTART + RLENGTH - 3, 1)) - clr = (clr ? clr : highlight("PRI_X")) - if (ENVIRON["HIDE_PRIORITY_SUBSTITUTION"] != "") { - $0 = substr($0, 1, RLENGTH - 4) substr($0, RSTART + RLENGTH) - } - } - end_clr = (clr ? highlight("DEFAULT") : "") - - prj_beg = highlight("COLOR_PROJECT") - prj_end = (prj_beg ? (highlight("DEFAULT") clr) : "") - - ctx_beg = highlight("COLOR_CONTEXT") - ctx_end = (ctx_beg ? (highlight("DEFAULT") clr) : "") - - gsub(/[ \t][ \t]*/, "\n&\n") - len = split($0, words, /\n/) - - printf "%s", clr - for (i = 1; i <= len; ++i) { - if (words[i] ~ /^[+].*[A-Za-z0-9_]$/) { - printf "%s", prj_beg words[i] prj_end - } else if (words[i] ~ /^[@].*[A-Za-z0-9_]$/) { - printf "%s", ctx_beg words[i] ctx_end - } else { - printf "%s", words[i] - } - } - printf "%s\n", end_clr - } - ''' \ - | sed ''' - s/'"${HIDE_PROJECTS_SUBSTITUTION:-^}"'//g - s/'"${HIDE_CONTEXTS_SUBSTITUTION:-^}"'//g - s/'"${HIDE_CUSTOM_SUBSTITUTION:-^}"'//g - ''' \ - | eval ${TODOTXT_FINAL_FILTER} \ - ) - [ "$filtered_items" ] && echo "$filtered_items" - - if [ $TODOTXT_VERBOSE -gt 0 ]; then - NUMTASKS=$( echo -n "$filtered_items" | sed -n '$ =' ) - TOTALTASKS=$( echo -n "$items" | sed -n '$ =' ) - fi - if [ $TODOTXT_VERBOSE -gt 1 ]; then - echo "TODO DEBUG: Filter Command was: ${filter_command:-cat}" - fi -} - -listWordsWithSigil() -{ - sigil=$1 - shift - - FILE=$TODO_FILE - [ "$TODOTXT_SOURCEVAR" ] && eval "FILE=$TODOTXT_SOURCEVAR" - eval "$(filtercommand 'cat "${FILE[@]}"' '' "$@")" | grep -o "[^ ]*${sigil}[^ ]\\+" | grep "^$sigil" | sort -u -} - -export -f cleaninput getPrefix getTodo getNewtodo shellquote filtercommand _list listWordsWithSigil getPadding _format die - -# == HANDLE ACTION == -action=$( printf "%s\n" "$ACTION" | tr 'A-Z' 'a-z' ) - -## If the first argument is "command", run the rest of the arguments -## using todo.sh builtins. -## Else, run a actions script with the name of the command if it exists -## or fallback to using a builtin -if [ "$action" == command ] -then - ## Get rid of "command" from arguments list - shift - ## Reset action to new first argument - action=$( printf "%s\n" "$1" | tr 'A-Z' 'a-z' ) -elif [ -d "$TODO_ACTIONS_DIR/$action" -a -x "$TODO_ACTIONS_DIR/$action/$action" ] -then - "$TODO_ACTIONS_DIR/$action/$action" "$@" - exit $? -elif [ -d "$TODO_ACTIONS_DIR" -a -x "$TODO_ACTIONS_DIR/$action" ] -then - "$TODO_ACTIONS_DIR/$action" "$@" - exit $? -fi - -## Only run if $action isn't found in .todo.actions.d -case $action in -"add" | "a") - if [[ -z "$2" && $TODOTXT_FORCE = 0 ]]; then - echo -n "Add: " - read input - else - [ -z "$2" ] && die "usage: $TODO_SH add \"TODO ITEM\"" - shift - input=$* - fi - _addto "$TODO_FILE" "$input" - ;; - -"addm") - if [[ -z "$2" && $TODOTXT_FORCE = 0 ]]; then - echo -n "Add: " - read input - else - [ -z "$2" ] && die "usage: $TODO_SH addm \"TODO ITEM\"" - shift - input=$* - fi - - # Set Internal Field Seperator as newline so we can - # loop across multiple lines - SAVEIFS=$IFS - IFS=$'\n' - - # Treat each line seperately - for line in $input ; do - _addto "$TODO_FILE" "$line" - done - IFS=$SAVEIFS - ;; - -"addto" ) - [ -z "$2" ] && die "usage: $TODO_SH addto DEST \"TODO ITEM\"" - dest="$TODO_DIR/$2" - [ -z "$3" ] && die "usage: $TODO_SH addto DEST \"TODO ITEM\"" - shift - shift - input=$* - - if [ -f "$dest" ]; then - _addto "$dest" "$input" - else - die "TODO: Destination file $dest does not exist." - fi - ;; - -"append" | "app" ) - errmsg="usage: $TODO_SH append ITEM# \"TEXT TO APPEND\"" - shift; item=$1; shift - getTodo "$item" - - if [[ -z "$1" && $TODOTXT_FORCE = 0 ]]; then - echo -n "Append: " - read input - else - input=$* - fi - case "$input" in - [$SENTENCE_DELIMITERS]*) appendspace=;; - *) appendspace=" ";; - esac - cleaninput "for sed" - - if sed -i.bak $item" s|^.*|&${appendspace}${input}|" "$TODO_FILE"; then - if [ $TODOTXT_VERBOSE -gt 0 ]; then - getNewtodo "$item" - echo "$item $newtodo" - fi - else - die "TODO: Error appending task $item." - fi - ;; - -"archive" ) - # defragment blank lines - sed -i.bak -e '/./!d' "$TODO_FILE" - [ $TODOTXT_VERBOSE -gt 0 ] && grep "^x " "$TODO_FILE" - grep "^x " "$TODO_FILE" >> "$DONE_FILE" - sed -i.bak '/^x /d' "$TODO_FILE" - if [ $TODOTXT_VERBOSE -gt 0 ]; then - echo "TODO: $TODO_FILE archived." - fi - ;; - -"del" | "rm" ) - # replace deleted line with a blank line when TODOTXT_PRESERVE_LINE_NUMBERS is 1 - errmsg="usage: $TODO_SH del ITEM# [TERM]" - item=$2 - getTodo "$item" - - if [ -z "$3" ]; then - if [ $TODOTXT_FORCE = 0 ]; then - echo "Delete '$todo'? (y/n)" - read ANSWER - else - ANSWER="y" - fi - if [ "$ANSWER" = "y" ]; then - if [ $TODOTXT_PRESERVE_LINE_NUMBERS = 0 ]; then - # delete line (changes line numbers) - sed -i.bak -e $item"s/^.*//" -e '/./!d' "$TODO_FILE" - else - # leave blank line behind (preserves line numbers) - sed -i.bak -e $item"s/^.*//" "$TODO_FILE" - fi - if [ $TODOTXT_VERBOSE -gt 0 ]; then - echo "$item $todo" - echo "TODO: $item deleted." - fi - else - echo "TODO: No tasks were deleted." - fi - else - sed -i.bak \ - -e $item"s/^\((.) \)\{0,1\} *$3 */\1/g" \ - -e $item"s/ *$3 *\$//g" \ - -e $item"s/ *$3 */ /g" \ - -e $item"s/ *$3 */ /g" \ - -e $item"s/$3//g" \ - "$TODO_FILE" - getNewtodo "$item" - if [ "$todo" = "$newtodo" ]; then - [ $TODOTXT_VERBOSE -gt 0 ] && echo "$item $todo" - die "TODO: '$3' not found; no removal done." - fi - if [ $TODOTXT_VERBOSE -gt 0 ]; then - echo "$item $todo" - echo "TODO: Removed '$3' from task." - echo "$item $newtodo" - fi - fi - ;; - -"depri" | "dp" ) - errmsg="usage: $TODO_SH depri ITEM#[, ITEM#, ITEM#, ...]" - shift; - [ $# -eq 0 ] && die "$errmsg" - - # Split multiple depri's, if comma separated change to whitespace separated - # Loop the 'depri' function for each item - for item in ${*//,/ }; do - getTodo "$item" - - if [[ "$todo" = \(?\)\ * ]]; then - sed -i.bak -e $item"s/^(.) //" "$TODO_FILE" - if [ $TODOTXT_VERBOSE -gt 0 ]; then - getNewtodo "$item" - echo "$item $newtodo" - echo "TODO: $item deprioritized." - fi - else - echo "TODO: $item is not prioritized." - fi - done - ;; - -"do" ) - errmsg="usage: $TODO_SH do ITEM#[, ITEM#, ITEM#, ...]" - # shift so we get arguments to the do request - shift; - [ "$#" -eq 0 ] && die "$errmsg" - - # Split multiple do's, if comma separated change to whitespace separated - # Loop the 'do' function for each item - for item in ${*//,/ }; do - getTodo "$item" - - # Check if this item has already been done - if [ "${todo:0:2}" != "x " ]; then - now=$(date '+%Y-%m-%d') - # remove priority once item is done - sed -i.bak $item"s/^(.) //" "$TODO_FILE" - sed -i.bak $item"s|^|x $now |" "$TODO_FILE" - if [ $TODOTXT_VERBOSE -gt 0 ]; then - getNewtodo "$item" - echo "$item $newtodo" - echo "TODO: $item marked as done." - fi - else - echo "TODO: $item is already marked done." - fi - done - - if [ $TODOTXT_AUTO_ARCHIVE = 1 ]; then - # Recursively invoke the script to allow overriding of the archive - # action. - "$TODO_FULL_SH" archive - fi - ;; - -"help" ) - shift ## Was help; new $1 is first help topic / action name - if [ $# -gt 0 ]; then - # Don't use PAGER here; we don't expect much usage output from one / few actions. - actionUsage "$@" - else - if [ -t 1 ] ; then # STDOUT is a TTY - if which "${PAGER:-less}" >/dev/null 2>&1; then - # we have a working PAGER (or less as a default) - help | "${PAGER:-less}" && exit 0 - fi - fi - help # just in case something failed above, we go ahead and just spew to STDOUT - fi - ;; - -"shorthelp" ) - if [ -t 1 ] ; then # STDOUT is a TTY - if which "${PAGER:-less}" >/dev/null 2>&1; then - # we have a working PAGER (or less as a default) - shorthelp | "${PAGER:-less}" && exit 0 - fi - fi - shorthelp # just in case something failed above, we go ahead and just spew to STDOUT - ;; - -"list" | "ls" ) - shift ## Was ls; new $1 is first search term - _list "$TODO_FILE" "$@" - ;; - -"listall" | "lsa" ) - shift ## Was lsa; new $1 is first search term - - TOTAL=$( sed -n '$ =' "$TODO_FILE" ) - PADDING=${#TOTAL} - - post_filter_command="${post_filter_command:-}${post_filter_command:+ | }awk -v TOTAL=$TOTAL -v PADDING=$PADDING '{ \$1 = sprintf(\"%\" PADDING \"d\", (\$1 > TOTAL ? 0 : \$1)); print }' " - cat "$TODO_FILE" "$DONE_FILE" | TODOTXT_VERBOSE=0 _format '' "$PADDING" "$@" - - if [ $TODOTXT_VERBOSE -gt 0 ]; then - TDONE=$( sed -n '$ =' "$DONE_FILE" ) - TASKNUM=$(TODOTXT_PLAIN=1 TODOTXT_VERBOSE=0 _format "$TODO_FILE" 1 "$@" | sed -n '$ =') - DONENUM=$(TODOTXT_PLAIN=1 TODOTXT_VERBOSE=0 _format "$DONE_FILE" 1 "$@" | sed -n '$ =') - echo "--" - echo "$(getPrefix "$TODO_FILE"): ${TASKNUM:-0} of ${TOTAL:-0} tasks shown" - echo "$(getPrefix "$DONE_FILE"): ${DONENUM:-0} of ${TDONE:-0} tasks shown" - echo "total $((TASKNUM + DONENUM)) of $((TOTAL + TDONE)) tasks shown" - fi - ;; - -"listfile" | "lf" ) - shift ## Was listfile, next $1 is file name - if [ $# -eq 0 ]; then - [ $TODOTXT_VERBOSE -gt 0 ] && echo "Files in the todo.txt directory:" - cd "$TODO_DIR" && ls -1 *.txt - else - FILE="$1" - shift ## Was filename; next $1 is first search term - - _list "$FILE" "$@" - fi - ;; - -"listcon" | "lsc" ) - shift - listWordsWithSigil '@' "$@" - ;; - -"listproj" | "lsprj" ) - shift - listWordsWithSigil '+' "$@" - ;; - -"listpri" | "lsp" ) - shift ## was "listpri", new $1 is priority to list or first TERM - - pri=$(printf "%s\n" "$1" | tr 'a-z' 'A-Z' | grep -e '^[A-Z]$' -e '^[A-Z]-[A-Z]$') && shift || pri="A-Z" - post_filter_command="${post_filter_command:-}${post_filter_command:+ | }grep '^ *[0-9]\+ ([${pri}]) '" - _list "$TODO_FILE" "$@" - ;; - -"move" | "mv" ) - # replace moved line with a blank line when TODOTXT_PRESERVE_LINE_NUMBERS is 1 - errmsg="usage: $TODO_SH mv ITEM# DEST [SRC]" - item=$2 - dest="$TODO_DIR/$3" - src="$TODO_DIR/$4" - - [ -z "$4" ] && src="$TODO_FILE" - [ -z "$dest" ] && die "$errmsg" - - [ -f "$src" ] || die "TODO: Source file $src does not exist." - [ -f "$dest" ] || die "TODO: Destination file $dest does not exist." - - getTodo "$item" "$src" - [ -z "$todo" ] && die "$item: No such item in $src." - if [ $TODOTXT_FORCE = 0 ]; then - echo "Move '$todo' from $src to $dest? (y/n)" - read ANSWER - else - ANSWER="y" - fi - if [ "$ANSWER" = "y" ]; then - if [ $TODOTXT_PRESERVE_LINE_NUMBERS = 0 ]; then - # delete line (changes line numbers) - sed -i.bak -e $item"s/^.*//" -e '/./!d' "$src" - else - # leave blank line behind (preserves line numbers) - sed -i.bak -e $item"s/^.*//" "$src" - fi - echo "$todo" >> "$dest" - - if [ $TODOTXT_VERBOSE -gt 0 ]; then - echo "$item $todo" - echo "TODO: $item moved from '$src' to '$dest'." - fi - else - echo "TODO: No tasks moved." - fi - ;; - -"prepend" | "prep" ) - errmsg="usage: $TODO_SH prepend ITEM# \"TEXT TO PREPEND\"" - replaceOrPrepend 'prepend' "$@" - ;; - -"pri" | "p" ) - item=$2 - newpri=$( printf "%s\n" "$3" | tr 'a-z' 'A-Z' ) - - errmsg="usage: $TODO_SH pri ITEM# PRIORITY -note: PRIORITY must be anywhere from A to Z." - - [ "$#" -ne 3 ] && die "$errmsg" - [[ "$newpri" = @([A-Z]) ]] || die "$errmsg" - getTodo "$item" - - oldpri= - if [[ "$todo" = \(?\)\ * ]]; then - oldpri=${todo:1:1} - fi - - if [ "$oldpri" != "$newpri" ]; then - sed -i.bak -e $item"s/^(.) //" -e $item"s/^/($newpri) /" "$TODO_FILE" - fi - if [ $TODOTXT_VERBOSE -gt 0 ]; then - getNewtodo "$item" - echo "$item $newtodo" - if [ "$oldpri" != "$newpri" ]; then - if [ "$oldpri" ]; then - echo "TODO: $item re-prioritized from ($oldpri) to ($newpri)." - else - echo "TODO: $item prioritized ($newpri)." - fi - fi - fi - if [ "$oldpri" = "$newpri" ]; then - echo "TODO: $item already prioritized ($newpri)." - fi - ;; - -"replace" ) - errmsg="usage: $TODO_SH replace ITEM# \"UPDATED ITEM\"" - replaceOrPrepend 'replace' "$@" - ;; - -"report" ) - # archive first - # Recursively invoke the script to allow overriding of the archive - # action. - "$TODO_FULL_SH" archive - - TOTAL=$( sed -n '$ =' "$TODO_FILE" ) - TDONE=$( sed -n '$ =' "$DONE_FILE" ) - NEWDATA="${TOTAL:-0} ${TDONE:-0}" - LASTREPORT=$(sed -ne '$p' "$REPORT_FILE") - LASTDATA=${LASTREPORT#* } # Strip timestamp. - if [ "$LASTDATA" = "$NEWDATA" ]; then - echo "$LASTREPORT" - [ $TODOTXT_VERBOSE -gt 0 ] && echo "TODO: Report file is up-to-date." - else - NEWREPORT="$(date +%Y-%m-%dT%T) ${NEWDATA}" - echo "${NEWREPORT}" >> "$REPORT_FILE" - echo "${NEWREPORT}" - [ $TODOTXT_VERBOSE -gt 0 ] && echo "TODO: Report file updated." - fi - ;; - -"deduplicate" ) - if [ $TODOTXT_PRESERVE_LINE_NUMBERS = 0 ]; then - deduplicateSedCommand='d' - else - deduplicateSedCommand='s/^.*//; p' - fi - - # To determine the difference when deduplicated lines are preserved, only - # non-empty lines must be counted. - originalTaskNum=$( sed -e '/./!d' "$TODO_FILE" | sed -n '$ =' ) - - # Look for duplicate lines and discard the second occurrence. - # We start with an empty hold space on the first line. For each line: - # G - appends newline + hold space to the pattern space - # s/\n/&&/; - double up the first new line so we catch adjacent dups - # /^\([^\n]*\n\).*\n\1/b dedup - # If the first line of the hold space shows up again later as an - # entire line, it's a duplicate. Jump to the "dedup" label, where - # either of the following is executed, depending on whether empty - # lines should be preserved: - # d - Delete the current pattern space, quit this line and - # move on to the next, or: - # s/^.*//; p - Clear the task text, print this line and move on to - # the next. - # s/\n//; - else (no duplicate), drop the doubled newline - # h; - replace the hold space with the expanded pattern space - # P; - print up to the first newline (that is, the input line) - # b - end processing of the current line - sed -i.bak -n \ - -e 'G; s/\n/&&/; /^\([^\n]*\n\).*\n\1/b dedup' \ - -e 's/\n//; h; P; b' \ - -e ':dedup' \ - -e "$deduplicateSedCommand" \ - "$TODO_FILE" - - newTaskNum=$( sed -e '/./!d' "$TODO_FILE" | sed -n '$ =' ) - deduplicateNum=$(( originalTaskNum - newTaskNum )) - if [ $deduplicateNum -eq 0 ]; then - echo "TODO: No duplicate tasks found" - else - echo "TODO: $deduplicateNum duplicate task(s) removed" - fi - ;; - -"listaddons" ) - if [ -d "$TODO_ACTIONS_DIR" ]; then - cd "$TODO_ACTIONS_DIR" || exit $? - for action in * - do - if [ -f "$action" -a -x "$action" ]; then - echo "$action" - elif [ -d "$action" -a -x "$action/$action" ]; then - echo "$action" - fi - done - fi - ;; - -* ) - usage;; -esac diff --git a/.urxvt/ext/LICENSE b/.urxvt/ext/LICENSE deleted file mode 100644 index d159169..0000000 --- a/.urxvt/ext/LICENSE +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/.urxvt/ext/README.md b/.urxvt/ext/README.md deleted file mode 100644 index b800ed3..0000000 --- a/.urxvt/ext/README.md +++ /dev/null @@ -1,107 +0,0 @@ -A small collection of perl extensions for the rxvt-unicode terminal emulator. - -Installation ------------- -Simply place the scripts you want to install in /usr/lib/urxvt/perl/ for -system-wide availability or in ~/.urxvt/ext/ for user-only availability. -You can also put them in a folder of your choice, but then you have to add this -line to your .Xdefaults/.Xresources: - - URxvt.perl-lib: /your/folder/ - -See the following sections for information on how to enable the scripts or set -script-specific options and keyboard mappings in your .Xdefaults/.Xresources. - - -keyboard-select ---------------- -Use keyboard shortcuts to select and copy text. - -After installing, put the following lines in your .Xdefaults/.Xresources: - - URxvt.perl-ext-common: ...,keyboard-select - URxvt.keysym.M-Escape: perl:keyboard-select:activate - -The following line overwrites the default Meta-s binding and allows to activate -keyboard-select directly in backward search mode: - - URxvt.keysym.M-s: perl:keyboard-select:search - -Use Meta-Escape to activate selection mode, then use the following keys: - - h/j/k/l: Move cursor left/down/up/right (also with arrow keys) - g/G/0/^/$/H/M/L/f/F/;/,/w/W/b/B/e/E: More vi-like cursor movement keys - '/'/?: Start forward/backward search - n/N: Repeat last search, N: in reverse direction - Ctrl-f/b: Scroll down/up one screen - Ctrl-d/u: Scroll down/up half a screen - v/V/Ctrl-v: Toggle normal/linewise/blockwise selection - y/Return: Copy selection to primary buffer, Return: deactivate afterwards - q/Escape: Deactivate keyboard selection mode - - -url-select ----------- -Use keyboard shortcuts to select URLs. - -This should be used as a replacement for the default matcher extension, it also -makes URLs clickable with the middle mouse button. - -After installing, put the following lines in your .Xdefaults/.Xresources: - - URxvt.perl-ext-common: ...,url-select - URxvt.keysym.M-u: perl:url-select:select_next - -Use Meta-u to activate URL selection mode, then use the following keys: - - j/k: Select next downward/upward URL (also with arrow keys) - g/G: Select first/last URL (also with home/end key) - o/Return: Open selected URL in browser, Return: deactivate afterwards - y: Copy (yank) selected URL and deactivate selection mode - q/Escape: Deactivate URL selection mode - -Options: - - URxvt.url-select.autocopy: if set to true, selected URLs are automatically - copied to the PRIMARY buffer - URxvt.url-select.button: mouse button to click-open URLs (default: 2) - URxvt.url-select.launcher: browser/command to open selected URL with - URxvt.url-select.underline: if set to true, all URLs get underlined - -For compatibility reasons, url-select will also use any patterns defined for -the matcher extension by reading all `URxvt.matcher.pattern.[0-9]` resources. - - -clipboard ---------- -Use keyboard shortcuts to copy the selection to the clipboard and to paste the -clipboard contents (optionally escaping all special characters). - -After installing, put the following lines in your .Xdefaults/.Xresources: - - URxvt.perl-ext-common: ...,clipboard - URxvt.keysym.M-c: perl:clipboard:copy - URxvt.keysym.M-v: perl:clipboard:paste - URxvt.keysym.M-C-v: perl:clipboard:paste_escaped - -Options: - URxvt.clipboard.autocopy: if set to true, the clipboard is automatically - updated whenever the PRIMARY selection changes - -You can also overwrite the system commands to use for copying/pasting. -The default ones are: - - URxvt.clipboard.copycmd: xsel -ib - URxvt.clipboard.pastecmd: xsel -ob - -If you prefer xclip, then put these lines in your .Xdefaults/.Xresources: - - URxvt.clipboard.copycmd: xclip -i -selection clipboard - URxvt.clipboard.pastecmd: xclip -o -selection clipboard - -On Mac OS X, put these lines in your .Xdefaults/.Xresources: - - URxvt.clipboard.copycmd: pbcopy - URxvt.clipboard.pastecmd: pbpaste - -The use of the functions should be self-explanatory! diff --git a/.urxvt/ext/clipboard b/.urxvt/ext/clipboard deleted file mode 100644 index 8e71792..0000000 --- a/.urxvt/ext/clipboard +++ /dev/null @@ -1,109 +0,0 @@ -#! perl -w -# Author: Bert Muennich -# Website: http://www.github.com/muennich/urxvt-perls -# License: GPLv2 - -# Use keyboard shortcuts to copy the selection to the clipboard and to paste -# the clipboard contents (optionally escaping all special characters). -# Requires xsel to be installed! - -# Usage: put the following lines in your .Xdefaults/.Xresources: -# URxvt.perl-ext-common: ...,clipboard -# URxvt.keysym.M-c: perl:clipboard:copy -# URxvt.keysym.M-v: perl:clipboard:paste -# URxvt.keysym.M-C-v: perl:clipboard:paste_escaped - -# Options: -# URxvt.clipboard.autocopy: If true, PRIMARY overwrites clipboard - -# You can also overwrite the system commands to use for copying/pasting. -# The default ones are: -# URxvt.clipboard.copycmd: xsel -ib -# URxvt.clipboard.pastecmd: xsel -ob -# If you prefer xclip, then put these lines in your .Xdefaults/.Xresources: -# URxvt.clipboard.copycmd: xclip -i -selection clipboard -# URxvt.clipboard.pastecmd: xclip -o -selection clipboard -# On Mac OS X, put these lines in your .Xdefaults/.Xresources: -# URxvt.clipboard.copycmd: pbcopy -# URxvt.clipboard.pastecmd: pbpaste - -# The use of the functions should be self-explanatory! - -use strict; - -sub on_start { - my ($self) = @_; - - $self->{copy_cmd} = $self->x_resource('clipboard.copycmd') || 'xsel -ib'; - $self->{paste_cmd} = $self->x_resource('clipboard.pastecmd') || 'xsel -ob'; - - if ($self->x_resource('clipboard.autocopy') eq 'true') { - $self->enable(sel_grab => \&sel_grab); - } - - () -} - -sub copy { - my ($self) = @_; - - if (open(CLIPBOARD, "| $self->{copy_cmd}")) { - my $sel = $self->selection(); - utf8::encode($sel); - print CLIPBOARD $sel; - close(CLIPBOARD); - } else { - print STDERR "error running '$self->{copy_cmd}': $!\n"; - } - - () -} - -sub paste { - my ($self) = @_; - - my $str = `$self->{paste_cmd}`; - if ($? == 0) { - $self->tt_paste($str); - } else { - print STDERR "error running '$self->{paste_cmd}': $!\n"; - } - - () -} - -sub paste_escaped { - my ($self) = @_; - - my $str = `$self->{paste_cmd}`; - if ($? == 0) { - $str =~ s/([!#\$%&\*\(\) ='"\\\|\[\]`~,<>\?])/\\\1/g; - $self->tt_paste($str); - } else { - print STDERR "error running '$self->{paste_cmd}': $!\n"; - } - - () -} - -sub on_user_command { - my ($self, $cmd) = @_; - - if ($cmd eq "clipboard:copy") { - $self->copy; - } elsif ($cmd eq "clipboard:paste") { - $self->paste; - } elsif ($cmd eq "clipboard:paste_escaped") { - $self->paste_escaped; - } - - () -} - -sub sel_grab { - my ($self) = @_; - - $self->copy; - - () -} diff --git a/.urxvt/ext/keyboard-select b/.urxvt/ext/keyboard-select deleted file mode 100644 index d9f16bf..0000000 --- a/.urxvt/ext/keyboard-select +++ /dev/null @@ -1,567 +0,0 @@ -#! perl -w -# Author: Bert Muennich -# Website: http://www.github.com/muennich/urxvt-perls -# License: GPLv2 - -# Use keyboard shortcuts to select and copy text. - -# Usage: put the following lines in your .Xdefaults/.Xresources: -# URxvt.perl-ext-common: ...,keyboard-select -# URxvt.keysym.M-Escape: perl:keyboard-select:activate -# The following line overwrites the default Meta-s binding and allows to -# activate keyboard-select directly in backward search mode: -# URxvt.keysym.M-s: perl:keyboard-select:search - -# Use Meta-Escape to activate selection mode, then use the following keys: -# h/j/k/l: Move cursor left/down/up/right (also with arrow keys) -# g/G/0/^/$/H/M/L/f/F/;/,/w/W/b/B/e/E: More vi-like cursor movement keys -# '/'/?: Start forward/backward search -# n/N: Repeat last search, N: in reverse direction -# Ctrl-f/b: Scroll down/up one screen -# Ctrl-d/u: Scroll down/up half a screen -# v/V/Ctrl-v: Toggle normal/linewise/blockwise selection -# y/Return: Copy selection to primary buffer, Return: deactivate afterwards -# q/Escape: Deactivate keyboard selection mode - - -use strict; - -sub on_start{ - my ($self) = @_; - - $self->{patterns}{'w'} = qr/\w[^\w\s]|\W\w|\s\S/; - $self->{patterns}{'W'} = qr/\s\S/; - $self->{patterns}{'b'} = qr/.*(?:\w[^\w\s]|\W\w|\s\S)/; - $self->{patterns}{'B'} = qr/.*\s\S/; - $self->{patterns}{'e'} = qr/[^\w\s](?=\w)|\w(?=\W)|\S(?=\s|$)/; - $self->{patterns}{'E'} = qr/\S(?=\s|$)/; - - () -} - - -sub on_user_command { - my ($self, $cmd) = @_; - - if (not $self->{active}) { - if ($cmd eq 'keyboard-select:activate') { - activate($self); - } elsif ($cmd eq 'keyboard-select:search') { - activate($self, 1); - } - } - - () -} - - -sub key_press { - my ($self, $event, $keysym, $char) = @_; - my $key = chr($keysym); - - if (lc($key) eq 'c' && $event->{state} & urxvt::ControlMask) { - deactivate($self); - } elsif ($self->{search}) { - if ($keysym == 0xff1b) { - if ($self->{search_mode}) { - deactivate($self); - } else { - $self->{search} = ''; - status_area($self); - } - } elsif ($keysym == 0xff08) { - $self->{search} = substr($self->{search}, 0, -1); - if (not $self->{search} and $self->{search_mode}) { - deactivate($self); - } else { - status_area($self); - } - } elsif ($keysym == 0xff0d) { - my $txt = substr($self->{search}, 1); - if ($txt) { - $self->{pattern} = ($txt =~ m/[[:upper:]]/) ? qr/\Q$txt\E/ : - qr/\Q$txt\E/i; - } elsif ($self->{pattern}) { - delete $self->{pattern}; - } - $self->{search} = ''; - if (not find_next($self)) { - if ($self->{search_mode}) { - deactivate($self); - } else { - status_area($self); - } - } - } elsif (length($char) > 0) { - $self->{search} .= $self->locale_decode($char); - status_area($self); - } - } elsif ($self->{move_to}) { - if ($keysym == 0xff1b) { - $self->{move_to} = 0; - status_area($self); - } elsif (length($char) > 0) { - $self->{move_to} = 0; - $self->{patterns}{'f-1'} = qr/^.*\Q$key\E/; - $self->{patterns}{'f+1'} = qr/^.+?\Q$key\E/; - move_to($self, ';'); - status_area($self); - } - } elsif ($keysym == 0xff1b || lc($key) eq 'q') { - deactivate($self); - } elsif ($key eq 'y' || $keysym == 0xff0d) { - if ($self->{select}) { - if ($self->{select} eq 'b') { - $self->selection($self->{selection}); - $self->selection_grab($event->{time}); - } else { - my ($br, $bc, $er, $ec) = calc_span($self); - $ec = $self->line($er)->l if $self->{select} eq 'l'; - $self->selection_beg($br, $bc); - $self->selection_end($er, $ec); - $self->selection_make($event->{time}); - } - if ($key eq 'y') { - if ($self->{select} ne 'b') { - $self->selection_beg(1, 0); - $self->selection_end(1, 0); - } - $self->{select} = ''; - status_area($self); - $self->want_refresh(); - } else { - deactivate($self); - } - } - } elsif ($key eq 'V') { - toggle_select($self, 'l'); - } elsif ($key eq 'v') { - if ($event->{state} & urxvt::ControlMask) { - toggle_select($self, 'b'); - } else { - toggle_select($self, 'n'); - } - } elsif ($key eq 'k' || $keysym == 0xff52) { - move_cursor($self, 'k'); - } elsif ($key eq 'j' || $keysym == 0xff54) { - move_cursor($self, 'j'); - } elsif ($key eq 'h' || $keysym == 0xff51) { - move_cursor($self, 'h'); - } elsif ($key eq 'l' || $keysym == 0xff53) { - move_cursor($self, 'l'); - } elsif ('gG0^$HML' =~ m/\Q$key\E/ || - ('fbdu' =~ m/\Q$key\E/ && $event->{state} & urxvt::ControlMask)) { - move_cursor($self, $key); - } elsif (lc($key) eq 'f') { - $self->{move_to} = 1; - $self->{move_dir} = $key eq 'F' ? -1 : 1; - status_area($self, $key); - } elsif (';,wWbBeE' =~ m/\Q$key\E/) { - move_to($self, $key); - } elsif ($key eq '/' || $key eq '?') { - $self->{search} = $key; - $self->{search_dir} = $key eq '?' ? -1 : 1; - status_area($self); - } elsif (lc($key) eq 'n') { - find_next($self, $self->{search_dir} * ($key eq 'N' ? -1 : 1)); - } - - return 1; -} - - -sub move_cursor { - my ($self, $key) = @_; - my ($cr, $cc) = $self->screen_cur(); - my $line = $self->line($cr); - - if ($key eq 'k' && $line->beg > $self->top_row) { - $cr = $line->beg - 1; - } elsif ($key eq 'j' && $line->end < $self->nrow - 1) { - $cr = $line->end + 1; - } elsif ($key eq 'h' && $self->{offset} > 0) { - $self->{offset} = $line->offset_of($cr, $cc) - 1; - $self->{dollar} = 0; - } elsif ($key eq 'l' && $self->{offset} < $line->l - 1) { - ++$self->{offset}; - } elsif ($key eq 'f' || $key eq 'd') { - my $vs = $self->view_start() + - ($key eq 'd' ? $self->nrow / 2 : $self->nrow - 1); - $vs = 0 if $vs > 0; - $cr += $vs - $self->view_start($vs); - } elsif ($key eq 'b' || $key eq 'u') { - my $vs = $self->view_start() - - ($key eq 'u' ? $self->nrow / 2 : $self->nrow - 1); - $vs = $self->top_row if $vs < $self->top_row; - $cr += $vs - $self->view_start($vs); - } elsif ($key eq 'g') { - ($cr, $self->{offset}) = ($self->top_row, 0); - $self->{dollar} = 0; - } elsif ($key eq 'G') { - ($cr, $self->{offset}) = ($self->nrow - 1, 0); - $self->{dollar} = 0; - } elsif ($key eq '0') { - $self->{offset} = 0; - $self->{dollar} = 0; - } elsif ($key eq '^') { - my $ltxt = $self->special_decode($line->t); - while ($ltxt =~ s/^( *)\t/$1 . " " x (8 - length($1) % 8)/e) {} - $self->{offset} = $ltxt =~ m/^ +/ ? $+[0] : 0; - $self->{dollar} = 0; - } elsif ($key eq '$') { - my $co = $line->offset_of($cr, $cc); - $self->{dollar} = $co + 1; - $self->{offset} = $line->l - 1; - } elsif ($key eq 'H') { - $cr = $self->view_start(); - } elsif ($key eq 'M') { - $cr = $self->view_start() + $self->nrow / 2; - } elsif ($key eq 'L') { - $cr = $self->view_start() + $self->nrow - 1; - } - - $line = $self->line($cr); - $cc = $self->{dollar} || $self->{offset} >= $line->l ? $line->l - 1 : - $self->{offset}; - $self->screen_cur($line->coord_of($cc)); - - status_area($self); - $self->want_refresh(); - - () -} - - -sub move_to { - my ($self, $key) = @_; - my ($cr, $cc) = $self->screen_cur(); - my $line = $self->line($cr); - my $offset = $self->{offset}; - my ($dir, $pattern); - my ($wrap, $found) = (0, 0); - - if ($key eq ';' || $key eq ',') { - $dir = $self->{move_dir} * ($key eq ',' ? -1 : 1); - $pattern = $self->{patterns}{sprintf('f%+d', $dir)}; - return if not $pattern; - } else { - if (lc($key) eq 'b') { - $dir = -1; - } else { - $dir = 1; - ++$offset if lc($key) eq 'e'; - } - $pattern = $self->{patterns}{$key}; - $wrap = 1; - } - - if ($dir > 0) { - NEXTDOWN: my $text = substr($line->t, $offset); - if ($text =~ m/$pattern/) { - $offset += $+[0] - 1; - $found = 1; - } elsif ($wrap && $line->end + 1 < $self->nrow) { - $cr = $line->end + 1; - $line = $self->line($cr); - $offset = 0; - if (lc($key) eq 'e') { - goto NEXTDOWN; - } else { - $found = 1; - } - } - } elsif ($dir < 0) { - NEXTUP: my $text = substr($line->t, 0, $offset); - if ($text =~ m/$pattern/) { - $offset += $+[0] - length($text) - 1; - $found = 1; - } elsif ($wrap) { - if ($offset > 0) { - $offset = 0; - $found = 1; - } elsif ($line->beg > $self->top_row) { - $cr = $line->beg - 1; - $line = $self->line($cr); - $offset = $line->l; - goto NEXTUP; - } - } - } - - if ($found) { - $self->{dollar} = 0; - $self->{offset} = $offset; - $self->screen_cur($line->coord_of($offset)); - $self->want_refresh(); - } - - () -} - - -sub find_next { - my ($self, $dir) = @_; - - return if not $self->{pattern}; - $dir = $self->{search_dir} if not $dir; - - my ($cr, $cc) = $self->screen_cur(); - my $line = $self->line($cr); - my $offset = $line->offset_of($cr, $cc); - my $text; - my $found = 0; - - ++$offset if $dir > 0; - - while (not $found) { - if ($dir > 0) { - $text = substr($line->t, $offset); - if ($text =~ m/$self->{pattern}/) { - $found = 1; - $offset += $-[0]; - } else { - last if $line->end >= $self->nrow; - $line = $self->line($line->end + 1); - $offset = 0; - } - } else { - $text = substr($line->t, 0, $offset); - if ($text =~ m/$self->{pattern}/) { - $found = 1; - $offset = $-[0] while $text =~ m/$self->{pattern}/g; - } else { - last if $line->beg <= $self->top_row; - $line = $self->line($line->beg - 1); - $offset = $line->l; - } - } - } - - if ($found) { - $self->{dollar} = 0; - $self->{offset} = $offset; - $self->screen_cur($line->coord_of($offset)); - status_area($self); - $self->want_refresh(); - } - - return $found; -} - - -sub tt_write { - return 1; -} - - -sub refresh { - my ($self) = @_; - my $reverse_cursor = $self->{select} ne 'l'; - my ($cr, $cc) = $self->screen_cur(); - - if ($self->{select}) { - my ($br, $bc, $er, $ec) = calc_span($self); - - if ($self->{select} eq 'b') { - delete $self->{selection} if $self->{selection}; - my $co = $self->line($cr)->offset_of($cr, $cc); - my $dollar = $self->{dollar} && $co >= $self->{dollar} - 1; - - my $r = $br; - while ($r <= $er) { - my $line = $self->line($r); - if ($bc < $line->l) { - $ec = $line->l if $dollar; - $self->{selection} .= substr($line->t, $bc, $ec - $bc); - my ($br, $bc) = $line->coord_of($bc); - my ($er, $ec) = $line->coord_of($ec <= $line->l ? $ec : $line->l); - $self->scr_xor_span($br, $bc, $er, $ec, urxvt::RS_RVid); - } elsif ($r == $cr) { - $reverse_cursor = 0; - } - $self->{selection} .= "\n" if $line->end < $er; - $r = $line->end + 1; - } - } else { - $self->scr_xor_span($br, $bc, $er, $ec, urxvt::RS_RVid); - } - - if ($reverse_cursor) { - # make the cursor visible again - $self->scr_xor_span($cr, $cc, $cr, $cc + 1, urxvt::RS_RVid); - } - } - - # scroll the current cursor position into visible area - if ($cr < $self->view_start()) { - $self->view_start($cr); - } elsif ($cr >= $self->view_start() + $self->nrow) { - $self->view_start($cr - $self->nrow + 1); - } - - () -} - - -sub activate { - my ($self, $search) = @_; - - $self->{active} = 1; - - $self->{select} = ''; - $self->{dollar} = 0; - $self->{move_to} = 0; - - if ($search) { - $self->{search} = '?'; - $self->{search_dir} = -1; - $self->{search_mode} = 1; - } else { - $self->{search} = ''; - $self->{search_mode} = 0; - } - - ($self->{oldcr}, $self->{oldcc}) = $self->screen_cur(); - $self->{old_view_start} = $self->view_start(); - $self->{old_pty_ev_events} = $self->pty_ev_events(urxvt::EV_NONE); - - my $line = $self->line($self->{oldcr}); - $self->{offset} = $line->offset_of($self->{oldcr}, $self->{oldcc}); - - $self->selection_beg(1, 0); - $self->selection_end(1, 0); - - $self->enable( - key_press => \&key_press, - refresh_begin => \&refresh, - refresh_end => \&refresh, - tt_write => \&tt_write, - ); - - if ($self->{offset} >= $line->l) { - $self->{offset} = $line->l > 0 ? $line->l - 1 : 0; - $self->screen_cur($line->coord_of($self->{offset})); - $self->want_refresh(); - } - - $self->{overlay_len} = 0; - status_area($self); - - () -} - - -sub deactivate { - my ($self) = @_; - - $self->selection_beg(1, 0); - $self->selection_end(1, 0); - - delete $self->{overlay} if $self->{overlay}; - delete $self->{selection} if $self->{selection}; - - $self->disable("key_press", "refresh_begin", "refresh_end", "tt_write"); - $self->screen_cur($self->{oldcr}, $self->{oldcc}); - $self->view_start($self->{old_view_start}); - $self->pty_ev_events($self->{old_pty_ev_events}); - - $self->want_refresh(); - - $self->{active} = 0; - - () -} - - -sub status_area { - my ($self, $extra) = @_; - my ($stat, $stat_len); - - if ($self->{search}) { - $stat_len = $self->ncol; - $stat = $self->{search} . ' ' x ($stat_len - length($self->{search})); - } else { - if ($self->{select}) { - $stat = "-V" . ($self->{select} ne 'n' ? uc($self->{select}) : "") . "- "; - } - - if ($self->top_row == 0) { - $stat .= "All"; - } elsif ($self->view_start() == $self->top_row) { - $stat .= "Top"; - } elsif ($self->view_start() == 0) { - $stat .= "Bot"; - } else { - $stat .= sprintf("%2d%%", - ($self->top_row - $self->view_start) * 100 / $self->top_row); - } - - $stat = "$extra $stat" if $extra; - $stat_len = length($stat); - } - - if (!$self->{overlay} || $self->{overlay_len} != $stat_len) { - delete $self->{overlay} if $self->{overlay}; - $self->{overlay} = $self->overlay(-1, -1, $stat_len, 1, - urxvt::OVERLAY_RSTYLE, 0); - $self->{overlay_len} = $stat_len; - } - - $self->{overlay}->set(0, 0, $self->special_encode($stat)); - $self->{overlay}->show(); - - () -} - - -sub toggle_select { - my ($self, $mode) = @_; - - if ($self->{select} eq $mode) { - $self->{select} = ''; - } else { - if (not $self->{select}) { - ($self->{ar}, $self->{ac}) = $self->screen_cur(); - } - $self->{select} = $mode; - } - - status_area($self); - $self->want_refresh(); - - () -} - - -sub calc_span { - my ($self) = @_; - my ($cr, $cc) = $self->screen_cur(); - my ($br, $bc, $er, $ec); - - if ($self->{select} eq 'b') { - $br = $self->line($cr)->beg; - $bc = $self->line($cr)->offset_of($cr, $cc); - $er = $self->line($self->{ar})->beg; - $ec = $self->line($self->{ar})->offset_of($self->{ar}, $self->{ac}); - ($br, $er) = ($er, $br) if $br > $er; - ($bc, $ec) = ($ec, $bc) if $bc > $ec; - } else { - if ($cr < $self->{ar}) { - ($br, $bc, $er, $ec) = ($cr, $cc, $self->{ar}, $self->{ac}); - } elsif ($cr > $self->{ar}) { - ($br, $bc, $er, $ec) = ($self->{ar}, $self->{ac}, $cr, $cc); - } else { - ($br, $er) = ($cr, $cr); - ($bc, $ec) = $cc < $self->{ac} ? ($cc, $self->{ac}) : ($self->{ac}, $cc); - } - } - - if ($self->{select} eq 'l') { - ($br, $er) = ($self->line($br)->beg, $self->line($er)->end); - ($bc, $ec) = (0, $self->ncol); - } else { - ++$ec; - } - - return ($br, $bc, $er, $ec); -} diff --git a/.urxvt/ext/url-select b/.urxvt/ext/url-select deleted file mode 100644 index f4ddda8..0000000 --- a/.urxvt/ext/url-select +++ /dev/null @@ -1,375 +0,0 @@ -#! perl -w -# Author: Bert Muennich -# Website: http://www.github.com/muennich/urxvt-perls -# Based on: http://www.jukie.net/~bart/blog/urxvt-url-yank -# License: GPLv2 - -# Use keyboard shortcuts to select URLs. -# This should be used as a replacement for the default matcher extension, -# it also makes URLs clickable with the middle mouse button. - -# Usage: put the following lines in your .Xdefaults/.Xresources: -# URxvt.perl-ext-common: ...,url-select -# URxvt.keysym.M-u: perl:url-select:select_next - -# Use Meta-u to activate URL selection mode, then use the following keys: -# j/k: Select next downward/upward URL (also with arrow keys) -# g/G: Select first/last URL (also with home/end key) -# o/Return: Open selected URL in browser, Return: deactivate afterwards -# y: Copy (yank) selected URL and deactivate selection mode -# q/Escape: Deactivate URL selection mode - -# Options: -# URxvt.url-select.autocopy: If true, selected URLs are copied to PRIMARY -# URvxt.url-select.button: Mouse button to click-open URLs (default: 2) -# URxvt.url-select.launcher: Browser/command to open selected URL with -# URxvt.url-select.underline: If set to true, all URLs get underlined - -use strict; - -sub on_start { - my ($self) = @_; - - # read resource settings - if ($self->x_resource('url-select.launcher')) { - @{$self->{browser}} = split /\s+/, $self->x_resource('url-select.launcher'); - } else { - @{$self->{browser}} = ('x-www-browser'); - } - if ($self->x_resource('url-select.underline') eq 'true') { - $self->enable(line_update => \&line_update); - } - if ($self->x_resource('url-select.autocopy') eq 'true') { - $self->{autocopy} = 1; - } - - $self->{state} = 0; - - for my $mod (split '', $self->x_resource("url-select.button") || - $self->x_resource("matcher.button") || 2) { - if ($mod =~ /^\d+$/) { - $self->{button} = $mod; - } elsif ($mod eq "C") { - $self->{state} |= urxvt::ControlMask; - } elsif ($mod eq "S") { - $self->{state} |= urxvt::ShiftMask; - } elsif ($mod eq "M") { - $self->{state} |= $self->ModMetaMask; - } elsif ($mod ne "-" && $mod ne " ") { - warn("invalid button/modifier in $self->{_name}<$self->{argv}[0]>: $mod\n"); - } - } - - if ($self->x_resource('matcher.pattern')) { - @{$self->{pattern}} = ($self->x_resource('matcher.pattern')); - } elsif ($self->x_resource('matcher.pattern.1')) { - my $current = 1; - - while ($self->x_resource("matcher.pattern.$current")) { - push @{$self->{pattern}}, $self->x_resource("matcher.pattern.$current"); - $current++; - } - } else { - @{$self->{pattern}} = qr{ - (?:https?://|ftp://|news://|mailto:|file://|\bwww\.) - [\w\-\@;\/?:&=%\$.+!*\x27,~#]* - ( - \([\w\-\@;\/?:&=%\$.+!*\x27,~#]*\) # Allow a pair of matched parentheses - | # - [\w\-\@;\/?:&=%\$+*~] # exclude some trailing characters (heuristic) - )+ - }x; - } - - () -} - - -sub line_update { - my ($self, $row) = @_; - - my $line = $self->line($row); - my $text = $line->t; - my $rend = $line->r; - - for my $pattern (@{$self->{pattern}}) { - while ($text =~ /$pattern/g) { - my $url = $&; - my ($beg, $end) = ($-[0], $+[0] - 1); - - for (@{$rend}[$beg .. $end]) { - $_ |= urxvt::RS_Uline; - } - $line->r($rend); - } - } - - () -} - - -sub on_user_command { - my ($self, $cmd) = @_; - - if ($cmd eq 'url-select:select_next') { - if (not $self->{active}) { - activate($self); - } - select_next($self, -1); - } - - () -} - - -sub key_press { - my ($self, $event, $keysym) = @_; - my $char = chr($keysym); - - if ($keysym == 0xff1b || lc($char) eq 'q' || - (lc($char) eq 'c' && $event->{state} & urxvt::ControlMask)) { - deactivate($self); - } elsif ($keysym == 0xff0d || $char eq 'o') { - $self->exec_async(@{$self->{browser}}, ${$self->{found}[$self->{n}]}[4]); - deactivate($self) unless $char eq 'o'; - } elsif ($char eq 'y') { - my $found = $self->{found}[$self->{n}]; - $self->selection_beg(${$found}[0], ${$found}[1]); - $self->selection_end(${$found}[2], ${$found}[3]); - $self->selection_make($event->{time}); - $self->selection_beg(1, 0); - $self->selection_end(1, 0); - deactivate($self); - } elsif ($char eq 'k' || $keysym == 0xff52 || $keysym == 0xff51) { - select_next($self, -1, $event); - } elsif ($char eq 'j' || $keysym == 0xff54 || $keysym == 0xff53) { - select_next($self, 1, $event); - } elsif ($char eq 'g' || $keysym == 0xff50) { - $self->{row} = $self->top_row - 1; - delete $self->{found}; - select_next($self, 1, $event); - } elsif ($char eq 'G' || $keysym == 0xff57) { - $self->{row} = $self->nrow; - delete $self->{found}; - select_next($self, -1, $event); - } - - return 1; -} - - -sub on_button_press { - my ($self, $event) = @_; - - my $mask = $self->ModLevel3Mask | $self->ModMetaMask | - urxvt::ShiftMask | urxvt::ControlMask; - - if ($event->{button} == $self->{button} && ($event->{state} & $mask) == $self->{state}) { - $self->{button_pressed} = 1; - $self->{button_col} = $event->{col}; - $self->{button_row} = $event->{row}; - } - - () -} - -sub on_button_release { - my ($self, $event) = @_; - - if ($self->{button_pressed} && $event->{button} == $self->{button}) { - my $col = $event->{col}; - my $row = $event->{row}; - - $self->{button_pressed} = 0; - - if ($col == $self->{button_col} && $row == $self->{button_row}) { - my $line = $self->line($row); - my $text = $line->t; - - for my $pattern (@{$self->{pattern}}) { - while ($text =~ /$pattern/g) { - my ($url, $beg, $end) = ($&, $-[0], $+[0]); - --$end if $url =~ s/["')]$//; - - if ($col >= $beg && $col <= $end) { - $self->exec_async(@{$self->{browser}}, $url); - return 1; - } - } - } - } - } - - () -} - - -sub select_next { - # $dir < 0: up, > 0: down - my ($self, $dir, $event) = @_; - my $row = $self->{row}; - - if (($dir < 0 && $self->{n} > 0) || - ($dir > 0 && $self->{n} < $#{ $self->{found} })) { - # another url on current line - $self->{n} += $dir; - hilight($self); - if ($self->{autocopy}) { - my $found = $self->{found}[$self->{n}]; - $self->selection_beg(${$found}[0], ${$found}[1]); - $self->selection_end(${$found}[2], ${$found}[3]); - $self->selection_make($event->{time}); - $self->selection_beg(1, 0); - $self->selection_end(1, 0); - } - return; - } - - while (($dir < 0 && $row > $self->top_row) || - ($dir > 0 && $row < $self->nrow - 1)) { - my $line = $self->line($row); - $row = ($dir < 0 ? $line->beg : $line->end) + $dir; - $line = $self->line($row); - my $text = $line->t; - - for my $pattern (@{$self->{pattern}}) { - if ($text =~ /$pattern/g) { - delete $self->{found}; - - do { - my ($beg, $end) = ($-[0], $+[0]); - push @{$self->{found}}, [$line->coord_of($beg), - $line->coord_of($end), substr($text, $beg, $end - $beg)]; - } while ($text =~ /$pattern/g); - - $self->{row} = $row; - $self->{n} = $dir < 0 ? $#{$self->{found}} : 0; - hilight($self); - if ($self->{autocopy}) { - my $found = $self->{found}[$self->{n}]; - $self->selection_beg(${$found}[0], ${$found}[1]); - $self->selection_end(${$found}[2], ${$found}[3]); - $self->selection_make($event->{time}); - $self->selection_beg(1, 0); - $self->selection_end(1, 0); - } - return; - } - } - } - - deactivate($self) unless $self->{found}; - - () -} - - -sub hilight { - my ($self) = @_; - - if ($self->{found}) { - if ($self->{row} < $self->view_start() || - $self->{row} >= $self->view_start() + $self->nrow) { - # scroll selected url into visible area - my $top = $self->{row} - ($self->nrow >> 1); - $self->view_start($top < 0 ? $top : 0); - } - - status_area($self); - $self->want_refresh(); - } - - () -} - - -sub refresh { - my ($self) = @_; - - if ($self->{found}) { - $self->scr_xor_span(@{$self->{found}[$self->{n}]}[0 .. 3], urxvt::RS_RVid); - } - - () -} - - -sub status_area { - my ($self) = @_; - - my $row = $self->{row} < 0 ? - $self->{row} - $self->top_row : abs($self->top_row) + $self->{row}; - my $text = sprintf("%d,%d ", $row + 1, $self->{n} + 1); - - if ($self->top_row == 0) { - $text .= "All"; - } elsif ($self->view_start() == $self->top_row) { - $text .= "Top"; - } elsif ($self->view_start() == 0) { - $text .= "Bot"; - } else { - $text .= sprintf("%2d%", - ($self->top_row - $self->view_start) * 100 / $self->top_row); - } - - my $text_len = length($text); - - if ($self->{overlay_len} != $text_len) { - delete $self->{overlay} if $self->{overlay}; - $self->{overlay} = $self->overlay(-1, -1, $text_len, 1, - urxvt::OVERLAY_RSTYLE, 0); - $self->{overlay_len} = $text_len; - } - - $self->{overlay}->set(0, 0, $self->special_encode($text)); - $self->{overlay}->show(); - - () -} - - -sub tt_write { - return 1; -} - - -sub activate { - my ($self) = @_; - - $self->{active} = 1; - - $self->{row} = $self->view_start() + $self->nrow; - $self->{n} = 0; - $self->{overlay_len} = 0; - $self->{button_pressed} = 0; - - $self->{view_start} = $self->view_start(); - $self->{pty_ev_events} = $self->pty_ev_events(urxvt::EV_NONE); - - $self->enable( - key_press => \&key_press, - refresh_begin => \&refresh, - refresh_end => \&refresh, - tt_write => \&tt_write, - ); - - () -} - - -sub deactivate { - my ($self) = @_; - - $self->disable("key_press", "refresh_begin", "refresh_end", "tt_write"); - $self->view_start($self->{view_start}); - $self->pty_ev_events($self->{pty_ev_events}); - - delete $self->{overlay} if $self->{overlay}; - delete $self->{found} if $self->{found}; - - $self->want_refresh(); - - $self->{active} = 0; - - () -} diff --git a/.vifm/colors/Default b/.vifm/colors/Default deleted file mode 100644 index c3c72dd..0000000 --- a/.vifm/colors/Default +++ /dev/null @@ -1,52 +0,0 @@ -" You can edit this file by hand. -" The " character at the beginning of a line comments out the line. -" Blank lines are ignored. - -" The Default color scheme is used for any directory that does not have -" a specified scheme and for parts of user interface like menus. A -" color scheme set for a base directory will also -" be used for the sub directories. - -" The standard ncurses colors are: -" Default = -1 = None, can be used for transparency or default color -" Black = 0 -" Red = 1 -" Green = 2 -" Yellow = 3 -" Blue = 4 -" Magenta = 5 -" Cyan = 6 -" White = 7 - -" Available style values (some of them can be combined): -" bold -" underline -" reverse or inverse -" standout -" none - -" Vifm supports 256 colors you can use color numbers 0-255 -" (requires properly set up terminal: set your TERM environment variable -" (directly or using resources) to some color terminal name (e.g. -" xterm-256color) from /usr/lib/terminfo/; you can check current number -" of colors in your terminal with tput colors command) - -" highlight group cterm=style ctermfg=foreground_color ctermbg=background_color - -highlight Win cterm=none ctermfg=white ctermbg=black -highlight Directory cterm=bold ctermfg=cyan ctermbg=default -highlight Link cterm=bold ctermfg=yellow ctermbg=default -highlight BrokenLink cterm=bold ctermfg=red ctermbg=default -highlight Socket cterm=bold ctermfg=magenta ctermbg=default -highlight Device cterm=bold ctermfg=red ctermbg=default -highlight Fifo cterm=bold ctermfg=cyan ctermbg=default -highlight Executable cterm=bold ctermfg=green ctermbg=default -highlight Selected cterm=bold ctermfg=magenta ctermbg=default -highlight CurrLine cterm=bold ctermfg=default ctermbg=blue -highlight TopLine cterm=none ctermfg=black ctermbg=white -highlight TopLineSel cterm=bold ctermfg=black ctermbg=default -highlight StatusLine cterm=bold ctermfg=black ctermbg=white -highlight WildMenu cterm=underline,reverse ctermfg=white ctermbg=black -highlight CmdLine cterm=none ctermfg=white ctermbg=black -highlight ErrorMsg cterm=none ctermfg=red ctermbg=black -highlight Border cterm=none ctermfg=black ctermbg=white diff --git a/.vifm/colors/alycolors b/.vifm/colors/alycolors deleted file mode 100644 index ddaacd6..0000000 --- a/.vifm/colors/alycolors +++ /dev/null @@ -1,60 +0,0 @@ -"" -"" vifm colorscheme -"" based on 'Default' & 'istib-solarized-dark' & 'juef-zenburn' -"" -"" Weitian LI -"" 2014/05/12 -"" - - -"" The standard ncurses colors are: -" Default = -1 = None (can be used for transparency or default color) -" Black = 0 -" Red = 1 -" Green = 2 -" Yellow = 3 -" Blue = 4 -" Magenta = 5 -" Cyan = 6 -" White = 7 - -"" Available style values (some of them can be combined): -" bold -" underline -" reverse/inverse -" standout -" none - -"" Vifm supports 256 colors you can use color numbers 0-255 -" (requires properly set up terminal: set your TERM environment variable -" (directly or using resources) to some color terminal name (e.g. -" xterm-256color) from /usr/lib/terminfo/; you can check current number -" of colors in your terminal with tput colors command) - -"" Syntax: -" highlight group cterm=style ctermfg=fg_color ctermbg=bg_color - - -highlight Win cterm=none ctermfg=default ctermbg=none - -highlight TopLine cterm=none ctermfg=yellow ctermbg=none -highlight TopLineSel cterm=bold ctermfg=magenta ctermbg=none -highlight StatusLine cterm=bold ctermfg=yellow ctermbg=none -highlight Border cterm=none ctermfg=default ctermbg=none - -highlight Selected cterm=bold ctermfg=magenta ctermbg=black -highlight CurrLine cterm=bold ctermfg=yellow ctermbg=blue - -highlight WildMenu cterm=bold,reverse ctermfg=yellow ctermbg=black -highlight CmdLine cterm=none ctermfg=white ctermbg=black -highlight ErrorMsg cterm=bold ctermfg=magenta ctermbg=black - -highlight Directory cterm=bold ctermfg=blue ctermbg=default -highlight Executable cterm=bold ctermfg=green ctermbg=default -highlight Link cterm=bold ctermfg=cyan ctermbg=default -highlight BrokenLink cterm=bold ctermfg=yellow ctermbg=red -highlight Device cterm=bold ctermfg=yellow ctermbg=default -highlight Socket cterm=bold ctermfg=magenta ctermbg=default -highlight Fifo cterm=none ctermfg=red ctermbg=default - -" vim: set ts=8 sw=4 tw=78 fenc=utf-8 ft=vifm: " diff --git a/.vifm/colors/dmilith-root b/.vifm/colors/dmilith-root deleted file mode 100644 index 393d02a..0000000 --- a/.vifm/colors/dmilith-root +++ /dev/null @@ -1,21 +0,0 @@ -" vim: filetype=vifm : - -" Author: Daniel Dettlaff (a.k.a. dmilith) - -highlight Win cterm=none ctermfg=white ctermbg=black -highlight Directory cterm=bold ctermfg=cyan ctermbg=black -highlight Link cterm=bold ctermfg=yellow ctermbg=black -highlight BrokenLink cterm=bold ctermfg=red ctermbg=none -highlight Socket cterm=bold ctermfg=magenta ctermbg=black -highlight Device cterm=bold ctermfg=red ctermbg=black -highlight Fifo cterm=bold ctermfg=cyan ctermbg=none -highlight Executable cterm=bold ctermfg=green ctermbg=black -highlight Selected cterm=bold ctermfg=magenta ctermbg=black -highlight CurrLine cterm=bold ctermfg=white ctermbg=30 -highlight TopLine cterm=bold ctermfg=white ctermbg=red -highlight TopLineSel cterm=bold ctermfg=yellow ctermbg=red -highlight StatusLine cterm=bold ctermfg=white ctermbg=red -highlight WildMenu cterm=underline,reverse ctermfg=white ctermbg=black -highlight CmdLine cterm=none ctermfg=white ctermbg=black -highlight ErrorMsg cterm=none ctermfg=red ctermbg=black -highlight Border cterm=none ctermfg=black ctermbg=red diff --git a/.vifm/colors/dmilith-user b/.vifm/colors/dmilith-user deleted file mode 100644 index 06473fc..0000000 --- a/.vifm/colors/dmilith-user +++ /dev/null @@ -1,21 +0,0 @@ -" vim: filetype=vifm : - -" Author: Daniel Dettlaff (a.k.a. dmilith) - -highlight Win cterm=none ctermfg=white ctermbg=black -highlight Directory cterm=bold ctermfg=cyan ctermbg=black -highlight Link cterm=bold ctermfg=yellow ctermbg=black -highlight BrokenLink cterm=bold ctermfg=red ctermbg=none -highlight Socket cterm=bold ctermfg=magenta ctermbg=black -highlight Device cterm=bold ctermfg=red ctermbg=black -highlight Fifo cterm=bold ctermfg=cyan ctermbg=none -highlight Executable cterm=bold ctermfg=green ctermbg=black -highlight Selected cterm=bold ctermfg=magenta ctermbg=black -highlight CurrLine cterm=bold ctermfg=white ctermbg=30 -highlight TopLine cterm=bold ctermfg=white ctermbg=blue -highlight TopLineSel cterm=bold ctermfg=yellow ctermbg=blue -highlight StatusLine cterm=bold ctermfg=white ctermbg=blue -highlight WildMenu cterm=underline,reverse ctermfg=white ctermbg=black -highlight CmdLine cterm=none ctermfg=white ctermbg=black -highlight ErrorMsg cterm=none ctermfg=red ctermbg=black -highlight Border cterm=none ctermfg=black ctermbg=blue diff --git a/.vifm/colors/istib-solarized-dark b/.vifm/colors/istib-solarized-dark deleted file mode 100644 index b81415f..0000000 --- a/.vifm/colors/istib-solarized-dark +++ /dev/null @@ -1,25 +0,0 @@ -" vim: filetype=vifm : - -" Author: Stéphane (a.k.a. istib) - -highlight Win cterm=none ctermfg=default ctermbg=none - -highlight TopLine cterm=none ctermfg=blue ctermbg=none -highlight TopLineSel cterm=none ctermfg=blue ctermbg=none -highlight StatusLine cterm=none ctermfg=blue ctermbg=none -highlight Border cterm=none ctermfg=blue ctermbg=none - -highlight Selected cterm=bold ctermfg=magenta ctermbg=default -highlight CurrLine cterm=bold ctermfg=default ctermbg=blue - -highlight WildMenu cterm=underline,reverse ctermfg=white ctermbg=black -highlight CmdLine cterm=none ctermfg=white ctermbg=black -highlight ErrorMsg cterm=none ctermfg=red ctermbg=black - -highlight Directory cterm=none ctermfg=cyan ctermbg=default -highlight Link cterm=none ctermfg=yellow ctermbg=default -highlight BrokenLink cterm=none ctermfg=red ctermbg=default -highlight Socket cterm=none ctermfg=magenta ctermbg=default -highlight Device cterm=none ctermfg=red ctermbg=default -highlight Fifo cterm=none ctermfg=cyan ctermbg=default -highlight Executable cterm=none ctermfg=green ctermbg=default diff --git a/.vifm/colors/juef-zenburn b/.vifm/colors/juef-zenburn deleted file mode 100644 index d777c10..0000000 --- a/.vifm/colors/juef-zenburn +++ /dev/null @@ -1,21 +0,0 @@ -" vim: filetype=vifm : - -" Author: Svyatoslav Mishyn (a.k.a. juef) - -highlight Win cterm=none ctermfg=188 ctermbg=237 -highlight Directory cterm=none ctermfg=108 ctermbg=default -highlight CmdLine cterm=none ctermfg=188 ctermbg=237 -highlight ErrorMsg cterm=bold ctermfg=115 ctermbg=default -highlight TopLine cterm=none ctermfg=174 ctermbg=235 -highlight TopLineSel cterm=bold ctermfg=174 ctermbg=235 -highlight StatusLine cterm=bold ctermfg=144 ctermbg=235 -highlight Executable cterm=none ctermfg=172 ctermbg=default -highlight Selected cterm=none ctermfg=116 ctermbg=238 -highlight Border cterm=none ctermfg=default ctermbg=235 -highlight CurrLine cterm=none ctermfg=223 ctermbg=235 -highlight WildMenu cterm=bold,reverse ctermfg=144 ctermbg=235 -highlight Link cterm=none ctermfg=142 ctermbg=default -highlight BrokenLink cterm=none ctermfg=181 ctermbg=default -highlight Device cterm=none ctermfg=174 ctermbg=default -highlight Fifo cterm=none ctermfg=109 ctermbg=default -highlight Socket cterm=none ctermfg=magenta ctermbg=default diff --git a/.vifm/colors/reicheltd-light b/.vifm/colors/reicheltd-light deleted file mode 100644 index 6d633ff..0000000 --- a/.vifm/colors/reicheltd-light +++ /dev/null @@ -1,26 +0,0 @@ -" vim: filetype=vifm : - -" Author: Daniel R. (a.k.a. reicheltd) - -highlight Win cterm=none ctermfg=236 ctermbg=255 -highlight Directory cterm=bold ctermfg=21 ctermbg=255 -highlight Link cterm=bold ctermfg=39 ctermbg=default - -highlight BrokenLink cterm=bold ctermfg=red ctermbg=default -highlight Socket cterm=bold ctermfg=magenta ctermbg=default -highlight Device cterm=bold ctermfg=blue ctermbg=default - -highlight Fifo cterm=bold ctermfg=cyan ctermbg=default -highlight Executable cterm=bold ctermfg=red ctermbg=default -highlight Selected cterm=bold ctermfg=200 ctermbg=default - -highlight CurrLine cterm=bold ctermfg=255 ctermbg=27 -highlight TopLine cterm=none ctermfg=236 ctermbg=255 -highlight TopLineSel cterm=bold ctermfg=236 ctermbg=255 - -highlight StatusLine cterm=bold ctermfg=236 ctermbg=255 -highlight WildMenu cterm=underline,reverse ctermfg=236 ctermbg=255 -highlight CmdLine cterm=none ctermfg=236 ctermbg=255 - -highlight ErrorMsg cterm=none ctermfg=red ctermbg=236 -highlight Border cterm=none ctermfg=236 ctermbg=255 diff --git a/.vifm/vifm-help.txt b/.vifm/vifm-help.txt deleted file mode 100644 index 61b50aa..0000000 --- a/.vifm/vifm-help.txt +++ /dev/null @@ -1,3099 +0,0 @@ -vifm(1) Vifm vifm(1) - - - -NAME - vifm - vi file manager - -SYNOPSIS - vifm [OPTION]... - vifm [OPTION]... LWIN_DIR - vifm [OPTION]... LWIN_DIR RWIN_DIR - -DESCRIPTION - Vifm is a ncurses based file manager with vi like keybindings. If you - use vi, vifm gives you complete keyboard control over your files with‐ - out having to learn a new set of commands. - -OPTIONS - The vifm executable will start vifm in the current directory unless it - is given a different directory on the command line. - - - Starts Vifm in the specified path. - - - Starts Vifm in the specified paths. - - Specifying two directories triggers split view even when vifm was in - single-view mode on finishing previous session. To suppress this be‐ - haviour :only command can be put in the vifmrc file. - - When only one path argument is found on command-line, the left/top pane - is automatically set as the current view. - - Paths to files are also allowed in case you want vifm to start with - some archive opened. If you want to select file, prepend its path with - --select. - - -f only used from the vifm.vim script. The selected files are - written to $VIFM/vimfiles and vifm exits. - - --logging - Log some errors to $VIFM/log. Also /var/log/vifm-startup-log - (on *nix) and startup-log in the directory of executable (on - Windows) is used to log startup process (when configuration - directory isn't determined). - - --remote - Sends the rest of command line to the active vifm server (one of - already running instances if any). When there is no server, - quits silently. There is no limit on how many arguments can be - processed. One can combine --remote with -c or + to execute command in already running instance of vifm. - See also "Client-Server" section below. - - -c or + - Run command-line mode on startup. Commands in such - arguments are executed in the order they appear in command line. - Commands with spaces or special symbols must be enclosed in dou‐ - ble or single quotes or all special symbols should be escaped - (the exact syntax strongly depends on shell). - - --help, -h - Show an overview of the commandline options. - - --version, -v - Show version information and quit. - - --no-configs - Don't read vifmrc and vifminfo. - - - See Startup section below for the explanations on $VIFM. - -General keys - Ctrl-C or Escape - cancel most operations. - - Ctrl-C or Escape - clear all selected files. - - Ctrl-L clear and redraw the screen. - -Basic Movement - The basic vi key bindings are used to move through the files and popup - windows. - - k, gk, or Ctrl-P - moves cursor up one line. - - j, gj or Ctrl-N - moves cursor down one line. - - h when 'lsview' is off moves up one directory, otherwise moves - left one file. - - l when 'lsview' is off moves into a directory or launches a file, - otherwise moves left one file. - - gg move to the top of the file list. - - gh moves up one directory. - - gl or Enter - moves into a directory or launches a file. - - G move to the bottom of the file list. - - H move to the first file in the window. - - M move to the file in the middle of the window. - - L move to the last file in the window. - - Ctrl-F or Page Down - move forward one page. - - Ctrl-B or Page Up - move back one page. - - Ctrl-D jump back one half page. - - Ctrl-U jump forward one half page. - - n% move to the file that is n percent from the top of the list (for - example 25%). - - 0 or ^ move cursor to the first column. See 'lsview' option descrip‐ - tion. - - $ move cursor to the last column. See 'lsview' option descrip‐ - tion. - - Space Bar - toggles between the two file lists. - -Movement with Count - Most movement commands also accept a count, 12j would move down 12 - files. - - [count]% - move to percent of the file list. - - [count]j - move down count files. - - [count]k - move up count files. - - [count]G or [count]gg - move to list position count. - -Scrolling panes - zt redraw pane with file in top of list. - - zz redraw pane with file in center of list. - - zb redraw pane with file in bottom of list. - - Ctrl-E scroll pane one line down. - - Ctrl-Y scroll pane one line up. - -Pane manipulation - Second character can be entered with or without Control key. - - Ctrl-W H - move the pane to the far left. - - Ctrl-W J - move the pane to the very bottom. - - Ctrl-W K - move the pane to the very top. - - Ctrl-W L - move the pane to the far right. - - Ctrl-W b - switch to bottom-right window. - - Ctrl-W h - switch to the left pane. - - Ctrl-W j - switch to the pane below. - - Ctrl-W k - switch to the pane above. - - Ctrl-W l - switch to the right pane. - - Ctrl-W o - shortcut for :only - - Ctrl-W p - switch to previous window. - - Ctrl-W s - shortcut for :split - - Ctrl-W t - switch to top-left window. - - Ctrl-W v - shortcut for :vsplit - - Ctrl-W w - switch to other pane. - - Ctrl-W x - exchange panes. - - [count1]Ctrl-W[count2]+ - increase size of the view by count1*count2. - - [count1]Ctrl-W[count2]- - decrease size of the view by count1*count2.. - - [count1]Ctrl-W[count2]< - increase size of the view by count1*count2.. - - [count1]Ctrl-W[count2]> - decrease size of the view by count1*count2.. - - Ctrl-W | - maximize current view. - - Ctrl-W _ - maximize current view. - - Ctrl-W = - make size of two views equal. - -Marks - Marks are set the same way as they are in vi. - - You can use this characters for marks [a-z][A-Z][0-9]. - - m[a-z][A-Z][0-9] - to set a mark for the current file. - - '[a-z][A-Z][0-9] - moves to the file set for the mark. - -Searching - /regular expression pattern[Return] - will highlight all files matching the pattern and go to the next - match. - - ?regular expression pattern[Return] - will highlight all files matching the pattern and go to the pre‐ - vious match. - - [count]n - find the next match of / or ?. - - [count]N - find the previous match of / or ?. - - If 'hlsearch' option is set, hitting n/N to perform search and go to - the first matching item resets current selection in normal mode. It is - not the case if search was already performed on files in the directory, - thus selection is not reset after clearing selection with escape key - and hitting n/N key again. - - [count]f[character] - search forward for file with [character] as first character in - name. Search wraps around the end of the list. - - [count]F[character] - search backward for file with [character] as first character in - name. Search wraps around the end of the list. - - [count]; - find the next match of f or F. - - [count], - find the previous match of f or F. - - Note: f, F, ; and , wrap around list beginning and end when they are - used alone and they don't wrap when they are used as selectors. - -File Filters - There are three basic file filters: - - - dot files filter (excluding "." and ".." special directories, which - appearance is controlled by the 'dotdirs' option) - - - manual filter for file names - - - automatic filter for file names - - - local filter for file names (see description of the "=" normal mode - command) - - Performing operations on manual filter for file names automatically - does the same on automatic one. The file name filter is separated - mainly for convenience purpose and to get more deterministic behaviour. - - The basic vim folding key bindings are used for filtering files. - - Each file list has its own copy of each filter. - - Filtered files are not checked in / search or :commands. - - Files and directories are filtered separately. For this a slash is - appended to a directory name before testing whether it matches the fil‐ - ter. Examples: - - " filter directories which names end with '.files' - :filter /^.*\.files\/$/ - - " filter files which names end with '.d' - :filter /^.*\.d$/ - - " filter files and directories which names end with '.o' - :filter /^.*\.o\/?$/ - - zo Show all of the dot files. - - zf Filter all of the selected files. - - za Toggle the showing and hiding of dot files. - - zm Filter all of the dot files. - - zO Show the files filtered out by filename filter. - - zM Filter the files matching the filename filter. - - zR Remove all filters. - - =regular expression pattern[Return] - filter out files that don't match regular expression. This kind - of filter is automatically reset when directory is changed. - -Other Normal Mode Keys - [count]: - enter command line mode. Count will add range. - - q: open external editor to prompt for command-line command. See - "Command line editing" section for details. - - q/ open external editor to prompt for search pattern to be searched - in forward direction. See "Command line editing" section for - details. - - q? open external editor to prompt for search pattern to be searched - in backward direction. See "Command line editing" section for - details. - - q= open external editor to prompt for filter pattern. See "Command - line editing" section for details. Unlike other q{x} commands - this one doesn't work in Visual mode. - - [count]!! and [count]! - enter command line mode with entered ! command. Count will mod‐ - ify range. - - Ctrl-O go backward through history. - - Ctrl-I if 'cpoptions' contains "t" flag, and switch active - pane just like does, otherwise it goes forward through - directory history of the current view. - - Ctrl-G creates a window showing detailed information about the current - file. - - Shift-Tab - enters view mode (works only after activating view pane with - :view command). - - ga calculate directory size. - - gA like ga, but force update. - - gf find link destination (like l with 'followlinks' off, but also - finds directories). - - gr only for MS-Windows - same as l key, but tries to run program with administrative - privileges. - - gv go to visual mode restoring last selection. - - gs restore last t selection, like gv for visual mode selection. - - gu - make names of selected files lowercase. - - [count]guu and [count]gugu - make names of [count] files starting from the current one lower‐ - case. Without [count] only current file is affected. - - gU - make names of selected files uppercase. - - [count]gUU and [count]gUgU - make names of [count] files starting from the current one upper‐ - case. Without [count] only current file is affected. - - e explore file in the current pane. - - i opens file with associated program even if it's an executable. - - cw rename a file or files. - - cW change only name of file (without extension). - - cl change link target. - - co only for *nix - change file owner. - - cg only for *nix - change file group. - - cp change file attributes (permission on *nix and properties on - Windows). - - [count]C - clone file [count] times. - - [count]dd or d[count]selector - moves the selected files to trash directory (if 'trash' option - is set, otherwise delete). See "Trash directory" section below. - - [count]DD or D[count]selector - removes the selected files. - - Y, [count]yy or y[count]selector - yanks the selected files. - - Y same as yy. - - p will copy the yanked files to the current directory or move the - files to the current directory if they were deleted with dd or - :d[elete] or if the files were yanked from trash directory. See - "Trash directory" section below. - - P moves the last yanked files. The advantage of using P instead - of d followed by p is that P moves files only once. This isn't - important in case you're moving files in the same file system - where your home directory is, but using P to move files on some - other file system (or file systems, in case you want to move - files from fs1 to fs2 and your home is on fs3) can save your - time. - - al puts symbolic links with absolute paths. - - rl puts symbolic links with relative paths. - - t select or unselect (tag) the current file. - - u undo last change. - - Ctrl-R redo last change. - - v enter visual mode. - - V enter visual mode. - - [count]Ctrl-A - increment first number in file name by count (1 by default). - - [count]Ctrl-X - decrement first number in file name by count (1 by default). - - ZQ same as :quit! - - ZZ same as :quit - - . repeat last command line command (not normal mode command) of - this session (does nothing right after startup or :restart com‐ - mand). The command doesn't depend on command-line history and - can be used with completely disabled history. - - ( goto previous group. Groups are defined by primary sorting key. - For name and iname members of each group have same first letter, - for all other sorting keys vifm uses size, uid, ... - - ) goto next group. See ( key description above. - -Using Count - You can use count with commands like yy. - - [count]yy - yank count files starting from current cursor position downward. - - Or you can use count with motions passed to y, d or D. - - d[count]j - delete (count + 1) files starting from current cursor position - upward. - -Registers - vifm supports multiple registers for temporary storing list of yanked - or deleted files. - - Registers should be specified with hitting double quite key followed by - a register name. Count is specified after register name. By default - commands use unnamed register, which has double quote as its name. - - Though all commands accept registers, most of commands ignores them - (for example H or Ctrl-U). Other commands can fill register or append - new files to it. - - Presently vifm supports ", _, a-z and A-Z characters as register names. - - As mentioned above " is unnamed register and has special meaning of the - default register. Every time when you use named registers (a-z and A- - Z) unnamed register is updated to contain same list of files as the - last used register. - - _ is black hole register. It can be used for writing, but its list is - always empty. - - Registers with names from a to z and from A to Z are named ones. Low‐ - ercase registers are cleared before adding new files, while uppercase - aren't and should be used to append new files to the existing file list - of appropriate lowercase register (A for a, B for b, ...). - - Registers can be changed on :empty command if they contain files under - trash directory (see "Trash directory" section below). - - Registers do not contain one file more than once. - - Example: - - "a2yy - - will put names of two files to register a (and to the unnamed regis‐ - ter), - - "Ad - - will remove one file and append its name to register a (and to the - unnamed register), - - p or "ap or "Ap - - will insert previously yanked and deleted files into current directory. - -Selectors - y, d, D, !, gu and gU commands accept selectors. You can combine them - with any of selectors below to quickly remove or yank several files. - - Most of selectors are like vi motions: j, k, gg, G, H, L, M, %, f, F, - ;, comma, ', ^, 0 and $. But there are some additional ones. - - a all files in current view. - - s selected files. - - S all files except selected. - - Examples: - dj - delete file under cursor and one below. - d2j - delete file under cursor and two below. - y6gg - yank all files from cursor position to 6th file in the list. - - When you pass a count to whole command and its selector they are multi‐ - plied. So: - 2d2j - delete file under cursor and four below. - 2dj - delete file under cursor and two below. - 2y6gg - yank all files from cursor position to 12th file in the list. - -Visual Mode - In visual mode work almost all normal mode keys, but they do not accept - selectors. - - Enter save selection and go back to normal mode. - - gv restore previous visual selection. - - v leave visual mode. - - V leave visual mode. - - : enter command line mode. When you leave it selection will be - cleared. - - o switch active selection bound. - - O switch active selection bound. - - gu, u make names of selected files lowercase. - - gU, U make names of selected files uppercase. - -View Mode - This mode tries to imitate the less program. List of builtin shortcuts - can be found below. Shortcuts can be customized using :qmap, :qnoremap - and :qunmap command-line commands. - - Shift-Tab, Tab, q, Q, ZZ - go back to normal mode. - - [count]e, [count]Ctrl-E, [count]j, [count]Ctrl-N, [count]Enter - forward one line (or [count] lines). - - [count]y, [count]Ctrl-Y, [count]k, [count]Ctrl-K, [count]Ctrl-P - backward one line (or [count] lines). - - [count]f, [count]Ctrl-F, [count]Ctrl-V, [count]Space Bar - forward one window (or [count] lines). - - [count]b, [count]Ctrl-B, [count]Alt-V - backward one window (or [count] lines). - - [count]z - forward one window (and set window to [count]). - - [count]w - backward one window (and set window to [count]). - - [count]Alt-Space - forward one window, but don't stop at end-of-file. - - [count]d, [count]Ctrl-D - forward one half-window (and set half-window to [count]). - - [count]u, [count]Ctrl-U - backward one half-window (and set half-window to [count]). - - r, Ctrl-R, Ctrl-L - repaint screen. - - R reload view preserving scroll position. - - [count]/pattern - search forward for ([count]‐th) matching line. - - [count]?pattern - search backward for ([count]‐th) matching line. - - [count]n - repeat previous search (for [count]‐th occurrence). - - [count]N - repeat previous search in reverse direction. - - [count]g, [count]<, [count]Alt-< - go to first line in file (or line [count]). - - [count]G, [count]>, [count]Alt-> - go to last line in file (or line [count]). - - [count]p, [count]% - go to beginning of file (or N percent into file). - - v edit the current file with vim. - - - Ctrl-W H - move the pane to the far left. - - Ctrl-W J - move the pane to the very bottom. - - Ctrl-W K - move the pane to the very top. - - Ctrl-W L - move the pane to the far right. - - - Ctrl-W h - switch to left pane. - - Ctrl-W j - switch to pane below. - - Ctrl-W k - switch to pane above. - - Ctrl-W l - switch to right pane. - - - Ctrl-W b - switch to bottom-right window. - - Ctrl-W t - switch to top-left window. - - - Ctrl-W p - switch to previous window. - - Ctrl-W w - switch to other pane. - - - Ctrl-W o - leave only one pane. - - Ctrl-W s - split window horizontally. - - Ctrl-W v - split window vertically. - - - Ctrl-W x - exchange panes. - - - Ctrl-W + - increase size of the view. - - Ctrl-W - - decrease size of the view. - - Ctrl-W < - increase size of the view. - - Ctrl-W > - decrease size of the view. - - Ctrl-W | - maximize current view. - - Ctrl-W _ - maximize current view. - - Ctrl-W = - make size of two views equal. - - - In general, all "Ctrl-W x" keys above work the same was as in Normal - mode. Active mode is automatically changed on navigating among win‐ - dows. When less-like mode activated on file preview is left using one - by "Ctrl-W x" keys, its state is stored until another file is showed - using preview (it's possible to leave the mode, hide preview pane, do - something else, then get back to the file and show preview pane again - with previously stored state in it). - -Command line Mode - This keys apply to all submodes of the command line mode: command, - prompt and search. - - Down, Up, Left, Right, Home, End and Delete are extended keys and they - are not available if vifm is compiled with --disable-extended-keys - option. - - Esc, Ctrl-C - leave command line mode, cancels input. Cancelled input is - saved into appropriate history and can be recalled later. - - Ctrl-M, Enter - execute command and leave command line mode. - - Ctrl-I, Tab - complete command or its argument. - - Shift-Tab - complete in reverse order. - - Ctrl-_ stop completion and return original input. - - Ctrl-K remove characters from cursor position till the end of line. - - Ctrl-U remove characters from cursor position till the beginning of - line. - - Ctrl-H, Backspace - remove character before the cursor. - - Ctrl-D, Delete - remove character under the cursor. - - Ctrl-B, Left - move cursor to the left. - - Ctrl-F, Right - move cursor to the right. - - Ctrl-A, Home - go to line beginning. - - Ctrl-E, End - go to line end - - Alt-B go to the beginning of previous word. - - Alt-F go to the end of next word. - - Ctrl-W remove characters from cursor position till the beginning of - previous word. - - Alt-D remove characters from cursor position till the beginning of - next word. - - Ctrl-T swap the order of current and previous character and move cursor - forward or, if cursor past the end of line, swap the order of - two last characters in the line. - - Alt-. insert last part of previous command to current cursor position. - Each next call will insert last part of older command. - - Ctrl-G edit command-line content in external editor. See "Command line - editing" section for details. - - Ctrl-N recall more recent command-line from history. - - Ctrl-P recall older command-line from history. - - Up recall more recent command-line from history, that begins as the - current command-line. - - Down recall older command-line from history, that begins as the cur‐ - rent command-line. - -Command line editing - vifm provides a facility to edit several kinds of data, that is usually - edited in command-line mode, in external editor (using command speci‐ - fied by ´vicmd' or 'vixcmd' option). This has at least two advantages - over built-in command-line mode: - - one can use full power of Vim to edit text; - - finding and reusing history entries becomes possible. - - The facility is supported by four input submodes of the command-line: - - command; - - forward search; - - backward search; - - file rename (see description of cw and cW normal mode keys). - - Editing command-line using external editor is activated by the c_CTRL-G - shortcut. It's also possible to do almost the same from Normal and - Visual modes using q:, q/ and q? commands. - - Temporary file created for the purpose of editing the line has the fol‐ - lowing structure: - - 1. First line, which is either empty or contains text already entered - in command-line. - - 2. 2nd and all other lines with history items starting with the most - recent one. Altering this lines in any way won't change history - items stored by vifm. - - After editing application is finished the first line of the file is - taken as the result of operation, when the application returns zero - exit code. If the application returns an error (see :cquit command in - Vim), all the edits made to the file are ignored, but the initial value - of the first line is saved in appropriate history. - -Commands - Commands are executed with :command_name - - Commented out lines should start with the double quote symbol, which - may be preceded by whitespace characters. - - ´|' can be used to separate commands, so you can give multiple commands - in one line. If you want to use '|' in an argument, precede it with - '\'. - - These commands see '|' as part of their arguments even when it's - escaped: - - :[range]! - :cmap - :cnoremap - :command - :filetype - :fileviewer - :filextype - :map - :mmap - :mnoremap - :nmap - :nnoremap - :noremap - :normal - :qmap - :qnoremap - :vmap - :vnoremap - :windo - :winrun - - To be able to use another command after one of these, wrap it with the - :execute command. An example: - if filetype('.') == 'reg' | execute '!!echo regular file' | endif - - :[count] - - :number - move to the file number. - :12 would move to the 12th file in the list. - :0 move to the top of the list. - :$ move to the bottom of the list. - - :[count]command - The only builtin :[count]command are :[count]d[elete] and - :[count]y[ank]. - - :d3 would delete three files starting at the current file position - moving down. - - :3d would delete one file at the third line in the list. - - :command [args] - - :[range]!program - will execute the program in a shell - - :[range]!command & - - will run the process in the background using vifm's means. - - Programs that write to stdout like ls will create an error message - showing partial output of the command. - - Take note of the space before ampersand symbol, if you omit it, command - will be run in the background using job control of your shell. - - Accepts macros. - - :[range]!! - is the same as :! but will pause the screen before returning to - Vifm. - - :!! will execute the last command. - - :[range]alink[!?] - creates absolute symbolic links of files in directory of other - view. With "?" vifm will open vi to edit filenames. "!" - forces overwrite. - - :[range]alink[!] path - creates absolute symbolic links of files in directory specified - with the path (absolute or relative to directory of other view). - "!" forces overwrite. - - :[range]alink[!] name1 name2... - creates absolute symbolic links of files in directory of other - view giving each next link a corresponding name from the argu‐ - ment list. "!" forces overwrite. - - :apropos manpage - will create a menu of items returned by the apropos command. - Selecting an item in the menu will open the corresponding man‐ - page. By default the command relies on the external "apropos" - utility, which can be customized by altering value of the 'apro‐ - posprg' option. - - :apropos - repeats last :apropos command. - - :cd or :cd ~ or :cd $HOME - change to your home directory. - - :cd - go to previous directory. - - :cd ~/dir - change directory to ~/dir. - - :cd /curr/dir /other/dir - change directory of the current pane to /curr/dir and directory - of the other pane to /other/dir. When using relative paths vifm - assumes that both of them are relative to current directory of - current view. Command will not fail if one of directories is - invalid. Accepts macros. - - :cd! /dir - same as :cd /dir /dir. - - :c[hange] - create a menu window to alter a files properties. - - :[range]chmod - shows file attributes (permission on *nix and properties on Win‐ - dows) change dialog. - - :[range]chmod[!] arg... - only for *nix - changes permissions for files. See 'man chmod' for arg format. - "!" means set permissions recursively. - - :[range]chown - only for *nix - same as co key in normal mode. - - :[range]chown [user][:][group] - only for *nix - changes owner and/or group of files. Operates on directories - recursively. - - :[range]clone[!?] - clones files in current directory. With "?" vifm will open vi - to edit filenames. "!" forces overwrite. Macros are expanded. - - :[range]clone[!] path - clones files to directory specified with the path (absolute or - relative to current directory). "!" forces overwrite. Macros - are expanded. - - :[range]clone[!] name1 name2... - clones files in current directory giving each next clone a cor‐ - responding name from the argument list. "!" forces overwrite. - Macros are expanded. - - :colo[rscheme]? - prints current color scheme name in the status bar. - - :colo[rscheme] - gives a menu with a list of available color schemes. You can - choose default color scheme here. It will be used for view if - no DIRECTORY in colorscheme file fits current path. It's also - used to set border color (except view titles) and colors in the - menus and dialogs. - - :colo[rscheme] color_scheme_name - changes default color scheme to color_scheme_name. - - :colo[rscheme] color_scheme_name directory - associates directory with the color scheme. The directory argu‐ - ment can be both absolute or relative path when :colorscheme - command is executed from command line, but mandatory should be - an absolute path when the command is executed in scripts loaded - at startup (until vifm is completely loaded). - - :comc[lear] - removes all user defined commands. - - :com[mand] - gives a menu of user commands. - - :com[mand] beginning - shows user defined commands that start with the beginning. - - :com[mand] name action - sets a new user command. - Trying to use a reserved command name will result in an error - message. - Use :com[mand]! to overwrite a previously set command. - Unlike vim user commands do not have to start with a capital - letter. User commands are run in a shell by default. To run a - command in the background you must set it as a background com‐ - mand with & at the end of the commands action (:com rm rm %f &). - Command name cannot contain numbers or special symbols (except - '?' and '!'). - - :com[mand] name /pattern - will set search pattern. - - :com[mand] name filter pattern - will set file name filter. - - :com[mand] cmd :commands - will set kind of alias for internal command (like in a shell). - Will pass range given to alias to an aliased command, so running - :%cp after - :command cp :copy %a - equals - :%copy - - :[range]co[py][!?][ &] - copies files to directory of other view. With "?" vifm will - open vi to edit filenames. "!" forces overwrite. - - :[range]co[py][!] path[ &] - copies files to directory specified with the path (absolute or - relative to directory of other view). "!" forces overwrite. - - :[range]co[py][!] name1 name2...[ &] - copies files to directory of other view giving each next file a - corresponding name from the argument list. "!" forces over‐ - write. - - :[range]d[elete][!][ &] - delete selected file or files. "!" means completely remove - file. - - :[range]d[elete][!] [reg] [count][ &] - will delete files to the reg register. "!" means completely - remove file. - - :delc[ommand] command_name - will remove the command_name user command. - - :delm[arks]! - will delete all marks. - - :delm[arks] marks ... - will delete specified marks, each argument is treated as a set - of marks. - - :di[splay] - popup menu with registers content. - - :di[splay] list ... - display the contents of the numbered and named registers that - are mentioned in list (for example "az to display "", "a and "z - content). - - :dirs display directory stack. - - :ec[ho] [...] - evaluates each argument as an expression and outputs them sepa‐ - rated by a space. See help on :let command for a definition of - . - - :[range]e[dit] [file...] - will load the selected or passed file or files into vi. Accepts - macros. - - :el[se] - executes commands until next matching :endif if they previously - were not being executed. See also help on :if and :endif com‐ - mands. - - :empty will permanently remove 'rm -fr' files from trash directory. It - will also remove all operations from undolist that have no sense - after :empty and remove all records about files in trash direc‐ - tory from all registers. See "Trash directory" section below. - - :en[dif] - ends conditional block. See also help on :if and :else com‐ - mands. - - :exe[cute] [...] - evaluates each argument as an expression and joins results sepa‐ - rated by a space to get a single string, which is then executed - as a command-line command. See help on :let command for a defi‐ - nition of . - - :exi[t][!] - same as :quit. - - :f[ile] - popup menu of programs set for the file type of the current - file. Add ' &' at the end of command to run program in back‐ - ground. - - :f[ile] arg - run associated command that begins with the arg without opening - menu. - - :filet[ype] pat1,pat2,... [{descr}]def_prog[ &],[{descr}]prog2[ &],... - will associate given program list to each of the patterns. - Associated program (command) is used by handlers of l and Enter - keys (and also in the :file menu). If you need to insert comma - into command just double it (",,"). Space followed by an amper‐ - sand as two last characters of a command means running of the - command in the background. Optional description can be given to - each command to ease understanding of what command will do in - the :file menu. Vifm will try the rest of the programs for an - association when the default isn't found. When program entry - doesn't contain any of vifm macros, name of current file is - appended as if program entry ended with %c macro. On Windows - path to executables containing spaces can (and should be for - correct work with such paths) be double quoted. See "Globs" - section below for pattern definition. See also "Automatic FUSE - mounts" section below. Example for zip archives and several - actions: - - filetype *.zip,*.jar,*.war,*.ear - \ {Mount with fuse-zip} - \ FUSE_MOUNT|fuse-zip %SOURCE_FILE %DESTINATION_DIR, - \ {View contents} - \ zip -sf %c | less, - \ {Extract here} - \ tar -xf %c, - - :filex[type] pat1,pat2,... [{ description }] def_program,program2,... - same as :filetype, but vifm will ignore this command if it's not running in X. - In X :filextype is equal to :filetype. See "Globs" section below for pattern - definition. See also "Automatic FUSE mounts" section below. - - :filev[iewer] pat1,pat2,... command - will associate given command as a viewer to each of the patterns. Viewer is a - command which output is captured and showed in the second pane of vifm after - running :view command. When the command doesn't contain any of vifm macros, - name of current file is appended as if command ended with %c macro. See - "Globs" section below for pattern definition. Example for zip archives: - - fileviewer *.zip,*.jar,*.war,*.ear zip -sf %c - - :filter[!] regular_expression_pattern - :filter[!] /regular_expression_pattern/ - will filter all the files out of the directory listing that match the regular - expression. Using second variant you can use the bar ('|') symbol without - escaping. Empty regular expression (specified by //, "" or '') means using of - the last search pattern. Use '!' to control state of filter inversion after - updating filter value (also see 'cpoptions' description). Filter is matched - case sensitively on *nix and case insensitively on Windows. - :filter /.o$ would filter all files ending in .o from the filelist. - Note: vifm uses extended regular expressions. - - :filter - reset filter (set it to empty string) and show all files. - - :filter! - same as :invert. - - :filter? - show current value of name and auto filters. - - :[range]fin[d] pattern - will show results of find command in the menu. Searches among selected files if - any. Accepts macros. By default the command relies on the external "find" - utility, which can be customized by altering value of the 'findprg' option. - - :[range]fin[d] -opt... - same as :find above, but user defines all find arguments. Searches among - selected files if any. - - :[range]fin[d] path -opt... - same as :find above, but user defines all find arguments. Ignores selection and - range. - - :[range]fin[d] - repeats last :find command. - - :fini[sh] - Stop sourcing a script. Can only be used in a vifm script file. This is a quick - way to skip the rest of the file. - - :[range]gr[ep][!] pattern - will show results of grep command in the menu. Add "!" to request inversion of - search (look for lines that do not match pattern). Searches among selected - files if any and no range given. Ignores binary files by default. By default - the command relies on the external "grep" utility, which can be customized by - altering value of the 'grepprg' option. - - :[range]gr[ep][!] -opt... - same as :grep above, but user defines all find arguments, which are not escaped. - Searches among selected files if any. - - :[range]gr[ep][!] - repeats last :grep command. "!" of this command inverts "!" in repeated - command. - - :h[elp] - show the help file. - - :h[elp] argument - is the same as using ':h argument' in vim. Use vifm- to get help - on vifm (tab completion works). This form of the command doesn't work when - ´vimhelp' option is off. - - :hi[ghlight] - will show information about all highlight groups in the current directory. - - :hi[ghlight] group-name - will show information on given highlight group of the default color scheme. - - :hi[ghlight] group-name cterm=style | ctermfg=color | ctermbg=color - sets style (cterm), foreground (ctermfg) or/and background (ctermbg) parameters - of highlight groups of the current default color scheme. - - Available style values (some of them can be combined): - - bold - - underline - - reverse or inverse - - standout - - none - - Available group-name values: - - Win - color of all windows (views, dialogs, menus) - - Border - color of vertical parts of the border - - TopLineSel - top line color of the current pane - - TopLine - top line color of the other pane - - CmdLine - the command line/status bar color - - ErrorMsg - color of error messages in the status bar - - StatusLine - color of the line above the status bar - - WildMenu - color of the wild menu items - - CurrLine - line at cursor position in the view - - Selected - color of selected files - - Directory - color of directories - - Link - color of symbolic links in the views - - BrokenLink - color of broken symbolic links - - Socket - color of sockets - - Device - color of block and character devices - - Executable - color of executable files - - Fifo - color of fifo pipes - - Available colors: - - -1 or default or none - default or transparent - - black - - red - - green - - yellow - - blue - - magenta - - cyan - - white - - Light versions of colors are regular colors with bold attribute set. So order - of arguments of :highlight command is important and it's better to put "cterm" - in front of others to prevent it from overwriting attributes set by "ctermfg" or - "ctermbg" arguments. - - Since there are two colors and only one bold attribute it affects both colors - when "reverse" attribute is used when running vifm in terminal emulator. While - linux native console can handle boldness of foreground and background colors - independently, which is for consistency with terminal emulators accessible from - vifm only implicitly by using light versions of colors. - - Here is the hierarchy of highlight groups, which you need to know for using - transparency: - StatusLine - WildMenu - Border - CmdLine - ErrorMsg - Win - Directory - Link - BrokenLink - Socket - Device - Fifo - Executable - Selected - CurrLine - TopLine - TopLineSel - - "none" means default terminal color for highlight groups at the first level of - the hierarchy and transparency for all others. - - :his[tory] - creates a popup menu of directories visited. - - :his[tory] x - x can be: - d[ir] or . show directory history. - c[md] or : show command line history. - s[earch] or / show search history and search forward on l key. - f[search] or / show search history and search forward on l key. - b[search] or ? show search history and search backward on l key. - i[nput] or @ show prompt history (e.g. on one file renaming). - fi[lter] or = show filter history (see description of the "=" normal mode command). - - :if {expr1} - starts conditional block. Commands are executed until next matching :else of - :endif command if {expr1} evaluates to non-zero, otherwise they are ignored. - See also help on :else and :endif commands. - - :invert [f] - invert file name filter. - - :invert? [f] - show current filter state. - - :invert s - invert selection. - - :invert o - invert sorting order of the primary sorting key. - - :invert? o - show sorting order of the primary sorting key. - - :jobs shows menu of current backgrounded processes. - - :let $ENV_VAR = - sets environment variable. Warning: setting environment variable to an empty - string on Windows removes it. - - :let $ENV_VAR .= - append value to environment variable. - - Where could be a single-quoted string, double-quoted string, an environment variable, function call or a concatanation of any of them in any order using the '.' operator. Any whitespace is ignored. - - :locate filename - uses the locate command to create a menu of filenames - Selecting a file from the menu will reload the current file list in vifm - to show the selected file. By default the command relies on the external - "locate" utility (it's assumed that its database is already built), which can be - customized by altering value of the 'locateprg' option. - - :locate - repeats last :locate command. - - :[range]ma[rk][?] x [/full/path] [filename] - Set mark x (a-zA-Z0-9) at /full/path and filename. By default current directory - is being used. If no filename was given and /full/path is current directory - then last file in [range] is used. Using of macros is allowed. Question mark - will stop command from overwriting existing marks. - - :marks create a popup menu of bookmarks. - - :marks list ... - display the contents of the marks that are mentioned in list. - - :mes[sages] - shows previously given messages (up to 50). - - :mkdir[!] dir ... - creates directories with given names. "!" means make parent directories as - needed. Macros are expanded. - - :[range]m[ove][!?][ &] - moves files to directory of other view. With "?" vifm will open vi to edit - filenames. "!" forces overwrite. - - :[range]m[ove][!] path[ &] - moves files to directory specified with the path (absolute or relative to - directory of other view). "!" forces overwrite. - - :[range]m[ove][!] name1 name2...[ &] - moves files to directory of other view giving each next file a corresponding - name from the argument list. "!" forces overwrite. - - :noh[lsearch] - clear selection in current pane. - - :norm[al][!] commands - executes normal mode commands. If "!" is used, mappings will not be used. If - the last command is unfinished it will be aborted as if or was - typed. A ":" should be completed as well. Commands can't start with a space, - so put a count of 1 (one) before it. - - :on[ly] - changes the window to show only the current file directory. - - :popd remove pane directories from stack. - - :pushd[!] /curr/dir [/other/dir] - add pane directories to stack and process arguments like :cd command. - - :pushd exchanges the top two items of the directory stack. - - :pw[d] show the present working directory. - - :q[uit][!] - will exit vifm (add ! if you don't want to save changes or check if there are - any of backgrounded commands still running). - - :[range]y[ank] [reg] [count] - will yank files to the reg register. - - :ls lists windows of active terminal multiplexer (only when terminal multiplexer is - used). This is achieved by issuing proper command for active terminal - multiplexer, thus the list is not handled by vifm. - - :reg[isters] - popup menu with registers content. - - :reg[isters] list ... - display the contents of the numbered and named registers that are mentioned in - list (for example "az to display "", "a and "z content). - - :[range]rename[!] - rename files using vi to edit names. ! means go recursively through directories. - - :[range]rename name1 name2... - rename each of selected files to a corresponding name. - - :restart - will free a lot of things (histories, commands, etc.), reread vifminfo and - vifmrc files and run startup commands passed in the argument list, thus losing - all unsaved changes (e.g. recent history or keys mapped in current session). - - :[range]restore - will restore file from trash directory, doesn't work in any other directory. - See "Trash directory" section below. - - :[range]rlink[!?] - creates relative symbolic links of files in directory of other view. With "?" - vifm will open vi to edit filenames. "!" forces overwrite. - - :[range]rlink[!] path - creates relative symbolic links of files in directory specified with the path - (absolute or relative to directory of other view). "!" forces overwrite. - - :[range]rlink[!] name1 name2... - creates relative symbolic links of files in directory of other view giving each - next link a corresponding name from the argument list. "!" forces overwrite. - - :screen - toggles whether to use the terminal multiplexer or not. - A terminal multiplexer uses pseudo terminals to allow multiple windows to be - used in the console or in a single xterm. Starting vifm from terminal - multiplexer with appropriate support turned on will cause vifm to open a new - terminal multiplexer window for each new file edited or program launched from - vifm. - This requires screen version 3.9.9 or newer for the screen -X argument or tmux - (version or newer 1.8 is recommented). - - :screen? - shows whether integration with terminal multiplexers is enabled. - - Note: the command is called screen for historical reasons (when tmux wasn't yet - supported) and might be changed in future releases, or get an alias. - - :se[t] shows all options that differ from their default value. - - :se[t] all - shows all options. - - :se[t] opt1=val1 opt2='val2' opt3="val3" ... - will set options to given values. - You can use following syntax: - - for all options - option, option? and option& - - for boolean options - nooption, invoption and option! - - for integer options - option=x, option+=x and option-=x - - for string options - option=x - - for string list options - option=x, option+=x and option-=x - - for enumeration options - option=x, option+=x and option-=x - - for enumeration options - option=x - - for set options - option=x, option+=x and option-=x - - for charset options - option=x, option+=x and option-=x - - the meaning: - - option - turn option on (for boolean) or print its value (for all others) - - nooption - turn option off - - invoption - invert option state - - option! - invert option state - - option? - print option value - - option& - reset option to its default value - - option=x or option:x - set option to x - - option+=x - add x to option - - option-=x - remove (or subtract) x from option - - Option name can be prepended and appended by any number of whitespace - characters. - - :sh[ell] - will start a shell. - - :sor[t] - creates a popup menu of different sorting methods, when one can select primary - sorting key. When 'viewcolumns' options is empty and 'lsview' is off, changing - primary sorting key will also affect view look (in particular the second column - of the view will be changed). - - :so[urce] file - reads command-line commands from the file. - - :sp[lit] - switch to a two window horizontal view. - - :sp[lit]! - toggles window horizontal splitting. - - :sp[lit] path - splits the window horizontally to show both file directories. And changes other - pane to path (absolute or relative to current directory of active pane). - - :[range]s[ubstitite]/pattern/string/[flags] - for each file in range replace a match of pattern with string. - - String can contain \0...\9 to link to capture groups (\0 - all match, \1 - - first group, etc.). - - Available flags: - - - i - ignore case (the 'ignorecase' and 'smartcase' options are not used) - - - I - don't ignore case (the 'ignorecase' and 'smartcase' options are not used) - - - g - substitute all matches in each file name (each g toggles this) - - :[range]s[ubstitute]//string/[flags] - will use previous pattern. - - :[range]s[ubstitute] - will repeat previous substitution command. - - :sync [relative path] - change the other panel to the current panel directory or to some path relative - to the current directory. Using macros is allowed. - - :sync! - change the other panel to the current panel directory and synchronize cursor - position. - - :touch file... - will create files. Aborts on errors and won't update time of existing files. - Macros are expanded. - - :[range]tr/pattern/string/ - for each file in range transliterate the characters which appear in pattern to - the corresponding character in string. When string is shorter than pattern, - it's padded with its last character. - - String can contain ...9 to link to capture groups (0 - all match, 1 - first - group, etc.). - - :undol[ist] - show list of latest changes. Add ! to see commands. - - :unl[et][!] $ENV_VAR1 $ENV_VAR2 ... - remove environment variables. Add ! to omit displaying of warnings about - nonexistent variables. - - :ve[rsion] - show menu with version information. - - :vifm same as :version. - - :vie[w] - toggle on and off the quick file view. - - :vie[w]! - turns on quick file view if it's off. - - :volumes - only for MS-Windows - will popup menu with volume list. Hitting l (or Enter) key will open - appropriate volume in the current pane. - - :vs[plit] - switch to a two window vertical view. - - :vs[plit]! - toggles window vertical splitting. - - :vs[plit] path - splits the window vertically to show both file directories. And changes other - pane to path (absolute or relative to current directory of active pane). - - :windo [command...] - Execute command for each pane (same as :winrun % command). - - :winrun type [command...] - Execute command for pane(s), which is determined by type argument: - - ^ - top-left pane - - $ - bottom-right pane - - % - all panes - - . - current pane - - , - other pane - - :w[rite] - write vifminfo file (add ! to force write even if settings weren't changed). - - :wq[!] same as :quit, but ! only disables check of backgrounded commands. - - :x[it][!] - will exit Vifm (add ! if you don't want to save changes). - - - :map lhs rhs - map lhs key sequence to rhs in normal and visual modes. - - :map! lhs rhs - map lhs key sequence to rhs in command line mode. - - - :cm[ap] lhs rhs - map lhs to rhs in command line mode. - - :mm[ap] lhs rhs - map lhs to rhs in menu mode. - - :nm[ap] lhs rhs - map lhs to rhs in normal mode. - - :qm[ap] lhs rhs - map lhs to rhs in view mode. - - :vm[ap] lhs rhs - map lhs to rhs in visual mode. - - - :cm[ap] - lists all maps in command line mode. - - :mm[ap] - lists all maps in menu mode. - - :nm[ap] - lists all maps in normal mode. - - :qm[ap] - lists all maps in view mode. - - :vm[ap] - lists all maps in visual mode. - - - :cm[ap] beginning - lists all maps in command line mode that start with the beginning. - - :mm[ap] beginning - lists all maps in menu mode that start with the beginning. - - :nm[ap] beginning - lists all maps in normal mode that start with the beginning. - - :qm[ap] beginning - lists all maps in view mode that start with the beginning. - - :vm[ap] beginning - lists all maps in visual mode that start with the beginning. - - - :no[remap] lhs rhs - map the key sequence lhs to {rhs} for normal and visual modes, but disallow - mapping of rhs. - - :no[remap]! lhs rhs - map the key sequence lhs to {rhs} for command line mode, but disallow mapping of - rhs. - - - :cno[remap] lhs rhs - map the key sequence lhs to {rhs} for command line mode, but disallow mapping of - rhs. - - :mn[oremap] lhs rhs - map the key sequence lhs to {rhs} for menu mode, but disallow mapping of rhs. - - :nn[oremap] lhs rhs - map the key sequence lhs to {rhs} for normal mode, but disallow mapping of rhs. - - :qn[oremap] lhs rhs - map the key sequence lhs to {rhs} for view mode, but disallow mapping of rhs. - - :vn[oremap] lhs rhs - map the key sequence lhs to {rhs} for visual mode, but disallow mapping of rhs. - - - :unm[ap] lhs - remove the mapping of lhs from normal and visual modes. - - :unm[ap]! lhs - remove the mapping of lhs from command line mode. - - - :cu[nmap] lhs - remove the mapping of lhs from command line mode. - - :mu[nmap] lhs - remove the mapping of lhs from menu mode. - - :nun[map] lhs - remove the mapping of lhs from normal mode. - - :qun[map] lhs - remove the mapping of lhs from view mode. - - :vu[nmap] lhs - remove the mapping of lhs from visual mode. - -Ranges - The ranges implemented include: - 2,3 - from second to third file in the list (including it) - % - the entire directory. - . - the current position in the filelist. - $ - the end of the filelist. - 't - the mark position t. - - Examples: - - :%delete - - would delete all files in the directory. - - :2,4delete - - would delete the files in the list positions 2 through 4. - - :.,$delete - - would delete the files from the current position to the end of the - filelist. - - :3delete4 - - would delete the files in the list positions 3, 4, 5, 6. - - If a backward range is given :4,2delete - an query message is given and - user can chose what to do next. - - The builtin commands that accept a range are :d[elete] and :y[ank]. - -Command macros - The command macros may be used in user commands. - - %a User arguments. When user arguments contain macros, they are - expanded before preforming substitution of %a. - - %c %"c The current file under the cursor. - - %C %"C The current file under the cursor in the other directory. - - %f %"f All of the selected files. - - %F %"F All of the selected files in the other directory list. - - %b %"b Same as %f %F. - - %d %"d Full path to current directory. - - %D %"D Full path to other file list directory. - - %rx %"rx - Full paths to files in the register {x}. In case of invalid - symbol in place of {x}, it's processed with the rest of the line - and default register is used. - - %m Show command output in a menu. - - %M Same as %m, but l (or Enter) key is handled like for :locate and - :find commands. - - %S Show command output in the status bar. - - %s Execute command in split window of active terminal multiplexer - (ignored if not running inside one). - - %i Completely ignore command output. - - Use %% if you need to put a percent sign in your command. - - Note that %m, %M, %s, %S and %i macros are mutually exclusive. Only the - last one of them in the command will take effect. - - You can use filename modifiers after %c, %C, %f, %F, %b, %d and %D - macros. Supported modifiers are: - - - :p - full path - - - :u - UNC name of path (e.g. "\\server" in - "\\server\share"), Windows only. Expands to current computer name - for not UNC paths. - - - :~ - relative to the home directory - - - :. - relative to current directory - - - :h - head of the filename - - - :t - tail of the filename - - - :r - root of the filename (without last extension) - - - :e - extension of the filename (last one) - - - :s?pat?sub? - substitute the first occurrence of pat with sub. You - can use any character for '?', but it must not occur in pat or sub. - - - :gs?pat?sub? - like :s, but substitutes all occurrences of pat with - sub. - - See ':h filename-modifiers' in Vim's documentation for the detailed - description. - - Using %x means expand corresponding macro escaping all characters - that have special meaning. And %"x means using of double quotes and - escape only backslash and double quote characters, which is more use‐ - ful on Windows systems. - - Position and quantity (if there is any) of %m, %M, %S or %s macros in - the command is unimportant. All their occurrences will be removed - from the resulting command. - - %c and %f macros are expanded to file names only, when %C and %F are - expanded to full paths. %f and %F follow this in %b too. - - :com move mv %f %D - would set the :move command to move all of the files selected in the - current directory to the other directory. - - The %a macro will substitute any arguments given in a command into the - command. All arguments are considered optional. ":com lsl !!ls -l %a" - will set the lsl command to execute ls -l with or without an argument. - - :lsl - will list the directory contents of the current directory. - - :lsl filename - will list only the given filename. - - The macros can also be used in directly executing commands. ":!mv %f - %D" would move the current directory selected files to the other direc‐ - tory. - - Appending & to the end of a command will cause it to be executed in the - background.Typically you want to run two kinds of external commands in - thebackground: - - GUI applications that doesn't fork thus block vifm (:!sxiv %f &); - - console tools that do not work with terminal (:!mv %f %D &). - - You don't want to run terminal commands, which require terminal input - oroutput something because they will mess up vifm's TUI. Anyway, if you - did runsuch a command, you can use Ctrl-L key to update vifm's TUI. - - Rewriting the example command with macros given above with background‐ - ing: - - :!mv %f %D & - - Note that %m, %M, %s, %S and %i macros have bigger priority than &. So - command containing at least one of them can't be backgrounded and " &" - at the end will be just silently ignored. - -Command backgrounding - Copy and move operation can take a lot of time to proceed. That's why - vifm supports backgrounding of this two operations. To run :copy, - :move or :delete command in the background just add " &" at the end of - a command. - - For each background operation a new thread will be created. Currently - job cannot be stopped or paused. - - You can see if command is still running in the :jobs menu. Back‐ - grounded commands have progress instead of process id at the line - beginning. - - Background operations cannot be undone. - -Globs - :filetype, :filextype and :fileviewer commands support globs to match - file names. Here is a short overview of globs and some important - points that one needs to know about them. - - Only names of files are matched by the globs, not full paths. E.g. - :filetype Makefile make %c - will match files with name "Makefile" regardless whether it's in root - or home directory. - - *, ?, [ and ] are treated as special symbols in the pattern. E.g. - :filetype * less %c - matches all files. One can use character classes for escaping, so - :filetype [*] less %c - matches only one file name, the one which contains only asterisk sym‐ - bol. - - * means any number of any characters (possibly an empty substring), - with one exception: asterisk at the pattern beginning doesn't match dot - in the first position. E.g. - :fileviewer *.zip,*.jar zip -sf %c - associates using of zip program to preview all files with zip or jar - extensions as listing of their content. - - ? means any character at this position. E.g. - :fileviewer ?.out file %c - calls file tool for all files which has exactly one character before - their extension (e.g. a.out, b.out). - - Square brackets designate character class, which means that whole char‐ - acter class matches against any of characters listed in it. For exam‐ - ple - :fileviewer *.[ch] highlight -O xterm256 -s dante --syntax c %c - makes vifm call highlight program to colorize source and header files - in C language for a 256-color terminal. Equal command would be - :fileviewer *.c,*.h highlight -O xterm256 -s dante --syntax c %c - - Inside square brackets ^ or ! can be used for symbol class negotiation - and the - symbol to set a range. ^ and ! should appear right after the - opening square bracket. For example - :filetype *.[!d]/ inspect_dir - associates inspect_dir as additional handler for all directories that - have one character extension unless it's "d" letter. And - :filetype [0-9].jpg sxiv - associates sxiv picture viewer only for JPEG-files that contain single - digit in their name. - -:set options - Local options - These are kind of options that are local to a specific view. So - you can set ascending sorting order for left pane and descending - order for right pane. - - aproposprg - type: string - default: "apropos %a" - Specifies format for an external command to be invoked by the - :apropos command. The format supports expanding of macros, spe‐ - cific for a particular *prg option, and %% sequence for insert‐ - ing percent sign literally. This option should include the %a - macro to specify placement of arguments passed to the :apropos - command. If the macro is not used, it will be implicitly added - after a space to the value of this option. - - autochpos - type: boolean - default: true - When disabled vifm will set cursor to the first line in the view - after :cd and :pushd commands instead of saved cursor position. - Disabling this will also make vifm clear information about cur‐ - sor position in the view history on :cd and :pushd commands (and - on startup if autochpos is disabled in the vifmrc). l key in - the :history . menu is treated like :cd command. This option - affects bookmarks, file position will not preserved. - - columns co - type: int - default: terminal width on startup - Terminal width in characters. - - classify - type: string list - default: ":dir:/" - Specifies file name prefixes and suffixes depending on file - types. The format is: [{prefix}]:{filetype}:[{suffix}]. Either - {prefix} or {suffix} or both of them can be omitted (which is - the default for all unspecified file types), this means empty - {prefix} and/or {suffix}. {prefix} and {suffix} should consist - exactly of one character. Elements are separated by commas. - Neither prefixes nor suffixes are part of file names, so they - don't affect commands which operate on file names in any way. - Comma (',') character should not be used. List of file type - names can be found in the description of filetype() function. - - confirm cf - type: boolean - default: true - Ask about permanent deletion of files (on D or :delete! command - or on undo/redo operation). - - cpoptions cpo - type: charset - default: "fst" - Contains a sequence of single-character flags. Each flag - enables behaviour of older versions of vifm. Flags: - f - when included, running :filter command results in not - inverted (matching files are filtered out) and :filter! in - inverted (matching files are left) filter, when omitted, meaning - of the exclamation mark changes to the opposite; - s - when included, yy, dd and DD normal mode commands act on - selection, otherwise they operate on current file only; - t - when included, (thus ) behave as and - switch active pane, otherwise and go forward in the - view history. - - dotdirs - type: set - default: nonrootparent - Controls displaying of dot directories. The following values - are possible: - - rootparent - show "../" in root directory of file system - - nonrootparent - show "../" in non-root directories of file - system - Note that empty directories will always contain "../" entry - regardless of value of this option. "../" will disappear at the - moment at least one file is created inside the directory. - - fastrun - type: boolean - default: false - With this option turned on you can run partially entered com‐ - mands with unambiguous beginning using :! (e.g. :!Te instead of - :!Terminal or :!Te). - - findprg - type: string - default: "find %s %a -print , -type d \( ! -readable -o ! -exe‐ - cutable \) -prune" - Specifies format for an external command to be invoked by the - :find command. The format supports expanding of macros, spe‐ - cific for a particular *prg option, and %% sequence for insert‐ - ing percent sign literally. This option should include the %s - macro to specify placement of list of paths to search in and the - %a macro to specify placement of arguments passed to the :find - command. If some of the macros are not used, they will be - implicitly added after a space to the value of the option in the - following order: %s, %a. - - %s and %a macro can slightly change their meaning depending on - :find command arguments. When the first argument points to an - existing directory, %s is assigned all arguments and %a is left - empty. Otherwise, %s is assigned a dot (".") meaning current - directory or list of selected filenames if any. %a is assigned - arguments when first argument starts with a dash ("-"), other‐ - wise an escaped version of arguments, prepended by "-name" (on - *nix) or "-iname" (on Windows) predicate. - - followlinks - type: boolean - default: true - Follow links on l or Enter. - - fusehome - type: string - default: "($TMPDIR | $TEMP | $TEMPDIR | $TMP)/vifm_FUSE/" - Directory to be used as a root dir for FUSE mounts. Value of - the option can contain environment variables (in form - "$envname"), which will be expanded (prepend it with a slash to - prevent expansion). The value should expand to an absolute - path. - - If you change this option, vifm won't remount anything. It - affects future mounts only. See "Automatic FUSE mounts" section - below for more information. - - gdefault gd - type: boolean - default: false - When on, 'g' flag is on for :substitute by default. - - grepprg - type: string - default: "grep -n -H -I -r %i %a %s" - Specifies format for an external command to be invoked by the - :grep command. The format supports expanding of macros, spe‐ - cific for a particular *prg option, and %% sequence for insert‐ - ing percent sign literally. This option should include the %i - macro to specify placement of "-v" string when inversion of - results is requested, the %a macro to specify placement of argu‐ - ments passed to the :grep command and the %s macro to specify - placement of list of files to search in. If some of the macros - are not used, they will be implicitly added after a space to the - value of the 'grepprg' option in the following order: %i, %a, - %s. - - Example of setup to use ack (http://beyondgrep.com/) instead of - grep: - set grepprg=ack\ -H\ -r\ %i\ %a\ %s - or The Silver Searcher (https://github.com/ggreer/the_sil‐ - ver_searcher): - set grepprg=ag\ --line-numbers\ %i\ %a\ %s - - - history hi - type: integer - default: 15 - Maximum number of directories in the view history and lines in - the prompt, command line and search histories. - - hlsearch hls - type: bool - default: true - Highlight all matches of search pattern. - - iec type: boolean - default: false - Use KiB, MiB, ... instead of KB, MB, ... - - ignorecase ic - type: boolean - default: false - Ignore case in search patterns (:substitute, / and ? commands) - and characters after f and F commands. It doesn't affect file - filtering. - - incsearch is - type: boolean - default: false - When this option is set, search will be performed starting from - initial cursor position each time search pattern is changed. - - laststatus ls - type: boolean - default: true - Controls if status bar is visible. - - lines type: int - default: terminal height on startup - Terminal height in lines. - - locateprg - type: string - default: "locate %a" - Specifies format for an external command to be invoked by the - :locate command. The format supports expanding of macros, spe‐ - cific for a particular *prg option, and %% sequence for insert‐ - ing percent sign literally. This option should include the %a - macro to specify placement of arguments passed to the :locate - command. If the macro is not used, it will be implicitly added - after a space to the value of this option. - - lsview type: boolean - default: false - type: local - When this option is set, directory view will be displayed in - multiple columns with filenames similar to output of `ls -x` - command. See ls-like view section below for format description. - - rulerformat ruf - type: string - default: "%=%l-%S " - Determines the content of the ruler. Its width is 13 characters - and it's right aligned. Following macros are supported: - %l - file number - %L - total number of files in view (including filtered) - %- - number of filtered files - %S - number of showed files - %= - separation point between left and right align items - %% - percent sign - - Percent sign can be followed by optional minimum field width. - Add '-' before minimum field width if you want field to be right - aligned. Example: - - set rulerformat="%=%2l-%S [%L] " - - runexec - type: boolean - default: false - Run executable file on Enter or l. - - scrollbind scb - type: boolean - default: false - When this option is set, vifm will try to keep difference of - scrolling positions of two windows constant. - - scrolloff so - type: int - default: 0 - Minimal number of screen lines to keep above and below the cur‐ - sor. If you want cursor line to always be in the middle of the - view (except at the beginning or end of the file list), set this - option to some large value (e.g. 999). - - shell sh - type: string - default: $SHELL or "sh" or "cmd" (on MS-Windows) - Full path to the shell to use to run external commands. - - shortmess shm - type: charset - default: "" - Contains a sequence of single-character flags. Each flag - enables shortening of some message displayed by vifm in the TUI. - Flags: - T - truncate status-bar messages in the middle if they are too - long to fit on the command line. "..." will appear in the mid‐ - dle. - - slowfs type: string list - default: "" - only for *nix - A list of mounter fs name beginnings (first column in /etc/mtab - or /proc/mounts) that work too slow for you. This option can be - used to stop vifm from making some requests to particular kinds - of file systems that can slow down file browsing. Currently - this means don't check if directory has changed and do not check - if target of symbolic links exists. - - smartcase scs - type: boolean - default: false - Overrides the ignorecase option if the search pattern contains - at least one upper case character. Only used when ignorecase - option is enabled. It doesn't affect file filtering. - - sort type: string list - default: +name on *nix and +iname on Windows - type: local - Sets list of sorting keys (first item is primary key, second is - secondary key, etc.): - [+-]ext - sort by extension - [+-]name - sort by name (including extension) - [+-]iname - sort by name (including extension, ignores case) - [+-]gid - sort by group id (*nix only) - [+-]gname - sort by group name (*nix only) - [+-]mode - sort by mode (*nix only) - [+-]perms - sort by permissions string (*nix only) - [+-]uid - sort by owner id (*nix only) - [+-]uname - sort by owner name (*nix only) - [+-]size - sort by size - [+-]atime - sort by time accessed - [+-]ctime - sort by time changed - [+-]mtime - sort by time modified - - ´+' means ascending sort for this key, and '-' means descending sort. - - In case name (iname on Windoes) is skipped, it will be added at the end - automatically. - - This option also changes view columns according to primary sorting key - set, unless 'viewcolumns' option is not empty. - - sortnumbers - type: boolean - default: false - type: local - Natural sort of (version) numbers within text. - - statusline stl - type: string - default: "" - Determines the content of the status line (the line right above - command-line). Empty string means use same format like in pre‐ - vious versions. Following macros are supported: - - - %t - file name (considering value of the 'classify' option) - - - %A - file attributes (permissions on *nix or properties on - Windows) - - - %u - user name or uid (if it cannot be resolved) - - - %g - group name or gid (if it cannot be resolved) - - - %s - file size in human readable format - - - %E - size of selected files in human readable format, same as - %s when no files are selected, except that it will never - show size of ../ in visual mode, since it cannot be - selected - - - %d - file modification date (uses 'timefmt' option) - - - all 'rulerformat' macros - - Percent sign can be followed by optional minimum field width. - Add '-' before minimum field width if you want field to be right - aligned. Example: - - set statusline=" %t%= %A %10u:%-7g %15s %20d " - - On Windows file properties include next flags (upper case means - flag is on): - A - archive - H - hidden - I - content isn't indexed - R - readonly - S - system - C - compressed - D - directory - E - encrypted - P - reparse point (e.g. symbolic link) - Z - sparse file - - sortorder - type: enumeration - default: ascending - Sets sort order for primary key: ascending, descending. - - tabstop ts - type: integer - default: value from curses library - Number of spaces that a Tab in the file counts for. - - timefmt - type: string - default: " %m/%d %H:%M" - Format of time in file list. See man date or man strf‐ - time for details. - - timeoutlen tm - type: integer - default: 1000 - The time in milliseconds that is waited for a mapped key - in case of already typed key sequence is ambiguous. - - trash type: boolean - default: true - Use trash directory. See "Trash directory" section - below. - - trashdir - type: string - default: "$HOME/.vifm/Trash" - Sets path to trash directory. Value of the option can - contain environment variables (in form "$envname"), which - will be expanded (prepend it with a slash to prevent - expansion). The value should expand to an absolute path. - - Will attempt to create the directory if it does not - exist. See "Trash directory" section below. - - undolevels ul - type: integer - default: 100 - Maximum number of changes that can be undone. - - vicmd type: string - default: "vim" - The actual command used to start vi. Ampersand sign at - the end (regardless whether it's preceded by space or - not) means backgrounding of command. - - viewcolumns - type: string - default: "" - type: local - Format string containing list of columns in the view. - When this option is empty view columns to show are chosen - automatically using sorting keys (see 'sort') as a base. - Value of this option is ignored if 'lsview' is set. See - Column view section below for format description. - - An example of setting the options for both panes (note - vifm-windo command): - windo set viewcolumns=-{name}..,6{size},11{perms} - - vixcmd type: string - default: value of vicmd - The command used to start vi when in X. Ampersand sign - at the end (regardless whether it's preceded by space or - not) means backgrounding of command. - - vifminfo - type: set - default: bookmarks - - Controls what will be saved in the $VIFM/vifminfo file. - options - all options that can be set with the :set command - filetypes - associated programs and viewers - commands - user defined commands (see :command description) - bookmarks - bookmarks, except special ones like '< and '> - tui - state of the user interface (sorting, number of - windows, quick - view state, active view) - dhistory - directory history - state - file name and dot filters and terminal multiplex‐ - ers integration - state - cs - default color scheme - savedirs - save last visited directory (needs dhistory) - chistory - command line history - shistory - search history (/ and ? commands) - phistory - prompt history - fhistory - filter history (see description of the "=" normal - mode command) - dirstack - directory stack overwrites previous stack, unless - stack of - current session is empty - registers - registers content - - vimhelp - type: boolean - default: false - Use vim help format. - - wildmenu wmnu - type: boolean - default: false - Controls whether possible matches of completion will be - shown above the command line. - - wrap type: boolean - default: true - Controls whether to wrap text in quick view. - - wrapscan ws - type: boolean - default: true - Searches wrap around end of the list. - -Mappings - Since it's not easy to enter special characters there are several spe‐ - cial sequences that can be used in place of them. They are: - - Enter key - - Backspace key - - - Tabulation and Shift+Tabulation keys - - - Keys with obvious names. - - - Delete key. and mean different codes, but - is more common. - - ,,...,,,,,, - Control + some key. - - ,,..., - ,,..., Alt + some key. - - ,,..., - ,,..., only for *nix - Alt + Ctrl + some key. - - - - Functional keys - - - - only for MS-Windows - Functional keys with Control key pressed. - - - - only for MS-Windows - Functional keys with Alt key pressed. - - - - only for MS-Windows - Functional keys with Shift key pressed. - - vifm removes whitespace characters at the beginning and end of com‐ - mands. That's why you may want to use at the end of rhs in - mappings. For example: - - cmap man - - will put "man " in line when you hit the key in the command line - mode. - -Expression syntax - Supported expressions is a subset of what VimL provides. - - Expression syntax summary, from least to most significant: - - vifm-expr1 expr2 == expr2 equal - expr2 != expr2 not equal - - vifm-expr2 expr3 . expr3 .. string concatenation - - vifm-expr3 "string" string constant, \ is special - 'string' string constant, ' is doubled - $VAR environment variable - function(expr1, ...) function call - - ".." indicates that the operations in this level can be concatenated. - - expr1 - ----- - expr2 {cmp} expr2 - - Compare two expr2 expressions, resulting in a 0 if it evaluates to - false or 1 if it evaluates to true. - - equal == - notequal != - - Examples: - 'a' == 'a' evaluates to 1 - 'a' == 'b' evaluates to 0 - - expr2 - ----- - expr3 . expr3 .. string concatenation - - Examples: - 'a' . 'b' = 'ab' - 'aaa' . '' . 'c' = 'aaac' - - expr3 - ----- - - string - ------ - "string" string constant - - Note that double quotes are used. - - A string constant accepts these special characters: - \b backspace - \e escape - \n newline - \r return - \t tab - \\ backslash - \" double quote - - Examples: - "\"Hello,\tWorld!\"" - "Hi,\nthere!" - - literal-string - -------------- - ´string' string constant - - Note that single quotes are used. - - This string is taken as it is. No backslashes are removed or have a - special meaning. The only exception is that two quotes stand for one - quote. - - Examples: - 'All\slashes\are\saved.' - 'This string contains doubled single quotes ''here''' - - environment variable - -------------------- - $VAR environment variable - - The String value of any environment variable. When it is not defined, - the result is an empty string. - - Examples: - 'This is my $PATH env: ' . $PATH - 'vifmrc at ' . $MYVIFMRC . ' is used.' - - function call - ------------- - function(expr1, ...) function call - - See Functions section below. - - Examples: - "'" . filetype('.') . "'" - filetype('.') == 'reg' - -Functions - USAGE RESULT DESCRIPTION - - expand({expr}) String Expand macros in {expr}. - filetype({fnum}) String Returns file type from position. - - expand({expr}) - Expands macros in {expr} just like it's done for command-line commands. - Returns a string. See "Command macros" section above. Examples: - " percent sign - :echo expand('%%') - " the last part of directory name of the other pane - :echo expand('%D:t') - - filetype({fnum}) - The result is a string, which represents file type and is one of the - list: - exe executables - reg regular files - link symbolic links - dir directories - char character devices - block block devices - fifo pipes - sock *nix domain sockets - ? unknown file type (should never appear) - Parameter {fnum} can have following values: - - '.' to get type of file under the cursor in the active pane - -Menus and dialogs - General - - j, k - move. - , Ctrl-C, ZZ, ZQ - quit. - , l - select and exit the menu. - Ctrl-L - redraw the menu. - - Escape, Ctrl-C, ZZ, ZQ, q - quit. - - In all menus - - Ctrl-B/Ctrl-F - Ctrl-D/Ctrl-U - Ctrl-E/Ctrl-Y - / and ?, n/N - [num]G/[num]gg - H/M/L - zb/zt/zz - zh - scroll menu items [count] characters to the right. - zl - scroll menu items [count] characters to the left. - zH - scroll menu items half of screen width characters to the right. - zL - scroll menu items half of screen width characters to the left. - - All these keys have the same meaning as in normal mode (but not L in - filetype menu). - - : - enter command line mode for menus (currently only :exi[t], :q[uit], - :x[it] and :{range} are supported). - - Apropos menu - - l key won't close the menu allowing user to pick another man page, use - :q to close the menu. - - Commands menu - - dd on a command to remove. - - Bookmarks menu - - Escape or Ctrl-C to abort j and k to move through. - dd on a bookmark to remove. - - Directory stack menu - - Pressing l or Enter on directory name will rotate stack to place - selected directory pair at the top of the stack. - - Filetype menu - - Commands from vifmrc or typed in command-line are displayed above empty - line. All commands below empty line are from .desktop files. - - Fileinfo dialog - - Enter - close dialog - q - close dialog - - Sort dialog - - h - switch ascending/descending. - Space - switch ascending/descending. - q - close dialog - - Attributes (permissions or properties) dialog - - h - check/uncheck. - Space - check/uncheck. - q - close dialog - - Item states: - - - * - checked flag. - - - X - means that it has different value for files in selection. - - - d (*nix only) - (only for execute flags) means u-x+X, g-x+X or o-x+X - argument for the chmod program. If you want to remove execute right - from all files, but preserve it for directories, set all execute - flags to 'd' and check ´Set Recursively' flag. - -Startup - On startup vifm determines several variables that are used during the - session. They are determined in the order they appear below. - - On *nix systems $HOME is normally present and used as is. On Windows - systems vifm tries to find correct home directory in the following - order: - - $HOME variable; - - $USERPROFILE variable; - - a combination of $HOMEDRIVE and $HOMEPATH variables. - - vifm tries to find correct configuration directory by checking the fol‐ - lowing places: - - $VIFM variable; - - parent directory of the executable file (on Windows only); - - $HOME/.vifm directory; - - $APPDATA/Vifm directory (on Windows only). - - vifm tries to find correct configuration file by checking the following - places: - - $MYVIFMRC variable; - - vifmrc in parent directory of the executable file (on Windows only); - - $VIFM/vifmrc file. - -Configure - See Startup section above for the explanations on $VIFM and $MYVIFMRC. - - The vifmrc file contains commands that will be executed on vifm - startup. See $MYVIFMRC variable description for search algorithm used - to find vifmrc. Use it to set settings, mappings, filetypes etc. To - use multi line commands precede each next line with a slash (whitespace - before slash is ignored, but all spaces at the end of the lines are - saved). For example: - set - \smartcase - equals "setsmartcase". When - set - \ smartcase - equals "set smartcase". - - The $VIFM/vifminfo file contains session settings. You may edit it by - hand to change the settings, but it's not recommended to do that, edit - vifmrc instead. You can control what settings will be saved in - vifminfo by setting ´vifminfo' option. Vifm always writes this file on - exit unless 'vifminfo' option is empty. Bookmarks, commands, directory - history, filetypes, fileviewers and registers in the file are merged - with vifm configuration (which has bigger priority). - - The $VIFM/scripts directory can contain shell scripts. vifm modifies - it's PATH environment variable to let user run those scripts without - specifying full path. All subdirectories of the $VIFM/scripts will be - added to PATH too. Script in a subdirectory overlaps script with the - same name in all its parent directories. - - The $VIFM/colors directory contains color schemes. - -Automatic FUSE mounts - vifm has a builtin support of automated FUSE file system mounts. It is - implemented using file associations mechanism. To enable automated - mounts, one needs to use a specially formated program line in filetype - or filextype commands. Currently two formats are supported: - - 1) FUSE_MOUNT This format should be used in case when all information - needed for mounting all files of a particular type is the same. E.g. - mounting of tar files don't require any file specific options. - - Format line: - FUSE_MOUNT|mounter %SOURCE_FILE %DESTINATION_DIR [%CLEAR] - - Example filetype command: - :filetype FUSE_MOUNT|fuse-zip %SOURCE_FILE %DESTINATION_DIR - - 2) FUSE_MOUNT2 This format allows one to use specially formatted files - to perform mounting and is useful for mounting remotes, for example - remote file systems over ftp or ssh. - - Format line: - FUSE_MOUNT2|mounter %PARAM %DESTINATION_DIR [%CLEAR] - - Example filetype command: - :filetype FUSE_MOUNT2|sshfs %PARAM %DESTINATION_DIR - - Example file content: - root@127.0.0.1:/ - - All % macros are expanded by vifm at runtime and have the following - meaning: - - %SOURCE_FILE is replaced by full path to selected file - - %DESTINATION_DIR is replaced by full path to mount directory, which - is created by vifm basing on the value of 'fusehome' option. - - %PARAM value is filled from the first line of file (whole line), - though in the future it can be changed to whole file content - - %CLEAR means that you want to clear screen before running mount - command. - - %CLEAR is an optional macro. Other macros are not mandatory, but mount - commands likely won't work without them. - - The mounted FUSE file systems will be automatically unmounted in two - cases: - - - when vifm quits (with ZZ, :q, etc. or when killed by signal) - - - when you explicitly leave mount point going up to its parent direc‐ - tory (with h, Enter on "../" or ":cd ..") and other pane is not in - the same directory or its child directories. - -View look - vifm supports displaying of file list view in two different ways: - - - in a table mode, when multiple columns can be set using 'viewcolumns' - option (see Column view section below for details); - - - in a multicolumn list manner which looks almost like `ls -x` command - output (see ls-like view section below for details). - - The look is local for each view and can be chosen by changing value of - the ´lsview' boolean option. - - Depending on view look some of keys change their meaning to allow more - natural cursor moving. This concerns mainly h, j, k, l and other simi‐ - lar navigation keys. - - Also some of options can be ignored if they don't affect view display‐ - ing in selected look. For example value of 'viewcolumns' when 'lsview' - is set. - -ls-like view - When this view look is enabled by setting 'lsview' option on, vifm will - display files in multiple columns. Number of columns depends on the - length of the longest file name present in current directory of the - view. Whole file list is automatically reflowed on directory change, - terminal or view resize. - - View looks close to output of `ls -x` command, so files are listed left - to right in rows. - - In this mode file manipulation commands (e.g. d) don't work line-wise - like they do in Vim, since such operations would be uncommon for file - manipulating tasks. Thus, for example, dd will remove only current - file. - -Column view - View columns are described by a comma-separated list of column descrip‐ - tions, each of which has the following format - [ '-' ] [ fw ( [ '.' tw ] | '%' ) ] '{' type '}' '.'{0,3} - where fw stands for full width and tw stands for text width. - - So it basically consists of four parts: - 1. Optional alignment specifier - 2. Optional width specifier - 3. Mandatory column name - 4. Optional cropping specifier - - Alignment specifier - - It's an optional minus sign as the first symbol of the string. - - Specifies type of text alignment within a column. Two types are sup‐ - ported: - - - left align - set viewcolumns=-{name} - - - right align (default) - set viewcolumns={name} - - Width specifier - - It's a number followed by a percent sign, two numbers (second one - should be less than or equal to the first one) separated with a dot or - a single number. - - Specifies column width and its units. There are tree size types: - - - absolute size - column width is specified in characters - set viewcolumns=-100{name},20.15{ext} - results in two columns with lengths of 100 and 20 and a reserved - space of five characters on the left of second column. - - - relative (percent) size - column width is specified in percents of - view width - set viewcolumns=-80%{name},15%{ext},5%{mtime} - results in three columns with lengths of 80/100, 15/100 and 5/100 of - view width. - - - auto size (default) - column width is automatically determined - set viewcolumns=-{name},{ext},{mtime} - results in three columns with length of one third of view width. - There is no size adjustment to content, since it will slow down ren‐ - dering. - - Columns of different sizing types can be freely mixed in one view. - Though sometimes some of columns can be seen partly or be completely - invisible if there is not enough space to display them. - - Column name - - This is just a sort key surrounded with curly braces, e.g. - {name},{ext},{mtime} - {name} and {iname} keys are the same and present both for consistency - with ´sort' option. - - Empty curly braces ({}) are replaced with the default secondary column - for primary sort key. So after the next command view will be displayed - almost as if 'viewcolumns' is empty, but adding ellipsis for long file - names: - set viewcolumns=-{name}..,6{}. - - Cropping specifier - - It's from one to three dots after closing curly brace in column format. - - Specifies type of text truncation if it doesn't fix in the column. Cur‐ - rently tree types are supported: - - - truncation - text is truncated - set viewcolumns=-{name}. - results in truncation of names that are too long too fit in the view. - - - adding of ellipsis - ellipsis on the left or right are added when - needed - set viewcolumns=-{name}.. - results in that ellipsis are added at the end of too long file names. - - - none (default) - text can pass column boundaries - set viewcolumns=-{name}...,{ext} - results in that long file names can partially be written on the ext - column. - -Color schemes - The color schemes in vifm can be applied in two different ways: - - - as the default (or main) color scheme - - - as local to a panel color scheme - - Both types are set using |vifm-:colorscheme| command, but of different - forms: - - - :colorscheme color_scheme_name - for the default color scheme - - - :colorscheme color_scheme_name directory - for local color schemes - - Look of different parts of the TUI (Text User Interface) is determined - in this way: - - - Border, TopLineSel, TopLine, CmdLine, ErrorMsg, StatusLine and Wild‐ - Menu are always determined by the default color scheme - - - CurrLine, Selected, Directory, Link, BrokenLink, Socket, Device, Exe‐ - cutable, Fifo and Win are determined by default color scheme and a - set of local colorschemes, which can be empty - - There might be a set of local color schemes because they are structured - hierarchically according to file system structure. For example, having - the following piece of file system: - - ~ - `-- bin - | - `-- my - - Two color schemes: - - # ~/.vifm/colors/for_bin - highlight Win cterm=none ctermfg=white ctermbg=red - highlight CurrLine cterm=none ctermfg=red ctermbg=black - - # ~/.vifm/colors/for_bin_my - highlight CurrLine cterm=none ctermfg=green ctermbg=black - - And these three commands in the vifmrc file: - - colorscheme Default - colorscheme for_bin ~/bin - colorscheme for_bin_my ~/bin/my - - File list will look in the following way for each level: - - - ~/ - Default color scheme - black background - cursor with blue background - - - ~/bin/ - mix of Default and for_bin color schemes - red background - cursor with black background and red foreground - - - ~/bin/my/ - mix of Default, for_bin and for_bin_my color schemes - red background - cursor with black background and green foreground - -Trash directory - vifm has support of trash directory, which is used as temporary storage - for deleted files or files that were cut. Using trash is controlled by - the ´trash' option, and exact path to the trash can be set with - 'trashdir' option. Trash directory in vifm differs from the system- - wide one by default, because of possible incompatibilities of storing - deleted files among different file managers. But one can set - 'trashdir' to "~/.local/share/Trash" to use a "standard" trash direc‐ - tory. - - There are two scenarios of using trash in vifm: - - 1. As a place for storing files that were cut by "d" and may be - inserted to some other place in file system. - - 2. As a storage of files, that are deleted but not purged yet. - - The first scenario uses deletion ("d") operations to put files to trash - and put ("p") operations to restore files from trash directory. Note - that such operations move files to and from trash directory, which can - be long term operations in case of different partitions or remote - drives mounted locally. - - The second scenario uses deletion ("d") operations for moving files to - trash directory and :empty command-line command to purge all previously - deleted files. - - Deletion and put operations depend on registers, which can point to - files in trash directory. Normally, there are no nonexistent files in - registers, but vifm doesn't keep track of modifications under trash - directory, so one shouldn't expect value of registers to be absolutely - correct if trash directory was modified not by operation that are meant - for it. But this won't lead to any issues with operations, since they - ignore nonexistent files. - -Client-Server - vifm supports remote execution of command-line mode commands as well as - remote changing of directories. This is possible using --remote com‐ - mand-line argument. - - To execute a command remotely combine --remote argument with -c or +. For example: - vifm --remote -c 'cd /' - vifm --remote '+cd /' - - To change directory not using command-line mode commands one can spec‐ - ify paths right after --remote argument, like this: - vifm --remote / - vifm --remote ~ - vifm --remote /usr/bin /tmp - - At the moment there is no way of specifying, which instance of vifm - should arguments be sent. The main purpose of --remote argument is to - provide support of using vifm as a single-instance application. - -Plugin - Plugin for using vifm in vim as a file selector. - - Commands: - - :EditVifm select a file or files to open in the current buffer. - :SplitVifm split buffer and select a file or files to open. - :VsplitVifm vertically split buffer and select a file or files to - open. - :DiffVifm select a file or files to compare to the current file - with - :vert diffsplit. - :TabVifm select a file or files to open in tabs. - - Each command accepts up to two arguments: left pane directory and right - pane directory. After arguments are checked, vifm process is spawned - in a special "file-picker" mode. To pick files just open them either - by pressing l, i or Enter keys, or by running :edit command. If no - files are selected, file under the cursor is opened, otherwise whole - selection is passed to the plugin and opened in vim. - - The plugin have only two settings. It's a string variable named - g:vifm_term to let user specify command to run gui terminal. By - default it's equal to ´xterm -e'. And another string variable named - g:vifm_exec, which equals "vifm" by default and specifies path to - vifm's executable. To pass arguments to vifm use g:vifm_exec_args, - which is empty by default. - - To use the plugin copy the vifm.vim file to either the system wide - vim/plugin directory or into ~/.vim/plugin. - - If you would prefer not to use the plugin and it is in the system wide - plugin directory add - - let loaded_vifm=1 - - to your ~/.vimrc file. - -Reserved - The following command names are reserved and shouldn't be used for user - commands. - - g[lobal] - v[global] - -SEE ALSO - Website: http://vifm.sourceforge.net/ - - Esperanto translation of the documentation by Sebastian Cyprych: - http://cyprych.neostrada.pl/tekstoj/komputiloj/vifm-help.eo.html - -AUTHOR - Vifm was written by ksteen - And currently is developed by xaizek - - - - Oct 19, 2013 vifm(1) diff --git a/.vifm/vifmrc b/.vifm/vifmrc deleted file mode 100644 index 3b4a1be..0000000 --- a/.vifm/vifmrc +++ /dev/null @@ -1,314 +0,0 @@ -"" -"" ~/.vifm/vifmrc -"" -"" Weitian LI -"" 2014/05/12 -"" - -""" general settings {{{ -" This is the actual command used to start vi. The default is vim. -" If you would like to use another vi clone such Elvis or Vile -" you will need to change this setting. -set vicmd=vim -" set vicmd=elvis\ -G\ termcap -" set vicmd=vile - -" Trash Directory -" The default is to move files that are deleted with dd or :d to -" the trash directory. If you change this you will not be able to move -" files by deleting them and then using p to put the file in the new location. -" I recommend not changing this until you are familiar with vifm. -" This probably shouldn't be an option. -set trash - -" This is how many directories to store in the directory history. -set history=100 - -" Follow links on l or Enter. -set followlinks - -" With this option turned on you can run partially entered commands with -" unambiguous beginning using :! (e.g. :!Te instead of :!Terminal or :!Te). -set fastrun - -" Natural sort of (version) numbers within text. -set sortnumbers - -" Maximum number of changes that can be undone. -set undolevels=100 - -" If you installed the vifm.txt help file set vimhelp. -" If would rather use a plain text help file set novimhelp. -set novimhelp - -" If you would like to run an executable file when you -" press return on the file name set this. -set norunexec - -" Use KiB, MiB, ... instead of KB, MB, ... -set iec - -" Selected color scheme -"colorscheme Default -colorscheme alycolors - -" The FUSE_HOME directory will be used as a root dir for all FUSE mounts. -" Unless it exists with write/exec permissions set, vifm will attempt to -" create it. -set fusehome=/tmp/vifm_FUSE - -" Format for displaying time in file list. For example: -" TIME_STAMP_FORMAT=%m/%d-%H:%M -" See man date or man strftime for details. -set timefmt=%m/%d\ %H:%M - -" Show list of matches on tab complition in command-line mode -set wildmenu - -" Ignore case search unless it contains at least one uppercase letter -set ignorecase -set smartcase - -" Use increment searching (search while typing) -set incsearch - -" Don't highlight search results automatically -"set nohlsearch - -" Try to leave some space from cursor to upper/lower border in lists -set scrolloff=4 - -" Don't do to much requests to slow file systems -set slowfs=curlftpfs - -" Set custom status line look -set statusline=" %t%= %A %10u:%-7g %15s %20d " - -" What should be saved automatically between vifm runs -" Like in previous versions of vifm -" set vifminfo=options,filetypes,commands,bookmarks,dhistory,state,cs -" Like in vi -set vifminfo=dhistory,savedirs,chistory,state,tui,shistory, - \phistory,fhistory,dirstack,registers,bookmarks -""" settings }}} - -""" marks {{{ -" :mark mark /full/directory/path [filename] -mark h ~/ -mark b ~/bin/ -mark d ~/documents/ -mark m ~/music/ -mark o ~/office/ -mark p ~/pictures/ -mark u ~/unix/ -mark x ~/private/ -""" marks }}} - -""" mappings {{{ -" to speed up -nmap ; : - -nmap s :shell -nmap S :sort -nmap w :view -nmap o :!gvim --remote-tab-silent %f -nmap O :!gvim %f -" open file in the background using its default program -nmap gb :file &l - -" Yank current directory path into the clipboard -nmap yd :!echo %d | xclip %i - -" Yank current file path into the clipboard -nmap yf :!echo %c:p | xclip %i - -" Mappings for faster renaming -nmap I cw -nmap cc cw -nmap A cw - -" Opening console in current directory -nmap ,t :!xterm & - -" Opening vim to edit .vifmrc -nmap ,c :execute ':!vim $MYVIFMRC' | restart -" Opening gvim to edit .vifmrc -nmap ,C :!gvim --remote-tab-silent $MYVIFMRC & - -" Toggle wrap setting on ,w key -nmap ,w :set wrap! - -nmap :!less %f -nmap :edit -nmap :copy -nmap :move -nmap :mkdir -nmap :delete -""" mappings }}} - -""" command {{{ -" :com[mand] command_name action -" The following macros can be used in a command -" %a is replaced with the user arguments. -" %c the current file under the cursor. -" %C the current file under the cursor in the other directory. -" %f the current selected file, or files. -" %F the current selected file, or files in the other directory. -" %b same as %f %F. -" %d the current directory name. -" %D the other window directory name. -" %m run the command in a menu window -command df df -h %m 2> /dev/null -command diff vim -d %f %F -command zip zip -r %f.zip %f -command run !! ./%f -command make !!make -command vgrep vim "+grep %a" -""" command }}} - -""" filetype & fileview {{{ -" The file type is for the default programs to be used with -" a file extension. -" :filetype pattern1,pattern2 [{desc}]defaultprogram[ &],[{desc}]program2 -" :fileviewer pattern1,pattern2 consoleviewer -" The other programs for the file type can be accessed with the :file command -" The command macros %f, %F, %d, %F may be used in the commands. -" The % macro is ignored. To use a % you must put %%. - -" For automated FUSE mounts, you must register an extension with :file[x]type -" in one of following formats: -" -" :filetype extensions FUSE_MOUNT|some_mount_command using %SOURCE_FILE and %DESTINATION_DIR variables -" %SOURCE_FILE and %DESTINATION_DIR are filled in by vifm at runtime. -" A sample line might look like this: -" :filetype *.zip,*.jar,*.war,*.ear FUSE_MOUNT|fuse-zip %SOURCE_FILE %DESTINATION_DIR -" -" :filetype extensions FUSE_MOUNT2|some_mount_command using %PARAM and %DESTINATION_DIR variables -" %PARAM and %DESTINATION_DIR are filled in by vifm at runtime. -" A sample line might look like this: -" :filetype *.ssh FUSE_MOUNT2|sshfs %PARAM %DESTINATION_DIR -" %PARAM value is filled from the first line of file (whole line). -" Example first line for SshMount filetype: root@127.0.0.1:/ -" -" You can also add %CLEAR if you want to clear screen before running FUSE -" program. - -" Pdf -filetype *.pdf zathura %f,apvlv %f,xpdf %f -fileview *.pdf pdftotext -nopgbrk %c - - -" PostScript -filextype *.ps,*.ps.gz gv %c %i & - -" Djvu -filextype *.djvu apvlv %f - -" Audio -filetype *.wav,*.mp3,*.flac,*.ogg,*.m4a - \ {Play using ffplay} - \ ffplay %c, - \ {Play using MPlayer} - \ mplayer %f, -fileviewer *.mp3 mp3info - -" Video -filextype *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.vob,*.flv - \ {View using ffplay} - \ ffplay -fs %c, - \ {View using Dragon} - \ dragon %f, - \ {View using mplayer} - \ mplayer %f, -fileviewer *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.vob - \ ffprobe -pretty %c 2>&1 - -" Web -filetype *.html,*.htm links,mozilla,uzbl-browser %f %i & - -" Object -filetype *.o nm %f | less - -" Image -filextype *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm - \ {View in feh} - \ feh -FZ %d --start-at %d/%c 2>/dev/null &, - \ {View in sxiv} - \ sxiv, - \ {View in gpicview} - \ gpicview %c, -fileviewer *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm - \ convert -identify %f -verbose /dev/null - -" MD5 -filetype *.md5 - \ {Check MD5 hash sum} - \ md5sum -c %f, - -" FuseZipMount -filetype *.zip,*.jar,*.war,*.ear - \ {Mount with fuse-zip} - \ FUSE_MOUNT|fuse-zip %SOURCE_FILE %DESTINATION_DIR, - \ {View contents} - \ zip -sf %c | less, - \ tar -xf %c, -fileviewer *.zip,*.jar,*.war,*.ear zip -sf %c - -" ArchiveMount -filetype *.tar.bz2,*.tbz2,*.tgz,*.tar.gz - \ {Mount with archivemount} - \ FUSE_MOUNT|archivemount %SOURCE_FILE %DESTINATION_DIR, -fileviewer *.tgz,*.tar.gz tar -tzf %c -fileviewer *.tar.bz2,*.tbz2 tar -tjf %c - -" Rar2FsMount -filetype *.rar - \ {Mount with rar2fs} - \ FUSE_MOUNT|rar2fs %SOURCE_FILE %DESTINATION_DIR, - -" IsoMount -filetype *.iso - \ {Mount with fuseiso} - \ FUSE_MOUNT|fuseiso %SOURCE_FILE %DESTINATION_DIR, - -" SshMount -filetype *.ssh - \ {Mount with sshfs} - \ FUSE_MOUNT2|sshfs %PARAM %DESTINATION_DIR, - -" FtpMount -filetype *.ftp - \ {Mount with curlftpfs} - \ FUSE_MOUNT2|curlftpfs -o ftp_port=-,,disable_eprt %PARAM %DESTINATION_DIR, - -" Fuse7z -filetype *.7z - \ {Mount with fuse-7z} - \ FUSE_MOUNT|fuse-7z %SOURCE_FILE %DESTINATION_DIR, - -" Office files -filextype *.doc,*.docx,*.xls,*.xlsx libreoffice %f & -fileview *.docx, docx2txt.pl %f - - -" Qt projects -filextype *.pro qtcreator %f & - -" Directories -filextype */ - \ {View in thunar} - \ Thunar %f &, -fileview .*/,*/ tree %f - -" Open all other files with default system programs (you can also remove all -" :file[x]type commands above to ensure they don't interfere with system-wide -" settings). By default all unknown files are opened with 'vi[x]cmd' -" uncommenting one of lines below will result in ignoring 'vi[x]cmd' option -" for unknown file types. -" For *nix: -" filetype * xdg-open -" For OS X: -" filetype * open -" For Windows: -" filetype * start, explorer -""" filetype & fileview }}} - -" vim: set ts=8 sw=4 tw=78 fenc=utf-8 ft=vifm: " diff --git a/.xbindkeysrc b/.xbindkeysrc deleted file mode 100644 index ef89ab1..0000000 --- a/.xbindkeysrc +++ /dev/null @@ -1,104 +0,0 @@ -# For the benefit of emacs users: -*- shell-script -*- -########################### -# xbindkeys configuration # -########################### -# -# Version: 1.8.4 -# -# If you edit this file, do not forget to uncomment any lines -# that you change. -# The pound(#) symbol may be used anywhere for comments. -# -# To specify a key, you can use 'xbindkeys --key' or -# 'xbindkeys --multikey' and put one of the two lines in this file. -# -# The format of a command line is: -# "command to start" -# associated key -# -# -# A list of keys is in /usr/include/X11/keysym.h and in -# /usr/include/X11/keysymdef.h -# The XK_ is not needed. -# -# List of modifier: -# Release, Control, Shift, Mod1 (Alt), Mod2 (NumLock), -# Mod3 (CapsLock), Mod4, Mod5 (Scroll). -# - -# The release modifier is not a standard X modifier, but you can -# use it if you want to catch release events instead of press events - -# By defaults, xbindkeys does not pay attention with the modifiers -# NumLock, CapsLock and ScrollLock. -# Uncomment the lines above if you want to pay attention to them. - -#keystate_numlock = enable -#keystate_capslock = enable -#keystate_scrolllock= enable - -#"xbindkeys_show" -# control+shift + q - -###### music control ###### {{{ -"mpc toggle" - m:0x0 + c:172 - XF86AudioPlay - -"mpc stop" - m:0x0 + c:174 - XF86AudioStop - -"mpc prev" - m:0x0 + c:173 - XF86AudioPrev - -"mpc next" - m:0x0 + c:171 - XF86AudioNext -###### music }}} - -###### volume control ###### {{{ -"amixer sset Master '5%+' unmute" - m:0x0 + c:123 - XF86AudioRaiseVolume - -"amixer sset Master '5%-' unmute" - m:0x0 + c:122 - XF86AudioLowerVolume - -"amixer sset Master toggle" - m:0x0 + c:121 - XF86AudioMute -###### volume }}} - -###### thinkpad ###### {{{ -## thinkpad special keys require 'thinkpad_acpi' module - -# ThinkVantage button -"dmenu_run" - m:0x0 + c:156 - XF86Launch1 - -"~/bin/i3lock_exit.sh lock" - m:0x10 + c:160 - Mod2 + XF86ScreenSaver - -#"(Scheme function)" -# m:0x10 + c:220 -# Mod2 + XF86WebCam - -"arandr" - m:0x10 + c:235 - Mod2 + XF86Display - -# TouchPadToggle -"synclient TouchpadOff=`synclient -l | grep -c 'TouchpadOff.*=.*0'`" - m:0x10 + c:199 - Mod2 + XF86TouchpadToggle - -###### thinkpad ###### }}} - -################################## -# End of xbindkeys configuration # -################################## diff --git a/.xinitrc b/.xinitrc deleted file mode 100644 index f52892e..0000000 --- a/.xinitrc +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -# -# ~/.xinitrc -# - -# Run all system xinitrc shell scripts. -xinitdir="/etc/X11/xinit/xinitrc.d" -if [ -d "$xinitdir" ]; then - for script in $xinitdir/*; do - echo "Loading xinit script $script" - if [ -x "$script" -a ! -d "$script" ]; then - . "$script" - fi - done - unset $script -fi - -[ -f ~/.Xresources ] && xrdb -load ~/.Xresources - -# disable beep -xset b off - -# disable CapsLock -setxkbmap -option ctrl:nocaps - diff --git a/.xprofile b/.xprofile deleted file mode 100644 index de18e9a..0000000 --- a/.xprofile +++ /dev/null @@ -1,7 +0,0 @@ -# -# ~/.xprofile -# - -[ -f ~/.profile ] && . ~/.profile - -# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=sh: # diff --git a/.xspec/Xspec.init b/.xspec/Xspec.init deleted file mode 100644 index 47e12e4..0000000 --- a/.xspec/Xspec.init +++ /dev/null @@ -1,166 +0,0 @@ -# 120801 -# XSPEC Initial settings file. 03/2011 -# Valid setting lines consist of two strings in the format Key: Value -# leading and trailing blanks are ignored for the key, leading blanks/tabs ignored for -# the value. Invalid settings (no colon) are ignored, keys valid in format but not -# implemented are simply read but not used. -# -# -# Do not modify above this line -################################################ - -# -# User default local model directory -# example code may be found in the source tree at: -# ${PATH_TO_SRC}/src/XSModel/Model/LocalModelTemplate - -#LOCAL_MODEL_DIRECTORY: /path/to/your/local/model/dir - -################################################ -# -# options and commands for displaying helpfiles -# - - USE_ONLINE_HELP: false - - # Recognized local help formats: html pdf - # This is ignored when using online help - LOCAL_HELP_FORMAT: html - - # Recommended command for Adobe Acrobat version 7 and later: - PDF_COMMAND: acroread -openInNewWindow -tempFileTitle - - # Recommended command for Adobe Acrobat prior to version 7: - # PDF_COMMAND: acroread -useFrontEndProgram -tempFileTitle - - # Recommended command for Mac PDF viewing - # PDF_COMMAND: open - - # Recommended command for Cygwin PDF viewing - # PDF_COMMAND: xpdf -q - - # Recommended command for Mac html - # HTML_COMMAND: open - - HTML_COMMAND: firefox - -################################################# - -# -# setting for GUI mode. The code requires that the GUI setting -# starts with a 't' (case-insensitive) otherwise GUI mode is false -# and the command line mode is used. -# - -GUI: false - -# -# user-definable setting for the dummy response. Arguments required -# begin-range end-range, number of bins, logarithmic/linear. Defaults -# are {0.1,100,200,log} respectively. Setting for bin type must be "linear" -# if linear bins are to be created. -# - -DUMMY: 0.1 50. 50 log - - -# -# Chatter Level: Console chatter level then log chatter level. Currently (4/2001) -# logging has not been reimplemented. -# - -CHAT: 10 10 - -# -# photo absorption cross section table setting. -# possible values are vern, bcmc, obmc. - - -XSECT: bcmc - - -# -# solar abundance table indicator. Hard coded solar abundance vector. Choices are -# 'feld' Feldman, U., 1992. Physica Scripta, 46, 202. -# 'angr' is from Anders, E. & Grevesse, N., 1989. Geochimica and Cosmochimica Acta 53, 197. -# 'aneb' is from Anders, E. & Ebihara, 1982. Geochimica and Cosmochimica Acta 46, 2363. -# - -#ABUND: angr -ABUND: grsa - - -# -# fitting method (leven | anneal ...) -# - -METHOD: leven - -# -# statistic to be minimized (chi | cstat) -# - -STATISTIC: chi - -# -# weighting technique (standard | gehrels | churazov | model ) -# - -WEIGHT: standard - -# -# If true, fitting algorithm will calculate parameter derivatives -# numerically. If false, a faster analytic expression will be used, -# if applicable to the current fitting statistic. -# - -USE_NUMERICAL_DIFFERENTIATION: false - -# -# cosmology parameters ( H0, q0, lambda0 ) -# - -COSMO: 70. .0 .73 -# -# -# Default graphics package (PLT is currently the only option). -# - -GRAPH: plt - -# -# Default plotting device (e.g. for PGPLOT) -# - -PLOTDEVICE: /null - -# -# Y-axis plotting units when in setplot wave mode (angstrom, hz) -# - -WAVE_PLOT_UNITS: hz - -# -# User scripting directory -# - -USER_SCRIPT_DIRECTORY: $HOME/.xspec - -# -# Default setting for parameters' fit delta values. -# Valid options are: -# -# fixed -# proportional -# -# If set to 'fixed', the default values come from the settings in the -# model.dat model definition file. -# - -FIT_DELTAS: proportional .01 - -# -# Default setting for the AtomDB version number -# - -ATOMDB_VERSION: 2.0.2 diff --git a/.zshrc b/.zshrc deleted file mode 100644 index 8078788..0000000 --- a/.zshrc +++ /dev/null @@ -1,86 +0,0 @@ -## ~/.zshrc -## ZSH configuration file -## oh-my-zsh: http://ohmyz.sh/ - -# Path to your oh-my-zsh installation. -export ZSH=$HOME/.oh-my-zsh - -# Set name of the theme to load. -# Look in ~/.oh-my-zsh/themes/ -# Optionally, if you set this to "random", it'll load a random theme each -# time that oh-my-zsh is loaded. -#ZSH_THEME="robbyrussell" -ZSH_THEME="gentoo" - -# Example aliases -# alias zshconfig="mate ~/.zshrc" -# alias ohmyzsh="mate ~/.oh-my-zsh" - -# Uncomment the following line to use case-sensitive completion. -# CASE_SENSITIVE="true" - -# Uncomment the following line to disable bi-weekly auto-update checks. -DISABLE_AUTO_UPDATE="true" - -# Uncomment the following line to change how often to auto-update (in days). -# export UPDATE_ZSH_DAYS=13 - -# Uncomment the following line to disable colors in ls. -# DISABLE_LS_COLORS="true" - -# Uncomment the following line to disable auto-setting terminal title. -# DISABLE_AUTO_TITLE="true" - -# Uncomment the following line to disable command auto-correction. -# DISABLE_CORRECTION="true" - -# Uncomment the following line to display red dots whilst waiting for completion. -# COMPLETION_WAITING_DOTS="true" - -# Uncomment the following line if you want to disable marking untracked files -# under VCS as dirty. This makes repository status check for large repositories -# much, much faster. -# DISABLE_UNTRACKED_FILES_DIRTY="true" - -# Uncomment the following line if you want to change the command execution time -# stamp shown in the history command output. -# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" -# HIST_STAMPS="mm/dd/yyyy" - -# Would you like to use another custom folder than $ZSH/custom? -# ZSH_CUSTOM=/path/to/new-custom-folder - -# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) -# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ -# Example format: plugins=(rails git textmate ruby lighthouse) -#plugins=(fasd git suse tmux vi-mode) -plugins=(fasd git tmux vi-mode) - -source $ZSH/oh-my-zsh.sh - -# User configuration - -#export PATH="$HOME/bin:/usr/local/texlive/bin/x86_64-linux:/usr/lib64/mpi/gcc/openmpi/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/local/sbin:/usr/sbin:/sbin" -# export MANPATH="/usr/local/man:$MANPATH" - -# You may need to manually set your language environment -# export LANG=en_US.UTF-8 - -# Preferred editor for local and remote sessions -if [[ -n $SSH_CONNECTION ]]; then - export EDITOR='vim' -else - export EDITOR='vim' -fi - -# Compilation flags -# export ARCHFLAGS="-arch x86_64" - -# ssh -# export SSH_KEY_PATH="~/.ssh/dsa_id" - -# zsh local config -if [ -r ~/.zshrc.local ]; then - source ~/.zshrc.local -fi - diff --git a/.zshrc.local b/.zshrc.local deleted file mode 100644 index 9e5d50d..0000000 --- a/.zshrc.local +++ /dev/null @@ -1,113 +0,0 @@ -## ~/.zshrc.local -## ZSH local configuration file -## -## Weitian LI -## 2014/05/31 - -### locale {{{ -export LANG="en_US.UTF-8" -export LC_CTYPE="zh_CN.UTF-8" -export LC_COLLATE="C" -### }}} - -### environments {{{ -if [ -d "$HOME/bin" ]; then - export PATH="$HOME/bin:$PATH" -fi -# admin -if groups | grep -qE '\b(wheel|adm|sudo)\b'; then - export PATH="$PATH:/usr/local/sbin:/usr/sbin:/sbin" -fi - -# GREP_OPTIONS deprecated -unset GREP_OPTIONS -alias grep='grep --color=auto' -### environments }}} - -### vi mode {{{ -# oh-my-zsh: plugin: vi-mode -# Vim's text-objects-ish for zsh: https://github.com/hchbaw/opp.zsh - -#bindkey -v -# Reduce delay to 0.1 seconds -export KEYTIMEOUT=1 -## Key Bindings -# Use vim cli mode -bindkey '^P' up-history -bindkey '^N' down-history -# backspace and ^h working even after -# returning from command mode -bindkey '^?' backward-delete-char -bindkey '^h' backward-delete-char -# ctrl-w removed word backwards -bindkey '^w' backward-kill-word -# ctrl-r starts searching history backward -bindkey '^r' history-incremental-search-backward -### vi mode }}} - -### python-virtualenv {{{ -if [ -x /usr/bin/virtualenvwrapper.sh ]; then - export WORKON_HOME="$HOME/.virtualenvs" - export PROJECT_HOME="$HOME/web" - source /usr/bin/virtualenvwrapper.sh -fi -### python-virtualenv }}} - -### astro {{{ -# backup LD_LIBRARY_PATH settings -LD_LIBRARY_PATH_BAK="${LD_LIBRARY_PATH}" - -## HEASOFT settings -export HEADAS="$HOME/local/heasoft/heasoft-6.16/x86_64-unknown-linux-gnu" -function heainit() { - if [ "x${CALDB}" = "x" ]; then - export CALDB="$HOME/local/CALDB" - export CALDBALIAS="${CALDB}/software/tools/alias_config.fits" - export CALDBCONFIG="${CALDB}/software/tools/caldb.config" - fi - HEA_STATE="`echo $PATH | tr ':' '\n' | grep 'heasoft'`" - if [ "x${HEA_STATE}" = "x" ]; then - source $HEADAS/headas-init.sh > /dev/null - fi - unset HEA_STATE - export LD_LIBRARY_PATH="${LD_LIBRARY_PATH_BAK}" -} - -## CIAO settings -export CIAO_PATH="$HOME/local/ciao/ciao-4.6" -function ciaoinit() { - HEA_STATE="`echo $PATH | tr ':' '\n' | grep 'heasoft'`" - CIAO_STATE="`echo $PATH | tr ':' '\n' | grep 'ciao'`" - if [ "x${HEA_STATE}" = "x" ]; then - heainit > /dev/null - fi - if [ "x${CIAO_STATE}" = "x" ]; then - source $CIAO_PATH/bin/ciao.bash - else - source $CIAO_PATH/bin/ciao.bash -o - fi - unset HEA_STATE - unset CIAO_STATE - export CIAO_LD_LIBRARY_PATH="${ASCDS_INSTALL}/ots/lib" -} - -## chandra_acis_process scripts -export MASS_PROFILE_DIR="$HOME/bin/mass" -export CHANDRA_SCRIPT_DIR="$HOME/bin" -### astro }}} - -### aliases {{{ -alias qmass='qdp summary_mass_profile.qdp' -alias qnfw='qdp nfw_fit_center.qdp' -alias qsbp='qdp sbp_fit_center.qdp' -alias qtpro='qdp wang2012_fit_center.qdp' -alias fitwang="${MASS_PROFILE_DIR}/fit_wang2012_model tcl_temp_profile.txt" -alias fitmass="${MASS_PROFILE_DIR}/fit_mass.sh" -alias fitnfw="${MASS_PROFILE_DIR}/fit_nfw_mass mass_int.dat" -alias fitsbp="${MASS_PROFILE_DIR}/fit_sbp.sh" -alias calclxfx="${MASS_PROFILE_DIR}/calc_lxfx_simple.sh" -alias getlxfx="${MASS_PROFILE_DIR}/get_lxfx_data.sh" -alias chcld="${CHANDRA_SCRIPT_DIR}/chandra_collect_data_v3.sh" -alias chr500="${CHANDRA_SCRIPT_DIR}/ciao_r500avgt_v3.sh" -### aliases }}} - diff --git a/_Xmodmap b/_Xmodmap new file mode 100644 index 0000000..e6e0ef0 --- /dev/null +++ b/_Xmodmap @@ -0,0 +1,18 @@ +!! ~/.Xmodmap +!! +!! Custom keymaps +!! +!! Aaron LI +!! 2015/06/15 +!! + +!! Swap 'Caps Lock' with 'Left Control' +!! Reference: http://c2.com/cgi/wiki?RemapCapsLock +remove Lock = Caps_Lock +remove Control = Control_L +keysym Caps_Lock = Control_L +!! If don't want a 'Caps Lock' at all, just comment the following *1* line. +!keysym Control_L = Caps_Lock +add Control = Control_L +add Lock = Caps_Lock + diff --git a/_bash_aliases b/_bash_aliases new file mode 100644 index 0000000..7d25ed6 --- /dev/null +++ b/_bash_aliases @@ -0,0 +1,9 @@ +# ~/.bash_aliases +# + +### sbcl ### +#export CL_BREAK_CHARS="\"#'(),;\`\\|!?[]{}" +#alias sbcl="rlwrap -b \${CL_BREAK_CHARS} sbcl" +alias sbcl='sbcl --no-inform' + +# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=sh: # diff --git a/_bash_completion.d/todo_completion b/_bash_completion.d/todo_completion new file mode 100644 index 0000000..f443acb --- /dev/null +++ b/_bash_completion.d/todo_completion @@ -0,0 +1,113 @@ +#!/bin/bash source-this-script +[ "$BASH_VERSION" ] || return + +_todo() +{ + local cur prev opts + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + + local -r OPTS="-@ -@@ -+ -++ -d -f -h -p -P -PP -a -n -t -v -vv -V -x" + local -r COMMANDS="\ + add a addto addm append app archive command del \ + rm depri dp do help list ls listaddons listall lsa listcon \ + lsc listfile lf listpri lsp listproj lsprj move \ + mv prepend prep pri p replace report shorthelp" + local -r MOVE_COMMAND_PATTERN='^(move|mv)$' + + local _todo_sh=${_todo_sh:-todo.sh} + local completions + if [ $COMP_CWORD -eq 1 ]; then + completions="$COMMANDS $(eval TODOTXT_VERBOSE=0 $_todo_sh command listaddons) $OPTS" + elif [[ $COMP_CWORD -gt 2 && ( \ + "${COMP_WORDS[COMP_CWORD-2]}" =~ $MOVE_COMMAND_PATTERN || \ + "${COMP_WORDS[COMP_CWORD-3]}" =~ $MOVE_COMMAND_PATTERN ) ]]; then + # "move ITEM# DEST [SRC]" has file arguments on positions 2 and 3. + completions=$(eval TODOTXT_VERBOSE=0 $_todo_sh command listfile) + else + case "$prev" in + command) + completions=$COMMANDS;; + help) + completions="$COMMANDS $(eval TODOTXT_VERBOSE=0 $_todo_sh command listaddons)";; + addto|listfile|lf) + completions=$(eval TODOTXT_VERBOSE=0 $_todo_sh command listfile);; + -*) completions="$COMMANDS $(eval TODOTXT_VERBOSE=0 $_todo_sh command listaddons) $OPTS";; + *) case "$cur" in + +*) completions=$(eval TODOTXT_VERBOSE=0 $_todo_sh command listproj) + COMPREPLY=( $( compgen -W "$completions" -- $cur )) + [ ${#COMPREPLY[@]} -gt 0 ] && return 0 + # Fall back to projects extracted from done tasks. + completions=$(eval 'TODOTXT_VERBOSE=0 TODOTXT_SOURCEVAR=\$DONE_FILE' $_todo_sh command listproj) + ;; + @*) completions=$(eval TODOTXT_VERBOSE=0 $_todo_sh command listcon) + COMPREPLY=( $( compgen -W "$completions" -- $cur )) + [ ${#COMPREPLY[@]} -gt 0 ] && return 0 + # Fall back to contexts extracted from done tasks. + completions=$(eval 'TODOTXT_VERBOSE=0 TODOTXT_SOURCEVAR=\$DONE_FILE' $_todo_sh command listcon) + ;; + *) if [[ "$cur" =~ ^[0-9]+$ ]]; then + # Remove the (padded) task number; we prepend the + # user-provided $cur instead. + # Remove the timestamp prepended by the -t option, + # and the done date (for done tasks); there's no + # todo.txt option for that yet. + # But keep priority and "x"; they're short and may + # provide useful context. + # Remove any trailing whitespace; the Bash + # completion inserts a trailing space itself. + # Finally, limit the output to a single line just as + # a safety check of the ls action output. + local todo=$( \ + eval TODOTXT_VERBOSE=0 $_todo_sh '-@ -+ -p -x command ls "^ *${cur} "' | \ + sed -e 's/^ *[0-9]\{1,\} //' -e 's/^\((.) \)\{0,1\}[0-9]\{2,4\}-[0-9]\{2\}-[0-9]\{2\} /\1/' \ + -e 's/^\([xX] \)\([0-9]\{2,4\}-[0-9]\{2\}-[0-9]\{2\} \)\{1,2\}/\1/' \ + -e 's/[[:space:]]*$//' \ + -e '1q' \ + ) + # Append task text as a shell comment. This + # completion can be a safety check before a + # destructive todo.txt operation. + [ "$todo" ] && COMPREPLY[0]="$cur # $todo" + return 0 + else + return 0 + fi + ;; + esac + ;; + esac + fi + + COMPREPLY=( $( compgen -W "$completions" -- $cur )) + return 0 +} +complete -F _todo todo.sh + +# If you define an alias (e.g. "t") to todo.sh, you need to explicitly enable +# completion for it, too: +#complete -F _todo t +# It is recommended to put this line next to your alias definition in your +# ~/.bashrc (or wherever else you're defining your alias). If you simply +# uncomment it here, you will need to redo this on every todo.txt update! + +# If you have renamed the todo.sh executable, or if it is not accessible through +# PATH, you need to add and use a wrapper completion function, like this: +#_todoElsewhere() +#{ +# local _todo_sh='/path/to/todo2.sh' +# _todo "$@" +#} +#complete -F _todoElsewhere /path/to/todo2.sh + +# If you use aliases to use different configuration(s), you need to add and use +# a wrapper completion function for each configuration if you want to complete +# fron the actual configured task locations: +#alias todo2='todo.sh -d "$HOME/todo2.cfg"' +#_todo2() +#{ +# local _todo_sh='todo.sh -d "$HOME/todo2.cfg"' +# _todo "$@" +#} +#complete -F _todo2 todo2 diff --git a/_bash_logout b/_bash_logout new file mode 100644 index 0000000..de4f5f7 --- /dev/null +++ b/_bash_logout @@ -0,0 +1,7 @@ +# ~/.bash_logout: executed by bash(1) when login shell exits. + +# when leaving the console clear the screen to increase privacy + +if [ "$SHLVL" = 1 ]; then + [ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q +fi diff --git a/_bash_profile b/_bash_profile new file mode 100644 index 0000000..94a6622 --- /dev/null +++ b/_bash_profile @@ -0,0 +1,5 @@ +# /etc/skel/.bash_profile + +# This file is sourced by bash for login shells. The following line +# runs your .bashrc and is recommended by the bash info pages. +[[ -f ~/.bashrc ]] && . ~/.bashrc diff --git a/_bashrc b/_bashrc new file mode 100644 index 0000000..a962229 --- /dev/null +++ b/_bashrc @@ -0,0 +1,130 @@ +# ~/.bashrc: executed by bash(1) for non-login shells. +# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) +# for examples + +# If not running interactively, don't do anything +case $- in + *i*) ;; + *) return;; +esac + +# don't put duplicate lines or lines starting with space in the history. +# See bash(1) for more options +HISTCONTROL=ignoreboth + +# append to the history file, don't overwrite it +shopt -s histappend + +# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) +HISTSIZE=1000 +HISTFILESIZE=2000 + +# Vi key bindings +set -o vi + +# check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize + +# If set, the pattern "**" used in a pathname expansion context will +# match all files and zero or more directories and subdirectories. +#shopt -s globstar + +# make less more friendly for non-text input files, see lesspipe(1) +#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" + +# set variable identifying the chroot you work in (used in the prompt below) +if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then + debian_chroot=$(cat /etc/debian_chroot) +fi + +# set a fancy prompt (non-color, unless we know we "want" color) +case "$TERM" in + xterm-color|*-256color) color_prompt=yes;; +esac + +# uncomment for a colored prompt, if the terminal has the capability; turned +# off by default to not distract the user: the focus in a terminal window +# should be on the output of commands, not on the prompt +force_color_prompt=yes + +if [ -n "$force_color_prompt" ]; then + if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then + # We have color support; assume it's compliant with Ecma-48 + # (ISO/IEC-6429). (Lack of such support is extremely rare, and such + # a case would tend to support setf rather than setaf.) + color_prompt=yes + else + color_prompt= + fi +fi + +if [ "$color_prompt" = yes ]; then + PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' +else + PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' +fi +unset color_prompt force_color_prompt + +# If this is an xterm set the title to user@host:dir +case "$TERM" in +xterm*|rxvt*) + PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" + ;; +*) + ;; +esac + +# enable color support of ls and also add handy aliases +if [ -x /usr/bin/dircolors ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + alias ls='ls --color=auto' + alias dir='dir --color=auto' + alias vdir='vdir --color=auto' + + alias grep='grep --color=auto' + alias fgrep='fgrep --color=auto' + alias egrep='egrep --color=auto' +fi + +# colored GCC warnings and errors +export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' + +# Alias definitions. +# You may want to put all your additions into a separate file like +# ~/.bash_aliases, instead of adding them here directly. +# See /usr/share/doc/bash-doc/examples in the bash-doc package. + +if [ -f ~/.bash_aliases ]; then + . ~/.bash_aliases +fi + +# enable programmable completion features (you don't need to enable +# this, if it's already enabled in /etc/bash.bashrc and /etc/profile +# sources /etc/bash.bashrc). +if ! shopt -oq posix; then + if [ -f /usr/share/bash-completion/bash_completion ]; then + . /usr/share/bash-completion/bash_completion + elif [ -f /etc/bash_completion ]; then + . /etc/bash_completion + fi +fi + + +### environment variables {{{ +export EDITOR=vim +### }}} + + +### aliases {{{ +alias ll='ls -l' +alias lf='ls -F' +alias la='ls -A' +alias l='ls -CF' + +# ~/.bash_aliases +[ -f ~/.bash_aliases ] && . ~/.bash_aliases +### aliases }}} + + +# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=sh: # diff --git a/_calendar/calendar b/_calendar/calendar new file mode 100644 index 0000000..6f7b320 --- /dev/null +++ b/_calendar/calendar @@ -0,0 +1,33 @@ +/* + * $HOME/.calendar/calendar + * + * LY4ever + * April 8, 2011 + */ + +LANG=C + +ChineseNewYear=XinNian + +#include + +XinNian-1 Chu Xi +XinNian Xin Nian +XinNian+14 Yuan Xiao + +/* birthday */ +2011/5/27 SanSan's father's birthday +2011/7/20 *** SanSan's birthday *** +2011/8/6 Qi Xi +2011/9/12 Zhong Qiu + +/* arrangement */ +5/28 Hostizzle.com +6/27 Hostizzle.com +7/26 Hostizzle.com +8/25 Hostizzle.com +9/24 Hostizzle.com +10/23 Hostizzle.com +11/22 Hostizzle.com +12/21 Hostizzle.com + diff --git a/_calendar/nomail b/_calendar/nomail new file mode 100644 index 0000000..e69de29 diff --git a/_config/gtk-3.0/bookmarks b/_config/gtk-3.0/bookmarks index 067f5ec..e81273e 100644 --- a/_config/gtk-3.0/bookmarks +++ b/_config/gtk-3.0/bookmarks @@ -1,6 +1,8 @@ +file:///home/aly/astro file:///home/aly/books file:///home/aly/documents -file:///home/aly/downloads +file:///home/aly/download file:///home/aly/music file:///home/aly/pictures +file:///home/aly/ownCloud davs://ly.noip.me:8801/remote.php/webdav Aly's ownCloud diff --git a/_config/gtk-3.0/settings.ini b/_config/gtk-3.0/settings.ini index 0a14ade..30d76f3 100644 --- a/_config/gtk-3.0/settings.ini +++ b/_config/gtk-3.0/settings.ini @@ -1,20 +1,8 @@ [Settings] -gtk-font-name=Oxygen-Sans 10 -;gtk-application-prefer-dark-theme=1 -gtk-theme-name=QtCurve -;gtk-theme-name=FlatStudioDark -gtk-icon-theme-name=default.kde4 -gtk-fallback-icon-theme-name=gnome -gtk-cursor-theme-name=breeze_cursors -gtk-cursor-theme-size=0 +gtk-font-name=Oxygen-Sans Sans-Book 10 +gtk-theme-name=Adwaita +gtk-icon-theme-name=breeze +gtk-fallback-icon-theme=gnome gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ -gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR -gtk-button-images=1 gtk-menu-images=1 -gtk-enable-event-sounds=1 -gtk-enable-input-feedback-sounds=1 -gtk-xft-antialias=1 -gtk-xft-hinting=1 -gtk-xft-hintstyle=hintmedium -gtk-xft-rgba=rgb -gtk-application-prefer-dark-theme=1 +gtk-button-images=1 diff --git a/_config/htop/htoprc b/_config/htop/htoprc deleted file mode 100644 index 5bef5a2..0000000 --- a/_config/htop/htoprc +++ /dev/null @@ -1,25 +0,0 @@ -# Beware! This file is rewritten by htop when settings are changed in the interface. -# The parser is also very primitive, and not human-friendly. -fields=0 48 17 18 38 39 40 2 46 47 49 1 -sort_key=46 -sort_direction=1 -hide_threads=0 -hide_kernel_threads=1 -hide_userland_threads=0 -shadow_other_users=0 -show_thread_names=0 -highlight_base_name=0 -highlight_megabytes=1 -highlight_threads=0 -tree_view=0 -header_margin=1 -detailed_cpu_time=0 -cpu_count_from_zero=0 -update_process_names=0 -account_guest_in_cpu_meter=0 -color_scheme=0 -delay=15 -left_meters=AllCPUs Memory Swap -left_meter_modes=1 1 1 -right_meters=Tasks LoadAverage Uptime -right_meter_modes=2 2 2 diff --git a/_config/user-dirs.dirs b/_config/user-dirs.dirs index c2fb534..096474b 100644 --- a/_config/user-dirs.dirs +++ b/_config/user-dirs.dirs @@ -6,10 +6,10 @@ # absolute path. No other format is supported. # XDG_DESKTOP_DIR="$HOME/Desktop" -XDG_DOWNLOAD_DIR="$HOME/" -XDG_TEMPLATES_DIR="$HOME/" -XDG_PUBLICSHARE_DIR="$HOME/" -XDG_DOCUMENTS_DIR="$HOME/" -XDG_MUSIC_DIR="$HOME/" -XDG_PICTURES_DIR="$HOME/" -XDG_VIDEOS_DIR="$HOME/" +XDG_DOWNLOAD_DIR="$HOME/download" +XDG_TEMPLATES_DIR="$HOME/templates" +XDG_PUBLICSHARE_DIR="$HOME/public" +XDG_DOCUMENTS_DIR="$HOME/documents" +XDG_MUSIC_DIR="$HOME/music" +XDG_PICTURES_DIR="$HOME/pictures" +XDG_VIDEOS_DIR="$HOME/videos" diff --git a/_conky/cronograph/accuweather/accuweather.sh b/_conky/cronograph/accuweather/accuweather.sh new file mode 100755 index 0000000..fe6a407 --- /dev/null +++ b/_conky/cronograph/accuweather/accuweather.sh @@ -0,0 +1,172 @@ +#!/bin/sh + +## get the directory of this script +SCRIPT_PATH=`readlink -f $0` +SCRIPT_DIR=`dirname ${SCRIPT_PATH}` + +## address (Accuweather url) +address="http://www.accuweather.com/en/cn/shanghai/106577/weather-forecast/106577" # Shanghai + + +## function: test_image() +test_image() { + case $1 in + 1) + echo a + ;; + 2|3) + echo b + ;; + 4|5) + echo c + ;; + 6) + echo d + ;; + 7) + echo e + ;; + 8) + echo f + ;; + 11) + echo 0 + ;; + 12) + echo h + ;; + 13|14) + echo g + ;; + 15) + echo m + ;; + 16|17) + echo k + ;; + 18) + echo i + ;; + 19) + echo q + ;; + 20|21|23) + echo o + ;; + 22) + echo r + ;; + 24|31) + echo E + ;; + 25) + echo v + ;; + 26) + echo x + ;; + 29) + echo y + ;; + 30) + echo 5 + ;; + 32) + echo 6 + ;; + 33) + echo A + ;; + 34|35) + echo B + ;; + 36|37) + echo C + ;; + 38) + echo D + ;; + 39|40) + echo G + ;; + 41|42) + echo K + ;; + 43|44) + echo O + ;; + *) + echo - + ;; + esac +} + + +#kill -STOP $(pidof conky) +#killall wget + +## urls and wget weather data +loc_id=$(echo ${address} | sed 's/\/weather-forecast.*$//' | sed 's/^.*\///') +last_number=$(echo ${address} | sed 's/^.*\///') + +curr_addr="$(echo ${address} | sed 's/weather-forecast.*$//')current-weather/${last_number}" +wget -O ${SCRIPT_DIR}/curr_cond_raw "${curr_addr}" + +addr1="$(echo ${address} | sed 's/weather-forecast.*$//')daily-weather-forecast/${last_number}" +wget -O ${SCRIPT_DIR}/tod_ton_raw "${addr1}" + +addr2="${addr1}?day=6" +wget -O ${SCRIPT_DIR}/last_days_raw "${addr2}" + +## current conditions +if [ -s ${SCRIPT_DIR}/curr_cond_raw ]; then + sed -i '/detail-now/,/#details/!d' ${SCRIPT_DIR}/curr_cond_raw + egrep -i '"cond"|icon i-|detail-tab-panel' ${SCRIPT_DIR}/curr_cond_raw > ${SCRIPT_DIR}/curr_cond + sed -i -e 's/^.*detail-tab-panel //g' -e 's/^.*icon i-//g' -e 's/"><\/div>.*$//g' ${SCRIPT_DIR}/curr_cond + sed -i -e 's/^.*"cond">//g' -e 's/°/\n/g' -e 's/<\/span>.*"temp">/\n/g' -e 's/<.*>//g' ${SCRIPT_DIR}/curr_cond + sed -i -e 's/">//g' -e 's/-->//g' -e 's/\r$//g' -e 's/ i-alarm.*$//g' -e 's/-[a-z].*$//g' ${SCRIPT_DIR}/curr_cond + image=$(sed -n 2p ${SCRIPT_DIR}/curr_cond) + sed -i 2s/${image}/$(test_image ${image})/ ${SCRIPT_DIR}/curr_cond +fi + +## First 5 days +if [ -s ${SCRIPT_DIR}/tod_ton_raw ]; then + sed -i '/feed-tabs/,/\.feed-tabs/!d' ${SCRIPT_DIR}/tod_ton_raw + egrep -i 'Early AM|Today|Tonight|Overnight|icon i-|cond|temp|Mon|Tue|Wed|Thu|Fri|Sat|Sun' ${SCRIPT_DIR}/tod_ton_raw > ${SCRIPT_DIR}/tod_ton + sed -i -e 's/^.*#">//g' -e 's/^.*icon i-//g' -e 's/^.*cond">//g' -e 's/^.*temp">//g' ${SCRIPT_DIR}/tod_ton + sed -i -e 's/Lo<\/span> /\n/g' -e 's/<\/a>.*$//g' -e 's/ "><.*$//g' -e 's/&#.*$//g' -e 's/teo//g' ${SCRIPT_DIR}/tod_ton + sed -i -e 's/.*$//g' -e 's/<\/span>//g' -e 's/\r$//g' -e 's/ i-alarm.*$//g' ${SCRIPT_DIR}/tod_ton + sed -i -e 's/Early AM/EARLY AM/' -e 's/Today/TODAY/' -e 's/Tonight/TONIGHT/' -e 's/Overnight/OVERNIGHT/' -e 's/Mon/MON/' -e 's/Tue/TUE/' -e 's/Wed/WED/' -e 's/Thu/THU/' -e 's/Fri/FRI/' -e 's/Sat/SAT/' -e 's/Sun/SUN/' -e 's/-[a-z]*$//g' ${SCRIPT_DIR}/tod_ton + time=$(sed -n 1p ${SCRIPT_DIR}/tod_ton) + image=$(sed -n 2p ${SCRIPT_DIR}/tod_ton) + # + if [ "${time}" = "TODAY" ]; then + sed -i 2s/${image}/$(test_image ${image})/ ${SCRIPT_DIR}/tod_ton + elif [ "${time}" = "TONIGHT" -o "${time}" = "OVERNIGHT" -o "${time}" = "EARLY AM" ]; then + sed -i 2s/${image}/$(test_image ${image})/ ${SCRIPT_DIR}/tod_ton + sed -i 3a- ${SCRIPT_DIR}/tod_ton + fi + # + for i in $(seq 7 5 22); do + image=$(sed -n "${i}"p ${SCRIPT_DIR}/tod_ton) + sed -i ${i}s/${image}/$(test_image ${image})/ ${SCRIPT_DIR}/tod_ton + done +fi + +## Next 5 days +if [ -s ${SCRIPT_DIR}/last_days_raw ]; then + sed -i '/feed-tabs/,/\.feed-tabs/!d' ${SCRIPT_DIR}/last_days_raw + egrep -i 'icon i-|cond|temp|Mon|Tue|Wed|Thu|Fri|Sat|Sun' ${SCRIPT_DIR}/last_days_raw > ${SCRIPT_DIR}/last_days + sed -i -e 's/^.*#">//g' -e 's/^.*icon i-//g' -e 's/^.*cond">//g' -e 's/^.*temp">//g' ${SCRIPT_DIR}/last_days + sed -i -e 's/Lo<\/span> /\n/g' -e 's/<\/a>.*$//g' -e 's/ "><.*$//g' -e 's/&#.*$//g' -e 's/teo//g' ${SCRIPT_DIR}/last_days + sed -i -e 's/.*$//g' -e 's/<\/span>//g' -e 's/\r$//g' -e 's/ i-alarm.*$//g' ${SCRIPT_DIR}/last_days + sed -i -e 's/Mon/MON/' -e 's/Tue/TUE/' -e 's/Wed/WED/' -e 's/Thu/THU/' -e 's/Fri/FRI/' -e 's/Sat/SAT/' -e 's/Sun/SUN/' -e 's/-[a-z]*$//g' ${SCRIPT_DIR}/last_days + # + for i in $(seq 7 5 22); do + image=$(sed -n "${i}"p ${SCRIPT_DIR}/last_days) + sed -i ${i}s/${image}/$(test_image ${image})/ ${SCRIPT_DIR}/last_days + done +fi + +#kill -CONT $(pidof conky) + diff --git a/_conky/cronograph/accuweather/curr_cond b/_conky/cronograph/accuweather/curr_cond new file mode 100644 index 0000000..f5d92e6 --- /dev/null +++ b/_conky/cronograph/accuweather/curr_cond @@ -0,0 +1,5 @@ +night +A +Clear +18 + diff --git a/_conky/cronograph/accuweather/curr_cond_raw b/_conky/cronograph/accuweather/curr_cond_raw new file mode 100644 index 0000000..9f2b26c --- /dev/null +++ b/_conky/cronograph/accuweather/curr_cond_raw @@ -0,0 +1,1646 @@ + + + + Shanghai Current Weather - AccuWeather Forecast for Shanghai China + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +
    +
    + + + + + + + + + + + + + + +
    + +
    +
    + + + + + + +
    + +
    +
    +
    + + + + + +
    + +
    + + + +
    +
    + + + + + + + + + + + + +
    +
    + +
    +
    +
    +
    + +
    +
    +
    + + +
    + 1 - 5 of 45 days | All 45 days + +
    + + +
    + Next 5 Days + +
      +
    • +
      +
      +

      Today

      +

      May 10

      +
      +
      + Rain and drizzle this morning + 22°Lo 19° +
      + +
      + +
    • +
    • +
      +
      +

      Sun

      +

      May 11

      +
      +
      + Humid with heavy rain + 23°Lo 17° +
      + + more +
      + +
    • +
    • +
      +
      +

      Mon

      +

      May 12

      +
      +
      + Nice and warm with sunshine + 26°Lo 16° +
      + + more +
      + +
    • +
    • +
      +
      +

      Tue

      +

      May 13

      +
      +
      + Rather cloudy and warm + 26°Lo 18° +
      + + more +
      + +
    • +
    • +
      +
      +

      Wed

      +

      May 14

      +
      +
      + Showers around in the morning + 25°Lo 18° +
      + + more +
      + +
    • +
    +
    + + + + +
    + + +
    +
    +
    +
    +
    Light fog 19° RealFeel® 20°
    + +
    + +
    + +
    +
    +

    N

    +

    E

    +

    S

    +

    W

    + +
    + + +
      +
    • Humidity: 88%
    • +
    • Pressure: 1014.00 mb
    • +
    • UV Index: 4
    • +
    • Cloud Cover: 20%
    • +
    • Ceiling: 549 m
    • +
    • Dew Point: 17° C
    • +
    • Visibility: 3 km
    • +
    + +
    + + +
    17 km/h
    + +
    + +
    + +
    + + + + +
    +
    +

    Sunrise/Sunset

    +
    + + + Sunrise / Sunset Illustration + +

    + Rises at + 5:03 AM + with + + 13:36 + + of sunlight, then sets at + 6:39 PM +

    + +
    + + +
    +
    +

    Moonrise/Moonset

    + Astronomy > +
    + + + Moonrise / Moonset Illustration + +

    + Rises at + 2:18 PM + with + 12:14 + of moolight, then sets at + 2:32 AM +

    + +
    + + + +
    +
    +

    Temperature Summary - 10:58 AM

    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
     Temp (°C)
    Now19°
    Yesterday21°
    RealFeel®20°
    RealFeel® Shade18°
    Wind Chill19°
    Dew Point17°
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
     Hi / Lo
    Previous 6 Hours20°
     18°
    Previous 12 Hours20°
     17°
    Previous 24 Hours22°
     17°
    +
    +
    +
    +
    + +
    +
    +

    Temperature History - May 10

    + more Historical Weather Data > + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
     TodayNormalRecord5/10/2013
    High22°23°N/A24°
    Low19°16°N/A18°
    +
    + + +
    +
    +

    Precipitation Summary - 10:58 AM

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
     Amount (mm)
    Previous 1 Hour0
    Previous 3 Hours0
    Previous 6 Hours1
    Previous 9 Hours1
    Previous 12 Hours1
    Previous 18 Hours1
    Previous 24 Hours1
    +
    +
    + +
    +
    +
    + +
    +
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + Top Story +

    Shanghai Weather Report

    +
    + + + +
    +

    Rainfall Tops 400 mm Near Hong Kong, More to Come

    +
    May 9, 2014; 10:05 PM ET
    +

    Hong Kong has already endured flooding rain, and more is on the way for this weekend. more >

    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    + + + + + +
    + + + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    + + + + + + + +
    + +
    + + + + + + + +
    + +
    + + +
    + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + diff --git a/_conky/cronograph/accuweather/last_days b/_conky/cronograph/accuweather/last_days new file mode 100644 index 0000000..75a56d9 --- /dev/null +++ b/_conky/cronograph/accuweather/last_days @@ -0,0 +1,25 @@ +WED +12 +Showers around in the morning +25 +17 +THU +d +Mostly cloudy +26 +18 +FRI +b +Partly sunny +23 +15 +SAT +i +Cooler with rain +17 +16 +SUN +i +Periods of rain +21 +17 diff --git a/_conky/cronograph/accuweather/last_days_raw b/_conky/cronograph/accuweather/last_days_raw new file mode 100644 index 0000000..6ac7def --- /dev/null +++ b/_conky/cronograph/accuweather/last_days_raw @@ -0,0 +1,82 @@ +
    + Previous 5 Days + Next 5 Days + +
      +
    • +
      +
      +

      Wed

      +

      May 14

      +
      +
      + Showers around in the morning + 25°Lo 17° +
      + +
      + +
    • +
    • +
      +
      +

      Thu

      +

      May 15

      +
      +
      + Mostly cloudy + 26°Lo 18° +
      + + more +
      + +
    • +
    • +
      +
      +

      Fri

      +

      May 16

      +
      +
      + Partly sunny + 23°Lo 15° +
      + + more +
      + +
    • +
    • +
      +
      +

      Sat

      +

      May 17

      +
      +
      + Cooler with rain + 17°Lo 16° +
      + + more +
      + +
    • +
    • +
      +
      +

      Sun

      +

      May 18

      +
      +
      + Periods of rain + 21°Lo 17° +
      + + more +
      + +
    • +
    +
    + diff --git a/_conky/cronograph/accuweather/tod_ton b/_conky/cronograph/accuweather/tod_ton new file mode 100644 index 0000000..a839d7e --- /dev/null +++ b/_conky/cronograph/accuweather/tod_ton @@ -0,0 +1,25 @@ +TONIGHT +h +Rain and drizzle late +- +17 +SAT +e +Cloudy and breezy +21 +18 +SUN +i +Humid with heavy rain +23 +16 +MON +a +Nice and warm with sunshine +26 +16 +TUE +d +Rather cloudy and warm +26 +17 diff --git a/_conky/cronograph/accuweather/tod_ton_raw b/_conky/cronograph/accuweather/tod_ton_raw new file mode 100644 index 0000000..2976b86 --- /dev/null +++ b/_conky/cronograph/accuweather/tod_ton_raw @@ -0,0 +1,81 @@ +
    + Next 5 Days + +
      +
    • +
      +
      +

      Tonight

      +

      May 9

      +
      +
      + Rain and drizzle late + Lo 17° +
      + +
      + +
    • +
    • +
      +
      +

      Sat

      +

      May 10

      +
      +
      + Cloudy and breezy + 21°Lo 18° +
      + + more +
      + +
    • +
    • +
      +
      +

      Sun

      +

      May 11

      +
      +
      + Humid with heavy rain + 23°Lo 16° +
      + + more +
      + +
    • +
    • +
      +
      +

      Mon

      +

      May 12

      +
      +
      + Nice and warm with sunshine + 26°Lo 16° +
      + + more +
      + +
    • +
    • +
      +
      +

      Tue

      +

      May 13

      +
      +
      + Rather cloudy and warm + 26°Lo 17° +
      + + more +
      + +
    • +
    +
    + diff --git a/_conky/cronograph/conky_start.sh b/_conky/cronograph/conky_start.sh new file mode 100755 index 0000000..98dbb27 --- /dev/null +++ b/_conky/cronograph/conky_start.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +CONKYRC="$HOME/.conky/cronograph/conkyrc" + +sleep 5 + +conky -d -c ${CONKYRC} "$@" + +exit 0 + diff --git a/_conky/cronograph/conkyrc b/_conky/cronograph/conkyrc new file mode 100644 index 0000000..3a54030 --- /dev/null +++ b/_conky/cronograph/conkyrc @@ -0,0 +1,89 @@ +# — Conky settings — # + +background yes + +update_interval 1 +total_run_times 0 +net_avg_samples 2 + +override_utf8_locale yes + +double_buffer yes +no_buffers yes + +text_buffer_size 2048 +imlib_cache_size 0 + +temperature_unit celsius + +# — Window specifications — # + +own_window_class Conky +own_window yes +own_window_type desktop +own_window_transparent yes +own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager + +border_inner_margin 0 +border_outer_margin 0 + +minimum_size 300 330 +maximum_width 300 + +alignment top_right + +gap_x 30 +gap_y 75 + + +# — Graphics settings — # +draw_shades no +draw_outline no +draw_borders no +draw_graph_borders no + +# — Text settings — # +use_xft yes +xftfont hooge 05_53:size=6 +xftalpha 0.5 + +default_color FFFFFF + +uppercase no +use_spacer right + +color0 white +color1 orange +color2 green + +# — Lua Load — # + +lua_load $HOME/.conky/cronograph/scripts/clock_rings.lua +lua_draw_hook_pre clock_rings +lua_load $HOME/.conky/cronograph/scripts/multi_rings.lua +lua_draw_hook_post main + +TEXT +${execi 600 sh $HOME/.conky/cronograph/accuweather/accuweather.sh} +#${voffset 29}${offset 120}BAT: +${voffset 29}${goto 109}GENTOO${goto 157}Linux +${voffset 17}${goto 65}${font hooge 05_53:size=12}${time %H:%M}${font}${goto 185}UPTIME: +${voffset 2}${goto 65}${time %a %d %b}${goto 185}${uptime} +${voffset 2}${goto 65}${time %Y} +${voffset -6}${goto 145}HD +${voffset 12}${alignc}${fs_free}/${fs_size} +${voffset 36}${goto 91}${cpu cpu0}%${goto 221}${memperc}% +${voffset 10}${goto 76}CPU${goto 205}MEM +${voffset 16}${goto 82}${font hooge 05_53:size=12}${execpi 600 sed -n '4p' $HOME/.conky/cronograph/accuweather/curr_cond}°C${font}${voffset -30}${goto 125}${font ConkyWeather:size=40}${execpi 600 sed -n '2p' $HOME/.conky/cronograph/accuweather/curr_cond}${font}${voffset -16}${goto 185}${execpi 600 sed -n '3p' $HOME/.conky/cronograph/accuweather/curr_cond}${voffset 12}${goto 185}${font ConkyWeather:size=20}${voffset 1}${goto 80}${execpi 600 sed -n '7p' $HOME/.conky/cronograph/accuweather/tod_ton}${goto 135}${execpi 600 sed -n '12p' $HOME/.conky/cronograph/accuweather/tod_ton}${goto 185}${execpi 600 sed -n '17p' $HOME/.conky/cronograph/accuweather/tod_ton}${font}${voffset 6}${goto 84}${execpi 600 sed -n '9p' $HOME/.conky/cronograph/accuweather/tod_ton}°/${execpi 600 sed -n '10p' $HOME/.conky/cronograph/accuweather/tod_ton}°${goto 140}${execpi 600 sed -n '14p' $HOME/.conky/cronograph/accuweather/tod_ton}°/${execpi 600 sed -n '15p' $HOME/.conky/cronograph/accuweather/tod_ton}°${goto 190}${execpi 600 sed -n '19p' $HOME/.conky/cronograph/accuweather/tod_ton}°/${execpi 600 sed -n '20p' $HOME/.conky/cronograph/accuweather/tod_ton}°${voffset 7}${goto 85}${execpi 600 sed -n '6p' $HOME/.conky/cronograph/accuweather/tod_ton}${goto 140}${execpi 600 sed -n '11p' $HOME/.conky/cronograph/accuweather/tod_ton}${goto 190}${execpi 600 sed -n '16p' $HOME/.conky/cronograph/accuweather/tod_ton} +${if_match ${battery_percent BAT0}>0}${if_match ${battery_percent BAT0}<=15}${image $HOME/.conky/cronograph/images/Red.png -p 129,18 -s 40x40}${endif}${endif} +${if_match ${battery_percent BAT0}>15}${if_match ${battery_percent BAT0}<=20}${image $HOME/.conky/cronograph/images/Orange.png -p 129,18 -s 40x40}${endif}${endif} +${if_match ${battery_percent BAT0}>20}${if_match ${battery_percent BAT0}<=35}${image $HOME/.conky/cronograph/images/Yellow.png -p 129,18 -s 40x40}${endif}${endif} +${if_match ${battery_percent BAT0}>35}${if_match ${battery_percent BAT0}<=100}${image $HOME/.conky/cronograph/images/Dark_Green.png -p 129,18 -s 40x40}${endif}${endif} +${execpi 30 cat $HOME/.conky/cronograph/scripts/blinkingLED} +## mpd ## +${if_mpd_playing}${voffset 6}${goto 10}${font Sans:size=8:bold}${mpd_artist}${font}${voffset -5}${font Sans:size=8} - ${mpd_title}${font} +${voffset 4}${goto 10}${mpd_bar 5,220}${alignr 10}${mpd_elapsed}/${mpd_length} +${else}${voffset 6}${goto 10}${font hooge 05_53:size=8}MPD: stopped${font} +${endif} + +# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=conkyrc: # diff --git a/_conky/cronograph/images/Blank.png b/_conky/cronograph/images/Blank.png new file mode 100644 index 0000000..a8adf65 Binary files /dev/null and b/_conky/cronograph/images/Blank.png differ diff --git a/_conky/cronograph/images/Blue.png b/_conky/cronograph/images/Blue.png new file mode 100644 index 0000000..2407cbe Binary files /dev/null and b/_conky/cronograph/images/Blue.png differ diff --git a/_conky/cronograph/images/Dark_Green.png b/_conky/cronograph/images/Dark_Green.png new file mode 100644 index 0000000..d40bcc4 Binary files /dev/null and b/_conky/cronograph/images/Dark_Green.png differ diff --git a/_conky/cronograph/images/Dark_Purple.png b/_conky/cronograph/images/Dark_Purple.png new file mode 100644 index 0000000..bb5da19 Binary files /dev/null and b/_conky/cronograph/images/Dark_Purple.png differ diff --git a/_conky/cronograph/images/Green.png b/_conky/cronograph/images/Green.png new file mode 100644 index 0000000..602ad43 Binary files /dev/null and b/_conky/cronograph/images/Green.png differ diff --git a/_conky/cronograph/images/Orange.png b/_conky/cronograph/images/Orange.png new file mode 100644 index 0000000..7574f9c Binary files /dev/null and b/_conky/cronograph/images/Orange.png differ diff --git a/_conky/cronograph/images/Pink.png b/_conky/cronograph/images/Pink.png new file mode 100644 index 0000000..6d2d973 Binary files /dev/null and b/_conky/cronograph/images/Pink.png differ diff --git a/_conky/cronograph/images/Purple.png b/_conky/cronograph/images/Purple.png new file mode 100644 index 0000000..e8c58e7 Binary files /dev/null and b/_conky/cronograph/images/Purple.png differ diff --git a/_conky/cronograph/images/Red.png b/_conky/cronograph/images/Red.png new file mode 100644 index 0000000..d2673e6 Binary files /dev/null and b/_conky/cronograph/images/Red.png differ diff --git a/_conky/cronograph/images/Yellow.png b/_conky/cronograph/images/Yellow.png new file mode 100644 index 0000000..8e2f62c Binary files /dev/null and b/_conky/cronograph/images/Yellow.png differ diff --git a/_conky/cronograph/scripts/blinkingLED b/_conky/cronograph/scripts/blinkingLED new file mode 100755 index 0000000..3f4c814 --- /dev/null +++ b/_conky/cronograph/scripts/blinkingLED @@ -0,0 +1,3 @@ +${image $HOME/.conky/cronograph/images/Blank.png -p 129, 241 -s 40x40}${if_match ${execi 1 num=$(date +%-S);rem=$(( num % 2 ));if [ $rem -eq 0 ] ; then echo 0 ; else echo 1 ; fi}==0}${image $HOME/.conky/cronograph/images/Blue.png -p 129, 241 -s 40x40}${endif} +${image $HOME/.conky/cronograph/images/Blank.png -p 19, 129 -s 40x40}${if_match ${execi 1 num=$(date +%-S);rem=$(( num % 2 ));if [ $rem -eq 0 ] ; then echo 0 ; else echo 1 ; fi}==0}${image $HOME/.conky/cronograph/images/Blue.png -p 19, 129 -s 40x40}${endif} +${image $HOME/.conky/cronograph/images/Blank.png -p 240, 129 -s 40x40}${if_match ${execi 1 num=$(date +%-S);rem=$(( num % 2 ));if [ $rem -eq 0 ] ; then echo 0 ; else echo 1 ; fi}==0}${image $HOME/.conky/cronograph/images/Blue.png -p 240, 129 -s 40x40}${endif} diff --git a/_conky/cronograph/scripts/clock_rings.lua b/_conky/cronograph/scripts/clock_rings.lua new file mode 100755 index 0000000..fb6a838 --- /dev/null +++ b/_conky/cronograph/scripts/clock_rings.lua @@ -0,0 +1,358 @@ +--[[ +Clock Rings by londonali1010 (2009) + +This script draws percentage meters as rings, and also draws clock hands if you want! It is fully customisable; all options are described in the script. This script is based off a combination of my clock.lua script and my rings.lua script. + +IMPORTANT: if you are using the 'cpu' function, it will cause a segmentation fault if it tries to draw a ring straight away. The if statement near the end of the script uses a delay to make sure that this doesn't happen. It calculates the length of the delay by the number of updates since Conky started. Generally, a value of 5s is long enough, so if you update Conky every 1s, use update_num > 5 in that if statement (the default). If you only update Conky every 2s, you should change it to update_num > 3; conversely if you update Conky every 0.5s, you should use update_num > 10. ALSO, if you change your Conky, is it best to use "killall conky; conky" to update it, otherwise the update_num will not be reset and you will get an error. + +To call this script in Conky, use the following (assuming that you save this script to ~/scripts/rings.lua): + lua_load ~/scripts/clock_rings-v1.1.1.lua + lua_draw_hook_pre clock_rings + +Changelog: ++ v1.1.1 -- Fixed minor bug that caused the script to crash if conky_parse() returns a nil value (20.10.2009) ++ v1.1 -- Added colour option for clock hands (07.10.2009) ++ v1.0 -- Original release (30.09.2009) +]] + +settings_table = { + { + -- Edit this table to customise your rings. + -- You can create more rings simply by adding more elements to settings_table. + -- "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'. + name='time', + -- "arg" is the argument to the stat type, e.g. if in Conky you would write ${cpu cpu0}, 'cpu0' would be the argument. If you would not use an argument in the Conky variable, use ''. + arg='%I.%M', + -- "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100. + max=12, + -- "bg_colour" is the colour of the base ring. + bg_colour=0xFFFFFF, + -- "bg_alpha" is the alpha value of the base ring. + bg_alpha=0.1, + -- "fg_colour" is the colour of the indicator part of the ring. + fg_colour=0xFFFFFF, + -- "fg_alpha" is the alpha value of the indicator part of the ring. + fg_alpha=0.5, + -- "x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky window. + x=150, y=150, + -- "radius" is the radius of the ring. + radius=135, + -- "thickness" is the thickness of the ring, centred around the radius. + thickness=4, + -- "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative. + start_angle=0, + -- "end_angle" is the ending angle of the ring, in degrees, clockwise from top. Value can be either positive or negative, but must be larger than start_angle. + end_angle=360 + }, + { + name='time', + arg='%M.%S', + max=60, + bg_colour=0xFFFFFF, + bg_alpha=0.1, + fg_colour=0xFFFFFF, + fg_alpha=0.5, + x=150, y=150, + radius=140, + thickness=4, + start_angle=0, + end_angle=360 + }, + { + name='time', + arg='%S', + max=60, + bg_colour=0xFFFFFF, + bg_alpha=0.1, + fg_colour=0xFFFFFF, + fg_alpha=0.5, + x=150, y=150, + radius=145, + thickness=4, + start_angle=0, + end_angle=360 + }, + { + name='', + arg='', + max=100, + bg_colour=0x000000, + bg_alpha=0.1, + fg_colour=0xFFFFFF, + fg_alpha=0.0, + x=150, y=150, + radius=66, + thickness=130, + start_angle=0, + end_angle=360 + }, + { + name='', + arg='', + max=100, + bg_colour=0xFFFFFF, + bg_alpha=1.0, + fg_colour=0xFFFFFF, + fg_alpha=0.0, + x=150, y=150, + radius=1, + thickness=10, + start_angle=0, + end_angle=360 + }, + { + name='', + arg='', + max=100, + bg_colour=0xFFFFFF, + bg_alpha=1.0, + fg_colour=0xFFFFFF, + fg_alpha=0.0, + x=85, y=150, + radius=30, + thickness=1, + start_angle=0, + end_angle=360 + }, + { + name='', + arg='', + max=100, + bg_colour=0x000000, + bg_alpha=0.3, + fg_colour=0xFFFFFF, + fg_alpha=0.0, + x=85, y=150, + radius=15, + thickness=27, + start_angle=0, + end_angle=360 + }, + { + name='', + arg='', + max=100, + bg_colour=0xFFFFFF, + bg_alpha=1.0, + fg_colour=0xFFFFFF, + fg_alpha=0.0, + x=85, y=150, + radius=1, + thickness=2, + start_angle=0, + end_angle=360 + }, + { + name='', + arg='', + max=100, + bg_colour=0xFFFFFF, + bg_alpha=1.0, + fg_colour=0xFFFFFF, + fg_alpha=0.0, + x=215, y=150, + radius=30, + thickness=1, + start_angle=0, + end_angle=360 + }, + { + name='', + arg='', + max=100, + bg_colour=0x000000, + bg_alpha=0.3, + fg_colour=0xFFFFFF, + fg_alpha=0.0, + x=215, y=150, + radius=15, + thickness=27, + start_angle=0, + end_angle=360 + }, + { + name='', + arg='', + max=100, + bg_colour=0xFFFFFF, + bg_alpha=1.0, + fg_colour=0xFFFFFF, + fg_alpha=0.0, + x=215, y=150, + radius=1, + thickness=2, + start_angle=0, + end_angle=360 + }, + { + name='', + arg='', + max=100, + bg_colour=0xFFFFFF, + bg_alpha=1.0, + fg_colour=0xFFFFFF, + fg_alpha=0.0, + x=150, y=75, + radius=25, + thickness=1, + start_angle=0, + end_angle=360 + }, + { + name='', + arg='', + max=100, + bg_colour=0x000000, + bg_alpha=0.3, + fg_colour=0xFFFFFF, + fg_alpha=0.0, + x=150, y=75, + radius=13, + thickness=22, + start_angle=0, + end_angle=360 + }, + { + name='', + arg='', + max=100, + bg_colour=0xFFFFFF, + bg_alpha=1.0, + fg_colour=0xFFFFFF, + fg_alpha=0.0, + x=150, y=75, + radius=1, + thickness=2, + start_angle=0, + end_angle=360 + }, + } + +-- Use these settings to define the origin and extent of your clock. + +clock_r=127 + +-- "clock_x" and "clock_y" are the coordinates of the centre of the clock, in pixels, from the top left of the Conky window. + +clock_x=150 +clock_y=150 + +-- Colour & alpha of the clock hands + +clock_colour=0xFFFFFF +clock_alpha=1 + +-- Do you want to show the seconds hand? + +show_seconds=true + +require 'cairo' + +function rgb_to_r_g_b(colour,alpha) + return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha +end + +function draw_ring(cr,t,pt) + local w,h=conky_window.width,conky_window.height + + local xc,yc,ring_r,ring_w,sa,ea=pt['x'],pt['y'],pt['radius'],pt['thickness'],pt['start_angle'],pt['end_angle'] + local bgc, bga, fgc, fga=pt['bg_colour'], pt['bg_alpha'], pt['fg_colour'], pt['fg_alpha'] + + local angle_0=sa*(2*math.pi/360)-math.pi/2 + local angle_f=ea*(2*math.pi/360)-math.pi/2 + local t_arc=t*(angle_f-angle_0) + + -- Draw background ring + + cairo_arc(cr,xc,yc,ring_r,angle_0,angle_f) + cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga)) + cairo_set_line_width(cr,ring_w) + cairo_stroke(cr) + + -- Draw indicator ring + + cairo_arc(cr,xc,yc,ring_r,angle_0,angle_0+t_arc) + cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga)) + cairo_stroke(cr) +end + +function draw_clock_hands(cr,xc,yc) + local secs,mins,hours,secs_arc,mins_arc,hours_arc + local xh,yh,xm,ym,xs,ys + + secs=os.date("%S") + mins=os.date("%M") + hours=os.date("%I") + + secs_arc=(2*math.pi/60)*secs + mins_arc=(2*math.pi/60)*mins+secs_arc/60 + hours_arc=(2*math.pi/12)*hours+mins_arc/12 + + -- Draw hour hand + + xh=xc+0.7*clock_r*math.sin(hours_arc) + yh=yc-0.7*clock_r*math.cos(hours_arc) + cairo_move_to(cr,xc,yc) + cairo_line_to(cr,xh,yh) + + cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND) + cairo_set_line_width(cr,5) + cairo_set_source_rgba(cr,rgb_to_r_g_b(clock_colour,clock_alpha)) + cairo_stroke(cr) + + -- Draw minute hand + + xm=xc+clock_r*math.sin(mins_arc) + ym=yc-clock_r*math.cos(mins_arc) + cairo_move_to(cr,xc,yc) + cairo_line_to(cr,xm,ym) + + cairo_set_line_width(cr,3) + cairo_stroke(cr) + + -- Draw seconds hand + + if show_seconds then + xs=xc+clock_r*math.sin(secs_arc) + ys=yc-clock_r*math.cos(secs_arc) + cairo_move_to(cr,xc,yc) + cairo_line_to(cr,xs,ys) + + cairo_set_line_width(cr,1) + cairo_stroke(cr) + end +end + +function conky_clock_rings() + local function setup_rings(cr,pt) + local str='' + local value=0 + + str=string.format('${%s %s}',pt['name'],pt['arg']) + str=conky_parse(str) + + value=tonumber(str) + if value == nil then value = 0 end + pct=value/pt['max'] + + draw_ring(cr,pct,pt) + end + + -- Check that Conky has been running for at least 5s + + if conky_window==nil then return end + local cs=cairo_xlib_surface_create(conky_window.display,conky_window.drawable,conky_window.visual, conky_window.width,conky_window.height) + + local cr=cairo_create(cs) + + local updates=conky_parse('${updates}') + update_num=tonumber(updates) + + if update_num>5 then + for i in pairs(settings_table) do + setup_rings(cr,settings_table[i]) + end + end + + draw_clock_hands(cr,clock_x,clock_y) +end diff --git a/_conky/cronograph/scripts/multi_rings.lua b/_conky/cronograph/scripts/multi_rings.lua new file mode 100755 index 0000000..b9735b2 --- /dev/null +++ b/_conky/cronograph/scripts/multi_rings.lua @@ -0,0 +1,375 @@ +--============================================================================== +-- multi_rings.lua +-- +-- author : SLK +-- version : v2011011601 +-- license : Distributed under the terms of GNU GPL version 2 or later +-- +--============================================================================== + +require 'cairo' + +-------------------------------------------------------------------------------- +-- clock DATA +-- HOURS +clock_h = { + { + name='time', arg='%H', max_value=12, + x=150, y=150, + graph_radius=140, + graph_thickness=3, + graph_unit_angle=30, graph_unit_thickness=5, + graph_bg_colour=0xffffff, graph_bg_alpha=0.0, + graph_fg_colour=0xFFFFFF, graph_fg_alpha=0.0, + txt_radius=100, + txt_weight=1, txt_size=10.0, + txt_fg_colour=0xFFFFFF, txt_fg_alpha=0.0, + graduation_radius=125, + graduation_thickness=10, graduation_mark_thickness=2, + graduation_unit_angle=30, + graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=1.0, + }, +} +-- MINUTES +clock_m = { + { + name='time', arg='%M', max_value=60, + x=150, y=150, + graph_radius=100, + graph_thickness=3, + graph_unit_angle=6, graph_unit_thickness=3, + graph_bg_colour=0xffffff, graph_bg_alpha=0.0, + graph_fg_colour=0xFFFFFF, graph_fg_alpha=0.0, + txt_radius=100, + txt_weight=0, txt_size=9.0, + txt_fg_colour=0xFFFFFF, txt_fg_alpha=0.0, + graduation_radius=57, + graduation_thickness=0, graduation_mark_thickness=2, + graduation_unit_angle=30, + graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.0, + }, +} +-- SECONDS +clock_s = { + { + name='time', arg='%S', max_value=60, + x=150, y=150, + graph_radius=50, + graph_thickness=3, + graph_unit_angle=6, graph_unit_thickness=3, + graph_bg_colour=0xffffff, graph_bg_alpha=0.0, + graph_fg_colour=0xFFFFFF, graph_fg_alpha=0.0, + txt_radius=100, + txt_weight=0, txt_size=12.0, + txt_fg_colour=0xFFFFFF, txt_fg_alpha=0.0, + graduation_radius=0, + graduation_thickness=0, graduation_mark_thickness=0, + graduation_unit_angle=0, + graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.0, + }, +} + +-------------------------------------------------------------------------------- +-- gauge DATA +gauge = { +{ + name='cpu', arg='cpu0', max_value=100, + x=85, y=150, + graph_radius=14, + graph_thickness=27, + graph_start_angle=0, + graph_unit_angle=3.5, graph_unit_thickness=3.0, + graph_bg_colour=0xFFFFFF, graph_bg_alpha=0.0, + graph_fg_colour=0xFFFFFF, graph_fg_alpha=0.0, + hand_fg_colour=0xFFFFFF, hand_fg_alpha=1.0, + txt_radius=1, + txt_weight=0, txt_size=8.0, + txt_fg_colour=0xFFFFFF, txt_fg_alpha=0.0, + graduation_radius=27, + graduation_thickness=4, graduation_mark_thickness=4, + graduation_unit_angle=30, + graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=1.0, + caption='', + caption_weight=1, caption_size=8.0, + caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.0, +}, +{ + name='memperc', arg='', max_value=100, + x=215, y=150, + graph_radius=14, + graph_thickness=27, + graph_start_angle=0, + graph_unit_angle=3.5, graph_unit_thickness=3.0, + graph_bg_colour=0xFFFFFF, graph_bg_alpha=0.0, + graph_fg_colour=0xFFFFFF, graph_fg_alpha=0.0, + hand_fg_colour=0xFFFFFF, hand_fg_alpha=1.0, + txt_radius=1, + txt_weight=0, txt_size=8.0, + txt_fg_colour=0xFFFFFF, txt_fg_alpha=0.0, + graduation_radius=27, + graduation_thickness=4, graduation_mark_thickness=4, + graduation_unit_angle=30, + graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=1.0, + caption='', + caption_weight=1, caption_size=8.0, + caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.0, +}, +{ + name='fs_used_perc', arg='/', max_value=100, + x=150, y=75, + graph_radius=10, + graph_thickness=23, + graph_start_angle=0, + graph_unit_angle=3.5, graph_unit_thickness=3.0, + graph_bg_colour=0xFFFFFF, graph_bg_alpha=0.0, + graph_fg_colour=0xFFFFFF, graph_fg_alpha=0.0, + hand_fg_colour=0xFFFFFF, hand_fg_alpha=1.0, + txt_radius=1, + txt_weight=0, txt_size=8.0, + txt_fg_colour=0xFFFFFF, txt_fg_alpha=0.0, + graduation_radius=22, + graduation_thickness=4, graduation_mark_thickness=4, + graduation_unit_angle=30, + graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=1.0, + caption='', + caption_weight=1, caption_size=8.0, + caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.0, +}, +} + +------------------------------------------------------------------------------- +-- rgb_to_r_g_b +-- converts color in hexa to decimal +-- +function rgb_to_r_g_b(colour, alpha) + return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha +end + +------------------------------------------------------------------------------- +-- angle_to_position +-- convert degree to rad and rotate (0 degree is top/north) +-- +function angle_to_position(start_angle, current_angle) + local pos = current_angle + start_angle + return ( ( pos * (2 * math.pi / 360) ) - (math.pi / 2) ) +end + +------------------------------------------------------------------------------- +-- draw_clock_ring +-- displays clock +-- +function draw_clock_ring(display, data, value) + local max_value = data['max_value'] + local x, y = data['x'], data['y'] + local graph_radius = data['graph_radius'] + local graph_thickness, graph_unit_thickness = data['graph_thickness'], data['graph_unit_thickness'] + local graph_unit_angle = data['graph_unit_angle'] + local graph_bg_colour, graph_bg_alpha = data['graph_bg_colour'], data['graph_bg_alpha'] + local graph_fg_colour, graph_fg_alpha = data['graph_fg_colour'], data['graph_fg_alpha'] + + -- background ring + cairo_arc(display, x, y, graph_radius, 0, 2 * math.pi) + cairo_set_source_rgba(display, rgb_to_r_g_b(graph_bg_colour, graph_bg_alpha)) + cairo_set_line_width(display, graph_thickness) + cairo_stroke(display) + + -- arc of value + local val = (value % max_value) + local i = 1 + while i <= val do + cairo_arc(display, x, y, graph_radius,( ((graph_unit_angle * i) - graph_unit_thickness)*(2*math.pi/360) )-(math.pi/2),((graph_unit_angle * i) * (2*math.pi/360))-(math.pi/2)) + cairo_set_source_rgba(display,rgb_to_r_g_b(graph_fg_colour,graph_fg_alpha)) + cairo_stroke(display) + i = i + 1 + end + local angle = (graph_unit_angle * i) - graph_unit_thickness + + -- graduations marks + local graduation_radius = data['graduation_radius'] + local graduation_thickness, graduation_mark_thickness = data['graduation_thickness'], data['graduation_mark_thickness'] + local graduation_unit_angle = data['graduation_unit_angle'] + local graduation_fg_colour, graduation_fg_alpha = data['graduation_fg_colour'], data['graduation_fg_alpha'] + if graduation_radius > 0 and graduation_thickness > 0 and graduation_unit_angle > 0 then + local nb_graduation = 360 / graduation_unit_angle + local i = 1 + while i <= nb_graduation do + cairo_set_line_width(display, graduation_thickness) + cairo_arc(display, x, y, graduation_radius, (((graduation_unit_angle * i)-(graduation_mark_thickness/2))*(2*math.pi/360))-(math.pi/2),(((graduation_unit_angle * i)+(graduation_mark_thickness/2))*(2*math.pi/360))-(math.pi/2)) + cairo_set_source_rgba(display,rgb_to_r_g_b(graduation_fg_colour,graduation_fg_alpha)) + cairo_stroke(display) + cairo_set_line_width(display, graph_thickness) + i = i + 1 + end + end + + -- text + local txt_radius = data['txt_radius'] + local txt_weight, txt_size = data['txt_weight'], data['txt_size'] + local txt_fg_colour, txt_fg_alpha = data['txt_fg_colour'], data['txt_fg_alpha'] + local movex = txt_radius * (math.cos((angle * 2 * math.pi / 360)-(math.pi/2))) + local movey = txt_radius * (math.sin((angle * 2 * math.pi / 360)-(math.pi/2))) + cairo_select_font_face (display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, txt_weight); + cairo_set_font_size (display, txt_size); + cairo_set_source_rgba (display, rgb_to_r_g_b(txt_fg_colour, txt_fg_alpha)); + cairo_move_to (display, x + movex - (txt_size / 2), y + movey + 3); + cairo_show_text (display, value); + cairo_stroke (display); +end + +------------------------------------------------------------------------------- +-- draw_gauge_ring +-- displays gauges +-- +function draw_gauge_ring(display, data, value) + local max_value = data['max_value'] + local x, y = data['x'], data['y'] + local graph_radius = data['graph_radius'] + local graph_thickness, graph_unit_thickness = data['graph_thickness'], data['graph_unit_thickness'] + local graph_start_angle = data['graph_start_angle'] + local graph_unit_angle = data['graph_unit_angle'] + local graph_bg_colour, graph_bg_alpha = data['graph_bg_colour'], data['graph_bg_alpha'] + local graph_fg_colour, graph_fg_alpha = data['graph_fg_colour'], data['graph_fg_alpha'] + local hand_fg_colour, hand_fg_alpha = data['hand_fg_colour'], data['hand_fg_alpha'] + local graph_end_angle = (max_value * graph_unit_angle) % 360 + + -- background ring + cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, 0), angle_to_position(graph_start_angle, graph_end_angle)) + cairo_set_source_rgba(display, rgb_to_r_g_b(graph_bg_colour, graph_bg_alpha)) + cairo_set_line_width(display, graph_thickness) + cairo_stroke(display) + + -- arc of value + local val = value % (max_value + 1) + local start_arc = 0 + local stop_arc = 0 + local i = 1 + while i <= val do + start_arc = (graph_unit_angle * i) - graph_unit_thickness + stop_arc = (graph_unit_angle * i) + cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc)) + cairo_set_source_rgba(display, rgb_to_r_g_b(graph_fg_colour, graph_fg_alpha)) + cairo_stroke(display) + i = i + 1 + end + local angle = start_arc + + -- hand + start_arc = (graph_unit_angle * val) - (graph_unit_thickness * 2) + stop_arc = (graph_unit_angle * val) + cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc)) + cairo_set_source_rgba(display, rgb_to_r_g_b(hand_fg_colour, hand_fg_alpha)) + cairo_stroke(display) + + -- graduations marks + local graduation_radius = data['graduation_radius'] + local graduation_thickness, graduation_mark_thickness = data['graduation_thickness'], data['graduation_mark_thickness'] + local graduation_unit_angle = data['graduation_unit_angle'] + local graduation_fg_colour, graduation_fg_alpha = data['graduation_fg_colour'], data['graduation_fg_alpha'] + if graduation_radius > 0 and graduation_thickness > 0 and graduation_unit_angle > 0 then + local nb_graduation = graph_end_angle / graduation_unit_angle + local i = 0 + while i < nb_graduation do + cairo_set_line_width(display, graduation_thickness) + start_arc = (graduation_unit_angle * i) - (graduation_mark_thickness / 2) + stop_arc = (graduation_unit_angle * i) + (graduation_mark_thickness / 2) + cairo_arc(display, x, y, graduation_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc)) + cairo_set_source_rgba(display,rgb_to_r_g_b(graduation_fg_colour,graduation_fg_alpha)) + cairo_stroke(display) + cairo_set_line_width(display, graph_thickness) + i = i + 1 + end + end + + -- text + local txt_radius = data['txt_radius'] + local txt_weight, txt_size = data['txt_weight'], data['txt_size'] + local txt_fg_colour, txt_fg_alpha = data['txt_fg_colour'], data['txt_fg_alpha'] + local movex = txt_radius * math.cos(angle_to_position(graph_start_angle, angle)) + local movey = txt_radius * math.sin(angle_to_position(graph_start_angle, angle)) + cairo_select_font_face (display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, txt_weight) + cairo_set_font_size (display, txt_size) + cairo_set_source_rgba (display, rgb_to_r_g_b(txt_fg_colour, txt_fg_alpha)) + cairo_move_to (display, x + movex - (txt_size / 2), y + movey + 3) + cairo_show_text (display, value) + cairo_stroke (display) + + -- caption + local caption = data['caption'] + local caption_weight, caption_size = data['caption_weight'], data['caption_size'] + local caption_fg_colour, caption_fg_alpha = data['caption_fg_colour'], data['caption_fg_alpha'] + local tox = graph_radius * (math.cos((graph_start_angle * 2 * math.pi / 360)-(math.pi/2))) + local toy = graph_radius * (math.sin((graph_start_angle * 2 * math.pi / 360)-(math.pi/2))) + cairo_select_font_face (display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, caption_weight); + cairo_set_font_size (display, caption_size) + cairo_set_source_rgba (display, rgb_to_r_g_b(caption_fg_colour, caption_fg_alpha)) + cairo_move_to (display, x + tox + 5, y + toy + 1) + -- bad hack but not enough time ! + if graph_start_angle < 105 then + cairo_move_to (display, x + tox - 30, y + toy + 1) + end + cairo_show_text (display, caption) + cairo_stroke (display) +end + +------------------------------------------------------------------------------- +-- go_clock_rings +-- loads data and displays clock +-- +function go_clock_rings(display) + local function load_clock_rings(display, data) + local str, value = '', 0 + str = string.format('${%s %s}',data['name'], data['arg']) + str = conky_parse(str) + value = tonumber(str) + draw_clock_ring(display, data, value) + end + + for i in pairs(clock_h) do + load_clock_rings(display, clock_h[i]) + end + for i in pairs(clock_m) do + load_clock_rings(display, clock_m[i]) + end + for i in pairs(clock_s) do + load_clock_rings(display, clock_s[i]) + end +end + +------------------------------------------------------------------------------- +-- go_gauge_rings +-- loads data and displays gauges +-- +function go_gauge_rings(display) + local function load_gauge_rings(display, data) + local str, value = '', 0 + str = string.format('${%s %s}',data['name'], data['arg']) + str = conky_parse(str) + value = tonumber(str) + draw_gauge_ring(display, data, value) + end + + for i in pairs(gauge) do + load_gauge_rings(display, gauge[i]) + end +end + +------------------------------------------------------------------------------- +-- MAIN +function conky_main() + if conky_window == nil then + return + end + + local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height) + local display = cairo_create(cs) + + local updates = conky_parse('${updates}') + update_num = tonumber(updates) + + if update_num > 5 then + go_clock_rings(display) + go_gauge_rings(display) + end + +end + diff --git a/_conkyrc b/_conkyrc new file mode 100644 index 0000000..3a54030 --- /dev/null +++ b/_conkyrc @@ -0,0 +1,89 @@ +# — Conky settings — # + +background yes + +update_interval 1 +total_run_times 0 +net_avg_samples 2 + +override_utf8_locale yes + +double_buffer yes +no_buffers yes + +text_buffer_size 2048 +imlib_cache_size 0 + +temperature_unit celsius + +# — Window specifications — # + +own_window_class Conky +own_window yes +own_window_type desktop +own_window_transparent yes +own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager + +border_inner_margin 0 +border_outer_margin 0 + +minimum_size 300 330 +maximum_width 300 + +alignment top_right + +gap_x 30 +gap_y 75 + + +# — Graphics settings — # +draw_shades no +draw_outline no +draw_borders no +draw_graph_borders no + +# — Text settings — # +use_xft yes +xftfont hooge 05_53:size=6 +xftalpha 0.5 + +default_color FFFFFF + +uppercase no +use_spacer right + +color0 white +color1 orange +color2 green + +# — Lua Load — # + +lua_load $HOME/.conky/cronograph/scripts/clock_rings.lua +lua_draw_hook_pre clock_rings +lua_load $HOME/.conky/cronograph/scripts/multi_rings.lua +lua_draw_hook_post main + +TEXT +${execi 600 sh $HOME/.conky/cronograph/accuweather/accuweather.sh} +#${voffset 29}${offset 120}BAT: +${voffset 29}${goto 109}GENTOO${goto 157}Linux +${voffset 17}${goto 65}${font hooge 05_53:size=12}${time %H:%M}${font}${goto 185}UPTIME: +${voffset 2}${goto 65}${time %a %d %b}${goto 185}${uptime} +${voffset 2}${goto 65}${time %Y} +${voffset -6}${goto 145}HD +${voffset 12}${alignc}${fs_free}/${fs_size} +${voffset 36}${goto 91}${cpu cpu0}%${goto 221}${memperc}% +${voffset 10}${goto 76}CPU${goto 205}MEM +${voffset 16}${goto 82}${font hooge 05_53:size=12}${execpi 600 sed -n '4p' $HOME/.conky/cronograph/accuweather/curr_cond}°C${font}${voffset -30}${goto 125}${font ConkyWeather:size=40}${execpi 600 sed -n '2p' $HOME/.conky/cronograph/accuweather/curr_cond}${font}${voffset -16}${goto 185}${execpi 600 sed -n '3p' $HOME/.conky/cronograph/accuweather/curr_cond}${voffset 12}${goto 185}${font ConkyWeather:size=20}${voffset 1}${goto 80}${execpi 600 sed -n '7p' $HOME/.conky/cronograph/accuweather/tod_ton}${goto 135}${execpi 600 sed -n '12p' $HOME/.conky/cronograph/accuweather/tod_ton}${goto 185}${execpi 600 sed -n '17p' $HOME/.conky/cronograph/accuweather/tod_ton}${font}${voffset 6}${goto 84}${execpi 600 sed -n '9p' $HOME/.conky/cronograph/accuweather/tod_ton}°/${execpi 600 sed -n '10p' $HOME/.conky/cronograph/accuweather/tod_ton}°${goto 140}${execpi 600 sed -n '14p' $HOME/.conky/cronograph/accuweather/tod_ton}°/${execpi 600 sed -n '15p' $HOME/.conky/cronograph/accuweather/tod_ton}°${goto 190}${execpi 600 sed -n '19p' $HOME/.conky/cronograph/accuweather/tod_ton}°/${execpi 600 sed -n '20p' $HOME/.conky/cronograph/accuweather/tod_ton}°${voffset 7}${goto 85}${execpi 600 sed -n '6p' $HOME/.conky/cronograph/accuweather/tod_ton}${goto 140}${execpi 600 sed -n '11p' $HOME/.conky/cronograph/accuweather/tod_ton}${goto 190}${execpi 600 sed -n '16p' $HOME/.conky/cronograph/accuweather/tod_ton} +${if_match ${battery_percent BAT0}>0}${if_match ${battery_percent BAT0}<=15}${image $HOME/.conky/cronograph/images/Red.png -p 129,18 -s 40x40}${endif}${endif} +${if_match ${battery_percent BAT0}>15}${if_match ${battery_percent BAT0}<=20}${image $HOME/.conky/cronograph/images/Orange.png -p 129,18 -s 40x40}${endif}${endif} +${if_match ${battery_percent BAT0}>20}${if_match ${battery_percent BAT0}<=35}${image $HOME/.conky/cronograph/images/Yellow.png -p 129,18 -s 40x40}${endif}${endif} +${if_match ${battery_percent BAT0}>35}${if_match ${battery_percent BAT0}<=100}${image $HOME/.conky/cronograph/images/Dark_Green.png -p 129,18 -s 40x40}${endif}${endif} +${execpi 30 cat $HOME/.conky/cronograph/scripts/blinkingLED} +## mpd ## +${if_mpd_playing}${voffset 6}${goto 10}${font Sans:size=8:bold}${mpd_artist}${font}${voffset -5}${font Sans:size=8} - ${mpd_title}${font} +${voffset 4}${goto 10}${mpd_bar 5,220}${alignr 10}${mpd_elapsed}/${mpd_length} +${else}${voffset 6}${goto 10}${font hooge 05_53:size=8}MPD: stopped${font} +${endif} + +# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=conkyrc: # diff --git a/_gnupg/dirmngr.conf b/_gnupg/dirmngr.conf new file mode 100644 index 0000000..7696da9 --- /dev/null +++ b/_gnupg/dirmngr.conf @@ -0,0 +1,21 @@ +##################################################################### +# GnuPG configuration file +# +# dirmngr: CRL and OCSP daemon (GnuPG >= 2.1) +# ~/.gnupg/dirmngr.conf +# +# Ref: +# [1] SKS Keyservers: Overview of the pools +# https://sks-keyservers.net/overview-of-pools.php +# +# Weitian LI +# 2015/01/16 +##################################################################### + +# keyserver hkps://hkps.pool.sks-keyservers.net +# This pool only contains servers available using hkps. +# keyserver-options ca-cert-file' is obsolete! (GnuPG >= 2.1) +# NOTE: cannot use '~' or '$HOME' in path ?? +hkp-cacert /home/aly/dotfiles/.gnupg/sks-keyservers.netCA.pem + +# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=gpg: # diff --git a/_gnupg/gpg-agent.conf b/_gnupg/gpg-agent.conf new file mode 100644 index 0000000..35d2924 --- /dev/null +++ b/_gnupg/gpg-agent.conf @@ -0,0 +1,21 @@ +##################################################################### +# GnuPG Agent configuration file +# ~/.gnupg/gpg-agent.conf +# +# Ref: +# Gentoo wiki: GnuPG +# +# Weitian LI +# 2014/06/12 +##################################################################### + +pinentry-program /usr/bin/pinentry-gtk-2 +#pinentry-program /usr/bin/pinentry-qt4 +#pinentry-program /usr/bin/pinentry-curses + +no-grab + +# default timeout of the passphrase (60 minutes) +default-cache-ttl 3600 + +# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=gpg: # diff --git a/_gnupg/gpg.conf b/_gnupg/gpg.conf new file mode 100644 index 0000000..258c10e --- /dev/null +++ b/_gnupg/gpg.conf @@ -0,0 +1,130 @@ +##################################################################### +# GnuPG configuration file +# ~/.gnupg/gpg.conf +# +# Based on Github: ioerror/duraconf's configuration: +# https://github.com/ioerror/duraconf/blob/master/configs/gnupg/gpg.conf +# +# Reference: +# [1] Riseup: OpenPGP Best Practices +# https://help.riseup.net/en/gpg-best-practices +# [2] Secure GnuPG configuration +# http://sparkslinux.wordpress.com/2013/07/09/secure-gnupg-configuration +# +# Weitian LI +# Created: 2014/06/12 +# Updated: 2015/08/19 +##################################################################### + +#----------------------------- +# default key +#----------------------------- + +# The default key to sign with. If this option is not used, the default key is +# the first key found in the secret keyring +default-key 0xAC3464FADAAE632186099CA6240E2A635D72729A + +#----------------------------- +# behavior +#----------------------------- + +# Uncomment the following option to get rid of the copyright notice +no-greeting + +# create ASCII armored output (default is binary OpenPGP format) +#armor + +# If you do not use the Latin-1 (ISO-8859-1) charset, you should tell +# GnuPG which is the native character set. Please check the man page +# for supported character sets. This character set is only used for +# metadata and not for the actual message which does not undergo any +# translation. Note that future version of GnuPG will change to UTF-8 +# as default character set. +charset utf-8 + +# Disable inclusion of the version string in ASCII armored output +no-emit-version + +# Disable comment string in clear text signatures and ASCII armored messages +no-comments + +# Display long key IDs +keyid-format 0xlong + +# List all keys (or the specified ones) along with their fingerprints +with-fingerprint + +# Display the calculated validity of user IDs during key listings +list-options show-uid-validity +verify-options show-uid-validity + +# Try to use the GnuPG-Agent. With this option, GnuPG first tries to connect to +# the agent before it asks for a passphrase. +use-agent + +#----------------------------- +# keyserver +#----------------------------- + +# This is the server that --recv-keys, --send-keys, and --search-keys will +# communicate with to receive keys from, send keys to, and search for keys on +#keyserver hkp://pool.sks-keyservers.net +keyserver hkps://hkps.pool.sks-keyservers.net + +# Provide a certificate store to override the system default +# Get this from https://sks-keyservers.net/sks-keyservers.netCA.pem +# option 'ca-cert-file' is obsolete. (GnuPG >= 2.1) +#keyserver-options ca-cert-file=~/dotfiles/.gnupg/sks-keyservers.netCA.pem + +# Set the proxy to use for HTTP and HKP keyservers - default to the standard +# local Tor socks proxy +# It is encouraged to use Tor for improved anonymity. Preferrably use either a +# dedicated SOCKSPort for GnuPG and/or enable IsolateDestPort and +# IsolateDestAddr +#keyserver-options http-proxy=socks5-hostname://127.0.0.1:9050 +# Don't leak DNS, see https://trac.torproject.org/projects/tor/ticket/2846 +# XXX: unknown to gnupg 2.1.7 +#keyserver-options no-try-dns-srv + +# When using --refresh-keys, if the key in question has a preferred keyserver +# URL, then disable use of that preferred keyserver to refresh the key from +keyserver-options no-honor-keyserver-url + +# When searching for a key with --search-keys, include keys that are marked on +# the keyserver as revoked +keyserver-options include-revoked + +# Automatic retrieve keys from a keyserver when verifying signatures made by +# keys that are not on the local keyring. +# NOTE: This option makes a "web bug" like behavior possible. +# Keyserver operators can see which keys you rquest, so by sending +# you a message signed by a brand new key (which you naturally will +# not have on your local keyring), the operator can tell both your +# IP address and the time when you verified the signature. +keyserver-options auto-key-retrieve + +#----------------------------- +# algorithm and ciphers +#----------------------------- + +# list of personal digest preferences. When multiple digests are supported by +# all recipients, choose the strongest one +#personal-cipher-preferences AES256 TWOFISH AES192 AES +personal-cipher-preferences AES256 AES192 AES CAST5 + +# list of personal digest preferences. When multiple ciphers are supported by +# all recipients, choose the strongest one +personal-digest-preferences SHA512 SHA384 SHA256 SHA224 + +# list of personal compress preferences +personal-compress-preferences ZLIB BZIP2 ZIP + +# message digest algorithm used when signing a key +cert-digest-algo SHA512 + +# This preference list is used for new keys and becomes the default for +# "setpref" in the edit menu +#default-preference-list SHA512 SHA384 SHA256 SHA224 AES256 TWOFISH AES192 AES ZLIB BZIP2 ZIP Uncompressed +default-preference-list SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed + +# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=gpg: # diff --git a/_gnupg/sks-keyservers.netCA.pem b/_gnupg/sks-keyservers.netCA.pem new file mode 100644 index 0000000..24a2ad2 --- /dev/null +++ b/_gnupg/sks-keyservers.netCA.pem @@ -0,0 +1,32 @@ +-----BEGIN CERTIFICATE----- +MIIFizCCA3OgAwIBAgIJAK9zyLTPn4CPMA0GCSqGSIb3DQEBBQUAMFwxCzAJBgNV +BAYTAk5PMQ0wCwYDVQQIDARPc2xvMR4wHAYDVQQKDBVza3Mta2V5c2VydmVycy5u +ZXQgQ0ExHjAcBgNVBAMMFXNrcy1rZXlzZXJ2ZXJzLm5ldCBDQTAeFw0xMjEwMDkw +MDMzMzdaFw0yMjEwMDcwMDMzMzdaMFwxCzAJBgNVBAYTAk5PMQ0wCwYDVQQIDARP +c2xvMR4wHAYDVQQKDBVza3Mta2V5c2VydmVycy5uZXQgQ0ExHjAcBgNVBAMMFXNr +cy1rZXlzZXJ2ZXJzLm5ldCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoC +ggIBANdsWy4PXWNUCkS3L//nrd0GqN3dVwoBGZ6w94Tw2jPDPifegwxQozFXkG6I +6A4TK1CJLXPvfz0UP0aBYyPmTNadDinaB9T4jIwd4rnxl+59GiEmqkN3IfPsv5Jj +MkKUmJnvOT0DEVlEaO1UZIwx5WpfprB3mR81/qm4XkAgmYrmgnLXd/pJDAMk7y1F +45b5zWofiD5l677lplcIPRbFhpJ6kDTODXh/XEdtF71EAeaOdEGOvyGDmCO0GWqS +FDkMMPTlieLA/0rgFTcz4xwUYj/cD5e0ZBuSkYsYFAU3hd1cGfBue0cPZaQH2HYx +Qk4zXD8S3F4690fRhr+tki5gyG6JDR67aKp3BIGLqm7f45WkX1hYp+YXywmEziM4 +aSbGYhx8hoFGfq9UcfPEvp2aoc8u5sdqjDslhyUzM1v3m3ZGbhwEOnVjljY6JJLx +MxagxnZZSAY424ZZ3t71E/Mn27dm2w+xFRuoy8JEjv1d+BT3eChM5KaNwrj0IO/y +u8kFIgWYA1vZ/15qMT+tyJTfyrNVV/7Df7TNeWyNqjJ5rBmt0M6NpHG7CrUSkBy9 +p8JhimgjP5r0FlEkgg+lyD+V79H98gQfVgP3pbJICz0SpBQf2F/2tyS4rLm+49rP +fcOajiXEuyhpcmzgusAj/1FjrtlynH1r9mnNaX4e+rLWzvU5AgMBAAGjUDBOMB0G +A1UdDgQWBBTkwyoJFGfYTVISTpM8E+igjdq28zAfBgNVHSMEGDAWgBTkwyoJFGfY +TVISTpM8E+igjdq28zAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4ICAQAR +OXnYwu3g1ZjHyley3fZI5aLPsaE17cOImVTehC8DcIphm2HOMR/hYTTL+V0G4P+u +gH+6xeRLKSHMHZTtSBIa6GDL03434y9CBuwGvAFCMU2GV8w92/Z7apkAhdLToZA/ +X/iWP2jeaVJhxgEcH8uPrnSlqoPBcKC9PrgUzQYfSZJkLmB+3jEa3HKruy1abJP5 +gAdQvwvcPpvYRnIzUc9fZODsVmlHVFBCl2dlu/iHh2h4GmL4Da2rRkUMlbVTdioB +UYIvMycdOkpH5wJftzw7cpjsudGas0PARDXCFfGyKhwBRFY7Xp7lbjtU5Rz0Gc04 +lPrhDf0pFE98Aw4jJRpFeWMjpXUEaG1cq7D641RpgcMfPFvOHY47rvDTS7XJOaUT +BwRjmDt896s6vMDcaG/uXJbQjuzmmx3W2Idyh3s5SI0GTHb0IwMKYb4eBUIpQOnB +cE77VnCYqKvN1NVYAqhWjXbY7XasZvszCRcOG+W3FqNaHOK/n/0ueb0uijdLan+U +f4p1bjbAox8eAOQS/8a3bzkJzdyBNUKGx1BIK2IBL9bn/HravSDOiNRSnZ/R3l9G +ZauX0tu7IIDlRCILXSyeazu0aj/vdT3YFQXPcvt5Fkf5wiNTo53f72/jYEJd6qph +WrpoKqrwGwTpRUCMhYIUt65hsTxCiJJ5nKe39h46sg== +-----END CERTIFICATE----- diff --git a/_gtkrc-2.0 b/_gtkrc-2.0 new file mode 100644 index 0000000..dc786c3 --- /dev/null +++ b/_gtkrc-2.0 @@ -0,0 +1,8 @@ +## +## ~/.gtkrc-2.0 +## + +## NOTE: cannot use `~' and `$HOME' here + +include "/home/aly/.gtkrc.mine" + diff --git a/_gtkrc.mine b/_gtkrc.mine new file mode 100644 index 0000000..0927f91 --- /dev/null +++ b/_gtkrc.mine @@ -0,0 +1,25 @@ +## +## ~/.gtkrc.mine +## + +## font +gtk-font-name = "Sans 10" + +## theme +gtk-theme-name = "Clearlooks" +#gtk-theme-name = "FlatStudioLight" +#gtk-theme-name = "FlatStudioGray" +#gtk-theme-name = "FlatStudioDark" + +## icon +#gtk-icon-theme-name = "AwOken" +gtk-icon-theme-name = "AwOkenWhite" +#gtk-icon-theme-name = "AwOkenDark" + +## toolbar +# GTK_TOOLBAR_ICONS: only icons +# GTK_TOOLBAR_TEXT: only text +# GTK_TOOLBAR_BOTH: both icon and text +# GTK_TOOLBAR_BOTH_HORIZ: icon and text next to the icon +gtk-toolbar-style = GTK_TOOLBAR_ICONS + diff --git a/_i3/config b/_i3/config new file mode 100644 index 0000000..1e274bb --- /dev/null +++ b/_i3/config @@ -0,0 +1,386 @@ +########################################################### +## ~/.i3/config +## +## i3 config file (v4) +## +## References: +## [1] http://i3wm.org/docs/userguide.html +## +## Credits: +## [1] https://github.com/Airblader/dotfiles-manjaro +## [2] https://github.com/Remedan/dotfiles +## +## Aaron LI +## Created: 2014-05-10 +## Updated: 2015-12-18 +########################################################### + +###### NOTES ###### {{{ +# To get a config file with the same key positions, but for your current +# layout, use the `i3-config-wizard' +###### NOTES ###### }}} + +###### variables ###### {{{ +## modifier +# Mod1: Alt +# Mod4: Win +set $mod Mod1 +set $sup Mod4 + +# variables used in this config +set $i3_scripts ~/.i3/scripts +set $i3_images ~/.i3/images + +# screenshots directory +set $shots_dir ~/pictures/screenshots +###### variables ###### }}} + +###### settings ###### {{{ +# Font for window titles. (also for bar if not specified) +# ISO 10646: Unicode +# Use pango to choose FreeType fonts +#font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1 +#font pango:DejaVu Sans Mono 10 +font pango:Terminus, WenQuanYi Bitmap Song, FontAwesome, 10 + +# use `Mouse+$mod' to drag floating windows +floating_modifier $mod + +# focus follows mouse (default yes) +#focus_follows_mouse no + +# timeout of urgency hint on workspace change (default 500ms) +force_display_urgency_hint 1000 ms + +# do not focus the activated window, always mark urgent (default: smart) +focus_on_window_activation urgent + +# ipc (`i3-msg' to run i3 commands) +ipc-socket ~/.i3/i3-ipc.sock +###### settings ###### }}} + +###### appearance ###### {{{ +# border style +#new_window 1pixel +bindsym $mod+t border normal +bindsym $mod+y border pixel 3 +bindsym $mod+u border none + +# 2 pixel border by default +for_window [class="^.*"] border pixel 2 + +# orientation for new workspaces +default_orientation auto + +# hide vertical borders adjacent to the screen edge +#hide_edge_borders vertical + +### colors +# molokai +set $black #1b1d1e +set $white #f8f8f2 +set $dark_gray #303030 +set $light_gray #9999aa +set $red #b60050 +set $light_red #f92672 +set $green #88bb22 +set $light_green #80ff00 +set $brown #c47f2c +set $yellow #ffba68 +set $blue #30309b +set $light_blue #7070f0 +set $purple #7e40a5 +set $light_purple #bb88dd +set $cyan #4699af +set $light_cyan #66d9ef + +# BORDER BACKGROUND TEXT INDICATOR +client.focused $green $green $black $green +client.unfocused $black $black $white $black +client.focused_inactive $black $black $white $black +client.urgent $red $red $black $red +client.background $black +###### appearance ###### }}} + +###### workspace ###### {{{ +# name workspace +set $ws1 "1: " +set $ws2 "2: " +set $ws3 "3: " +set $ws4 "4: " +set $ws5 "5: ??" +set $ws6 "6: ??" +set $ws7 "7: " +set $ws8 "8:  " +set $ws9 "9: " +set $ws0 "10: " + +# switch to workspace +bindsym $mod+1 workspace $ws1 +bindsym $mod+2 workspace $ws2 +bindsym $mod+3 workspace $ws3 +bindsym $mod+4 workspace $ws4 +bindsym $mod+5 workspace $ws5 +bindsym $mod+6 workspace $ws6 +bindsym $mod+7 workspace $ws7 +bindsym $mod+8 workspace $ws8 +bindsym $mod+9 workspace $ws9 +bindsym $mod+0 workspace $ws0 + +# auto back-and-forth when switched to the current workspace +workspace_auto_back_and_forth yes + +# move focused container to workspace +bindsym $mod+Shift+1 move container to workspace $ws1 +bindsym $mod+Shift+2 move container to workspace $ws2 +bindsym $mod+Shift+3 move container to workspace $ws3 +bindsym $mod+Shift+4 move container to workspace $ws4 +bindsym $mod+Shift+5 move container to workspace $ws5 +bindsym $mod+Shift+6 move container to workspace $ws6 +bindsym $mod+Shift+7 move container to workspace $ws7 +bindsym $mod+Shift+8 move container to workspace $ws8 +bindsym $mod+Shift+9 move container to workspace $ws9 +bindsym $mod+Shift+0 move container to workspace $ws0 +# move to provided workspace +bindsym $mod+Shift+m exec i3-input -F 'move container to workspace "%s"' -P 'move to workspace: ' + +# switch workspace +bindsym $mod+Tab workspace back_and_forth +bindsym $mod+Ctrl+Left workspace prev +bindsym $mod+Ctrl+Right workspace next +# also bind ThinkPad 'XF86Back' and 'XF86Forward' keys +#bindsym XF86Back workspace prev +#bindsym XF86Forward workspace next +###### workspace ###### }}} + +###### key bindings ###### {{{ +# start a terminal +bindsym $mod+Return exec urxvtc || i3-sensible-terminal + +# kill focused window +bindsym $mod+Shift+q kill +bindsym $mod+F4 kill + +# change focus (h/j/k/l) +bindsym $mod+h focus left +bindsym $mod+j focus down +bindsym $mod+k focus up +bindsym $mod+l focus right + +# alternatively, you can use the cursor keys: +bindsym $mod+Left focus left +bindsym $mod+Down focus down +bindsym $mod+Up focus up +bindsym $mod+Right focus right + +# move focused window (h/j/k/l) +bindsym $mod+Shift+h move left +bindsym $mod+Shift+j move down +bindsym $mod+Shift+k move up +bindsym $mod+Shift+l move right + +# alternatively, you can use the cursor keys: +bindsym $mod+Shift+Left move left +bindsym $mod+Shift+Down move down +bindsym $mod+Shift+Up move up +bindsym $mod+Shift+Right move right + +# split in horizontal orientation +bindsym $mod+Shift+v split h +# split in vertical orientation +bindsym $mod+v split v + +# enter fullscreen mode for the focused container +bindsym $mod+f fullscreen + +# change container layout (stacked, tabbed, toggle split) +bindsym $mod+s layout stacking +bindsym $mod+w layout tabbed +bindsym $mod+e layout toggle split + +# toggle tiling / floating +bindsym $mod+Shift+space floating toggle + +# change focus between tiling / floating windows +bindsym $mod+space focus mode_toggle + +# focus the parent container +bindsym $mod+a focus parent + +# focus the child container +bindsym $mod+c focus child + +## scratchpad +# move the currently focused window to the scratchpad +bindsym $mod+Shift+minus move scratchpad +# Show the next scratchpad window or hide the focused scratchpad window. +# If there are multiple scratchpad windows, this command cycles through them. +bindsym $mod+minus scratchpad show + +# toggle whether to stick a window to the screen (regardless of workspaces) +bindsym $mod+Shift+s sticky toggle + +# reload the configuration file +bindsym $mod+Shift+c reload +# restart i3 inplace (preserves layout/session, can be used to upgrade i3) +bindsym $mod+Shift+r restart +# exit i3 (logs you out of your X session) +bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'" +###### key bindings ###### }}} + +###### i3 modes ###### {{{ +# resize window (you can also use the mouse for that) +mode "resize" { + # These bindings trigger as soon as you enter the resize mode + # Pressing left will shrink the window's width. + # Pressing right will grow the window's width. + # Pressing up will shrink the window's height. + # Pressing down will grow the window's height. + bindsym h resize shrink width 10 px or 10 ppt + bindsym j resize grow height 10 px or 10 ppt + bindsym k resize shrink height 10 px or 10 ppt + bindsym l resize grow width 10 px or 10 ppt + # same bindings, but for the arrow keys + bindsym Left resize shrink width 10 px or 10 ppt + bindsym Down resize grow height 10 px or 10 ppt + bindsym Up resize shrink height 10 px or 10 ppt + bindsym Right resize grow width 10 px or 10 ppt + # back to normal: Enter or Escape + bindsym Return mode "default" + bindsym Escape mode "default" +} +bindsym $mod+r mode "resize" + +# mode_system: prompt for lock, logout, suspend, shutdown, etc. +set $mode_system System (l) lock, (e) logout, (s) suspend, (r) reboot, (Shift+s) shutdown +mode "$mode_system" { + bindsym l exec --no-startup-id $i3_scripts/i3exit.sh lock, mode "default" + bindsym e exec --no-startup-id $i3_scripts/i3exit.sh logout, mode "default" + bindsym s exec --no-startup-id $i3_scripts/i3exit.sh suspend, mode "default" + bindsym r exec --no-startup-id $i3_scripts/i3exit.sh reboot, mode "default" + bindsym Shift+s exec --no-startup-id $i3_scripts/i3exit.sh shutdown, mode "default" + # back to normal: Enter or Escape + bindsym Return mode "default" + bindsym Escape mode "default" +} +bindsym $mod+Ctrl+Delete mode "$mode_system" +###### i3 modes ###### }}} + +###### application bindings ###### {{{ +## NOTE: (Mod4: Win) +## Some Mod4-keys binded for urxvt (~/.Xresources) +## Mod4-c, Mod4-v, Mod4-Shift-v +## Mod4-Escape, Mode4-s, Mod4-u + +## program launcher +#bindsym $mod+d exec --no-startup-id dmenu_run +#bindsym $mod+F2 exec --no-startup-id dmenu_run +# use 'rofi' instead of 'dmenu' +bindsym $mod+d exec --no-startup-id rofi -show run +bindsym $mod+F2 exec --no-startup-id rofi -show run +# `i3-dmenu-desktop' only displays applications with a .desktop file +bindsym $mod+p exec --no-startup-id i3-dmenu-desktop + +# lock screen (i3lock) +bindsym $mod+Ctrl+l exec --no-startup-id $i3_scripts/i3exit.sh lock +bindsym $sup+l exec --no-startup-id $i3_scripts/i3exit.sh lock +# turn off display +bindsym $mod+Ctrl+b exec --no-startup-id sleep 1 && xset dpms force off + +# screenshots +bindsym --release Print exec --no-startup-id scrot -e 'mv $f $shots_dir/' +bindsym --release $mod+Print exec --no-startup-id scrot -s -e 'mv $f $shots_dir/' + +# terminal +bindsym $sup+t exec urxvtc || urxvt || i3-sensible-terminal +bindsym $sup+Enter exec urxvtc || urxvt || i3-sensible-terminal +# file manager +bindsym $sup+f exec thunar +# web browser +bindsym $sup+w exec ~/bin/firefox || firefox + +## dropdown terminal +# auto start urxvt if closed +exec --no-startup-id "while true; do urxvt -name 'dropdown_term'; done" +#for_window [instance="dropdown_term"] floating enable, border 1pixel +#for_window [instance="dropdown_term"] move scratchpad; [instance="dropdown_term"] scratchpad show; resize shrink height 100px; resize grow width 626px; move position 1px 20px; move scratchpad +for_window [instance="dropdown_term"] floating enable, border 1pixel, resize shrink height 100px, resize grow width 626px, move position 1px 20px +for_window [instance="dropdown_term"] move scratchpad +bindsym $mod+backslash [instance="dropdown_term"] scratchpad show +###### applications bindings ###### }}} + +###### window control ###### {{{ +## floating +for_window [window_role="pop-up"] floating enable +for_window [window_role="bubble"] floating enable +for_window [window_role="task_dialog"] floating enable +for_window [window_role="Preferences"] floating enable + +for_window [window_type="dialog"] floating enable +for_window [window_type="menu"] floating enable + +for_window [class="(?i)Arandr"] floating enable +for_window [class="Xscreensaver-demo"] floating enable + +for_window [title="^XBindKey:.*Hit.*"] floating enable + +for_window [class="(?i)Xfce4-notifyd"] floating enable, border none + +# assign workspace for applications +assign [class="(?i)firefox"] $ws1 +###### window control ###### }}} + +###### i3bar ###### {{{ +bar { + #status_command i3status -c ~/.i3/i3status.conf + status_command i3blocks -c ~/.i3/i3blocks.conf + position top + # whether show the current binding mode indicator (default yes) + #binding_mode_indicator no + font pango:Terminus, WenQuanYi Bitmap Song, FontAwesome, 11 + tray_output primary + separator_symbol " " + # disable scroll on workspace buttons + bindsym button4 nop + bindsym button5 nop + # disable tray padding (default: 2) + tray_padding 0 + # display workspace of name "[n]:[NAME]" with only the "[NAME]" + strip_workspace_numbers yes + + colors { + statusline $white + background $black + separator $green + # BORDER BACKGROUND TEXT + focused_workspace $light_green $light_green $black + active_workspace $black $black $white + inactive_workspace $black $black $white + urgent_workspace $light_red $light_red $white + binding_mode $black $black $yellow + } +} +###### i3bar ###### }}} + +###### autostart ###### {{{ +## run applications on startup +## if need to run command when restarting i3, use `exec_always' +exec --no-startup-id xset b off +exec --no-startup-id xrdb -load ~/.Xresources +#exec --no-startup-id feh --bg-fill $i3_images/wallpaper.png +exec --no-startup-id sh ~/.fehbg +#exec --no-startup-id xcompmgr +exec --no-startup-id compton -b +exec --no-startup-id redshift +exec --no-startup-id xbindkeys +exec --no-startup-id urxvtd -q -o -f +exec --no-startup-id parcellite +exec --no-startup-id fcitx +exec --no-startup-id nm-applet +exec --no-startup-id xbacklight -set 80 +exec --no-startup-id xscreensaver -no-splash +exec --no-startup-id xfce4-power-manager +exec --no-startup-id mpd +###### autostart ###### }}} + +# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=conf: # diff --git a/_i3/i3blocks.conf b/_i3/i3blocks.conf new file mode 100644 index 0000000..28b79a6 --- /dev/null +++ b/_i3/i3blocks.conf @@ -0,0 +1,101 @@ +# +# i3blocks config file +# +# Aaron LI +# 2015-12-18 +# + + +# List of valid properties: +# +# align +# color +# command +# full_text +# instance +# interval +# label +# min_width +# name +# separator +# separator_block_width +# short_text +# signal +# urgent + +# Global properties +# +# The top properties below are applied to every block, but can be overridden. +# Each block command defaults to the script name to avoid boilerplate. +command=$SCRIPT_DIR/$BLOCK_NAME +separator_block_width=15 +markup=none + +# Volume indicator +# +# The first parameter sets the step (and units to display) +# The second parameter overrides the mixer selection +# See the script for details. +[volume] +label=VOL +#label=♪ +instance=Master +#instance=PCM +interval=once +signal=10 + +# Memory usage +# +# The type defaults to "mem" if the instance is not specified. +[memory] +label=MEM +separator=false +interval=30 + +# Network interface monitoring +# +# If the instance is not specified, use the interface used for default route. +# The address can be forced to IPv4 or IPv6 with -4 or -6 switches. +[iface] +#instance=wlan0 +color=#00FF00 +interval=10 +separator=false + +[wifi] +#instance=wlp3s0 +interval=10 +separator=false + +[bandwidth] +#instance=eth0 +interval=5 + +# CPU usage +# +# The script may be called with -w and -c switches to specify thresholds, +# see the script for details. +[cpu_usage] +label=CPU +interval=10 +min_width=CPU: 100.00% +#separator=false + +#[load_average] +#interval=10 + +# Battery indicator +# +# The battery instance defaults to 0. +[battery] +label=BAT +#label=⚡ +#instance=1 +interval=30 + +# Date Time +# +[time] +command=date '+%Y-%m-%d %H:%M:%S' +interval=5 + diff --git a/_i3/i3status.conf b/_i3/i3status.conf new file mode 100644 index 0000000..9a41923 --- /dev/null +++ b/_i3/i3status.conf @@ -0,0 +1,76 @@ +# ~/.i3status.conf +# i3status configuration file. +# see "man i3status" for documentation. + +# It is important that this file is edited as UTF-8. +# The following line should contain a sharp s: +# ß +# If the above line is not correctly displayed, fix your editor first! + +general { + colors = true + color_good = '#88b090' + color_degraded = '#ccdc90' + color_bad = '#e89393' + interval = 3 + # output format (i3bar|dzen2|xmobar|none) + output_format = 'i3bar' +} + +order += "volume master" +#order += "ipv6" +order += "disk /" +#order += "run_watch DHCP" +#order += "run_watch VPN" +#order += "wireless wlp3s0" +order += "ethernet eth0" +order += "battery 0" +order += "load" +order += "tztime local" + +volume master { + format = "%volume" + device = "default" + mixer = "Master" + mixer_idx = 0 +} + +#wireless wlp3s0 { +# #format_up = "W: (%quality at %essid) %ip" +# format_up = "%essid(%ip)" +# format_down = "down" +#} + +ethernet eth0 { + # if you use %speed, i3status requires root privileges + format_up = "E: %ip" + format_down = "E: down" +} + +battery 0 { + format = "%status %percentage %remaining" +} + +run_watch DHCP { + #pidfile = "/var/run/dhclient*.pid" + pidfile = "/var/run/dhcpd*.pid" +} + +run_watch VPN { + pidfile = "/var/run/vpnc/pid" +} + +tztime local { + #format = "%Y-%m-%d %H:%M:%S" + format = "%m-%d|%H:%M" +} + +load { + format = "%1min" +} + +disk "/" { + format = "%free" +} + +# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=conf: # diff --git a/_i3/images/wallpaper.png b/_i3/images/wallpaper.png new file mode 100644 index 0000000..468b1a9 Binary files /dev/null and b/_i3/images/wallpaper.png differ diff --git a/_i3/scripts/i3exit.sh b/_i3/scripts/i3exit.sh new file mode 100755 index 0000000..3616139 --- /dev/null +++ b/_i3/scripts/i3exit.sh @@ -0,0 +1,43 @@ +#!/bin/sh +# +# exit script used in i3 wm +# + +PNG_IMAGE="~/.i3/images/wallpaper.png" + +lock() { + if [ -f ${PNG_IMAGE} ]; then + i3lock -d -ti "${PNG_IMAGE}" + else + i3lock -d -c 000000 + fi +} + +case "$1" in + lock) + lock + ;; + logout) + i3-msg exit + ;; + suspend) + lock + dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Suspend + ;; + hibernate) + lock + dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Hibernate + ;; + reboot) + dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart + ;; + shutdown) + dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop + ;; + *) + echo "Usage: $0 {lock|logout|suspend|hibernate|reboot|shutdown}" + exit 2 +esac + +exit 0 + diff --git a/_inputrc b/_inputrc new file mode 100644 index 0000000..7d93f5d --- /dev/null +++ b/_inputrc @@ -0,0 +1,30 @@ +# +# ~/.inputrc +# +# readline configurations +# +# Reference: +# [1] ArchWiki - Readline +# https://wiki.archlinux.org/index.php/Readline +# +# Aaron LI +# 2015-09-26 +# + +#$include /etc/inputrc + +# vi mode +set editing-mode vi +$if mode=vi +set keymap vi-command +# these are for vi-command mode +"\e[A": history-search-backward +"\e[B": history-search-forward +set keymap vi-insert +# these are for vi-insert mode +"\e[A": history-search-backward +"\e[B": history-search-forward +$endif + + +# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=readline: # diff --git a/_lftprc b/_lftprc new file mode 100644 index 0000000..199415d --- /dev/null +++ b/_lftprc @@ -0,0 +1,112 @@ +## +## lftp config file +## ~/.lftp/rc +## ~/.lftprc +## +## LIweitiaNux +## August 16, 2012 +## +## Ref: http://ihavanna.org/linux/225 +## + + +## debug +#debug 3 + +## character settings {{{ +set ftp:charset GBK +set sftp:charset UTF-8 +set file:charset UTF-8 +## charset }}} + +## alias {{{ +alias nocharset "set ftp:charset; set file:charset" +alias gbk "set ftp:charset GBK; set file:charset UTF-8" +alias utf8 "set ftp:charset UTF-8; set file:charset UTF-8" + +alias reconnect "close; cache flush; cd ." +alias passive "set ftp:passive-mode" +## alias }}} + +## settings {{{ +# history +set cmd:csh-history on + +# default protocol selection +set default-protocol/ftp.* ftp +set default-protocol/www.* http +set default-protocol/localhost file + +# passive mode +set ftp:passive-mode yes + +# pget +set pget:default-n 5 + +# makes lftp faster but doesn't work with some sites/routers +# set ftp:sync-mode off + +# ssl +set ftp:ssl-protect-data yes +#set ftp:ssl-allow no +#set ftp:ssl-force no +# for sites use ssl, but NOT purchase a proper SSL +# NOTE: Middle-man attacks +# Ref: http://rajaseelan.com/2011/12/18/lftp-fatal-error-certificate-verification-not-trusted/ +set ssl:verify-certificate no + +## settings }}} + +## appearance {{{ +# make prompt look better +# colors (contributed by Matthew ) +set prompt "\[\e[0;33m\][\[\e[0;34m\]f\[\e[1m\]t\[\e[37m\]p\[\e[0;33m\]] \[\e[1;32m\]\u\[\e[0;33m\]\@\[\e[1;31m\]\h\[\e[0;33m\]:\[\e[1;34m\]\w\[\e[0;33m\] >\[\e[0m\] " +# Uncomment the following two lines to make switch cls and ls, making +# cls the default. +alias ls command cls +alias hostls command 'ls --color' + +# Terminal strings to set titlebars for terminals that don't +# properly specify tsl and fsl capabilities. +# Use cmd:set-term-status to enable this. +set cmd:term-status/*screen* "\e_\T\e\\" +set cmd:term-status/*xterm* "\e[11;0]\e]2;\T\007\e[11]" +set cmd:term-status/*rxvt* "\e[11;0]\e]2;\T\007\e[11]" +set cmd:set-term-status on +## appearance }}} + +## proxy {{{ +# Proxy can help to pass a firewall +# Environment variables ftp_proxy, http_proxy and no_proxy are used to +# initialize the below variables automatically. You can set them here too. +# +# ftp:proxy must communicate with client over ftp protocol, squid won't do. +# This can be e.g. TIS-FWTK or rftpd. User and password are optional. +# set ftp:proxy ftp://[user:pass@]your_ftp_proxy:port +# ...but squid still can be used to access ftp servers, using hftp protocol: +# set ftp:proxy http://your.squid.address:port +# ...if squid allows CONNECT to arbitrary ports, then you can use CONNECT +# instead of hftp: +# set ftp:use-hftp no + +# no proxy for host +# set ftp:proxy/local_host "" +# or domain +# set ftp:proxy/*.domain.com ... + +# http:proxy must communicate with client over http protocol, e.g. squid. +# Default port is 3128. +# set http:proxy your_http_proxy[:port] +# hftp:proxy must also be an http proxy. It is used for FTP over HTTP access. +# set hftp:proxy your_http_proxy[:port] + +# net:no-proxy disables proxy usage for list of domains. +# set net:no-proxy .domain.com,.otherdom.net + +# If you don't have direct ftp access, this setting can be useful to select +# hftp instead of ftp automatically. +# set ftp:proxy http://your.http.proxy:port +## proxy }}} + + +# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=lftp: # diff --git a/_mpdconf b/_mpdconf new file mode 120000 index 0000000..f3e7d2b --- /dev/null +++ b/_mpdconf @@ -0,0 +1 @@ +linux/_mpdconf \ No newline at end of file diff --git a/_mutt/attachments b/_mutt/attachments new file mode 100644 index 0000000..74575de --- /dev/null +++ b/_mutt/attachments @@ -0,0 +1,64 @@ +## +## Mutt attchment searching and counting configuration +## +## Weitian Li +## 2012/02/08 +## +## Ref: file:///usr/local/share/doc/mutt/html/mimesupport.html +## + +# Removing a pattern from a list removes that pattern literally. It +# does not remove any type matching the pattern. +# +# attachments +A */.* +# attachments +A image/jpeg +# unattachments +A */.* +# +# This leaves "attached" image/jpeg files on the allowed attachments +# list. It does not remove all items, as you might expect, because the +# second */.* is not a matching expression at this time. +# +# Remember: "unattachments" only undoes what "attachments" has done! +# It does not trigger any matching on actual messages. + +# Qualify any MIME part with an "attachment" disposition, EXCEPT for +# text/x-vcard and application/pgp parts. (PGP parts are already known +# to mutt, and can be searched for with ~g, ~G, and ~k.) +# +# I've added x-pkcs7 to this, since it functions (for S/MIME) +# analogously to PGP signature attachments. S/MIME isn't supported +# in a stock mutt build, but we can still treat it specially here. +# + +attachments +A */.* +attachments -A text/x-vcard application/pgp.* +attachments -A application/x-pkcs7-.* + + +# Discount all MIME parts with an "inline" disposition, unless they're +# text/plain. (Why inline a text/plain part unless it's external to the +# message flow?) + +attachments +I text/plain + + +# These two lines make Mutt qualify MIME containers. (So, for example, +# a message/rfc822 forward will count as an attachment.) The first +# line is unnecessary if you already have "attach-allow */.*", of +# course. These are off by default! The MIME elements contained +# within a message/* or multipart/* are still examined, even if the +# containers themselves don't qualify. + +#attachments +A message/.* multipart/.* +#attachments +I message/.* multipart/.* + + +## You probably don't really care to know about deleted attachments. +attachments -A message/external-body +attachments -I message/external-body + +## Then entering the command “attachments ?” as a command will list +## your current settings in Muttrc format, so that it can be pasted +## elsewhere. + +# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=muttrc: # diff --git a/_mutt/colors b/_mutt/colors new file mode 100644 index 0000000..de2f902 --- /dev/null +++ b/_mutt/colors @@ -0,0 +1,129 @@ +## +## Color settings for mutt. +## +## Weitian LI +## 2015/02/02 +## +## Ref: http://aperiodic.net/phil/configs/mutt/colors +## + +# Default color definitions +color normal white default +color hdrdefault green default +color quoted green default +color quoted1 yellow default +color quoted2 blue default +color signature cyan default +color indicator brightwhite blue +color error brightred default +color status brightblue black +color tree brightmagenta default +color tilde blue default +color attachment brightyellow default +color markers brightblue default +color message white default +color search brightwhite magenta +color bold brightyellow default + +# Color definitions when on a mono screen +mono bold bold +mono underline underline +mono indicator reverse +mono error bold + +# Colors for items in the header +color header brightmagenta default "^(From|Subject):" +color header brightyellow default "^Date:" +color header brightblue default "^To:" +color header brightcyan default "^Cc:" +color header brightblue default "^X-Label:" +mono header bold "^(From|Subject):" + + +# Many of these formulas were stolen from Jeremy Blosser +# These would be much simpler if colors were additive. + +# regular new messages +color index brightwhite default "~N !~T !~F !~p !~P" +# regular tagged messages +color index brightcyan default "~T !~F !~p !~P" +# regular flagged messages +color index brightblue default "~F !~p !~P" +# messages to me +color index yellow default "~p !~N !~T !~F !~P" +color index brightblue default "~p ~N !~T !~F !~P" +color index black cyan "~p ~T !~F !~P" +color index black magenta "~p ~F !~P" +# messages from me +color index green default "~P !~N !~T !~F" +color index brightblue default "~P ~N !~T !~F" +color index black cyan "~P ~T !~F" +color index black magenta "~P ~F" +# messages which mention my name in the body +#color index yellow default "~b \"([Ww]eitian|[Aa]ly|ly)\" !~N !~T !~F !~p !~P" +#color index brightyellow white "~b \"([Ww]eitian|[Aa]ly|ly)\" ~N !~T !~F !~p !~P" +#color index yellow cyan "~b \"([Ww]eitian|[Aa]ly|ly)\" ~T !~F !~p !~P" +#color index yellow red "~b \"([Ww]eitian|[Aa]ly|ly)\" ~F !~p !~P" +# messages which are in reference to my mails +#color index magenta default "~x \"(liweitianux|aaronly.me)@\" !~N !~T !~F !~p !~P" +#color index magenta white "~x \"(liweitianux|aaronly.me)@\" ~N !~T !~F !~p !~P" +#color index magenta cyan "~x \"(liweitianux|aaronly.me)@\" ~T !~F !~p !~P" +#color index magenta blue "~x \"(liweitianux|aaronly.me)@\" ~F !~p !~P" +# messages to root, etc. +color index cyan default "~C \"(root|postmaster|abuse|mailer-daemon)@\" !~N !~P !~p" +color index cyan white "~C \"(root|postmaster|abuse|mailer-daemon)@\" ~N !~P !~p" +# big messages +color index red default "!~N ~z 10485760-" +color index red cyan "~T !~F !~p !~P ~z 10485760-" +color index red white "~N ~z 10485760-" + +# deleted messages +color index brightred default "!~N ~D" +color index brightred white "~N ~D" + + +## Highlights inside the body of a message. + +# Attribution lines +color body magenta default "\\* [^<]+ <[^>]+> \\[[^]]+\\]:" +color body magenta default "(^|[^[:alnum:]])on [a-z0-9 ,]+( at [a-z0-9:,. +-]+)? wrote:" + +# URLs +color body brightyellow default "([a-z][a-z0-9+-]*://(((([a-z0-9_.!~*'();:&=+$,-]|%[0-9a-f][0-9a-f])*@)?((([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?|[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)(:[0-9]+)?)|([a-z0-9_.!~*'()$,;:@&=+-]|%[0-9a-f][0-9a-f])+)(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?(#([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?|(www|ftp)\\.(([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?(:[0-9]+)?(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?(#([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?)[^].,:;!)? \t\r\n<>\"]" + +# email addresses +color body brightmagenta default "((@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\]),)*@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\]):)?[0-9a-z_.+%$-]+@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\])" + +# PGP messages +color body brightblue default "^gpg: Good signature .*" +color body white default "^gpg: " +color body brightwhite red "^gpg: BAD signature from.*" +mono body bold "^gpg: Good signature" +mono body bold "^gpg: BAD signature from.*" + +# *bold* +color body brightblue default "(^|[[:space:][:punct:]])\\*[^*]+\\*([[:space:][:punct:]]|$)" +mono body bold "(^|[[:space:][:punct:]])\\*[^*]+\\*([[:space:][:punct:]]|$)" +# _underline_ +color body brightblue default "(^|[[:space:][:punct:]])_[^_]+_([[:space:][:punct:]]|$)" +mono body underline "(^|[[:space:][:punct:]])_[^_]+_([[:space:][:punct:]]|$)" +# /italic/ (sometimes gets directory names) +color body brightblue default "(^|[[:space:][:punct:]])/[^/]+/([[:space:][:punct:]]|$)" +mono body underline "(^|[[:space:][:punct:]])/[^/]+/([[:space:][:punct:]]|$)" + +# Various smilies and the like +color body brightwhite default "<[Gg]>" # +color body brightwhite default "<[Bb][Gg]>" # +color body brightwhite default " [;:]-*[})>{(<|]" # :-) etc... + +# Border lines. +color body blue default "( *[-+=#*~_]){6,}" + +## Custom highlights +# arXiv number +color body brightyellow default "(^|[[:space:]])arXiv:[[:space:]0-9\.]+$" +# arXiv title +color body brightwhite default "(^|[[:space:]])Title:\ .+$" + + +# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=muttrc: # diff --git a/_mutt/compose.rc b/_mutt/compose.rc new file mode 100644 index 0000000..f2645d8 --- /dev/null +++ b/_mutt/compose.rc @@ -0,0 +1,15 @@ +# read main config +source ~/.mutt/muttrc + +# remove hooks, headers and sig, they are already in the draft +unhook send-hook +unset signature +unmy_hdr * + +set edit_headers # show headers when composing + +# call the right editor immediately +set autoedit +set editor = "vim +/^$/+1 -c 'set ft=mail enc=utf-8 tw=72'" + +# vim: set ts=8 sw=4 tw=0 fenc= ft=muttrc: # diff --git a/_mutt/compose.sh b/_mutt/compose.sh new file mode 100755 index 0000000..9172421 --- /dev/null +++ b/_mutt/compose.sh @@ -0,0 +1,14 @@ +#!/bin/sh +# +# Compose mail in new tmux/screen window. +# +# Reference: +# [1] Multi-window Mutt with Screen +# http://op-co.de/blog/posts/mulit-window_mutt/ +# + +# set the screen window title to the message receiver +#awk -F 'To: ' '/^To:/ { print "\033k" $2 "\033\\" }' "$1" + +mutt -F ~/.mutt/compose.rc -H "$1" +rm "$1" diff --git a/_mutt/excel2text.sh b/_mutt/excel2text.sh new file mode 100755 index 0000000..c3d0f14 --- /dev/null +++ b/_mutt/excel2text.sh @@ -0,0 +1,31 @@ +#!/bin/sh +# +# excel2text - convert MS Excel files to ASCII text +# +# Written by Gary Johnson . +# +# Modification History: +# 2003-02-19 +# Changed the name xlHtml to xlhtml to match the xlhtml-0.5 +# release. + +prog=${0##*/} + +if [ $# -ne 1 ] +then + echo "Usage: $prog file" >&2 + exit 2 +fi + +xlhtml -te "$1" | +perl -pe 's/>-{21,}
    tags so + # that these lines adapt to the + # width of the cell. "21" is a + # value that works for the + # tables I'm sent. +w3m -dump -T text/html | +perl -pe ' + s/\xa0/ /gs; # Change A0 spaces to ASCII + # spaces. +' diff --git a/_mutt/gpg.rc b/_mutt/gpg.rc new file mode 100644 index 0000000..e918768 --- /dev/null +++ b/_mutt/gpg.rc @@ -0,0 +1,108 @@ +## +## Mutt GPG configuration +## -*-muttrc-*- +## +## Weitian LI +## 2015/02/02 +## +## Reference: +## [1] A Quick Guide to Mutt #GPG +## http://srobb.net/mutt.html#GPG +## [2] Encrypting Mutt +## http://jasonwryan.com/blog/2013/07/20/gnupg/ +## + +# %p The empty string when no passphrase is needed, +# the string "PGPPASSFD=0" if one is needed. +# +# %f Most PGP commands operate on a single file or a file +# containing a message. %f expands to this file's name. +# +# %s When verifying signatures, there is another temporary file +# containing the detached signature. %s expands to this +# file's name. +# +# %a In "signing" contexts, this expands to the value of the +# configuration variable $pgp_sign_as. You probably need to +# use this within a conditional % sequence. +# +# %r In many contexts, mutt passes key IDs to pgp. %r expands to +# a list of key IDs. + +# Note that we explicitly set the comment armor header since GnuPG, +# when used in some localiaztion environments, generates 8bit data +# in that header, thereby breaking PGP/MIME. + +# Decode application/pgp +set pgp_decode_command="gpg2 --status-fd=2 %?p?--passphrase-fd 0? --no-verbose --quiet --batch --output - %f" + +# Verify a pgp/mime signature +set pgp_verify_command="gpg2 --status-fd=2 --no-verbose --quiet --batch --output - --verify %s %f" + +# Decrypt a pgp/mime attachment +set pgp_decrypt_command="gpg2 --status-fd=2 %?p?--passphrase-fd 0? --no-verbose --quiet --batch --output - %f" + +# Create a pgp/mime signed attachment +set pgp_sign_command="gpg2 --no-verbose --batch --quiet --output - %?p?--passphrase-fd 0? --armor --detach-sign --textmode %?a?-u %a? %f" + +# Create a application/pgp signed (old-style) message +set pgp_clearsign_command="gpg2 --no-verbose --batch --quiet --output - %?p?--passphrase-fd 0? --armor --textmode --clearsign %?a?-u %a? %f" + +# Create a pgp/mime encrypted attachment +set pgp_encrypt_only_command="pgpewrap gpg2 --batch --quiet --no-verbose --output - --encrypt --textmode --armor --always-trust -- -r %r -- %f" + +# Create a pgp/mime encrypted and signed attachment +set pgp_encrypt_sign_command="pgpewrap gpg2 %?p?--passphrase-fd 0? --batch --quiet --no-verbose --textmode --output - --encrypt --sign %?a?-u %a? --armor --always-trust -- -r %r -- %f" + +# Import a key into the public key ring +set pgp_import_command="gpg2 --no-verbose --import %f" + +# Export a key from the public key ring +set pgp_export_command="gpg2 --no-verbose --export --armor %r" + +# Verify a key +set pgp_verify_key_command="gpg2 --verbose --batch --fingerprint --check-sigs %r" + +# Read in the public key ring +set pgp_list_pubring_command="gpg2 --no-verbose --batch --quiet --with-colons --list-keys %r" + +# Read in the secret key ring +set pgp_list_secring_command="gpg2 --no-verbose --batch --quiet --with-colons --list-secret-keys %r" + +# Fetch keys +# set pgp_getkeys_command="pkspxycwrap %r" + +# Use gpg-agent +set pgp_use_gpg_agent + +# This set the number of seconds to keep in memory the passpharse +# used to encrypt/sign the more the less secure it will be +set pgp_timeout=1800 + +# Pattern for good signature - may need to be adapted to locale! +# +# It's a regexp used against the GPG output: if it matches some line of the output +# then mutt considers the message a good signed one (ignoring the GPG exit code) +set pgp_good_sign="^gpg: Good signature from" +# set pgp_good_sign="^gpgv?: Good signature from " +# OK, here's a version which uses gnupg's message catalog: +# set pgp_good_sign="`gettext -d gnupg -s 'Good signature from "' | tr -d '"'`" +# This version uses --status-fd messages +# set pgp_good_sign="^\\[GNUPG:\\] GOODSIG" + +# Automatically sign all outcoming messages +set crypt_autosign +# Sign only replies to signed messages +#set crypt_replysign + +# Automatically encrypt outcoming messages +#set crypt_autoencrypt +# Encrypt only replies to signed messages +set crypt_replyencrypt +# encrypt and sign replies to encrypted messages +#set crypt_replysignencrypted + +# Automatically verify the sign of a message when opened +set crypt_verify_sig + +# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=muttrc: # diff --git a/_mutt/mailcap b/_mutt/mailcap new file mode 100644 index 0000000..0ec3d81 --- /dev/null +++ b/_mutt/mailcap @@ -0,0 +1,119 @@ +# +# mailcap - MIME configuration file +# +# Reference: +# [1] Gray Johnson's Mutt Page +# http://www.spocom.com/users/gjohnson/mutt/ +# +# Modified: 2015/02/02 +# + + +# From the attachment menu, if X is running, HTML attachments are sent +# to netscape for viewing; otherwise, they are sent to w3m. For +# in-line viewing, the HTML is converted to text. +# +# [Comment-out next line so that we can use w3m even within X.] +#text/html; mutt_netscape %s; test=RunningX +text/html; w3m -T text/html -I %{charset} -dump %s; \ + nametemplate=%s.html; copiousoutput + +# Add capability to edit attachments from the compose menu. +# +# Mutt can only edit attachments if they have a mailcap edit entry. +# (This would be a good thing to fix.) However, a mailcap entry +# apparently must include the display function--it can't be defaulted. +# The combination "cat; copiousoutput" comes close to the default in +# that in invokes the default pager on the output of cat. However, +# there is apparently no way to specify the default editor--a shell +# environment variable such as $VISUAL or $EDITOR is as close as we can +# get. +# +text/plain; ~/.mutt/mutt_bgrun.sh gvim -f %s; \ + test=sh -c 'test -n "${DISPLAY}"' +text/plain; vim %s +text/*; cat; copiousoutput; edit=$EDITOR %s + +message/rfc822; cat; copiousoutput; edit=$EDITOR %s + +# The following Microsoft application MIME attachments are viewed from +# the attachment menu using LibreOffice. +# +application/msword; ~/.mutt/mutt_bgrun.sh libreoffice %s; \ + test=sh -c 'test -n "${DISPLAY}"' +application/msword; word2text %s; copiousoutput +application/vnd.msword; ~/.mutt/mutt_bgrun.sh libreoffice %s; \ + test=sh -c 'test -n "${DISPLAY}"' +application/vnd.msword; word2text %s; copiousoutput +application/vnd.openxmlformats-officedocument.wordprocessingml.document; \ + ~/.mutt/mutt_bgrun.sh libreoffice %s; \ + test=sh -c 'test -n "${DISPLAY}"' +# +application/excel; ~/.mutt/mutt_bgrun.sh libreoffice %s; \ + test=sh -c 'test -n "${DISPLAY}"' +application/excel; excel2text %s; copiousoutput +application/msexcel; ~/.mutt/mutt_bgrun.sh libreoffice %s; \ + test=sh -c 'test -n "${DISPLAY}"' +application/msexcel; excel2text %s; copiousoutput +application/vnd.ms-excel; ~/.mutt/mutt_bgrun.sh libreoffice %s; \ + test=sh -c 'test -n "${DISPLAY}"' +application/vnd.ms-excel; excel2text %s; copiousoutput +application/x-excel; ~/.mutt/mutt_bgrun.sh libreoffice %s; \ + test=sh -c 'test -n "${DISPLAY}"' +application/x-excel; excel2text %s; copiousoutput +application/x-msexcel; ~/.mutt/mutt_bgrun.sh libreoffice %s; \ + test=sh -c 'test -n "${DISPLAY}"' +application/x-msexcel; excel2text %s; copiousoutput +application/ms-Excel; ~/.mutt/mutt_bgrun.sh libreoffice %s; \ + test=sh -c 'test -n "${DISPLAY}"' +application/ms-Excel; excel2text %s; copiousoutput +# +application/vnd.ms-powerpoint; ~/.mutt/mutt_bgrun.sh libreoffice %s; \ + test=sh -c 'test -n "${DISPLAY}"' +application/vnd.ms-powerpoint; ppt2text %s; copiousoutput +application/x-mspowerpoint; ~/.mutt/mutt_bgrun.sh libreoffice %s; \ + test=sh -c 'test -n "${DISPLAY}"' +application/x-mspowerpoint; ppt2text %s; copiousoutput +application/ppt; ~/.mutt/mutt_bgrun.sh libreoffice %s; \ + test=sh -c 'test -n "${DISPLAY}"' +application/ppt; ppt2text %s; copiousoutput + + +application/pdf; ~/.mutt/mutt_bgrun.sh evince %s; \ + test=sh -c 'test -n "${DISPLAY}"' +application/pdf; pdftotext %s -; copiousoutput + +application/postscript; ~/.mutt/mutt_bgrun.sh evince %s; \ + test=sh -c 'test -n "${DISPLAY}"' +application/postscript; ps2ascii %s; copiousoutput + +application/rtf; ~/.mutt/mutt_bgrun.sh libreoffice %s; \ + test=sh -c 'test -n "${DISPLAY}"' +application/rtf; rtf2text %s; copiousoutput + +#application/ms-tnef; tnef -w %s + +#application/octet-stream; mutt_octet_view -x %s; test=RunningX +#application/octet-stream; mutt_octet_view -v %s +#application/octet-stream; mutt_octet_view %s; copiousoutput + +image/*; ~/.mutt/mutt_bgrun.sh feh %s; \ + test=sh -c 'test -n "${DISPLAY}"' + +video/*; ~/.mutt/mutt_bgrun.sh vlc %s; \ + test=sh -c 'test -n "${DISPLAY}"' + +# Open scripts +application/x-shellscript; ~/.mutt/mutt_bgrun.sh gvim -f %s; \ + test=sh -c 'test -n "${DISPLAY}"' +application/x-shellscript; vim %s + +# Show archive conents. +# +application/x-compressed-tar; tar -tf %s; copiousoutput +application/x-bzip-compressed-tar; \ + bunzip2 -c %s | tar -tf -; copiousoutput +application/x-tar-gz; gunzip -c %s | tar -tf -; copiousoutput +application/x-7z-compressed; 7z l %s; copiousoutput + +# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=mailcap: # diff --git a/_mutt/mutt-notmuch.py b/_mutt/mutt-notmuch.py new file mode 100755 index 0000000..880b987 --- /dev/null +++ b/_mutt/mutt-notmuch.py @@ -0,0 +1,120 @@ +#!/usr/bin/env python3 +""" +mutt-notmuch-py + +This is a Gmail-only version of the original mutt-notmuch script. + +It will interactively ask you for a search query and then symlink the matching +messages to $HOME/.cache/mutt_results. + +Add this to your muttrc. + +macro index / "unset wait_keymutt-notmuch-py~/.cache/mutt_results" \ + "search mail (using notmuch)" + +This script overrides the $HOME/.cache/mutt_results each time you run a query. + +Install this by adding this file somewhere on your PATH. + +Tested on OSX Lion and Arch Linux. + +(c) 2012 - Honza Pokorny +Licensed under BSD +""" + +""" +ChangeLogs: +2015/02/02: Weitian LI + * replaced 'commands.getoutput' with 'subprocess' + * replaced 'raw_input' with 'input' + * fixed digest() with an Unicode encoding bug + * updated to use python 3.x +""" + +import os +import hashlib +import subprocess + +from mailbox import Maildir +from optparse import OptionParser +from collections import defaultdict + + +def digest(filename): + # Require python 3.x + with open(filename) as f: + return hashlib.sha1(f.read().encode('utf-8')).hexdigest() + + +def pick_all_mail(messages): + for m in messages: + if 'All Mail' in m: + return m + + +def empty_dir(directory): + box = Maildir(directory) + box.clear() + + +def command(cmd): + return subprocess.check_output(cmd, shell=True) + + +def main(dest_box, is_gmail): + query = input('Query: ') + + command('test -d %s/cur || mkdir -p %s/cur' % (dest_box, dest_box)) + command('test -d %s/new || mkdir -p %s/new' % (dest_box, dest_box)) + + empty_dir(dest_box) + + output = command('notmuch search --output=files %s' % query) + files = output.decode(encoding='UTF-8').split('\n') + + data = defaultdict(list) + messages = [] + + for f in files: + if not f: + continue + + try: + sha = digest(f) + data[sha].append(f) + except IOError: + print('File %s does not exist' % f) + + for sha in data: + if is_gmail and len(data[sha]) > 1: + messages.append(pick_all_mail(data[sha])) + else: + messages.append(data[sha][0]) + + for m in messages: + if not m: + continue + + target = os.path.join(dest_box, 'cur', os.path.basename(m)) + if not os.path.exists(target): + os.symlink(m, target) + + +if __name__ == '__main__': + p = OptionParser("usage: %prog [OPTIONS] [RESULTDIR]") + p.add_option('-g', '--gmail', dest='gmail', + action='store_true', default=True, + help='gmail-specific behavior') + p.add_option('-G', '--not-gmail', dest='gmail', + action='store_false', + help='gmail-specific behavior') + (options, args) = p.parse_args() + + if args: + dest = args[0] + else: + dest = '~/.cache/mutt_results' + + # Use expanduser() so that os.symlink() won't get weirded out by tildes. + main(os.path.expanduser(dest).rstrip('/'), options.gmail) + diff --git a/_mutt/mutt-xlabel.py b/_mutt/mutt-xlabel.py new file mode 100755 index 0000000..ea96e37 --- /dev/null +++ b/_mutt/mutt-xlabel.py @@ -0,0 +1,164 @@ +#!/usr/bin/env python3 +# +# Add/Modify 'X-Label' header for mutt. +# Label mails with mutt. +# +# Reference: +# [1] GTD (Getting Things Done) and Mutt +# https://docwhat.org/gtd-and-mutt/ +# +# muttrc settings: +# unignore X-Label: +# macro index,pager x 'set my_oldeditor=$editorset editor="~/.mutt/mutt-xlabel.py"Nset editor=$my_oldeditor' \ +# "edit X-Label" +# macro index \Cx "~y " \ +# "limit view to label" +# +# Weitian LI +# 2015/02/06 +# + +import sys +import os +import email +import readline + + +# Settings +HISTFILE = os.path.join(os.environ["HOME"], ".mutt/xlabel_history") +LABELFILE = os.path.join(os.environ["HOME"], ".mutt/xlabels") + + +class MyCompleter(object): + """ + Comstom completer for readline. + + Reference: + [1] autocomplete - How to code autocompletion in python? + http://stackoverflow.com/a/7821956 + """ + def __init__(self, options): + self.options = sorted(options) + + def complete(self, text, state): + if state == 0: # on first trigger, build possible matches + if text: # cache matches (entries that start with entered text) + self.matches = [s for s in self.options + if s and s.startswith(text)] + else: # no text entered, all matches possible + self.matches = self.options[:] + + # return match indexed by state + try: + return self.matches[state] + except IndexError: + return None + + +def my_input(prompt, default=None, completer=None): + if default is not None: + def pre_input_hook(): + readline.insert_text(default) + readline.redisplay() + readline.set_pre_input_hook(pre_input_hook) + # completer + if completer: + readline.set_completer(completer) + readline.parse_and_bind('tab: complete') + return input(prompt) + + +def load_labels(labelfile): + """ + Load saved labels from given labelfile, + return a list of labels. + """ + try: + with open(labelfile, 'r') as f: + label_list = f.read().split() + label_list = list(set(label_list)) + except FileNotFoundError: + label_list = [] + return label_list + + +def update_labels(labelfile, label_list, new_label_list): + """ + Save labels for later autocompletion. + """ + labels = sorted(list(set(label_list).union(set(new_label_list)))) + with open(labelfile, 'w') as f: + f.write(' '.join(labels)) + + +def get_xlabel(message): + """ + Get 'X-Label:' values from given Message object. + """ + labels = message.get_all('X-Label') + if labels: + label_str = ' '.join(labels) + else: + label_str = '' + # remove duplicates and sort + label_list = sorted(list(set(label_str.split()))) + return label_list + + +def write_xlabel(message, old_label_list, new_label_list, outfile): + """ + Update 'X-Label' value of given Message object; + then write Message object to outfile. + """ + # remove duplicates and sort + new_label_list = sorted(list(set(new_label_list))) + if set(old_label_list) != set(new_label_list): + # delete original 'X-Label' header (all occurences) + del message['X-Label'] + # add new 'X-Label' header + message['X-Label'] = ' '.join(new_label_list) + # write to outfile (Just OVERWRITE, OK??) + fp_out = open(outfile, 'w') + fp_out.write(message.as_string()) + fp_out.close() + + +def main(): + if len(sys.argv) != 2 and len(sys.argv) != 3: + print("Usage: %s [ outmail ]" % sys.argv[0]) + sys.exit(1) + + inmail = sys.argv[1] + if len(sys.argv) == 3: + outmail = sys.argv[2] + else: + outmail = inmail + + if hasattr(readline, 'read_history_file'): + try: + readline.read_history_file(HISTFILE) + except IOError: + pass + + # get all recorded labels for readline autocompletion + all_labels = load_labels(LABELFILE) + completer = MyCompleter(all_labels) + + # open mail and create email.message.Message object + msg = email.message_from_file(open(inmail, 'r')) + # get original labels + label_list = get_xlabel(msg) + # get user provided labels + new_label = my_input(prompt='X-Label: ', default=' '.join(label_list), + completer=completer.complete) + # write new labels to mail + write_xlabel(msg, label_list, new_label.split(), outmail) + # save readline history + readline.write_history_file(HISTFILE) + # save labels + update_labels(LABELFILE, all_labels, new_label.split()) + + +if "__main__" == __name__: + main() + diff --git a/_mutt/mutt_bgrun.sh b/_mutt/mutt_bgrun.sh new file mode 100755 index 0000000..0b2c651 --- /dev/null +++ b/_mutt/mutt_bgrun.sh @@ -0,0 +1,118 @@ +#!/bin/sh +# @(#) mutt_bgrun $Revision: 1.4 $ + +# mutt_bgrun - run an attachment viewer from mutt in the background +# Copyright (C) 1999-2002 Gary A. Johnson +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# SYNOPSIS +# mutt_bgrun viewer [viewer options] file +# +# DESCRIPTION +# Mutt invokes external attachment viewers by writing the +# attachment to a temporary file, executing the pipeline specified +# for that attachment type in the mailcap file, waiting for the +# pipeline to terminate, writing nulls over the temporary file, +# then deleting it. This causes problems when using graphical +# viewers such as qvpview and acroread to view attachments. +# +# If qvpview, for example, is executed in the foreground, the mutt +# user interface is hung until qvpview exits, so the user can't do +# anything else with mutt until he or she finishes reading the +# attachment and exits qvpview. This is especially annoying when +# a message contains several MS Office attachments--one would like +# to have them all open at once. +# +# If qvpview is executed in the background, it must be given +# enough time to completely read the file before returning control +# to mutt, since mutt will then obliterate the file. Qvpview is +# so slow that this time can exceed 20 seconds, and the bound is +# unknown. So this is again annoying. +# +# The solution provided here is to invoke the specified viewer +# from this script after first copying mutt's temporary file to +# another temporary file. This script can then quickly return +# control to mutt while the viewer can take as much time as it +# needs to read and render the attachment. +# +# EXAMPLE +# To use qvpview to view MS Office attachments from mutt, add the +# following lines to mutt's mailcap file. +# +# application/msword; mutt_bgrun qvpview %s +# application/vnd.ms-excel; mutt_bgrun qvpview %s +# application/vnd.ms-powerpoint; mutt_bgrun qvpview %s +# +# AUTHOR +# Gary A. Johnson +# +# +# ACKNOWLEDGEMENTS +# My thanks to the people who have commented on this script and +# offered solutions to shortcomings and bugs, especially Edmund +# GRIMLEY EVANS and Andreas Somogyi +# . + +prog=${0##*/} + +# Check the arguments first. + +if [ "$#" -lt "2" ] +then + echo "usage: $prog viewer [viewer options] file" >&2 + exit 1 +fi + +# Separate the arguments. Assume the first is the viewer, the last is +# the file, and all in between are options to the viewer. + +viewer="$1" +shift + +while [ "$#" -gt "1" ] +do + options="$options $1" + shift +done + +file="$1" + +# Create a temporary directory for our copy of the temporary file. +# +# This is more secure than creating a temporary file in an existing +# directory. + +tmpdir=/tmp/$LOGNAME$$ +umask 077 +mkdir "$tmpdir" || exit 1 +tmpfile="$tmpdir/${file##*/}" +#echo "file: ${file}" > ~/debug.$$.log +#echo "tmpfile: ${tmpfile}" >> ~/debug.$$.log + +# Copy mutt's temporary file to our temporary directory so that we can +# let mutt overwrite and delete it when we exit. + +cp "$file" "$tmpfile" + +# Run the viewer in the background and delete the temporary files when done. + +( + "$viewer" $options "$tmpfile" > /dev/null 2>&1 + rm -f "$tmpfile" + rmdir "$tmpdir" +) & + +# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=sh: # diff --git a/_mutt/mutt_octet_view.sh b/_mutt/mutt_octet_view.sh new file mode 100755 index 0000000..a1e6c6f --- /dev/null +++ b/_mutt/mutt_octet_view.sh @@ -0,0 +1,278 @@ +#!/bin/sh +# @(#) mutt_octet_view $Revision: 1.1 $ + +# mutt_octet_view - select octet-stream e-mail attachment viewer +# Copyright (C) 1997,1998,1999,2000 David A Pearson +# Copyright (C) 2000-2001 Gary A. Johnson +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# Mutt_octet_view is derived from Dave Pearson's mutt.octet.filter +# script (http://www.hagbard.demon.co.uk/archives/mutt.octet.filter). +# Mutt.octet.filter was designed to convert octet-stream e-mail +# attachments to text for use with mutt's auto_view feature. +# Mutt_octet_view extends this capability to use different viewers from +# mutt's attachment menu, including graphical viewers if X is available. +# +# To use mutt_octet_view, put the following lines in your mailcap file: +# +# application/octet-stream; mutt_octet_view -x %s; test=RunningX +# application/octet-stream; mutt_octet_view -v %s +# application/octet-stream; mutt_octet_view %s; copiousoutput +# +# and the following line in your muttrc file: +# +# auto_view application/octet-stream +# +# Mutt_octet_view is not a viewer itself; it only selects external +# viewers based on the attachments' file name suffixes (extensions). +# In addition to any viewers, you will need a copy of the author's +# mutt_bgrun script in order to run X viewers in the background. +# +# Please direct any comments to: +# +# Gary Johnson +# + + +ShowTAR() +{ + tar tvvf "$1" 2> /dev/null +} + +ShowTGZ() +{ + tar tzvvf "$1" 2> /dev/null +} + +ShowTBZ() +{ + bzip2 -dc "$1" | tar -tvv -f- 2> /dev/null +} + +ShowGZIP() +{ + gzip -dc "$1" 2> /dev/null +} + +ShowZIP() +{ + unzip -l "$1" 2> /dev/null +} + +ShowARJ() +{ + unarj l "$1" 2> /dev/null +} + +ShowVCard() +{ + cat "$1" | mutt.vcard.filter +} + +ShowTIF() +{ + tiffinfo "$1" +} + +ShowObject() +{ + nm "$1" +} + +ShowHTML() +{ + w3m -dump "$1" +} + +ShowPDF() +{ + pdftotext "$1" - +} + +Show() +{ + case "$Mode" in + SHOW) + if [ "$2" ] + then + $2 "$1" + elif [ "$3" -o "$4" ] + then + echo "[-- $Prog: file type is unsupported for autoview (use 'v' to view this part) --]" + else + echo "[-- $Prog: file type is unsupported --]" + fi + ;; + VIEW) + if [ "$3" ] + then + $3 "$1" + elif [ "$2" ] + then + $2 "$1" + else + echo "$Prog: file type is unsupported" >&2 + exit 1 + fi + ;; + XVIEW) + if [ "$4" ] + then + mutt_bgrun $4 "$1" || $4 "$1" + elif [ "$3" ] + then + $3 "$1" + elif [ "$2" ] + then + $2 "$1" + else + echo "$Prog: file type is unsupported" >&2 + exit 1 + fi + ;; + *) echo "$Prog: internal error: invalid Mode $Mode" >&2 + exit 2;; + esac +} + +# Initialize variables + +Prog=$(basename "$0") +Mode=SHOW + +# Check option arguments + +while [ $# -gt 0 ] +do + case "$1" in + -t) Mode=SHOW; shift;; + -v) Mode=VIEW; shift;; + -x) Mode=XVIEW; shift;; + -*) echo "$Prog: invalid option $1" >&2; exit 2;; + *) break;; + esac +done + +# Check file argument + +if [ $# -ne 1 ] +then + echo "usage: $Prog [-t|-v|-x] file" + exit 2 +fi + +File=$1 + +# Process file + +# The behavior of mutt_octet_view is governed primarily by the 'Show' +# function, the option argument, and the table below. 'Show' searches +# its arguments for a command that it can use to display File. It +# begins in the table column specified by the option argument -t (the +# default), -v or -x, and searches to the left until it finds a command +# (non-empty string), which it executes. Commands in the right-most +# column are executed in the background and are left to handle their own +# output. Commands in the other two columns are executed in the +# foreground and send their output to stdout. +# +# Here are some examples. +# +# Autoview Text View X View +# (from (from (from +# index attachment attachment +# menu, menu, menu, +# in-line) foreground) background) +# (-t) (-v) (-x) +# ----------- ----------- ----------- +# Func1 "" "" Func1 will be used to display +# file in all cases. This is +# useful when all that is +# required to display the file is +# a simple text transformation. +# +# "" Func2 "" The file will not be displayed +# in the pager output from the +# index menu. Func2 will be used +# to display the file from the +# attachment menu. This is +# useful when the file is to be +# displayed as text, but is not +# normally desired to view it +# along with the rest of the +# message. +# +# "" "" Func3 The file contains graphical +# material that cannot be viewed +# as text. Func3 will be used to +# display the file only from the +# attachment menu and only when X is +# available. Func3 will be run in +# the background so that the user +# can continue to use the mailer +# while the file is displayed. +# +# "" Func2 Func3 The file contents are not +# displayed in-line along with +# the rest of the message because +# the file is typically large. +# Func2 has only text output and +# is used when only a terminal is +# available for output. Func3 +# produces a nicer display when X +# is available. + +case "$File" in + # Autoview Text View X View + # (from (from (from + # index attachment attachment + # menu, menu, menu, + # in-line) foreground) background) + # (-t) (-v) (-x) + # ----------- ----------- ------------- +*.arj | *.ARJ ) Show "$File" "" ShowARJ "" ;; +*.doc | *.DOC ) Show "$File" word2text word2text qvpview ;; +*.gif | *.GIF ) Show "$File" "" "" xv ;; +*.htm | *.HTM ) Show "$File" ShowHTML w3m mutt_netscape ;; +*.html | *.HTML ) Show "$File" ShowHTML w3m mutt_netscape ;; +*.jpeg | *.JPEG ) Show "$File" "" "" xv ;; +*.jpg | *.JPG ) Show "$File" "" "" xv ;; +*.log | *.LOG ) Show "$File" cat less "" ;; +*.o ) Show "$File" "" ShowObject "" ;; +*.pdf | *.PDF ) Show "$File" "" ShowPDF acroread ;; +*.ppt | *.PPT ) Show "$File" "" "" qvpview ;; +*.ps | *.PS ) Show "$File" "" "" ghostview ;; +*.rtf | *.RTF ) Show "$File" "" rtf2text qvpview ;; +*.tar ) Show "$File" "" ShowTAR "" ;; +*.tar.bz2 ) Show "$File" "" ShowTBZ "" ;; +*.tar.gz ) Show "$File" "" ShowTGZ "" ;; +*.tar.Z ) Show "$File" "" ShowTGZ "" ;; +*.tar.z ) Show "$File" "" ShowTGZ "" ;; +*.tbz2 ) Show "$File" "" ShowTBZ "" ;; +*.tgz ) Show "$File" "" ShowTGZ "" ;; +*.tif | *.TIF ) Show "$File" "" ShowTIF xv ;; +*.txt | *.TXT ) Show "$File" cat less "" ;; +*.url | *.URL ) Show "$File" cat w3m "" ;; +*.vcf ) Show "$File" "" ShowVCard "" ;; +*.xls | *.XLS ) Show "$File" excel2text excel2text qvpview ;; +*.Z ) Show "$File" "" ShowGZIP "" ;; +*.z ) Show "$File" "" ShowGZIP "" ;; +*.zip | *.ZIP ) Show "$File" "" ShowZIP "" ;; +*.gz ) Show "$File" "" ShowGZIP "" ;; + # The *.gz entry must follow any other entries ending in + # .gz. +* ) echo "$Prog: file type is unsupported" >&2; exit 1 ;; + +esac diff --git a/_mutt/muttrc b/_mutt/muttrc new file mode 100644 index 0000000..6b369bb --- /dev/null +++ b/_mutt/muttrc @@ -0,0 +1,251 @@ +## +## Mutt configuration +## +## Weitian LI +## 2015/02/02 +## +## Reference: +## [1] The Homely Mutt +## http://stevelosh.com/blog/2012/10/the-homely-mutt/ +## [2] Mutt + offlineimap + notmuch + nottoomuch +## http://blog.tshirtman.fr/2013/3/17/mutt-offlineimap-notmuch-nottoomuch +## [3] ArchWiki - Mutt +## https://wiki.archlinux.org/index.php/Mutt +## [4] Using Two IMAP Accounts in Mutt +## http://pbrisbin.com/posts/two_accounts_in_mutt +## [5] The Mutt E-Mail Client +## http://www.mutt.org/doc/devel/manual.html +## [6] A Quick Guide to Mutt +## http://srobb.net/mutt.html +## [7] Multi-window Mutt with Screen +## http://op-co.de/blog/posts/mulit-window_mutt/ +## [8] Github - proycon/dotfiles - mutt with tmux +## https://github.com/proycon/dotfiles +## + +### Mail boxes +source ~/.mutt/mailboxes # Generated by OfflineIMAP + +### Mail accounts +folder-hook . source ~/.mutt/accounts/default +folder-hook 'gmail-aly.*' source ~/.mutt/accounts/gmail-aly +folder-hook 'gmail-li.*' source ~/.mutt/accounts/gmail-li +folder-hook 'outlook-aly.*' source ~/.mutt/accounts/outlook-aly +folder-hook 'outlook-li.*' source ~/.mutt/accounts/outlook-li +folder-hook 'sjtu.*' source ~/.mutt/accounts/sjtu +folder-hook 'autistici.*' source ~/.mutt/accounts/autistici +# Default account +source ~/.mutt/accounts/default + +### Files and directories +set alias_file = ~/.mutt/aliases +set certificate_file = ~/.mutt/certificates +set mailcap_path = ~/.mutt/mailcap +set history_file = ~/.mutt/history +set header_cache = ~/.mutt/cache/headers +set message_cachedir = ~/.mutt/cache/bodies +set tmpdir = ~/.mutt/tmp + +### General settings +set mbox_type = Maildir +set folder = ~/Mail +set timeout = 3 +set mail_check = 0 +set beep_new +set wrap_search # searches wrap around the end +set copy # always save a copy of outgoing messages +set delete # purge deleted messages without asking +set use_from # always generate the `From:' header field +set quit = ask-no # ask for confirmation when quit mutt +set history = 256 +set save_history = 256 +set sendmail_wait = 0 # Wait forever for sendmail to finish +unset wait_key +unset move +unset confirmappend +unset mark_old + +### Compose view +set editor = "vim +/^$/+1 -c 'set ft=mail enc=utf-8 tw=72'" +set envelope_from # which from? +set sig_dashes # dashes before my 'signature' +set autoedit # go to the editor right away when composing + # set, cannot use 'send-hooks' depend on recipients +set edit_headers # show headers when composing +set askcc # ask for CC: +set fcc_attach # save attachments with the body +set forward_format = "Fwd: %s" +set forward_quote # include message in forwards +set forward_decode # decode when forwarding +set attribution = "On %d, %n wrote:" +set fast_reply # skip to compose when replying +set reply_to # reply to 'Reply to:' field +set reverse_name # reply as whomever it was to +set include # include message in replies +#set postpone # auto postpone message not sent when exit +#set recall # prompt to recall postponed messages +unset mime_forward # forward attachments as part of body + +### Headers +ignore * +unignore from: to: cc: bcc: date: subject: X-Label: +unhdr_order * +hdr_order from: to: cc: date: subject: X-Label: + +### Encoding +set send_charset = "us-ascii:utf-8" +# if no charset given on incoming messages +set assumed_charset = "iso-8859-1:gb2312:gbk:gb18030:utf-8" +set rfc2047_parameters # to fix attachment filename encoding + +### Index view +# first bang ("!") to expand month week names in the C locale +set date_format = "!%a %m/%d %I:%M" +set index_format = "[%Z] %d %2M %-15.15L %4c%?X?[%X]& ? %s" +set folder_format = "%2C %t %N %8s %f" +set sort = threads +set sort_aux = reverse-last-date-received +set uncollapse_jump # don't collapse on an unread message +set sort_re # thread based on regex +set reply_regexp = "^(([Rr][Ee]?(\[[0-9]+\])?: *)?(\[[^]]+\] *)?)*" + +### Status bar +set status_chars = " *%A" +set status_format = "---[ Folder: %f %r ]---[ Msgs:%?M?%M/?%m%?n? New:%n?%?o? Old:%o?%?d? Del:%d?%?F? Flag:%F?%?t? Tag:%t?%?p? Post:%p?%?b? Inc:%b?%?l? %l? ]---%>-(%P)---" + +### Pager +set pager_format = "[%Z] %C/%m: %-20.20n | %s%* -- (%P)" +set pager_index_lines = 8 # number of index lines to show +set pager_context = 8 # number of context lines to show +set pager_stop # don't go to next message automatically +set menu_scroll # scroll in menus +set smart_wrap # don't split words +set tilde # show tildes like in vim +set quote_regexp = "^( {0,4}[>|:#%]| {0,4}[a-z0-9]+[>|]+)+" +unset markers # no ugly '+' signs for wrapped lines +alternative_order text/plain text/enriched text/html + +### Key bindings +bind index i noop +bind index collapse-thread +bind index p recall-message +bind index K previous-unread +bind index J next-unread +bind index,browser gg first-entry +bind index,browser G last-entry +#bind index,pager D delete-message +bind index,pager R group-reply +bind index,pager N search-opposite +bind index,pager \# noop +bind index,pager sync-mailbox +bind pager i exit +bind pager / search +bind pager previous-line +bind pager next-line +bind pager k previous-line +bind pager j next-line +bind pager gg top +bind pager G bottom +bind pager K previous-undeleted +bind pager J next-undeleted +bind pager \Cj next-unread +bind attach view-mailcap +bind compose p pgp-menu +bind editor complete-query +bind editor ^T complete + +### Macros +macro index q "?" \ + "Leaves Index to folder list" +macro index \Cr "N" \ + "mark tagged messages as read" +macro index C "?" \ + "copy a message to a mailbox" +macro index S "?" \ + "copy a message to a mailbox" +macro index B "~b " \ + "search message bodies" +macro index I "!" \ + "go to Inbox" +# Save a decoded copy in ~/ +macro index,pager > "cat > ~/" \ + "save message as" +# Open in vim +macro index,pager V "vim -c 'setlocal ft=mail buftype=nofile' -" \ + "open in vim" +# Sync mails with offlineimap +macro index,browser Z "offlineimap -o -u ttyui" \ + "offlineimap sync ..." +macro browser q "" \ + "Exit mutt" +macro browser "" \ + "Check New" +macro compose Y pfy \ + "send mail without GPG" +# urlview +macro pager \Cu "urlview" \ + "Follow links with urlview" +macro pager ';' "" \ + "q+ ;" +# notmuch +macro index s "unset wait_key~/.mutt/mutt-notmuch.py -G $folder/search+search" \ + "search mail (using notmuch)" +# labels +macro index,pager x 'set my_oldeditor=$editorset editor="~/.mutt/mutt-xlabel.py"Nset editor=$my_oldeditor' \ + "edit X-Label" +macro index \Cx "~y " \ + "limit view to label" + +### aliases +set sort_alias = alias # sort alias file by alias +set reverse_alias # show names from alias file in index +source $alias_file # enable auto-completion + +### abook +set query_command = "abook --mutt-query '%s'" +macro generic,index,pager \Ca "abook" "launch abook" +macro index,pager A "abook --add-email" "add the sender address to abook" + +### Misc settings +## Mailing lists: lists and subscribe +set followup_to # generate 'Mail-Followup-To:' header field +set honor_followup_to # 'Mail-Followup-To' header is honored +source ~/.mutt/mailinglists + +## Multiplexing using tmux +# compose mail in tmux window +macro index,pager M 'set my_oldeditor=$editorset editor="cp %s %s.2; tmux new-window -a -t mutt \"~/.mutt/compose.sh %s.2\""unset recallset editor=$my_oldeditor' \ + "mail in new tmux window" +#unset wait_key # already set above +# forward messages +# override the hotkey +macro index,pager P "tmux new-window -a -t mutt 'mutt -F ~/.mutt/compose.rc -p'" \ + "recall postponed message in new tmux window" +# Set the editor for for editing messages in-place, +# allows re-editing before sending, e.g. for use in forwarding messages. +macro compose E 'set my_oldeditor=$editorset editor="vim"set editor=$my_oldeditor' \ + "edit message in-place" +# open mailbox listing in a new window +macro index,pager Y 'tmux new-window -a -t mutt "mutt -y"' \ + "open mailbox listing in new tmux window" + +## Attachment searching and counting +source ~/.mutt/attachments + +## Colors +source ~/.mutt/colors + +## GnuPG +source ~/.mutt/gpg.rc + +## auto view +auto_view text/html application/x-tar-gz application/x-compressed-tar \ + application/x-bzip-compressed-tar + +## MIME types that should *not* be treated according to their mailcap entry +mime_lookup application/octet-stream application/X-Lotus-Manuscript + +### Local Settings +source `FILE=$HOME/.muttrc.local; if [ ! -s "$FILE" ]; then FILE=/dev/null; fi; echo "$FILE"` + +# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=muttrc: # diff --git a/_mutt/ppt2text.sh b/_mutt/ppt2text.sh new file mode 100755 index 0000000..43d22f4 --- /dev/null +++ b/_mutt/ppt2text.sh @@ -0,0 +1,23 @@ +#!/bin/sh +# +# ppt2text - convert MS PowerPoint files to ASCII text +# +# Written by Gary Johnson . +# +# Modification History: +# 2003-02-19 +# Changed the name pptHtml to ppthtml to match the xlhtml-0.5 +# release. + +prog=${0##*/} + +if [ $# -ne 1 ] +then + echo "Usage: $prog file" >&2 + exit 2 +fi + +ppthtml $1 | +w3m -dump -T text/html | +perl -pe 's/\xa0/ /g' # Change A0 spaces to ASCII + # spaces. diff --git a/_mutt/word2text.sh b/_mutt/word2text.sh new file mode 100755 index 0000000..fe9682d --- /dev/null +++ b/_mutt/word2text.sh @@ -0,0 +1,67 @@ +#!/bin/sh +# +# word2text - convert MS Word files to ASCII text +# +# SYNOPSIS +# word2text file +# +# DESCRIPTION +# Word2text uses wvHtml, w3m and some perl glue to convert the MS +# Word file specified by the argument to ASCII text on stdout. +# +# wvHtml converts MS Word files to HTML, but is intended to be +# used with a graphical browser such as Netscape Navigator, so it +# converts certain graphical elements to image files and +# corresponding tags that the browser can render. Since +# this script uses a text based browser, it uses perl to eliminate +# these tags. +# +# Compared to Quick View Plus (qvpview), the rendering of MS Word +# documents done by word2text is usually more accurate. Qvpview +# doesn't render unrecognized characters well, if at all. It also +# renders numbered lists as bullet lists. +# +# Compared to the plain text translations that some people include +# in their e-mail along with the original MS Word attachments, the +# rendering done by word2text is usually more readable: vertical +# spacing between paragraphs and list items is better and the +# adjustment of text within paragraphs is better. +# +# BUGS +# wvHtml occasionally dumps core. +# With the wv-0.7.4 release, some unnumbered lists are rendered as +# numbered. +# +# AUTHOR +# Gary A. Johnson +# +# +# REVISION HISTORY +# 2003-05-31 +# Between wv-0.5.42 and wv-0.7.4, wvHtml changed to insert +# a

    tag between each

  • tag and the following text, +# causing the list-item text to start on the line +# following the list-item bullet or number. A perl +# expression was added to this script to fix the problem. +# 2003-02-19 +# The command-line arguments to wvHtml changed, requiring +# the output file name as well as the input file name. +# Therefore, '-' (stdout) was added to the command as the +# output file name. + +wvHtml "$1" - 2> /dev/null | +perl -0777 -p -e ' + s|||gs; # Delete img tags. + s|()\s*

    |\1|gs; # Remove

    tags immediately + # following

  • tags. (This + # problem appeared somewhere + # between wv-0.5.42 and + # wv-0.7.4.) +' | +w3m -dump -T text/html | +perl -p -e ' + s/\n\s*\n/\n\n/gs; # Delete extra whitespace + # between lines. + s/\xa0/ /gs; # Change A0 spaces to ASCII + # spaces. +' diff --git a/_ncmpcpp/config b/_ncmpcpp/config new file mode 100644 index 0000000..5d7fc69 --- /dev/null +++ b/_ncmpcpp/config @@ -0,0 +1,523 @@ +#################################################### +## this is example configuration file, copy it to ## +## ~/.ncmpcpp/config and set up your preferences ## +#################################################### +# +##### directories ###### +## +## Directory for storing ncmpcpp related files. +## Changing it is useful if you want to store +## everything somewhere else and provide command +## line setting for alternative location to config +## file which defines that while launching ncmpcpp. +## +# +#ncmpcpp_directory = "~/.ncmpcpp" +# +## +## Directory for storing downloaded lyrics. It +## defaults to ~/.lyrics since other MPD clients +## (eg. ncmpc) also use that location. +## +# +lyrics_directory = "~/.lyrics" +# +##### connection settings ##### +# +## set it in order to make tag editor and renaming files work properly +# +#mpd_host = "localhost" +# +#mpd_port = "6600" +# +mpd_music_dir = "~/music" +# +#mpd_connection_timeout = "5" +# +mpd_crossfade_time = "5" +# +#mpd_communication_mode = "notifications" (polling/notifications) +# +##### music visualizer ##### +## +## Note: In order to make music visualizer work you'll +## need to use mpd fifo output, whose format parameter +## has to be set to 44100:16:1 for mono visualization +## or 44100:16:2 for stereo visualization. Example +## configuration (it has to be put into mpd.conf): +## +## audio_output { +## type "fifo" +## name "My FIFO" +## path "/tmp/mpd.fifo" +## format "44100:16:2" +## } +## +# +## +## If you set format to 44100:16:2, make it 'yes'. +## +# +#visualizer_in_stereo = "no" +visualizer_in_stereo = "yes" +# +visualizer_fifo_path = "/tmp/mpd.fifo" +# +## +## Note: Below parameter is needed for ncmpcpp +## to determine which output provides data for +## visualizer and thus allow syncing between +## visualization and sound as currently there +## are some problems with it. +## +# +visualizer_output_name = "My FIFO" +# +## +## Note: Below parameter defines how often ncmpcpp +## has to "synchronize" visualizer and audio outputs. +## 30 seconds is optimal value, but if you experience +## synchronization problems, set it to lower value. +## Keep in mind that sane values start with >=10. +## +# +visualizer_sync_interval = "30" +# +## +## Note: To enable spectrum frequency visualization +## you need to compile ncmpcpp with fftw3 support. +## +# +#visualizer_type = "wave" (spectrum/wave) +visualizer_type = "spectrum" (spectrum/wave) +# +#visualizer_look = "◆│" +visualizer_look = "◆▋" +# +##### system encoding ##### +## +## ncmpcpp should detect your charset encoding +## but if it failed to do so, you can specify +## charset encoding you are using here. +## +## Note: You can see whether your ncmpcpp build +## supports charset detection by checking output +## of `ncmpcpp --version`. +## +## Note: Since MPD uses utf8 by default, setting +## this option makes sense only if your encoding +## is different. +## +# +#system_encoding = "" +# +##### delays ##### +# +## delay after playlist highlighting will be disabled (0 = don't disable) +# +#playlist_disable_highlight_delay = "5" +# +## defines how long various messages are supposed to be visible +# +#message_delay_time = "4" +# +##### song format ##### +## +## for song format you can use: +## +## %l - length +## %f - filename +## %D - directory +## %a - artist +## %A - album artist +## %t - title +## %b - album +## %y - year +## %n - track number (01/12 -> 01) +## %N - full track info (01/12 -> 01/12) +## %g - genre +## %c - composer +## %p - performer +## %d - disc +## %C - comment +## $R - begin right alignment +## +## you can also put them in { } and then it will be displayed +## only if all requested values are available and/or define alternate +## value with { }|{ } eg. {%a - %t}|{%f} +## +## Note: If you want to set limit on maximal length of a tag, just +## put the appropriate number between % and character that defines +## tag type, e.g. to make album take max. 20 terminal cells, use '%20b'. +## +## Note: Format that is similar to "%a - %t" (i.e. without any additional +## braces) is equal to "{%a - %t}", so if one of the tags is missing, +## you'll get nothing. +## +## text can also have different color than the main window has, +## eg. if you want length to be green, write $3%l$9 +## +## available values: +## +## - 0 - default window color (discards all other colors) +## - 1 - black +## - 2 - red +## - 3 - green +## - 4 - yellow +## - 5 - blue +## - 6 - magenta +## - 7 - cyan +## - 8 - white +## - 9 - end of current color +## +## Note: colors can be nested. +## +# +#song_list_format = "{%a - }{%t}|{$8%f$9}$R{$3(%l)$9}" +# +#song_status_format = "{{%a{ \"%b\"{ (%y)}} - }{%t}}|{%f}" +# +#song_library_format = "{%n - }{%t}|{%f}" +# +#tag_editor_album_format = "{(%y) }%b" +# +## +## Note: Below variables are for alternative version of user's interface. +## Their syntax supports all tags and colors listed above plus some extra +## markers used for text attributes. They are followed by character '$'. +## After that you can put: +## +## - b - bold text +## - u - underline text +## - r - reverse colors +## - a - use alternative character set +## +## If you don't want to use an attribute anymore, just put it again, but +## this time insert character '/' between '$' and attribute character, +## e.g. {$b%t$/b}|{$r%f$/r} will display bolded title tag or filename +## with reversed colors. +## +# +#alternative_header_first_line_format = "$b$1$aqqu$/a$9 {%t}|{%f} $1$atqq$/a$9$/b" +# +#alternative_header_second_line_format = "{{$4$b%a$/b$9}{ - $7%b$9}{ ($4%y$9)}}|{%D}" +# +## +## Note: Below variables also supports +## text attributes listed above. +## +# +#now_playing_prefix = "$b" +# +#now_playing_suffix = "$/b" +# +#browser_playlist_prefix = "$2playlist$9 " +# +#selected_item_prefix = "$6" +# +#selected_item_suffix = "$9" +# +## colors are not supported for below variable +# +#song_window_title_format = "{%a - }{%t}|{%f}" +song_window_title_format = "{%a - }{%t}|{%f}" +# +##### columns settings ##### +## +## syntax of song columns list format is "column column etc." +## +## - syntax for each column is: +## +## (width of column)[column's color]{displayed tag} +## +## Note: Width is by default in %, if you want a column to +## have fixed size, add 'f' after the value, e.g. (10)[white]{a} +## will be the column that take 10% of screen (so the real column's +## width will depend on actual screen size), whereas (10f)[white]{a} +## will take 10 terminal cells, no matter how wide the screen is. +## +## - color is optional (if you want the default one, type []) +## +## Note: You can give a column additional attributes by putting appropriate +## character after displayed tag character. Available attributes are: +## +## - r - column will be right aligned +## - E - if tag is empty, empty tag marker won't be displayed +## +## You can also: +## +## - give a column custom name by putting it after attributes, +## separated with character ':', e.g. {lr:Length} gives you +## right aligned column of lengths named "Length". +## +## - define sequence of tags, that have to be displayed in case +## predecessor is empty in a way similar to the one in classic +## song format, i.e. using '|' character, e.g. {a|c|p:Owner} +## creates column named "Owner" that tries to display artist +## tag and then composer and performer if previous ones are +## not available. +## +# +#song_columns_list_format = "(7f)[green]{l} (25)[cyan]{a} (40)[]{t|f} (30)[red]{b}" +song_columns_list_format = "(7f)[green]{l} (25)[cyan]{a} (40)[]{t|f} (30)[magenta]{b}" +# +##### various settings ##### +# +## +## Note: Custom command that will be executed each +## time song changes. Useful for notifications etc. +## +## Attention: It doesn't support song format anymore. +## Use `ncmpcpp --now-playing SONG_FORMAT` instead. +## +#execute_on_song_change = "" +# +#playlist_show_remaining_time = "no" +# +#playlist_shorten_total_times = "no" +# +#playlist_separate_albums = "no" +# +#playlist_display_mode = "classic" (classic/columns) +playlist_display_mode = "columns" (classic/columns) +# +#browser_display_mode = "classic" (classic/columns) +browser_display_mode = "columns" (classic/columns) +# +#search_engine_display_mode = "classic" (classic/columns) +search_engine_display_mode = "columns" (classic/columns) +# +#playlist_editor_display_mode = "classic" (classic/columns) +playlist_editor_display_mode = "columns" (classic/columns) +# +#discard_colors_if_item_is_selected = "yes" +# +#incremental_seeking = "yes" +# +#seek_time = "1" +# +#autocenter_mode = "no" +autocenter_mode = "yes" +# +#centered_cursor = "no" +# +## +## Note: You can specify third character which will +## be used to build 'empty' part of progressbar. +## +#progressbar_look = "=>" +progressbar_look = "▪▪▫" +#progressbar_look = "♪♪ " +#progressbar_look = "=>" +#progressbar_look = "─- " +#progressbar_look = "▒▒░" +#progressbar_look = "┅┅┄" +#progressbar_look = "─⊙┄" +#progressbar_look = "─➞─" +#progressbar_look = "─┅─" +#progressbar_look = "▪▪▪" +#progressbar_look = "───" +#progressbar_look = "▁▁▁" +#progressbar_look = "‒‒‒" +#progressbar_look = "■◣ " +#progressbar_look = "◈◆◇" +# +#default_place_to_search_in = "database" (database/playlist) +# +#user_interface = "classic" (classic/alternative) +user_interface = "alternative" (classic/alternative) +# +#media_library_left_column = "a" (possible values: a,y,g,c,p, legend above) +# +#default_find_mode = "wrapped" (wrapped/normal) +# +#default_space_mode = "add" (add/select) +# +#default_tag_editor_left_col = "albums" (albums/dirs) +# +#default_tag_editor_pattern = "%n - %t" +# +#header_visibility = "yes" +# +#statusbar_visibility = "yes" +# +#titles_visibility = "yes" +titles_visibility = "no" +# +#header_text_scrolling = "yes" +# +#fancy_scrolling = "yes" +# +#cyclic_scrolling = "no" +# +#lines_scrolled = "2" +# +#follow_now_playing_lyrics = "no" +follow_now_playing_lyrics = "yes" +# +#fetch_lyrics_for_current_song_in_background = "no" +# +#store_lyrics_in_song_dir = "no" +# +## +## Note: If you set this variable, ncmpcpp will try to +## get info from last.fm in language you set and if it +## fails, it will fall back to english. Otherwise it will +## use english the first time. +## +## Note: Language has to be expressed as an ISO 639 alpha-2 code. +## +#lastfm_preferred_language = "" +# +#ncmpc_like_songs_adding = "no" (enabled - add/remove, disabled - always add) +# +#show_hidden_files_in_local_browser = "no" +# +#display_screens_numbers_on_start = "yes" +# +## +## How shall key_screen_switcher work? +## +## - "previous" - switch between current and last used screen +## - "sequence: 2 -> 9 -> 5" - switch between given sequence of screens. +## +## Screen numbers you can use after 'sequence' keyword are: +## +## - 1 - help +## - 2 - playlist +## - 3 - browser +## - 4 - search engine +## - 5 - media library +## - 6 - playlist editor +## - 7 - tag editor +## - 8 - outputs +## - 9 - visualizer +## - 10 - clock +## +## As you can see, above example will switch between +## playlist, visualizer and media library screens. +## +#screen_switcher_mode = "sequence: 2 -> 3" +# +## +## Default width of locked screen (in %). +## Acceptable values are from 20 to 80. +## +# +#locked_screen_width_part = "50" +# +#ask_for_locked_screen_width_part = "yes" +# +## +## Note: You can define startup screen for ncmpcpp +## by choosing screen number from the list above. +## +#startup_screen = "2" +# +#jump_to_now_playing_song_at_start = "yes" +# +#ask_before_clearing_main_playlist = "no" +# +#clock_display_seconds = "no" +# +#display_volume_level = "yes" +# +#display_bitrate = "no" +display_bitrate = "yes" +# +#display_remaining_time = "no" +# +#regular_expressions = "basic" (basic/extended) +# +## +## Note: If below is enabled, ncmpcpp will ignore leading +## "The" word while sorting items in browser, tags in +## media library, etc. +## +#ignore_leading_the = "no" +ignore_leading_the = "yes" +# +#block_search_constraints_change_if_items_found = "yes" +# +#mouse_support = "yes" +# +#mouse_list_scroll_whole_page = "yes" +# +#empty_tag_marker = "" +# +#tag_editor_extended_numeration = "no" +# +#media_library_display_date = "yes" +# +#media_library_display_empty_tag = "yes" +# +#media_library_disable_two_column_mode = "no" +# +#enable_window_title = "yes" +# +## +## Note: You can choose default search mode for search +## engine. Available modes are: +## +## - 1 - use mpd built-in searching (no regexes, pattern matching) +## - 2 - use ncmpcpp searching (pattern matching with support for regexes, +## but if your mpd is on a remote machine, downloading big database +## to process it can take a while +## - 3 - match only exact values (this mode uses mpd function for searching +## in database and local one for searching in current playlist) +## +# +#search_engine_default_search_mode = "1" +# +## +## Note: Below variables can allow you to physically +## remove files and directories from your hdd using +## ncmpcpp's browser screen. +## +# +#allow_physical_files_deletion = "no" +# +#allow_physical_directories_deletion = "no" +# +#external_editor = "" +external_editor = "vim" +# +#use_console_editor = "no" (set to yes, if your editor is console app) +use_console_editor = "yes" +# +##### colors definitions ##### +# +#colors_enabled = "yes" +# +#empty_tag_color = "cyan" +# +#header_window_color = "default" +# +#volume_color = "default" +# +#state_line_color = "default" +# +#state_flags_color = "default" +# +#main_window_color = "yellow" +# +#color1 = "white" +# +#color2 = "green" +# +#main_window_highlight_color = "yellow" +# +#progressbar_color = "default" +# +#statusbar_color = "default" +# +#alternative_ui_separator_color = "black" +# +#active_column_color = "red" +# +#visualizer_color = "yellow" +# +#window_border_color = "green" +# +#active_window_border = "red" +# diff --git a/_ncmpcpp/keys b/_ncmpcpp/keys new file mode 100644 index 0000000..6e06bb4 --- /dev/null +++ b/_ncmpcpp/keys @@ -0,0 +1,199 @@ +## +## ~/.ncmpcpp/keys +## key configuration file for ncmpcpp +## +## Tips: +## - it's possible to bind maximum two keys to a command +## - keys can be defined with a character or a decimal value +## - a command can be disabled by binding it to 0 +## +## Note: First bind of volume_up/down +## will be used to switch between columns. +## +## Configure ncmpcpp to have vim-like key bindings +## +## Aaron LI +## 2015-12-29 +## +# +key_up = 259 'k' +# +key_down = 258 'j' +# +#key_up_album = '[' +# +#key_down_album = ']' +# +#key_up_artist = '{' +# +#key_down_artist = '}' +# +#key_page_up = 339 +# +#key_page_down = 338 +# +key_home = 262 'g' +# +key_end = 360 'G' +# +#key_space = 32 +# +#key_enter = 10 +# +#key_delete = 330 'd' +# +#key_volume_up = 261 '+' +# +#key_volume_down = 260 '-' +# +#key_prev_column = 260 +key_prev_column = 'h' +# +#key_next_column = 261 +key_next_column = 'l' +# +#key_toggle_space_mode = 't' +# +#key_toggle_add_mode = 'T' +# +#key_toggle_mouse = '|' +# +#key_toggle_bitrate_visibility = '#' +# +#key_screen_switcher = 9 +# +#key_backward_screen_switcher = 353 +# +#key_help = '1' 265 +# +#key_playlist = '2' 266 +# +#key_browser = '3' 267 +# +#key_search_engine = '4' 268 +# +#key_media_library = '5' 269 +# +#key_playlist_editor = '6' 270 +# +#key_tag_editor = '7' 271 +# +#key_outputs = '8' 272 +# +#key_music_visualizer = '9' 273 +# +#key_clock = '0' 274 +# +#key_server_info = '@' +# +#key_stop = 's' +# +#key_pause = 'P' +key_pause = 'p' +# +#key_next = '>' +# +#key_prev = '<' +# +#key_replay = 263 127 +# +#key_seek_forward = 'f' +# +#key_seek_backward = 'b' +# +#key_toggle_repeat = 'r' +# +#key_toggle_random = 'z' +# +#key_toggle_single = 'y' +# +#key_toggle_consume = 'R' +# +#key_toggle_replay_gain_mode = 'Y' +# +#key_shuffle = 'Z' +# +#key_toggle_crossfade = 'x' +# +#key_set_crossfade = 'X' +# +#key_update_db = 'u' +# +#key_sort_playlist = 22 +# +#key_apply_filter = 6 +# +#key_find_forward = '/' +# +#key_find_backward = '?' +# +#key_next_found_position = '.' +key_next_found_position = 'n' +# +#key_prev_found_position = ',' +key_prev_found_position = 'N' +# +#key_toggle_find_mode = 'w' +# +#key_edit_tags = 'e' +# +#key_go_to_position = 'g' +# +#key_song_info = 'i' +# +#key_artist_info = 'I' +# +#key_lyrics = 'l' +key_lyrics = '.' +# +#key_reverse_selection = 'v' +# +#key_deselect_all = 'V' +# +#key_select_album = 'B' +# +#key_add_selected_items = 'A' +# +#key_clear = 'c' +# +#key_crop = 'C' +# +#key_move_song_up = 'm' +key_move_song_up = 'K' +# +#key_move_song_down = 'n' +key_move_song_down = 'J' +# +#key_move_to = 'M' +# +#key_move_before = 0 +# +#key_move_after = 0 +# +#key_add = 'a' +# +#key_save_playlist = 'S' +# +#key_go_to_now_playing = 'o' +# +#key_toggle_auto_center = 'U' +# +#key_toggle_display_mode = 'p' +key_toggle_display_mode = 'P' +# +#key_toggle_separators_in_playlist = '!' +# +#key_toggle_lyrics_db = 'L' +# +#key_toggle_fetching_lyrics_for_current_song_in_background = 'F' +# +#key_go_to_containing_directory = 'G' +# +#key_go_to_media_library = '~' +# +#key_go_to_parent_dir = 263 127 +# +#key_switch_tag_type_list = '`' +# +#key_quit = 'q' 'Q' +# diff --git a/_notmuch-config b/_notmuch-config new file mode 100644 index 0000000..ba7e7b2 --- /dev/null +++ b/_notmuch-config @@ -0,0 +1,93 @@ +## +## Configuration file for the notmuch mail system +## ~/.notmuch-config +## http://notmuchmail.org +## +## Weitian LI +## 2015/02/02 +## + +# Database configuration +# +# The only value supported here is 'path' which should be the top-level +# directory where your mail currently exists and to where mail will be +# delivered in the future. Files should be individual email messages. +# Notmuch will store its database within a sub-directory of the path +# configured here named ".notmuch". +# +[database] +path=/home/aly/Mail + +# User configuration +# +# Here is where you can let notmuch know how you would like to be +# addressed. Valid settings are +# +# name Your full name. +# primary_email Your primary email address. +# other_email A list (separated by ';') of other email addresses +# at which you receive email. +# +# Notmuch will use the various email addresses configured here when +# formatting replies. It will avoid including your own addresses in the +# recipient list of replies, and will set the From address based on the +# address to which the original email was addressed. +# +[user] +name=Aaron LI +primary_email=aaronly.me@outlook.com +other_email=aaronly.me@gmail.com;liweitianux@autistici.org;liweitianux@gmail.com;liweitianux@live.com; + +# Configuration for "notmuch new" +# +# The following options are supported here: +# +# tags A list (separated by ';') of the tags that will be +# added to all messages incorporated by "notmuch new". +# +# ignore A list (separated by ';') of file and directory names +# that will not be searched for messages by "notmuch new". +# +# NOTE: *Every* file/directory that goes by one of those +# names will be ignored, independent of its depth/location +# in the mail store. +# +[new] +tags=unread;inbox; +ignore= + +# Search configuration +# +# The following option is supported here: +# +# exclude_tags +# A ;-separated list of tags that will be excluded from +# search results by default. Using an excluded tag in a +# query will override that exclusion. +# +[search] +exclude_tags=deleted;spam; + +# Maildir compatibility configuration +# +# The following option is supported here: +# +# synchronize_flags Valid values are true and false. +# +# If true, then the following maildir flags (in message filenames) +# will be synchronized with the corresponding notmuch tags: +# +# Flag Tag +# ---- ------- +# D draft +# F flagged +# P passed +# R replied +# S unread (added when 'S' flag is not present) +# +# The "notmuch new" command will notice flag changes in filenames +# and update tags, while the "notmuch tag" and "notmuch restore" +# commands will notice tag changes and update flags in filenames +# +[maildir] +synchronize_flags=true diff --git a/_npmrc b/_npmrc new file mode 100644 index 0000000..f9e0a43 --- /dev/null +++ b/_npmrc @@ -0,0 +1,7 @@ +;; +;; npm config +;; + +;; install packages under user home directory +prefix = ${HOME}/npm + diff --git a/_offlineimap/offlineimap.py b/_offlineimap/offlineimap.py new file mode 100755 index 0000000..e3ae422 --- /dev/null +++ b/_offlineimap/offlineimap.py @@ -0,0 +1,68 @@ +#!/usr/bin/env python +# +# Add support of encrypting password with gpg2 for OfflineIMAP. +# Provide function 'mailpasswd' to decrypt the password. +# +# Configurations: +# [general] +# pythonfile = ~/.offlineimap/offlineimap.py +# ... +# [Repository ] +# remotepasseval = mailpasswd("") +# ... +# +# Reference: +# [1] Encrypt OfflineIMAP Password +# http://unix.stackexchange.com/questions/44214/encrypt-offlineimap-password +# +# Updated: 2015/02/02 +# + +import os +import subprocess + +def mailpasswd(account): + account = os.path.basename(account) + path = '{0}/.offlineimap/{1}.gpg'.format(os.environ['HOME'], account) + args = ['gpg2', '--for-your-eyes-only', '--no-tty', + '--quiet', '--batch', '--decrypt', path] + try: + return subprocess.check_output(args).strip() + except subprocess.CalledProcessError: + return '' + +# subprocess.check_output() only introduced in python 2.7 +# this version of 'mailpasswd' works with older version of python +#def mailpasswd(account): +# account = os.path.basename(account) +# path = '{0}/.offlineimap/{1}.gpg'.format(os.environ['HOME'], account) +# args = ['gpg2', '--for-your-eyes-only', '--no-tty', +# '--quiet', '--batch', '--decrypt', path] +# proc = subprocess.Popen(args, stdout=subprocess.PIPE) +# output = proc.communicate()[0].strip() +# retcode = proc.wait() +# if retcode == 0: +# return output +# else: +# return '' + + +# If you have several accounts that get checked simultaneously, and you +# use 'gpg-agent', then it will ask for you passphrase for each account. +# I prime the agent by creating a file, and priming the gpg-agent by +# decrypting this file on launch of offlineimap. +def prime_gpg_agent(): + # echo "prime" | gpg -e -r > ~/.offlineimap/prime.gpg + ret = False + i = 1 + while not ret: + ret = (mailpasswd("prime") == "prime") + if i > 2: + from offlineimap.ui import getglobalui + sys.stderr.write("Error reading in passwords. Terminating.\n") + getglobalui().terminate() + i += 1 + return ret + +prime_gpg_agent() + diff --git a/_offlineimap/postsync.sh b/_offlineimap/postsync.sh new file mode 100755 index 0000000..c5a3985 --- /dev/null +++ b/_offlineimap/postsync.sh @@ -0,0 +1,26 @@ +#!/bin/sh +# +# OfflineIMAP postsynchook +# +# Weitian LI +# 2015/02/02 +# + +## Check new mails & send notification +MAILDIR="${HOME}/Mail/" +newmails=0 +for d in `find ${MAILDIR} -maxdepth 2 -type d -iname '*inbox'`; do + n=`ls ${d}/new/ | wc -l` + newmails=`expr ${newmails} + ${n}` +done + +if [ ${newmails} -gt 0 ] && which notify-send >/dev/null 2>&1; then + export DISPLAY=":0" + export XAUTHORITY="${HOME}/.Xauthority" + notify-send -i 'mail-unread' -a "OfflineIMAP" \ + "OfflineIMAP: Received ${newmails} new mail(s)!" +fi + +## Invoke notmuch to index mails +notmuch new + diff --git a/_profile b/_profile new file mode 100644 index 0000000..12b78ae --- /dev/null +++ b/_profile @@ -0,0 +1,56 @@ +# ~/.profile: executed by the command interpreter for login shells. +# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login +# exists. +# see /usr/share/doc/bash/examples/startup-files for examples. +# the files are located in the bash-doc package. + +# the default umask is set in /etc/profile; for setting the umask +# for ssh logins, install and configure the libpam-umask package. +#umask 022 + +###### locale ###### +export LANG="en_US.UTF-8" +export LC_CTYPE="zh_CN.UTF-8" +export LC_COLLATE="C" + +###### input method ###### +export XMODIFIERS="@im=fcitx" +export INPUT_METHOD="fcitx" +export GTK_IM_MODULE="fcitx" +export GTK3_IM_MODULE="fcitx" +export QT_IM_MODULE="fcitx" +export QT4_IM_MODULE="fcitx" + + +###### PATH ###### +# admin +if groups | grep -qE '\b(wheel|adm|sudo)\b'; then + export PATH="$PATH:/usr/local/sbin:/usr/sbin:/sbin" +fi +# $HOME/bin +if [ -d "$HOME/bin" ]; then + export PATH="$HOME/bin:$PATH" +fi +# npm +if [ -d "$HOME/npm/bin" ]; then + export PATH="$PATH:$HOME/npm/bin" +fi + + +###### Xmodmap ###### +[ -f ~/.Xmodmap ] && xmodmap ~/.Xmodmap + + +###### ConTeXt ###### +export OSFONTDIR="/usr/local/share/fonts;$HOME/.fonts" + + +###### bash ###### +if [ -n "$BASH_VERSION" ]; then + # include .bashrc if it exists + if [ -f "$HOME/.bashrc" ]; then + . "$HOME/.bashrc" + fi +fi + +# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=sh: # diff --git a/_rtorrent.rc b/_rtorrent.rc new file mode 100644 index 0000000..339cbeb --- /dev/null +++ b/_rtorrent.rc @@ -0,0 +1,193 @@ +# +# rtorrent configure file +# + +### shortcuts ### +# Ctrl-q: closes rTorrent, done twice makes the program shutdown +# without waiting to send stopping information to the trackers +# Left arrow: returns to the previous screen +# Right arrow: goes to the next screen +# a|s|d: increase global upload throttle about 1|5|50 KB/s +# A|S|D: increase global download throttle about 1|5|50 KB/s +# z|x|c: decrease global upload throttle about 1|5|50 KB/s +# Z|X|C: decrease global download throttle about 1|5|50 KB/s +# Ctrl-S: starts download +# Ctrl-D: stops an active download, removes a stopped download +# + or -: changes the download priority of selected torrent +# Backspace: adds the specified .torrent. after pressing this button +# write fuul path or URL of .torrent file + +# This is an example resource file for rTorrent. Copy to +# ~/.rtorrent.rc and enable/modify the options as needed. Remember to +# uncomment the options you wish to enable. + +# Maximum and minimum number of peers to connect to per torrent. +#min_peers = 40 +max_peers = 52 + +# Same as above but for seeding completed torrents (-1 = same as downloading) +#min_peers_seed = 10 +max_peers_seed = 52 + +# Maximum number of simultanious uploads per torrent. +max_uploads = 8 + +# Global upload and download rate in KiB. "0" for unlimited. +download_rate = 0 +upload_rate = 0 + +# Default directory to save the downloaded torrents. +#directory = /home/[user]/torrents/ +#directory = ~/downloads/torrents + +# Default session directory. Make sure you don't run multiple instance +# of rtorrent using the same session directory. Perhaps using a +# relative path? +session = ~/downloads/torrents/.session/ + +# Watch a directory for new torrents, and stop those that have been detected +#schedule = watch_directory,5,5,load_start="~/downloads/torrents/*.torrent" +# stop downloading after the torrent file removed +schedule = untied_directory,5,5,stop_untied= +schedule = tied_directory,5,5,start_tied= + +# Close torrents when diskspace is low. +schedule = low_diskspace,5,60,close_low_diskspace=2000M + +# Stop torrents when reaching upload ratio in percent, +# when also reaching total upload in bytes, or when +# reaching final upload ratio in percent. +# example: stop at ratio 2.0 with at least 200 MB uploaded, or else ratio 20.0 +### error ### +#schedule = ratio,60,60,stop_on_ratio=200,200M,2000 + +# The ip address reported to the tracker. +#ip = 127.0.0.1 +#ip = rakshasa.no + +# The ip address the listening socket and outgoing connections is +# bound to. +#bind = 127.0.0.1 +#bind = rakshasa.no + +# Port range to use for listening. +port_range = 42396-43000 + +# Start opening ports at a random position within the port range. +port_random = yes + +# Encryption options, set to none (default) or any combination of the following: +# allow_incoming, try_outgoing, require, require_RC4, enable_retry, prefer_plaintext +# +# The example value allows incoming encrypted connections, starts unencrypted +# outgoing connections but retries with encryption if they fail, preferring +# plaintext to RC4 encryption after the encrypted handshake +# +# encryption = allow_incoming,enable_retry,prefer_plaintext +encryption = allow_incoming,try_outgoing,enable_retry + +# Enable DHT support for trackerless torrents or when all trackers are down. +# May be set to "disable" (completely disable DHT), "off" (do not start DHT), +# "auto" (start and stop DHT as needed), or "on" (start DHT immediately). +# The default is "off". For DHT to work, a session directory must be defined. +dht = auto + +# UDP port to use for DHT. +dht_port = 6881 + +# Enable peer exchange (for torrents not marked private) +peer_exchange = yes + +# Check hash for finished torrents. Might be usefull until the bug is +# fixed that causes lack of diskspace not to be properly reported. +check_hash = yes + +use_udp_trackers = yes + +# Alternative calls to bind and ip that should handle dynamic ip's. +#schedule = ip_tick,0,1800,ip=rakshasa +#schedule = bind_tick,0,1800,bind=rakshasa + +# for chinese support +encoding_list = UTF-8 + +# press 9 in your rtorrent client to see the changes in action +schedule = filter_active,30,30,"view_filter = active,\"or={d.get_up_rate=,d.get_down_rate=}\"" + +# for remote management +#scgi_port = localhost:5000 + + +#### Automatically Move Completed Torrent Data to 'Completed' Folders + +# location where new torrent data is placed, and where you should place your +# 'complete' data before you place your *.torrent file into the watch folder +directory = ~/downloads/torrents/incomplete + +# schedule a timer event named 'watch_directory_1': +# 1) triggers 10 seconds after rtorrent starts +# 2) triggers at 10 second intervals thereafter +# 3) Upon trigger, attempt to load (and start) new *.torrent files found in /home/user/torrents/watch/ +# 4) set a variable named 'custom1' with the value "/home/user/torrents/complete" +# NOTE: if you don't want it to automatically start the torrent, change 'load_start' to 'load' +schedule = watch_directory_1,10,10,"load_start=~/downloads/torrents/watch/*.torrent,d.set_custom1=~/downloads/torrents/complete" + +# insert a method with the alias 'checkdirs1' +# 1) returns true if the current path of the torrent data is not equal to the value of custom1 +# 2) otherwise, returns false +system.method.insert=checkdirs1,simple,"not=\"$equal={d.get_custom1=,d.get_base_path=}\"" + +# insert a method with the alias 'movecheck1' +# 1) returns true if all 3 commands return true ('result of checkdirs1' && 'torrent is 100% done', 'custom1 variable is set') +# 2) otherwise, returns false +system.method.insert=movecheck1,simple,"and={checkdirs1=,d.get_complete=,d.get_custom1=}" + +# insert a method with the alias 'movedir1' +# (a series of commands, separated by ';') +# 1) "set path of torrent to equal the value of custom1"; +# 2) "mv -u "; +# 3) "clear custom1", "stop the torrent","resume the torrent" +# 4) stop the torrent +# 5) start the torrent (to get the torrent to update the 'base path') +system.method.insert=movedir1,simple,"d.set_directory=$d.get_custom1=;execute=mv,-u,$d.get_base_path=,$d.get_custom1=;d.set_custom1=;d.stop=;d.start=" + +# set a key with the name 'move_hashed1' that is triggered by the hash_done event. +# 1) When hashing of a torrent completes, this custom key will be triggered. +# 2) when triggered, execute the 'movecheck1' method and check the return value. +# 3) if the 'movecheck' method returns 'true', execute the 'movedir1' method we inserted above. +# NOTE: 'branch' is an 'if' conditional statement: if(movecheck1){movedir1} +system.method.set_key=event.download.hash_done,move_hashed1,"branch={$movecheck1=,movedir1=}" + + +# +# Do not modify the following parameters unless you know what you're doing. +# +# Hash read-ahead controls how many MB to request the kernel to read +# ahead. If the value is too low the disk may not be fully utilized, +# while if too high the kernel might not be able to keep the read +# pages in memory thus end up trashing. +#hash_read_ahead = 10 + +# Interval between attempts to check the hash, in milliseconds. +#hash_interval = 100 + +# Number of attempts to check the hash while using the mincore status, +# before forcing. Overworked systems might need lower values to get a +# decent hash checking rate. +#hash_max_tries = 10 + +# Max number of files to keep open simultaniously. +#max_open_files = 128 + +# Number of sockets to simultaneously keep open. +#max_open_sockets = + + +# Example of scheduling commands: Switch between two ip's every 5 +# seconds. +#schedule = "ip_tick1,5,10,ip=torretta" +#schedule = "ip_tick2,10,10,ip=lampedusa" + +# Remove a scheduled event. +#schedule_remove = "ip_tick1" + diff --git a/_sbclrc b/_sbclrc new file mode 100644 index 0000000..d50d88f --- /dev/null +++ b/_sbclrc @@ -0,0 +1,23 @@ +;;; ~/.sbclrc + +;;; The following lines added by ql:add-to-init-file: +#-quicklisp +(let ((quicklisp-init (merge-pathnames "~/.quicklisp/setup.lisp" + (user-homedir-pathname)))) + (when (probe-file quicklisp-init) + (load quicklisp-init))) + +;;; http://common-lisp.net/project/linedit/ +;;; Check for --no-linedit command-line option. +(if (member "--no-linedit" sb-ext:*posix-argv* :test 'equal) + (setf sb-ext:*posix-argv* + (remove "--no-linedit" sb-ext:*posix-argv* :test 'equal)) + (when (interactive-stream-p *terminal-io*) + (require :sb-aclrepl) + (require :linedit) + (funcall (intern "INSTALL-REPL" :linedit) :wrap-current t))) + +;;; https://gist.github.com/bdsatish/5403002 +;; Don't break into debugger, but just display error message and return to top-level loop (REPL) +(setf *debugger-hook* #'(lambda (c h) (declare (ignore h)) (print c) (abort))) + diff --git a/_screenrc b/_screenrc new file mode 100644 index 0000000..66c8e05 --- /dev/null +++ b/_screenrc @@ -0,0 +1,83 @@ +# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # +# Use this line if you want instant charset mapping from gbk to +# unicode. Conflict with mutt's unicode setting. +#defencoding gbk + +# hardstatus line +hardstatus alwayslastline +#left aligned +#hardstatus string "%{= R}[%{y}%l%{r}][ %{=b b}%-w%{=rb db}%>%n %t%{-}%+w%{-b}%< %=%{R}][%{G}%c %{M}%D %m-%d%{R}]" +#center aligned +hardstatus string "%{= B}:%{= b}: %{= r}[ %{=b G}%H%{= r} ] %= %{=b b}%-w%{=rb db}%>%n %t%{-}%+w %=%{= r}[ %{G}%c %{M}%D %m-%d %{r}] %{= b}:%{B}:" +#caption always "%{= mW} %= %H %=" +#caption always "%{= gk}%-Lw%{= rW}%50> %n%f* %t %{-}%+Lw%< %= %{= Gk} %H %{= rW} %l %{= Gk} %0c:%s %d/%m %{-}" +#new version from vermaden +#hardstatus string '%{= M} %H%{= G} %l %= %{= w}%-w%{+b r}%n*%t%{-b r}%{w}%+w %= %{c}%d %D %{B}%c ' +# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # +## Some general options ## + +# Make the xterm scroller work in screen, also works +# with mouse scrollwheel(does not work...) +terminfo xterm*|rxvt ti@:te@ +#allow bold +#attrcolor b ".I" +## erase background with current bg color +#defbce "on" +#fix rxvt-unicode 256 color problem +terminfo rxvt-unicode 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' +# tell screen how to set colors. AB = background, AF=foreground +#terminfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' +#dynamic title +terminfo xterm* 'XT:hs:ts=\E]2;:fs=\007:ds=\E]2;screen\007' + +# Automatically detach on hangup, or the screen will keep eating your memory after the terminal emulator has been terminated. +autodetach on # default: on + +# Refresh the display when exiting programs like vim, nano, irssi and etc. +altscreen on + +#define a large scrollback buffer +defscrollback 1000 + +# Set messages timeout to 5 second: +msgwait 4 +msgminwait 1 +pow_detach_msg "Screen session of \$LOGNAME \$:cr:\$:nl:ended." +#version +# start message: +startup_message off # default: on + +# use audio bell +vbell off +vbell_msg " Wuff ---- Wuff!! " + +#nethack style messages +nethack on + +#utf-8 handling +defutf8 on + +attrcolor b ".I" + +#use zshell as default shell +#shell zsh +shell /bin/zsh + +# =-=-=-=-=-=-=-=-=-=-=Key bindings-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # +# bind F1 to select 1 +# bind F7 to detach screen session from this terminal +# bind F8 to kill current screen window. +# bind F9 to create a new screen +# bind F10 to rename current screen window +# bind F11 to move to previous window +# bind F12 to move to next window +#bindkey -k k1 select 1 +#bindkey -k k7 detach +#bindkey -k k8 kill +#bindkey -k k9 screen +#bindkey -k k; title +bindkey -k F1 prev +bindkey -k F2 next +# =-=-=-=-=-=-=-=-=-=-=-Sessions=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # +screen +screen diff --git a/_tmux.conf b/_tmux.conf new file mode 100644 index 0000000..260954e --- /dev/null +++ b/_tmux.conf @@ -0,0 +1,133 @@ +######################################################################### +## tmux configuration ## +## ~/.tmux.conf ## +## ## +## Weitian LI ## +## 2015/01/22 ## +## ## +## ChangeLogs: ## +######################################################################### + +## References: +## [1] tmux: Productive Mouse-Free Development (by Brian P. Hogan) +## https://pragprog.com/book/bhtmux/tmux +## [2] Copy and Paste in tmux +## http://dudenbostel.leanside.com/2014/01/copy-paste-in-tmux/ + +## Settings the prefix from 'C-b' to 'C-a' +#set-option -g prefix C-a +#unbind-key C-b +#bind-key C-a send-prefix + +## Settings the delay between prefix and command +set-option -gs escape-time 1 + +## Set the base index for windows to 1 instead of 0 +set-option -g base-index 1 + +## Set the base index for panes to 1 instead of 0 +set-window-option -g pane-base-index 1 + +## Reload the configuration file with 'Prefix-r' +bind r source-file ~/.tmux.conf \; display "Reloaded!" + +## More straightforward key bindings for splitting panes +unbind % +bind | split-window -h +unbind '"' +bind - split-window -v + +## Move between the split panes +bind h select-pane -L +bind j select-pane -D +bind k select-pane -U +bind l select-pane -R + +## C-h/C-l to cycle through windows +bind -r C-h select-window -t :- +bind -r C-l select-window -t :+ + +## Quich cycle through windows +#bind-key -n C-p previous-window +#bind-key -n C-n next-window + +## Pane resizing +bind -r H resize-pane -L 5 +bind -r J resize-pane -D 5 +bind -r K resize-pane -U 5 +bind -r L resize-pane -R 5 + +## Mouse support +#set-window-option -g mode-mouse on +#set-option -g mouse-select-window on +#set-option -g mouse-select-pane on +#set-option -g mouse-resize-pane on + +## Set the default terminal mode +set-option -g default-terminal "screen-256color" + +## Enable activity alerts +set-window-option -g monitor-activity on +set-option -g visual-activity on + +## utf8 +set-option -g status-utf8 on +set-window-option -g utf8 on + +## Vi mode +set-window-option -g mode-keys vi +set-option -g status-keys vi + +## Set copy mode +# start copy mode with 'Prefix-Escape' +bind-key Escape copy-mode +# paste the latest buffer with 'Prefix-p' +bind-key p paste-buffer +# delete the most recently copied buffer +bind-key + delete-buffer + +# vi-copy settings +bind-key -t vi-copy 'v' begin-selection +bind-key -t vi-copy 'y' copy-selection +# change between line- and column-wise selection +bind-key -t vi-copy 'V' rectangle-toggle +bind-key -t vi-copy 'Y' copy-end-of-line + +## Scrollback history +set-option -g history-limit 5000 + +## How long to display messages and other indicators (unit: ms) +set-option -g display-time 3000 + +## Send multiple commands without pressing Prefix again +set-option -g repeat-time 1000 + +## Maximize and restore a pane +unbind Up +bind Up new-window -d -n tmp \; swap-pane -s tmp.1 \; select-window -t tmp +unbind Down +bind Down last-window \; swap-pane -s tmp.1 \; kill-window -t tmp + +## Log output to a text file on demand +bind P pipe-pane -o "cat >> ~/#W.log" \; display "Toggled logging to ~/#W.log" + +### Styles ### + +## Set the status line +set-option -g status-style "bg=default" +set-option -g status-justify centre +set-option -g status-left-length 30 +set-option -g status-right-length 30 +set-option -g status-left " #[fg=yellow,bold]#h:#[fg=blue,bold]#S #[fg=magenta,bold]|#[default]" +set-option -g status-right "#[fg=magenta,bold]| #[fg=yellow,bold]%a %m/%d #[fg=blue,bold]%H:%M " + +set-window-option -g window-status-style "fg=blue,bold" +set-window-option -g window-status-current-style "fg=blue,bold,reverse" +set-window-option -g window-status-format "#I:#{=10:window_name}#F" +set-window-option -g window-status-current-format "#I:#W#F" + +## command/message line style +set-option -g message-style "fg=white,bold,bg=blue" + + +# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=tmux: # diff --git a/_todo/config b/_todo/config new file mode 100644 index 0000000..a60e513 --- /dev/null +++ b/_todo/config @@ -0,0 +1,95 @@ +########################################################### +## todo.txt-cli configuration +## https://github.com/ginatrapani/todo.txt-cli +########################################################### + +# === EDIT FILE LOCATIONS BELOW === + +# Your todo.txt directory +#export TODO_DIR="/Users/gina/Documents/todo" +#export TODO_DIR=$(dirname "$0") +export TODO_DIR="$HOME/.todo" + +# Your todo/done/report.txt locations +export TODO_FILE="$TODO_DIR/todo.txt" +export DONE_FILE="$TODO_DIR/done.txt" +export REPORT_FILE="$TODO_DIR/report.txt" + +# You can customize your actions directory location +export TODO_ACTIONS_DIR="$HOME/.todo.actions.d" + +# == EDIT FILE LOCATIONS ABOVE === + +# === COLOR MAP === + +## Text coloring and formatting is done by inserting ANSI escape codes. +## If you have re-mapped your color codes, or use the todo.txt +## output in another output system (like Conky), you may need to +## over-ride by uncommenting and editing these defaults. +## If you change any of these here, you also need to uncomment +## the defaults in the COLORS section below. Otherwise, todo.txt +## will still use the defaults! + +export BLACK='\\033[0;30m' +export RED='\\033[0;31m' +export GREEN='\\033[0;32m' +export BROWN='\\033[0;33m' +export BLUE='\\033[0;34m' +export PURPLE='\\033[0;35m' +export CYAN='\\033[0;36m' +export LIGHT_GREY='\\033[0;37m' +export DARK_GREY='\\033[1;30m' +export LIGHT_RED='\\033[1;31m' +export LIGHT_GREEN='\\033[1;32m' +export YELLOW='\\033[1;33m' +export LIGHT_BLUE='\\033[1;34m' +export LIGHT_PURPLE='\\033[1;35m' +export LIGHT_CYAN='\\033[1;36m' +export WHITE='\\033[1;37m' +export DEFAULT='\\033[0m' + +# === COLORS === + +## Uncomment and edit to override these defaults. +## Reference the constants from the color map above, +## or use $NONE to disable highlighting. +# +# Priorities can be any upper-case letter. +# A,B,C are highlighted; you can add coloring for more. +# +export PRI_A=$YELLOW # color for A priority +export PRI_B=$GREEN # color for B priority +export PRI_C=$LIGHT_BLUE # color for C priority +#export PRI_D=... # define your own +export PRI_X=$WHITE # color unless explicitly defined + +# There is highlighting for tasks that have been done, +# but haven't been archived yet. +# +export COLOR_DONE=$LIGHT_GREY + +# There is highlighting for projects and contexts. +# +export COLOR_PROJECT=$RED +export COLOR_CONTEXT=$RED + +# === BEHAVIOR === + +## customize list output +# +# TODOTXT_SORT_COMMAND will filter after line numbers are +# inserted, but before colorization, and before hiding of +# priority, context, and project. +# +#export TODOTXT_SORT_COMMAND='env LC_COLLATE=C sort -f -k2' +# +# Sort by priority, then by number +export TODOTXT_SORT_COMMAND='env LC_COLLATE=C sort -k 2,2 -k 1,1n' + +# TODOTXT_FINAL_FILTER will filter list output after colorization, +# priority hiding, context hiding, and project hiding. That is, +# just before the list output is displayed. +# +# export TODOTXT_FINAL_FILTER='cat' + +# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=sh: # diff --git a/_todo/todo.sh b/_todo/todo.sh new file mode 100755 index 0000000..fbd2725 --- /dev/null +++ b/_todo/todo.sh @@ -0,0 +1,1431 @@ +#! /usr/bin/env bash + +# === HEAVY LIFTING === +shopt -s extglob extquote + +# NOTE: Todo.sh requires the .todo/config configuration file to run. +# Place the .todo/config file in your home directory or use the -d option for a custom location. + +[ -f VERSION-FILE ] && . VERSION-FILE || VERSION="2.10" +version() { + cat <<-EndVersion + TODO.TXT Command Line Interface v$VERSION + + First release: 5/11/2006 + Original conception by: Gina Trapani (http://ginatrapani.org) + Contributors: http://github.com/ginatrapani/todo.txt-cli/network + License: GPL, http://www.gnu.org/copyleft/gpl.html + More information and mailing list at http://todotxt.com + Code repository: http://github.com/ginatrapani/todo.txt-cli/tree/master + EndVersion + exit 1 +} + +# Set script name and full path early. +TODO_SH=$(basename "$0") +TODO_FULL_SH="$0" +export TODO_SH TODO_FULL_SH + +oneline_usage="$TODO_SH [-fhpantvV] [-d todo_config] action [task_number] [task_description]" + +usage() +{ + cat <<-EndUsage + Usage: $oneline_usage + Try '$TODO_SH -h' for more information. + EndUsage + exit 1 +} + +shorthelp() +{ + cat <<-EndHelp + Usage: $oneline_usage + + Actions: + add|a "THING I NEED TO DO +project @context" + addm "THINGS I NEED TO DO + MORE THINGS I NEED TO DO" + addto DEST "TEXT TO ADD" + append|app ITEM# "TEXT TO APPEND" + archive + command [ACTIONS] + deduplicate + del|rm ITEM# [TERM] + depri|dp ITEM#[, ITEM#, ITEM#, ...] + do ITEM#[, ITEM#, ITEM#, ...] + help [ACTION...] + list|ls [TERM...] + listall|lsa [TERM...] + listaddons + listcon|lsc [TERM...] + listfile|lf [SRC [TERM...]] + listpri|lsp [PRIORITIES] [TERM...] + listproj|lsprj [TERM...] + move|mv ITEM# DEST [SRC] + prepend|prep ITEM# "TEXT TO PREPEND" + pri|p ITEM# PRIORITY + replace ITEM# "UPDATED TODO" + report + shorthelp + + Actions can be added and overridden using scripts in the actions + directory. + EndHelp + + # Only list the one-line usage from the add-on actions. This assumes that + # add-ons use the same usage indentation structure as todo.sh. + addonHelp | grep -e '^ Add-on Actions:' -e '^ [[:alpha:]]' + + cat <<-EndHelpFooter + + See "help" for more details. + EndHelpFooter +} + +help() +{ + cat <<-EndOptionsHelp + Usage: $oneline_usage + + Options: + -@ + Hide context names in list output. Use twice to show context + names (default). + -+ + Hide project names in list output. Use twice to show project + names (default). + -c + Color mode + -d CONFIG_FILE + Use a configuration file other than the default ~/.todo/config + -f + Forces actions without confirmation or interactive input + -h + Display a short help message; same as action "shorthelp" + -p + Plain mode turns off colors + -P + Hide priority labels in list output. Use twice to show + priority labels (default). + -a + Don't auto-archive tasks automatically on completion + -A + Auto-archive tasks automatically on completion + -n + Don't preserve line numbers; automatically remove blank lines + on task deletion + -N + Preserve line numbers + -t + Prepend the current date to a task automatically + when it's added. + -T + Do not prepend the current date to a task automatically + when it's added. + -v + Verbose mode turns on confirmation messages + -vv + Extra verbose mode prints some debugging information and + additional help text + -V + Displays version, license and credits + -x + Disables TODOTXT_FINAL_FILTER + + + EndOptionsHelp + + [ $TODOTXT_VERBOSE -gt 1 ] && cat <<-'EndVerboseHelp' + Environment variables: + TODOTXT_AUTO_ARCHIVE is same as option -a (0)/-A (1) + TODOTXT_CFG_FILE=CONFIG_FILE is same as option -d CONFIG_FILE + TODOTXT_FORCE=1 is same as option -f + TODOTXT_PRESERVE_LINE_NUMBERS is same as option -n (0)/-N (1) + TODOTXT_PLAIN is same as option -p (1)/-c (0) + TODOTXT_DATE_ON_ADD is same as option -t (1)/-T (0) + TODOTXT_VERBOSE=1 is same as option -v + TODOTXT_DISABLE_FILTER=1 is same as option -x + TODOTXT_DEFAULT_ACTION="" run this when called with no arguments + TODOTXT_SORT_COMMAND="sort ..." customize list output + TODOTXT_FINAL_FILTER="sed ..." customize list after color, P@+ hiding + TODOTXT_SOURCEVAR=\$DONE_FILE use another source for listcon, listproj + + + EndVerboseHelp + actionsHelp + addonHelp +} + +actionsHelp() +{ + cat <<-EndActionsHelp + Built-in Actions: + add "THING I NEED TO DO +project @context" + a "THING I NEED TO DO +project @context" + Adds THING I NEED TO DO to your todo.txt file on its own line. + Project and context notation optional. + Quotes optional. + + addm "FIRST THING I NEED TO DO +project1 @context + SECOND THING I NEED TO DO +project2 @context" + Adds FIRST THING I NEED TO DO to your todo.txt on its own line and + Adds SECOND THING I NEED TO DO to you todo.txt on its own line. + Project and context notation optional. + + addto DEST "TEXT TO ADD" + Adds a line of text to any file located in the todo.txt directory. + For example, addto inbox.txt "decide about vacation" + + append ITEM# "TEXT TO APPEND" + app ITEM# "TEXT TO APPEND" + Adds TEXT TO APPEND to the end of the task on line ITEM#. + Quotes optional. + + archive + Moves all done tasks from todo.txt to done.txt and removes blank lines. + + command [ACTIONS] + Runs the remaining arguments using only todo.sh builtins. + Will not call any .todo.actions.d scripts. + + deduplicate + Removes duplicate lines from todo.txt. + + del ITEM# [TERM] + rm ITEM# [TERM] + Deletes the task on line ITEM# in todo.txt. + If TERM specified, deletes only TERM from the task. + + depri ITEM#[, ITEM#, ITEM#, ...] + dp ITEM#[, ITEM#, ITEM#, ...] + Deprioritizes (removes the priority) from the task(s) + on line ITEM# in todo.txt. + + do ITEM#[, ITEM#, ITEM#, ...] + Marks task(s) on line ITEM# as done in todo.txt. + + help [ACTION...] + Display help about usage, options, built-in and add-on actions, + or just the usage help for the passed ACTION(s). + + list [TERM...] + ls [TERM...] + Displays all tasks that contain TERM(s) sorted by priority with line + numbers. Each task must match all TERM(s) (logical AND); to display + tasks that contain any TERM (logical OR), use + "TERM1\|TERM2\|..." (with quotes), or TERM1\\\|TERM2 (unquoted). + Hides all tasks that contain TERM(s) preceded by a + minus sign (i.e. -TERM). If no TERM specified, lists entire todo.txt. + + listall [TERM...] + lsa [TERM...] + Displays all the lines in todo.txt AND done.txt that contain TERM(s) + sorted by priority with line numbers. Hides all tasks that + contain TERM(s) preceded by a minus sign (i.e. -TERM). If no + TERM specified, lists entire todo.txt AND done.txt + concatenated and sorted. + + listaddons + Lists all added and overridden actions in the actions directory. + + listcon [TERM...] + lsc [TERM...] + Lists all the task contexts that start with the @ sign in todo.txt. + If TERM specified, considers only tasks that contain TERM(s). + + listfile [SRC [TERM...]] + lf [SRC [TERM...]] + Displays all the lines in SRC file located in the todo.txt directory, + sorted by priority with line numbers. If TERM specified, lists + all lines that contain TERM(s) in SRC file. Hides all tasks that + contain TERM(s) preceded by a minus sign (i.e. -TERM). + Without any arguments, the names of all text files in the todo.txt + directory are listed. + + listpri [PRIORITIES] [TERM...] + lsp [PRIORITIES] [TERM...] + Displays all tasks prioritized PRIORITIES. + PRIORITIES can be a single one (A) or a range (A-C). + If no PRIORITIES specified, lists all prioritized tasks. + If TERM specified, lists only prioritized tasks that contain TERM(s). + Hides all tasks that contain TERM(s) preceded by a minus sign + (i.e. -TERM). + + listproj [TERM...] + lsprj [TERM...] + Lists all the projects (terms that start with a + sign) in + todo.txt. + If TERM specified, considers only tasks that contain TERM(s). + + move ITEM# DEST [SRC] + mv ITEM# DEST [SRC] + Moves a line from source text file (SRC) to destination text file (DEST). + Both source and destination file must be located in the directory defined + in the configuration directory. When SRC is not defined + it's by default todo.txt. + + prepend ITEM# "TEXT TO PREPEND" + prep ITEM# "TEXT TO PREPEND" + Adds TEXT TO PREPEND to the beginning of the task on line ITEM#. + Quotes optional. + + pri ITEM# PRIORITY + p ITEM# PRIORITY + Adds PRIORITY to task on line ITEM#. If the task is already + prioritized, replaces current priority with new PRIORITY. + PRIORITY must be a letter between A and Z. + + replace ITEM# "UPDATED TODO" + Replaces task on line ITEM# with UPDATED TODO. + + report + Adds the number of open tasks and done tasks to report.txt. + + shorthelp + List the one-line usage of all built-in and add-on actions. + + EndActionsHelp +} + +addonHelp() +{ + if [ -d "$TODO_ACTIONS_DIR" ]; then + didPrintAddonActionsHeader= + for action in "$TODO_ACTIONS_DIR"/* + do + if [ -f "$action" -a -x "$action" ]; then + if [ ! "$didPrintAddonActionsHeader" ]; then + cat <<-EndAddonActionsHeader + Add-on Actions: + EndAddonActionsHeader + didPrintAddonActionsHeader=1 + fi + "$action" usage + elif [ -d "$action" -a -x "$action/$(basename $action)" ]; then + if [ ! "$didPrintAddonActionsHeader" ]; then + cat <<-EndAddonActionsHeader + Add-on Actions: + EndAddonActionsHeader + didPrintAddonActionsHeader=1 + fi + "$action/$(basename $action)" usage + fi + done + fi +} + +actionUsage() +{ + for actionName + do + action="${TODO_ACTIONS_DIR}/${actionName}" + if [ -f "$action" -a -x "$action" ]; then + "$action" usage + elif [ -d "$action" -a -x "$action/$(basename $action)" ]; then + "$action/$(basename $action)" usage + else + builtinActionUsage=$(actionsHelp | sed -n -e "/^ ${actionName//\//\\/} /,/^\$/p" -e "/^ ${actionName//\//\\/}$/,/^\$/p") + if [ "$builtinActionUsage" ]; then + echo "$builtinActionUsage" + echo + else + die "TODO: No action \"${actionName}\" exists." + fi + fi + done +} + +dieWithHelp() +{ + case "$1" in + help) help;; + shorthelp) shorthelp;; + esac + shift + + die "$@" +} +die() +{ + echo "$*" + exit 1 +} + +cleaninput() +{ + # Parameters: When $1 = "for sed", performs additional escaping for use + # in sed substitution with "|" separators. + # Precondition: $input contains text to be cleaned. + # Postcondition: Modifies $input. + + # Replace CR and LF with space; tasks always comprise a single line. + input=${input//$'\r'/ } + input=${input//$'\n'/ } + + if [ "$1" = "for sed" ]; then + # This action uses sed with "|" as the substitution separator, and & as + # the matched string; these must be escaped. + # Backslashes must be escaped, too, and before the other stuff. + input=${input//\\/\\\\} + input=${input//|/\\|} + input=${input//&/\\&} + fi +} + +getPrefix() +{ + # Parameters: $1: todo file; empty means $TODO_FILE. + # Returns: Uppercase FILE prefix to be used in place of "TODO:" where + # a different todo file can be specified. + local base=$(basename "${1:-$TODO_FILE}") + echo "${base%%.[^.]*}" | tr 'a-z' 'A-Z' +} + +getTodo() +{ + # Parameters: $1: task number + # $2: Optional todo file + # Precondition: $errmsg contains usage message. + # Postcondition: $todo contains task text. + + local item=$1 + [ -z "$item" ] && die "$errmsg" + [ "${item//[0-9]/}" ] && die "$errmsg" + + todo=$(sed "$item!d" "${2:-$TODO_FILE}") + [ -z "$todo" ] && die "$(getPrefix "$2"): No task $item." +} +getNewtodo() +{ + # Parameters: $1: task number + # $2: Optional todo file + # Precondition: None. + # Postcondition: $newtodo contains task text. + + local item=$1 + [ -z "$item" ] && die 'Programming error: $item should exist.' + [ "${item//[0-9]/}" ] && die 'Programming error: $item should be numeric.' + + newtodo=$(sed "$item!d" "${2:-$TODO_FILE}") + [ -z "$newtodo" ] && die "$(getPrefix "$2"): No updated task $item." +} + +replaceOrPrepend() +{ + action=$1; shift + case "$action" in + replace) + backref= + querytext="Replacement: " + ;; + prepend) + backref=' &' + querytext="Prepend: " + ;; + esac + shift; item=$1; shift + getTodo "$item" + + if [[ -z "$1" && $TODOTXT_FORCE = 0 ]]; then + echo -n "$querytext" + read input + else + input=$* + fi + + # Retrieve existing priority and prepended date + local -r priAndDateExpr='^\((.) \)\{0,1\}\([0-9]\{2,4\}-[0-9]\{2\}-[0-9]\{2\} \)\{0,1\}' + priority=$(sed -e "$item!d" -e "${item}s/${priAndDateExpr}.*/\\1/" "$TODO_FILE") + prepdate=$(sed -e "$item!d" -e "${item}s/${priAndDateExpr}.*/\\2/" "$TODO_FILE") + + if [ "$prepdate" -a "$action" = "replace" ] && [ "$(echo "$input"|sed -e "s/${priAndDateExpr}.*/\\1\\2/")" ]; then + # If the replaced text starts with a [priority +] date, it will replace + # the existing date, too. + prepdate= + fi + + # Temporarily remove any existing priority and prepended date, perform the + # change (replace/prepend) and re-insert the existing priority and prepended + # date again. + cleaninput "for sed" + sed -i.bak -e "$item s/^${priority}${prepdate}//" -e "$item s|^.*|${priority}${prepdate}${input}${backref}|" "$TODO_FILE" + if [ $TODOTXT_VERBOSE -gt 0 ]; then + getNewtodo "$item" + case "$action" in + replace) + echo "$item $todo" + echo "TODO: Replaced task with:" + echo "$item $newtodo" + ;; + prepend) + echo "$item $newtodo" + ;; + esac + fi +} + +#Preserving environment variables so they don't get clobbered by the config file +OVR_TODOTXT_AUTO_ARCHIVE="$TODOTXT_AUTO_ARCHIVE" +OVR_TODOTXT_FORCE="$TODOTXT_FORCE" +OVR_TODOTXT_PRESERVE_LINE_NUMBERS="$TODOTXT_PRESERVE_LINE_NUMBERS" +OVR_TODOTXT_PLAIN="$TODOTXT_PLAIN" +OVR_TODOTXT_DATE_ON_ADD="$TODOTXT_DATE_ON_ADD" +OVR_TODOTXT_DISABLE_FILTER="$TODOTXT_DISABLE_FILTER" +OVR_TODOTXT_VERBOSE="$TODOTXT_VERBOSE" +OVR_TODOTXT_DEFAULT_ACTION="$TODOTXT_DEFAULT_ACTION" +OVR_TODOTXT_SORT_COMMAND="$TODOTXT_SORT_COMMAND" +OVR_TODOTXT_FINAL_FILTER="$TODOTXT_FINAL_FILTER" + +# Prevent GREP_OPTIONS from malforming grep's output +GREP_OPTIONS="" + +# == PROCESS OPTIONS == +while getopts ":fhpcnNaAtTvVx+@Pd:" Option +do + case $Option in + '@' ) + ## HIDE_CONTEXT_NAMES starts at zero (false); increment it to one + ## (true) the first time this flag is seen. Each time the flag + ## is seen after that, increment it again so that an even + ## number shows context names and an odd number hides context + ## names. + : $(( HIDE_CONTEXT_NAMES++ )) + if [ $(( $HIDE_CONTEXT_NAMES % 2 )) -eq 0 ] + then + ## Zero or even value -- show context names + unset HIDE_CONTEXTS_SUBSTITUTION + else + ## One or odd value -- hide context names + export HIDE_CONTEXTS_SUBSTITUTION='[[:space:]]@[[:graph:]]\{1,\}' + fi + ;; + '+' ) + ## HIDE_PROJECT_NAMES starts at zero (false); increment it to one + ## (true) the first time this flag is seen. Each time the flag + ## is seen after that, increment it again so that an even + ## number shows project names and an odd number hides project + ## names. + : $(( HIDE_PROJECT_NAMES++ )) + if [ $(( $HIDE_PROJECT_NAMES % 2 )) -eq 0 ] + then + ## Zero or even value -- show project names + unset HIDE_PROJECTS_SUBSTITUTION + else + ## One or odd value -- hide project names + export HIDE_PROJECTS_SUBSTITUTION='[[:space:]][+][[:graph:]]\{1,\}' + fi + ;; + a ) + OVR_TODOTXT_AUTO_ARCHIVE=0 + ;; + A ) + OVR_TODOTXT_AUTO_ARCHIVE=1 + ;; + c ) + OVR_TODOTXT_PLAIN=0 + ;; + d ) + TODOTXT_CFG_FILE=$OPTARG + ;; + f ) + OVR_TODOTXT_FORCE=1 + ;; + h ) + # Short-circuit option parsing and forward to the action. + # Cannot just invoke shorthelp() because we need the configuration + # processed to locate the add-on actions directory. + set -- '-h' 'shorthelp' + OPTIND=2 + ;; + n ) + OVR_TODOTXT_PRESERVE_LINE_NUMBERS=0 + ;; + N ) + OVR_TODOTXT_PRESERVE_LINE_NUMBERS=1 + ;; + p ) + OVR_TODOTXT_PLAIN=1 + ;; + P ) + ## HIDE_PRIORITY_LABELS starts at zero (false); increment it to one + ## (true) the first time this flag is seen. Each time the flag + ## is seen after that, increment it again so that an even + ## number shows priority labels and an odd number hides priority + ## labels. + : $(( HIDE_PRIORITY_LABELS++ )) + if [ $(( $HIDE_PRIORITY_LABELS % 2 )) -eq 0 ] + then + ## Zero or even value -- show priority labels + unset HIDE_PRIORITY_SUBSTITUTION + else + ## One or odd value -- hide priority labels + export HIDE_PRIORITY_SUBSTITUTION="([A-Z])[[:space:]]" + fi + ;; + t ) + OVR_TODOTXT_DATE_ON_ADD=1 + ;; + T ) + OVR_TODOTXT_DATE_ON_ADD=0 + ;; + v ) + : $(( TODOTXT_VERBOSE++ )) + ;; + V ) + version + ;; + x ) + OVR_TODOTXT_DISABLE_FILTER=1 + ;; + esac +done +shift $(($OPTIND - 1)) + +# defaults if not yet defined +TODOTXT_VERBOSE=${TODOTXT_VERBOSE:-1} +TODOTXT_PLAIN=${TODOTXT_PLAIN:-0} +TODOTXT_CFG_FILE=${TODOTXT_CFG_FILE:-$HOME/.todo/config} +TODOTXT_FORCE=${TODOTXT_FORCE:-0} +TODOTXT_PRESERVE_LINE_NUMBERS=${TODOTXT_PRESERVE_LINE_NUMBERS:-1} +TODOTXT_AUTO_ARCHIVE=${TODOTXT_AUTO_ARCHIVE:-1} +TODOTXT_DATE_ON_ADD=${TODOTXT_DATE_ON_ADD:-0} +TODOTXT_DEFAULT_ACTION=${TODOTXT_DEFAULT_ACTION:-} +TODOTXT_SORT_COMMAND=${TODOTXT_SORT_COMMAND:-env LC_COLLATE=C sort -f -k2} +TODOTXT_DISABLE_FILTER=${TODOTXT_DISABLE_FILTER:-} +TODOTXT_FINAL_FILTER=${TODOTXT_FINAL_FILTER:-cat} +TODOTXT_GLOBAL_CFG_FILE=${TODOTXT_GLOBAL_CFG_FILE:-/etc/todo/config} + +# Export all TODOTXT_* variables +export ${!TODOTXT_@} + +# Default color map +export NONE='' +export BLACK='\\033[0;30m' +export RED='\\033[0;31m' +export GREEN='\\033[0;32m' +export BROWN='\\033[0;33m' +export BLUE='\\033[0;34m' +export PURPLE='\\033[0;35m' +export CYAN='\\033[0;36m' +export LIGHT_GREY='\\033[0;37m' +export DARK_GREY='\\033[1;30m' +export LIGHT_RED='\\033[1;31m' +export LIGHT_GREEN='\\033[1;32m' +export YELLOW='\\033[1;33m' +export LIGHT_BLUE='\\033[1;34m' +export LIGHT_PURPLE='\\033[1;35m' +export LIGHT_CYAN='\\033[1;36m' +export WHITE='\\033[1;37m' +export DEFAULT='\\033[0m' + +# Default priority->color map. +export PRI_A=$YELLOW # color for A priority +export PRI_B=$GREEN # color for B priority +export PRI_C=$LIGHT_BLUE # color for C priority +export PRI_X=$WHITE # color unless explicitly defined + +# Default project and context colors. +export COLOR_PROJECT=$NONE +export COLOR_CONTEXT=$NONE + +# Default highlight colors. +export COLOR_DONE=$LIGHT_GREY # color for done (but not yet archived) tasks + +# Default sentence delimiters for todo.sh append. +# If the text to be appended to the task begins with one of these characters, no +# whitespace is inserted in between. This makes appending to an enumeration +# (todo.sh add 42 ", foo") syntactically correct. +export SENTENCE_DELIMITERS=',.:;' + +[ -e "$TODOTXT_CFG_FILE" ] || { + CFG_FILE_ALT="$HOME/todo.cfg" + + if [ -e "$CFG_FILE_ALT" ] + then + TODOTXT_CFG_FILE="$CFG_FILE_ALT" + fi +} + +[ -e "$TODOTXT_CFG_FILE" ] || { + CFG_FILE_ALT="$HOME/.todo.cfg" + + if [ -e "$CFG_FILE_ALT" ] + then + TODOTXT_CFG_FILE="$CFG_FILE_ALT" + fi +} + +[ -e "$TODOTXT_CFG_FILE" ] || { + CFG_FILE_ALT=$(dirname "$0")"/todo.cfg" + + if [ -e "$CFG_FILE_ALT" ] + then + TODOTXT_CFG_FILE="$CFG_FILE_ALT" + fi +} + +[ -e "$TODOTXT_CFG_FILE" ] || { + CFG_FILE_ALT="$TODOTXT_GLOBAL_CFG_FILE" + + if [ -e "$CFG_FILE_ALT" ] + then + TODOTXT_CFG_FILE="$CFG_FILE_ALT" + fi +} + + +if [ -z "$TODO_ACTIONS_DIR" -o ! -d "$TODO_ACTIONS_DIR" ] +then + TODO_ACTIONS_DIR="$HOME/.todo/actions" + export TODO_ACTIONS_DIR +fi + +[ -d "$TODO_ACTIONS_DIR" ] || { + TODO_ACTIONS_DIR_ALT="$HOME/.todo.actions.d" + + if [ -d "$TODO_ACTIONS_DIR_ALT" ] + then + TODO_ACTIONS_DIR="$TODO_ACTIONS_DIR_ALT" + fi +} + +# === SANITY CHECKS (thanks Karl!) === +[ -r "$TODOTXT_CFG_FILE" ] || dieWithHelp "$1" "Fatal Error: Cannot read configuration file $TODOTXT_CFG_FILE" + +. "$TODOTXT_CFG_FILE" + +# === APPLY OVERRIDES +if [ -n "$OVR_TODOTXT_AUTO_ARCHIVE" ] ; then + TODOTXT_AUTO_ARCHIVE="$OVR_TODOTXT_AUTO_ARCHIVE" +fi +if [ -n "$OVR_TODOTXT_FORCE" ] ; then + TODOTXT_FORCE="$OVR_TODOTXT_FORCE" +fi +if [ -n "$OVR_TODOTXT_PRESERVE_LINE_NUMBERS" ] ; then + TODOTXT_PRESERVE_LINE_NUMBERS="$OVR_TODOTXT_PRESERVE_LINE_NUMBERS" +fi +if [ -n "$OVR_TODOTXT_PLAIN" ] ; then + TODOTXT_PLAIN="$OVR_TODOTXT_PLAIN" +fi +if [ -n "$OVR_TODOTXT_DATE_ON_ADD" ] ; then + TODOTXT_DATE_ON_ADD="$OVR_TODOTXT_DATE_ON_ADD" +fi +if [ -n "$OVR_TODOTXT_DISABLE_FILTER" ] ; then + TODOTXT_DISABLE_FILTER="$OVR_TODOTXT_DISABLE_FILTER" +fi +if [ -n "$OVR_TODOTXT_VERBOSE" ] ; then + TODOTXT_VERBOSE="$OVR_TODOTXT_VERBOSE" +fi +if [ -n "$OVR_TODOTXT_DEFAULT_ACTION" ] ; then + TODOTXT_DEFAULT_ACTION="$OVR_TODOTXT_DEFAULT_ACTION" +fi +if [ -n "$OVR_TODOTXT_SORT_COMMAND" ] ; then + TODOTXT_SORT_COMMAND="$OVR_TODOTXT_SORT_COMMAND" +fi +if [ -n "$OVR_TODOTXT_FINAL_FILTER" ] ; then + TODOTXT_FINAL_FILTER="$OVR_TODOTXT_FINAL_FILTER" +fi + +ACTION=${1:-$TODOTXT_DEFAULT_ACTION} + +[ -z "$ACTION" ] && usage +[ -d "$TODO_DIR" ] || mkdir -p $TODO_DIR 2> /dev/null || dieWithHelp "$1" "Fatal Error: $TODO_DIR is not a directory" +( cd "$TODO_DIR" ) || dieWithHelp "$1" "Fatal Error: Unable to cd to $TODO_DIR" + +[ -f "$TODO_FILE" -o -c "$TODO_FILE" ] || > "$TODO_FILE" +[ -f "$DONE_FILE" -o -c "$DONE_FILE" ] || > "$DONE_FILE" +[ -f "$REPORT_FILE" -o -c "$REPORT_FILE" ] || > "$REPORT_FILE" + +if [ $TODOTXT_PLAIN = 1 ]; then + for clr in ${!PRI_@}; do + export $clr=$NONE + done + PRI_X=$NONE + DEFAULT=$NONE + COLOR_DONE=$NONE + COLOR_PROJECT=$NONE + COLOR_CONTEXT=$NONE +fi + +[[ "$HIDE_PROJECTS_SUBSTITUTION" ]] && COLOR_PROJECT="$NONE" +[[ "$HIDE_CONTEXTS_SUBSTITUTION" ]] && COLOR_CONTEXT="$NONE" + +_addto() { + file="$1" + input="$2" + cleaninput + + if [[ $TODOTXT_DATE_ON_ADD = 1 ]]; then + now=$(date '+%Y-%m-%d') + input=$(echo "$input" | sed -e 's/^\(([A-Z]) \)\{0,1\}/\1'"$now /") + fi + echo "$input" >> "$file" + if [ $TODOTXT_VERBOSE -gt 0 ]; then + TASKNUM=$(sed -n '$ =' "$file") + echo "$TASKNUM $input" + echo "$(getPrefix "$file"): $TASKNUM added." + fi +} + +shellquote() +{ + typeset -r qq=\'; printf %s\\n "'${1//\'/${qq}\\${qq}${qq}}'"; +} + +filtercommand() +{ + filter=${1:-} + shift + post_filter=${1:-} + shift + + for search_term + do + ## See if the first character of $search_term is a dash + if [ "${search_term:0:1}" != '-' ] + then + ## First character isn't a dash: hide lines that don't match + ## this $search_term + filter="${filter:-}${filter:+ | }grep -i $(shellquote "$search_term")" + else + ## First character is a dash: hide lines that match this + ## $search_term + # + ## Remove the first character (-) before adding to our filter command + filter="${filter:-}${filter:+ | }grep -v -i $(shellquote "${search_term:1}")" + fi + done + + [ -n "$post_filter" ] && { + filter="${filter:-}${filter:+ | }${post_filter:-}" + } + + printf %s "$filter" +} + +_list() { + local FILE="$1" + ## If the file starts with a "/" use absolute path. Otherwise, + ## try to find it in either $TODO_DIR or using a relative path + if [ "${1:0:1}" == / ]; then + ## Absolute path + src="$FILE" + elif [ -f "$TODO_DIR/$FILE" ]; then + ## Path relative to todo.sh directory + src="$TODO_DIR/$FILE" + elif [ -f "$FILE" ]; then + ## Path relative to current working directory + src="$FILE" + elif [ -f "$TODO_DIR/${FILE}.txt" ]; then + ## Path relative to todo.sh directory, missing file extension + src="$TODO_DIR/${FILE}.txt" + else + die "TODO: File $FILE does not exist." + fi + + ## Get our search arguments, if any + shift ## was file name, new $1 is first search term + + _format "$src" '' "$@" + + if [ $TODOTXT_VERBOSE -gt 0 ]; then + echo "--" + echo "$(getPrefix "$src"): ${NUMTASKS:-0} of ${TOTALTASKS:-0} tasks shown" + fi +} +getPadding() +{ + ## We need one level of padding for each power of 10 $LINES uses. + LINES=$(sed -n '$ =' "${1:-$TODO_FILE}") + printf %s ${#LINES} +} +_format() +{ + # Parameters: $1: todo input file; when empty formats stdin + # $2: ITEM# number width; if empty auto-detects from $1 / $TODO_FILE. + # Precondition: None + # Postcondition: $NUMTASKS and $TOTALTASKS contain statistics (unless $TODOTXT_VERBOSE=0). + + FILE=$1 + shift + + ## Figure out how much padding we need to use, unless this was passed to us. + PADDING=${1:-$(getPadding "$FILE")} + shift + + ## Number the file, then run the filter command, + ## then sort and mangle output some more + if [[ $TODOTXT_DISABLE_FILTER = 1 ]]; then + TODOTXT_FINAL_FILTER="cat" + fi + items=$( + if [ "$FILE" ]; then + sed = "$FILE" + else + sed = + fi \ + | sed -e ''' + N + s/^/ / + s/ *\([ 0-9]\{'"$PADDING"',\}\)\n/\1 / + /^[ 0-9]\{1,\} *$/d + ''' + ) + + ## Build and apply the filter. + filter_command=$(filtercommand "${pre_filter_command:-}" "${post_filter_command:-}" "$@") + if [ "${filter_command}" ]; then + filtered_items=$(echo -n "$items" | eval "${filter_command}") + else + filtered_items=$items + fi + filtered_items=$( + echo -n "$filtered_items" \ + | sed ''' + s/^ /00000/; + s/^ /0000/; + s/^ /000/; + s/^ /00/; + s/^ /0/; + ''' \ + | eval ${TODOTXT_SORT_COMMAND} \ + | awk ''' + function highlight(colorVar, color) { + color = ENVIRON[colorVar] + gsub(/\\+033/, "\033", color) + return color + } + { + clr = "" + if (match($0, /^[0-9]+ x /)) { + clr = highlight("COLOR_DONE") + } else if (match($0, /^[0-9]+ \([A-Z]\) /)) { + clr = highlight("PRI_" substr($0, RSTART + RLENGTH - 3, 1)) + clr = (clr ? clr : highlight("PRI_X")) + if (ENVIRON["HIDE_PRIORITY_SUBSTITUTION"] != "") { + $0 = substr($0, 1, RLENGTH - 4) substr($0, RSTART + RLENGTH) + } + } + end_clr = (clr ? highlight("DEFAULT") : "") + + prj_beg = highlight("COLOR_PROJECT") + prj_end = (prj_beg ? (highlight("DEFAULT") clr) : "") + + ctx_beg = highlight("COLOR_CONTEXT") + ctx_end = (ctx_beg ? (highlight("DEFAULT") clr) : "") + + gsub(/[ \t][ \t]*/, "\n&\n") + len = split($0, words, /\n/) + + printf "%s", clr + for (i = 1; i <= len; ++i) { + if (words[i] ~ /^[+].*[A-Za-z0-9_]$/) { + printf "%s", prj_beg words[i] prj_end + } else if (words[i] ~ /^[@].*[A-Za-z0-9_]$/) { + printf "%s", ctx_beg words[i] ctx_end + } else { + printf "%s", words[i] + } + } + printf "%s\n", end_clr + } + ''' \ + | sed ''' + s/'"${HIDE_PROJECTS_SUBSTITUTION:-^}"'//g + s/'"${HIDE_CONTEXTS_SUBSTITUTION:-^}"'//g + s/'"${HIDE_CUSTOM_SUBSTITUTION:-^}"'//g + ''' \ + | eval ${TODOTXT_FINAL_FILTER} \ + ) + [ "$filtered_items" ] && echo "$filtered_items" + + if [ $TODOTXT_VERBOSE -gt 0 ]; then + NUMTASKS=$( echo -n "$filtered_items" | sed -n '$ =' ) + TOTALTASKS=$( echo -n "$items" | sed -n '$ =' ) + fi + if [ $TODOTXT_VERBOSE -gt 1 ]; then + echo "TODO DEBUG: Filter Command was: ${filter_command:-cat}" + fi +} + +listWordsWithSigil() +{ + sigil=$1 + shift + + FILE=$TODO_FILE + [ "$TODOTXT_SOURCEVAR" ] && eval "FILE=$TODOTXT_SOURCEVAR" + eval "$(filtercommand 'cat "${FILE[@]}"' '' "$@")" | grep -o "[^ ]*${sigil}[^ ]\\+" | grep "^$sigil" | sort -u +} + +export -f cleaninput getPrefix getTodo getNewtodo shellquote filtercommand _list listWordsWithSigil getPadding _format die + +# == HANDLE ACTION == +action=$( printf "%s\n" "$ACTION" | tr 'A-Z' 'a-z' ) + +## If the first argument is "command", run the rest of the arguments +## using todo.sh builtins. +## Else, run a actions script with the name of the command if it exists +## or fallback to using a builtin +if [ "$action" == command ] +then + ## Get rid of "command" from arguments list + shift + ## Reset action to new first argument + action=$( printf "%s\n" "$1" | tr 'A-Z' 'a-z' ) +elif [ -d "$TODO_ACTIONS_DIR/$action" -a -x "$TODO_ACTIONS_DIR/$action/$action" ] +then + "$TODO_ACTIONS_DIR/$action/$action" "$@" + exit $? +elif [ -d "$TODO_ACTIONS_DIR" -a -x "$TODO_ACTIONS_DIR/$action" ] +then + "$TODO_ACTIONS_DIR/$action" "$@" + exit $? +fi + +## Only run if $action isn't found in .todo.actions.d +case $action in +"add" | "a") + if [[ -z "$2" && $TODOTXT_FORCE = 0 ]]; then + echo -n "Add: " + read input + else + [ -z "$2" ] && die "usage: $TODO_SH add \"TODO ITEM\"" + shift + input=$* + fi + _addto "$TODO_FILE" "$input" + ;; + +"addm") + if [[ -z "$2" && $TODOTXT_FORCE = 0 ]]; then + echo -n "Add: " + read input + else + [ -z "$2" ] && die "usage: $TODO_SH addm \"TODO ITEM\"" + shift + input=$* + fi + + # Set Internal Field Seperator as newline so we can + # loop across multiple lines + SAVEIFS=$IFS + IFS=$'\n' + + # Treat each line seperately + for line in $input ; do + _addto "$TODO_FILE" "$line" + done + IFS=$SAVEIFS + ;; + +"addto" ) + [ -z "$2" ] && die "usage: $TODO_SH addto DEST \"TODO ITEM\"" + dest="$TODO_DIR/$2" + [ -z "$3" ] && die "usage: $TODO_SH addto DEST \"TODO ITEM\"" + shift + shift + input=$* + + if [ -f "$dest" ]; then + _addto "$dest" "$input" + else + die "TODO: Destination file $dest does not exist." + fi + ;; + +"append" | "app" ) + errmsg="usage: $TODO_SH append ITEM# \"TEXT TO APPEND\"" + shift; item=$1; shift + getTodo "$item" + + if [[ -z "$1" && $TODOTXT_FORCE = 0 ]]; then + echo -n "Append: " + read input + else + input=$* + fi + case "$input" in + [$SENTENCE_DELIMITERS]*) appendspace=;; + *) appendspace=" ";; + esac + cleaninput "for sed" + + if sed -i.bak $item" s|^.*|&${appendspace}${input}|" "$TODO_FILE"; then + if [ $TODOTXT_VERBOSE -gt 0 ]; then + getNewtodo "$item" + echo "$item $newtodo" + fi + else + die "TODO: Error appending task $item." + fi + ;; + +"archive" ) + # defragment blank lines + sed -i.bak -e '/./!d' "$TODO_FILE" + [ $TODOTXT_VERBOSE -gt 0 ] && grep "^x " "$TODO_FILE" + grep "^x " "$TODO_FILE" >> "$DONE_FILE" + sed -i.bak '/^x /d' "$TODO_FILE" + if [ $TODOTXT_VERBOSE -gt 0 ]; then + echo "TODO: $TODO_FILE archived." + fi + ;; + +"del" | "rm" ) + # replace deleted line with a blank line when TODOTXT_PRESERVE_LINE_NUMBERS is 1 + errmsg="usage: $TODO_SH del ITEM# [TERM]" + item=$2 + getTodo "$item" + + if [ -z "$3" ]; then + if [ $TODOTXT_FORCE = 0 ]; then + echo "Delete '$todo'? (y/n)" + read ANSWER + else + ANSWER="y" + fi + if [ "$ANSWER" = "y" ]; then + if [ $TODOTXT_PRESERVE_LINE_NUMBERS = 0 ]; then + # delete line (changes line numbers) + sed -i.bak -e $item"s/^.*//" -e '/./!d' "$TODO_FILE" + else + # leave blank line behind (preserves line numbers) + sed -i.bak -e $item"s/^.*//" "$TODO_FILE" + fi + if [ $TODOTXT_VERBOSE -gt 0 ]; then + echo "$item $todo" + echo "TODO: $item deleted." + fi + else + echo "TODO: No tasks were deleted." + fi + else + sed -i.bak \ + -e $item"s/^\((.) \)\{0,1\} *$3 */\1/g" \ + -e $item"s/ *$3 *\$//g" \ + -e $item"s/ *$3 */ /g" \ + -e $item"s/ *$3 */ /g" \ + -e $item"s/$3//g" \ + "$TODO_FILE" + getNewtodo "$item" + if [ "$todo" = "$newtodo" ]; then + [ $TODOTXT_VERBOSE -gt 0 ] && echo "$item $todo" + die "TODO: '$3' not found; no removal done." + fi + if [ $TODOTXT_VERBOSE -gt 0 ]; then + echo "$item $todo" + echo "TODO: Removed '$3' from task." + echo "$item $newtodo" + fi + fi + ;; + +"depri" | "dp" ) + errmsg="usage: $TODO_SH depri ITEM#[, ITEM#, ITEM#, ...]" + shift; + [ $# -eq 0 ] && die "$errmsg" + + # Split multiple depri's, if comma separated change to whitespace separated + # Loop the 'depri' function for each item + for item in ${*//,/ }; do + getTodo "$item" + + if [[ "$todo" = \(?\)\ * ]]; then + sed -i.bak -e $item"s/^(.) //" "$TODO_FILE" + if [ $TODOTXT_VERBOSE -gt 0 ]; then + getNewtodo "$item" + echo "$item $newtodo" + echo "TODO: $item deprioritized." + fi + else + echo "TODO: $item is not prioritized." + fi + done + ;; + +"do" ) + errmsg="usage: $TODO_SH do ITEM#[, ITEM#, ITEM#, ...]" + # shift so we get arguments to the do request + shift; + [ "$#" -eq 0 ] && die "$errmsg" + + # Split multiple do's, if comma separated change to whitespace separated + # Loop the 'do' function for each item + for item in ${*//,/ }; do + getTodo "$item" + + # Check if this item has already been done + if [ "${todo:0:2}" != "x " ]; then + now=$(date '+%Y-%m-%d') + # remove priority once item is done + sed -i.bak $item"s/^(.) //" "$TODO_FILE" + sed -i.bak $item"s|^|x $now |" "$TODO_FILE" + if [ $TODOTXT_VERBOSE -gt 0 ]; then + getNewtodo "$item" + echo "$item $newtodo" + echo "TODO: $item marked as done." + fi + else + echo "TODO: $item is already marked done." + fi + done + + if [ $TODOTXT_AUTO_ARCHIVE = 1 ]; then + # Recursively invoke the script to allow overriding of the archive + # action. + "$TODO_FULL_SH" archive + fi + ;; + +"help" ) + shift ## Was help; new $1 is first help topic / action name + if [ $# -gt 0 ]; then + # Don't use PAGER here; we don't expect much usage output from one / few actions. + actionUsage "$@" + else + if [ -t 1 ] ; then # STDOUT is a TTY + if which "${PAGER:-less}" >/dev/null 2>&1; then + # we have a working PAGER (or less as a default) + help | "${PAGER:-less}" && exit 0 + fi + fi + help # just in case something failed above, we go ahead and just spew to STDOUT + fi + ;; + +"shorthelp" ) + if [ -t 1 ] ; then # STDOUT is a TTY + if which "${PAGER:-less}" >/dev/null 2>&1; then + # we have a working PAGER (or less as a default) + shorthelp | "${PAGER:-less}" && exit 0 + fi + fi + shorthelp # just in case something failed above, we go ahead and just spew to STDOUT + ;; + +"list" | "ls" ) + shift ## Was ls; new $1 is first search term + _list "$TODO_FILE" "$@" + ;; + +"listall" | "lsa" ) + shift ## Was lsa; new $1 is first search term + + TOTAL=$( sed -n '$ =' "$TODO_FILE" ) + PADDING=${#TOTAL} + + post_filter_command="${post_filter_command:-}${post_filter_command:+ | }awk -v TOTAL=$TOTAL -v PADDING=$PADDING '{ \$1 = sprintf(\"%\" PADDING \"d\", (\$1 > TOTAL ? 0 : \$1)); print }' " + cat "$TODO_FILE" "$DONE_FILE" | TODOTXT_VERBOSE=0 _format '' "$PADDING" "$@" + + if [ $TODOTXT_VERBOSE -gt 0 ]; then + TDONE=$( sed -n '$ =' "$DONE_FILE" ) + TASKNUM=$(TODOTXT_PLAIN=1 TODOTXT_VERBOSE=0 _format "$TODO_FILE" 1 "$@" | sed -n '$ =') + DONENUM=$(TODOTXT_PLAIN=1 TODOTXT_VERBOSE=0 _format "$DONE_FILE" 1 "$@" | sed -n '$ =') + echo "--" + echo "$(getPrefix "$TODO_FILE"): ${TASKNUM:-0} of ${TOTAL:-0} tasks shown" + echo "$(getPrefix "$DONE_FILE"): ${DONENUM:-0} of ${TDONE:-0} tasks shown" + echo "total $((TASKNUM + DONENUM)) of $((TOTAL + TDONE)) tasks shown" + fi + ;; + +"listfile" | "lf" ) + shift ## Was listfile, next $1 is file name + if [ $# -eq 0 ]; then + [ $TODOTXT_VERBOSE -gt 0 ] && echo "Files in the todo.txt directory:" + cd "$TODO_DIR" && ls -1 *.txt + else + FILE="$1" + shift ## Was filename; next $1 is first search term + + _list "$FILE" "$@" + fi + ;; + +"listcon" | "lsc" ) + shift + listWordsWithSigil '@' "$@" + ;; + +"listproj" | "lsprj" ) + shift + listWordsWithSigil '+' "$@" + ;; + +"listpri" | "lsp" ) + shift ## was "listpri", new $1 is priority to list or first TERM + + pri=$(printf "%s\n" "$1" | tr 'a-z' 'A-Z' | grep -e '^[A-Z]$' -e '^[A-Z]-[A-Z]$') && shift || pri="A-Z" + post_filter_command="${post_filter_command:-}${post_filter_command:+ | }grep '^ *[0-9]\+ ([${pri}]) '" + _list "$TODO_FILE" "$@" + ;; + +"move" | "mv" ) + # replace moved line with a blank line when TODOTXT_PRESERVE_LINE_NUMBERS is 1 + errmsg="usage: $TODO_SH mv ITEM# DEST [SRC]" + item=$2 + dest="$TODO_DIR/$3" + src="$TODO_DIR/$4" + + [ -z "$4" ] && src="$TODO_FILE" + [ -z "$dest" ] && die "$errmsg" + + [ -f "$src" ] || die "TODO: Source file $src does not exist." + [ -f "$dest" ] || die "TODO: Destination file $dest does not exist." + + getTodo "$item" "$src" + [ -z "$todo" ] && die "$item: No such item in $src." + if [ $TODOTXT_FORCE = 0 ]; then + echo "Move '$todo' from $src to $dest? (y/n)" + read ANSWER + else + ANSWER="y" + fi + if [ "$ANSWER" = "y" ]; then + if [ $TODOTXT_PRESERVE_LINE_NUMBERS = 0 ]; then + # delete line (changes line numbers) + sed -i.bak -e $item"s/^.*//" -e '/./!d' "$src" + else + # leave blank line behind (preserves line numbers) + sed -i.bak -e $item"s/^.*//" "$src" + fi + echo "$todo" >> "$dest" + + if [ $TODOTXT_VERBOSE -gt 0 ]; then + echo "$item $todo" + echo "TODO: $item moved from '$src' to '$dest'." + fi + else + echo "TODO: No tasks moved." + fi + ;; + +"prepend" | "prep" ) + errmsg="usage: $TODO_SH prepend ITEM# \"TEXT TO PREPEND\"" + replaceOrPrepend 'prepend' "$@" + ;; + +"pri" | "p" ) + item=$2 + newpri=$( printf "%s\n" "$3" | tr 'a-z' 'A-Z' ) + + errmsg="usage: $TODO_SH pri ITEM# PRIORITY +note: PRIORITY must be anywhere from A to Z." + + [ "$#" -ne 3 ] && die "$errmsg" + [[ "$newpri" = @([A-Z]) ]] || die "$errmsg" + getTodo "$item" + + oldpri= + if [[ "$todo" = \(?\)\ * ]]; then + oldpri=${todo:1:1} + fi + + if [ "$oldpri" != "$newpri" ]; then + sed -i.bak -e $item"s/^(.) //" -e $item"s/^/($newpri) /" "$TODO_FILE" + fi + if [ $TODOTXT_VERBOSE -gt 0 ]; then + getNewtodo "$item" + echo "$item $newtodo" + if [ "$oldpri" != "$newpri" ]; then + if [ "$oldpri" ]; then + echo "TODO: $item re-prioritized from ($oldpri) to ($newpri)." + else + echo "TODO: $item prioritized ($newpri)." + fi + fi + fi + if [ "$oldpri" = "$newpri" ]; then + echo "TODO: $item already prioritized ($newpri)." + fi + ;; + +"replace" ) + errmsg="usage: $TODO_SH replace ITEM# \"UPDATED ITEM\"" + replaceOrPrepend 'replace' "$@" + ;; + +"report" ) + # archive first + # Recursively invoke the script to allow overriding of the archive + # action. + "$TODO_FULL_SH" archive + + TOTAL=$( sed -n '$ =' "$TODO_FILE" ) + TDONE=$( sed -n '$ =' "$DONE_FILE" ) + NEWDATA="${TOTAL:-0} ${TDONE:-0}" + LASTREPORT=$(sed -ne '$p' "$REPORT_FILE") + LASTDATA=${LASTREPORT#* } # Strip timestamp. + if [ "$LASTDATA" = "$NEWDATA" ]; then + echo "$LASTREPORT" + [ $TODOTXT_VERBOSE -gt 0 ] && echo "TODO: Report file is up-to-date." + else + NEWREPORT="$(date +%Y-%m-%dT%T) ${NEWDATA}" + echo "${NEWREPORT}" >> "$REPORT_FILE" + echo "${NEWREPORT}" + [ $TODOTXT_VERBOSE -gt 0 ] && echo "TODO: Report file updated." + fi + ;; + +"deduplicate" ) + if [ $TODOTXT_PRESERVE_LINE_NUMBERS = 0 ]; then + deduplicateSedCommand='d' + else + deduplicateSedCommand='s/^.*//; p' + fi + + # To determine the difference when deduplicated lines are preserved, only + # non-empty lines must be counted. + originalTaskNum=$( sed -e '/./!d' "$TODO_FILE" | sed -n '$ =' ) + + # Look for duplicate lines and discard the second occurrence. + # We start with an empty hold space on the first line. For each line: + # G - appends newline + hold space to the pattern space + # s/\n/&&/; - double up the first new line so we catch adjacent dups + # /^\([^\n]*\n\).*\n\1/b dedup + # If the first line of the hold space shows up again later as an + # entire line, it's a duplicate. Jump to the "dedup" label, where + # either of the following is executed, depending on whether empty + # lines should be preserved: + # d - Delete the current pattern space, quit this line and + # move on to the next, or: + # s/^.*//; p - Clear the task text, print this line and move on to + # the next. + # s/\n//; - else (no duplicate), drop the doubled newline + # h; - replace the hold space with the expanded pattern space + # P; - print up to the first newline (that is, the input line) + # b - end processing of the current line + sed -i.bak -n \ + -e 'G; s/\n/&&/; /^\([^\n]*\n\).*\n\1/b dedup' \ + -e 's/\n//; h; P; b' \ + -e ':dedup' \ + -e "$deduplicateSedCommand" \ + "$TODO_FILE" + + newTaskNum=$( sed -e '/./!d' "$TODO_FILE" | sed -n '$ =' ) + deduplicateNum=$(( originalTaskNum - newTaskNum )) + if [ $deduplicateNum -eq 0 ]; then + echo "TODO: No duplicate tasks found" + else + echo "TODO: $deduplicateNum duplicate task(s) removed" + fi + ;; + +"listaddons" ) + if [ -d "$TODO_ACTIONS_DIR" ]; then + cd "$TODO_ACTIONS_DIR" || exit $? + for action in * + do + if [ -f "$action" -a -x "$action" ]; then + echo "$action" + elif [ -d "$action" -a -x "$action/$action" ]; then + echo "$action" + fi + done + fi + ;; + +* ) + usage;; +esac diff --git a/_urxvt/ext/LICENSE b/_urxvt/ext/LICENSE new file mode 100644 index 0000000..d159169 --- /dev/null +++ b/_urxvt/ext/LICENSE @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/_urxvt/ext/README.md b/_urxvt/ext/README.md new file mode 100644 index 0000000..b800ed3 --- /dev/null +++ b/_urxvt/ext/README.md @@ -0,0 +1,107 @@ +A small collection of perl extensions for the rxvt-unicode terminal emulator. + +Installation +------------ +Simply place the scripts you want to install in /usr/lib/urxvt/perl/ for +system-wide availability or in ~/.urxvt/ext/ for user-only availability. +You can also put them in a folder of your choice, but then you have to add this +line to your .Xdefaults/.Xresources: + + URxvt.perl-lib: /your/folder/ + +See the following sections for information on how to enable the scripts or set +script-specific options and keyboard mappings in your .Xdefaults/.Xresources. + + +keyboard-select +--------------- +Use keyboard shortcuts to select and copy text. + +After installing, put the following lines in your .Xdefaults/.Xresources: + + URxvt.perl-ext-common: ...,keyboard-select + URxvt.keysym.M-Escape: perl:keyboard-select:activate + +The following line overwrites the default Meta-s binding and allows to activate +keyboard-select directly in backward search mode: + + URxvt.keysym.M-s: perl:keyboard-select:search + +Use Meta-Escape to activate selection mode, then use the following keys: + + h/j/k/l: Move cursor left/down/up/right (also with arrow keys) + g/G/0/^/$/H/M/L/f/F/;/,/w/W/b/B/e/E: More vi-like cursor movement keys + '/'/?: Start forward/backward search + n/N: Repeat last search, N: in reverse direction + Ctrl-f/b: Scroll down/up one screen + Ctrl-d/u: Scroll down/up half a screen + v/V/Ctrl-v: Toggle normal/linewise/blockwise selection + y/Return: Copy selection to primary buffer, Return: deactivate afterwards + q/Escape: Deactivate keyboard selection mode + + +url-select +---------- +Use keyboard shortcuts to select URLs. + +This should be used as a replacement for the default matcher extension, it also +makes URLs clickable with the middle mouse button. + +After installing, put the following lines in your .Xdefaults/.Xresources: + + URxvt.perl-ext-common: ...,url-select + URxvt.keysym.M-u: perl:url-select:select_next + +Use Meta-u to activate URL selection mode, then use the following keys: + + j/k: Select next downward/upward URL (also with arrow keys) + g/G: Select first/last URL (also with home/end key) + o/Return: Open selected URL in browser, Return: deactivate afterwards + y: Copy (yank) selected URL and deactivate selection mode + q/Escape: Deactivate URL selection mode + +Options: + + URxvt.url-select.autocopy: if set to true, selected URLs are automatically + copied to the PRIMARY buffer + URxvt.url-select.button: mouse button to click-open URLs (default: 2) + URxvt.url-select.launcher: browser/command to open selected URL with + URxvt.url-select.underline: if set to true, all URLs get underlined + +For compatibility reasons, url-select will also use any patterns defined for +the matcher extension by reading all `URxvt.matcher.pattern.[0-9]` resources. + + +clipboard +--------- +Use keyboard shortcuts to copy the selection to the clipboard and to paste the +clipboard contents (optionally escaping all special characters). + +After installing, put the following lines in your .Xdefaults/.Xresources: + + URxvt.perl-ext-common: ...,clipboard + URxvt.keysym.M-c: perl:clipboard:copy + URxvt.keysym.M-v: perl:clipboard:paste + URxvt.keysym.M-C-v: perl:clipboard:paste_escaped + +Options: + URxvt.clipboard.autocopy: if set to true, the clipboard is automatically + updated whenever the PRIMARY selection changes + +You can also overwrite the system commands to use for copying/pasting. +The default ones are: + + URxvt.clipboard.copycmd: xsel -ib + URxvt.clipboard.pastecmd: xsel -ob + +If you prefer xclip, then put these lines in your .Xdefaults/.Xresources: + + URxvt.clipboard.copycmd: xclip -i -selection clipboard + URxvt.clipboard.pastecmd: xclip -o -selection clipboard + +On Mac OS X, put these lines in your .Xdefaults/.Xresources: + + URxvt.clipboard.copycmd: pbcopy + URxvt.clipboard.pastecmd: pbpaste + +The use of the functions should be self-explanatory! diff --git a/_urxvt/ext/clipboard b/_urxvt/ext/clipboard new file mode 100644 index 0000000..8e71792 --- /dev/null +++ b/_urxvt/ext/clipboard @@ -0,0 +1,109 @@ +#! perl -w +# Author: Bert Muennich +# Website: http://www.github.com/muennich/urxvt-perls +# License: GPLv2 + +# Use keyboard shortcuts to copy the selection to the clipboard and to paste +# the clipboard contents (optionally escaping all special characters). +# Requires xsel to be installed! + +# Usage: put the following lines in your .Xdefaults/.Xresources: +# URxvt.perl-ext-common: ...,clipboard +# URxvt.keysym.M-c: perl:clipboard:copy +# URxvt.keysym.M-v: perl:clipboard:paste +# URxvt.keysym.M-C-v: perl:clipboard:paste_escaped + +# Options: +# URxvt.clipboard.autocopy: If true, PRIMARY overwrites clipboard + +# You can also overwrite the system commands to use for copying/pasting. +# The default ones are: +# URxvt.clipboard.copycmd: xsel -ib +# URxvt.clipboard.pastecmd: xsel -ob +# If you prefer xclip, then put these lines in your .Xdefaults/.Xresources: +# URxvt.clipboard.copycmd: xclip -i -selection clipboard +# URxvt.clipboard.pastecmd: xclip -o -selection clipboard +# On Mac OS X, put these lines in your .Xdefaults/.Xresources: +# URxvt.clipboard.copycmd: pbcopy +# URxvt.clipboard.pastecmd: pbpaste + +# The use of the functions should be self-explanatory! + +use strict; + +sub on_start { + my ($self) = @_; + + $self->{copy_cmd} = $self->x_resource('clipboard.copycmd') || 'xsel -ib'; + $self->{paste_cmd} = $self->x_resource('clipboard.pastecmd') || 'xsel -ob'; + + if ($self->x_resource('clipboard.autocopy') eq 'true') { + $self->enable(sel_grab => \&sel_grab); + } + + () +} + +sub copy { + my ($self) = @_; + + if (open(CLIPBOARD, "| $self->{copy_cmd}")) { + my $sel = $self->selection(); + utf8::encode($sel); + print CLIPBOARD $sel; + close(CLIPBOARD); + } else { + print STDERR "error running '$self->{copy_cmd}': $!\n"; + } + + () +} + +sub paste { + my ($self) = @_; + + my $str = `$self->{paste_cmd}`; + if ($? == 0) { + $self->tt_paste($str); + } else { + print STDERR "error running '$self->{paste_cmd}': $!\n"; + } + + () +} + +sub paste_escaped { + my ($self) = @_; + + my $str = `$self->{paste_cmd}`; + if ($? == 0) { + $str =~ s/([!#\$%&\*\(\) ='"\\\|\[\]`~,<>\?])/\\\1/g; + $self->tt_paste($str); + } else { + print STDERR "error running '$self->{paste_cmd}': $!\n"; + } + + () +} + +sub on_user_command { + my ($self, $cmd) = @_; + + if ($cmd eq "clipboard:copy") { + $self->copy; + } elsif ($cmd eq "clipboard:paste") { + $self->paste; + } elsif ($cmd eq "clipboard:paste_escaped") { + $self->paste_escaped; + } + + () +} + +sub sel_grab { + my ($self) = @_; + + $self->copy; + + () +} diff --git a/_urxvt/ext/keyboard-select b/_urxvt/ext/keyboard-select new file mode 100644 index 0000000..d9f16bf --- /dev/null +++ b/_urxvt/ext/keyboard-select @@ -0,0 +1,567 @@ +#! perl -w +# Author: Bert Muennich +# Website: http://www.github.com/muennich/urxvt-perls +# License: GPLv2 + +# Use keyboard shortcuts to select and copy text. + +# Usage: put the following lines in your .Xdefaults/.Xresources: +# URxvt.perl-ext-common: ...,keyboard-select +# URxvt.keysym.M-Escape: perl:keyboard-select:activate +# The following line overwrites the default Meta-s binding and allows to +# activate keyboard-select directly in backward search mode: +# URxvt.keysym.M-s: perl:keyboard-select:search + +# Use Meta-Escape to activate selection mode, then use the following keys: +# h/j/k/l: Move cursor left/down/up/right (also with arrow keys) +# g/G/0/^/$/H/M/L/f/F/;/,/w/W/b/B/e/E: More vi-like cursor movement keys +# '/'/?: Start forward/backward search +# n/N: Repeat last search, N: in reverse direction +# Ctrl-f/b: Scroll down/up one screen +# Ctrl-d/u: Scroll down/up half a screen +# v/V/Ctrl-v: Toggle normal/linewise/blockwise selection +# y/Return: Copy selection to primary buffer, Return: deactivate afterwards +# q/Escape: Deactivate keyboard selection mode + + +use strict; + +sub on_start{ + my ($self) = @_; + + $self->{patterns}{'w'} = qr/\w[^\w\s]|\W\w|\s\S/; + $self->{patterns}{'W'} = qr/\s\S/; + $self->{patterns}{'b'} = qr/.*(?:\w[^\w\s]|\W\w|\s\S)/; + $self->{patterns}{'B'} = qr/.*\s\S/; + $self->{patterns}{'e'} = qr/[^\w\s](?=\w)|\w(?=\W)|\S(?=\s|$)/; + $self->{patterns}{'E'} = qr/\S(?=\s|$)/; + + () +} + + +sub on_user_command { + my ($self, $cmd) = @_; + + if (not $self->{active}) { + if ($cmd eq 'keyboard-select:activate') { + activate($self); + } elsif ($cmd eq 'keyboard-select:search') { + activate($self, 1); + } + } + + () +} + + +sub key_press { + my ($self, $event, $keysym, $char) = @_; + my $key = chr($keysym); + + if (lc($key) eq 'c' && $event->{state} & urxvt::ControlMask) { + deactivate($self); + } elsif ($self->{search}) { + if ($keysym == 0xff1b) { + if ($self->{search_mode}) { + deactivate($self); + } else { + $self->{search} = ''; + status_area($self); + } + } elsif ($keysym == 0xff08) { + $self->{search} = substr($self->{search}, 0, -1); + if (not $self->{search} and $self->{search_mode}) { + deactivate($self); + } else { + status_area($self); + } + } elsif ($keysym == 0xff0d) { + my $txt = substr($self->{search}, 1); + if ($txt) { + $self->{pattern} = ($txt =~ m/[[:upper:]]/) ? qr/\Q$txt\E/ : + qr/\Q$txt\E/i; + } elsif ($self->{pattern}) { + delete $self->{pattern}; + } + $self->{search} = ''; + if (not find_next($self)) { + if ($self->{search_mode}) { + deactivate($self); + } else { + status_area($self); + } + } + } elsif (length($char) > 0) { + $self->{search} .= $self->locale_decode($char); + status_area($self); + } + } elsif ($self->{move_to}) { + if ($keysym == 0xff1b) { + $self->{move_to} = 0; + status_area($self); + } elsif (length($char) > 0) { + $self->{move_to} = 0; + $self->{patterns}{'f-1'} = qr/^.*\Q$key\E/; + $self->{patterns}{'f+1'} = qr/^.+?\Q$key\E/; + move_to($self, ';'); + status_area($self); + } + } elsif ($keysym == 0xff1b || lc($key) eq 'q') { + deactivate($self); + } elsif ($key eq 'y' || $keysym == 0xff0d) { + if ($self->{select}) { + if ($self->{select} eq 'b') { + $self->selection($self->{selection}); + $self->selection_grab($event->{time}); + } else { + my ($br, $bc, $er, $ec) = calc_span($self); + $ec = $self->line($er)->l if $self->{select} eq 'l'; + $self->selection_beg($br, $bc); + $self->selection_end($er, $ec); + $self->selection_make($event->{time}); + } + if ($key eq 'y') { + if ($self->{select} ne 'b') { + $self->selection_beg(1, 0); + $self->selection_end(1, 0); + } + $self->{select} = ''; + status_area($self); + $self->want_refresh(); + } else { + deactivate($self); + } + } + } elsif ($key eq 'V') { + toggle_select($self, 'l'); + } elsif ($key eq 'v') { + if ($event->{state} & urxvt::ControlMask) { + toggle_select($self, 'b'); + } else { + toggle_select($self, 'n'); + } + } elsif ($key eq 'k' || $keysym == 0xff52) { + move_cursor($self, 'k'); + } elsif ($key eq 'j' || $keysym == 0xff54) { + move_cursor($self, 'j'); + } elsif ($key eq 'h' || $keysym == 0xff51) { + move_cursor($self, 'h'); + } elsif ($key eq 'l' || $keysym == 0xff53) { + move_cursor($self, 'l'); + } elsif ('gG0^$HML' =~ m/\Q$key\E/ || + ('fbdu' =~ m/\Q$key\E/ && $event->{state} & urxvt::ControlMask)) { + move_cursor($self, $key); + } elsif (lc($key) eq 'f') { + $self->{move_to} = 1; + $self->{move_dir} = $key eq 'F' ? -1 : 1; + status_area($self, $key); + } elsif (';,wWbBeE' =~ m/\Q$key\E/) { + move_to($self, $key); + } elsif ($key eq '/' || $key eq '?') { + $self->{search} = $key; + $self->{search_dir} = $key eq '?' ? -1 : 1; + status_area($self); + } elsif (lc($key) eq 'n') { + find_next($self, $self->{search_dir} * ($key eq 'N' ? -1 : 1)); + } + + return 1; +} + + +sub move_cursor { + my ($self, $key) = @_; + my ($cr, $cc) = $self->screen_cur(); + my $line = $self->line($cr); + + if ($key eq 'k' && $line->beg > $self->top_row) { + $cr = $line->beg - 1; + } elsif ($key eq 'j' && $line->end < $self->nrow - 1) { + $cr = $line->end + 1; + } elsif ($key eq 'h' && $self->{offset} > 0) { + $self->{offset} = $line->offset_of($cr, $cc) - 1; + $self->{dollar} = 0; + } elsif ($key eq 'l' && $self->{offset} < $line->l - 1) { + ++$self->{offset}; + } elsif ($key eq 'f' || $key eq 'd') { + my $vs = $self->view_start() + + ($key eq 'd' ? $self->nrow / 2 : $self->nrow - 1); + $vs = 0 if $vs > 0; + $cr += $vs - $self->view_start($vs); + } elsif ($key eq 'b' || $key eq 'u') { + my $vs = $self->view_start() - + ($key eq 'u' ? $self->nrow / 2 : $self->nrow - 1); + $vs = $self->top_row if $vs < $self->top_row; + $cr += $vs - $self->view_start($vs); + } elsif ($key eq 'g') { + ($cr, $self->{offset}) = ($self->top_row, 0); + $self->{dollar} = 0; + } elsif ($key eq 'G') { + ($cr, $self->{offset}) = ($self->nrow - 1, 0); + $self->{dollar} = 0; + } elsif ($key eq '0') { + $self->{offset} = 0; + $self->{dollar} = 0; + } elsif ($key eq '^') { + my $ltxt = $self->special_decode($line->t); + while ($ltxt =~ s/^( *)\t/$1 . " " x (8 - length($1) % 8)/e) {} + $self->{offset} = $ltxt =~ m/^ +/ ? $+[0] : 0; + $self->{dollar} = 0; + } elsif ($key eq '$') { + my $co = $line->offset_of($cr, $cc); + $self->{dollar} = $co + 1; + $self->{offset} = $line->l - 1; + } elsif ($key eq 'H') { + $cr = $self->view_start(); + } elsif ($key eq 'M') { + $cr = $self->view_start() + $self->nrow / 2; + } elsif ($key eq 'L') { + $cr = $self->view_start() + $self->nrow - 1; + } + + $line = $self->line($cr); + $cc = $self->{dollar} || $self->{offset} >= $line->l ? $line->l - 1 : + $self->{offset}; + $self->screen_cur($line->coord_of($cc)); + + status_area($self); + $self->want_refresh(); + + () +} + + +sub move_to { + my ($self, $key) = @_; + my ($cr, $cc) = $self->screen_cur(); + my $line = $self->line($cr); + my $offset = $self->{offset}; + my ($dir, $pattern); + my ($wrap, $found) = (0, 0); + + if ($key eq ';' || $key eq ',') { + $dir = $self->{move_dir} * ($key eq ',' ? -1 : 1); + $pattern = $self->{patterns}{sprintf('f%+d', $dir)}; + return if not $pattern; + } else { + if (lc($key) eq 'b') { + $dir = -1; + } else { + $dir = 1; + ++$offset if lc($key) eq 'e'; + } + $pattern = $self->{patterns}{$key}; + $wrap = 1; + } + + if ($dir > 0) { + NEXTDOWN: my $text = substr($line->t, $offset); + if ($text =~ m/$pattern/) { + $offset += $+[0] - 1; + $found = 1; + } elsif ($wrap && $line->end + 1 < $self->nrow) { + $cr = $line->end + 1; + $line = $self->line($cr); + $offset = 0; + if (lc($key) eq 'e') { + goto NEXTDOWN; + } else { + $found = 1; + } + } + } elsif ($dir < 0) { + NEXTUP: my $text = substr($line->t, 0, $offset); + if ($text =~ m/$pattern/) { + $offset += $+[0] - length($text) - 1; + $found = 1; + } elsif ($wrap) { + if ($offset > 0) { + $offset = 0; + $found = 1; + } elsif ($line->beg > $self->top_row) { + $cr = $line->beg - 1; + $line = $self->line($cr); + $offset = $line->l; + goto NEXTUP; + } + } + } + + if ($found) { + $self->{dollar} = 0; + $self->{offset} = $offset; + $self->screen_cur($line->coord_of($offset)); + $self->want_refresh(); + } + + () +} + + +sub find_next { + my ($self, $dir) = @_; + + return if not $self->{pattern}; + $dir = $self->{search_dir} if not $dir; + + my ($cr, $cc) = $self->screen_cur(); + my $line = $self->line($cr); + my $offset = $line->offset_of($cr, $cc); + my $text; + my $found = 0; + + ++$offset if $dir > 0; + + while (not $found) { + if ($dir > 0) { + $text = substr($line->t, $offset); + if ($text =~ m/$self->{pattern}/) { + $found = 1; + $offset += $-[0]; + } else { + last if $line->end >= $self->nrow; + $line = $self->line($line->end + 1); + $offset = 0; + } + } else { + $text = substr($line->t, 0, $offset); + if ($text =~ m/$self->{pattern}/) { + $found = 1; + $offset = $-[0] while $text =~ m/$self->{pattern}/g; + } else { + last if $line->beg <= $self->top_row; + $line = $self->line($line->beg - 1); + $offset = $line->l; + } + } + } + + if ($found) { + $self->{dollar} = 0; + $self->{offset} = $offset; + $self->screen_cur($line->coord_of($offset)); + status_area($self); + $self->want_refresh(); + } + + return $found; +} + + +sub tt_write { + return 1; +} + + +sub refresh { + my ($self) = @_; + my $reverse_cursor = $self->{select} ne 'l'; + my ($cr, $cc) = $self->screen_cur(); + + if ($self->{select}) { + my ($br, $bc, $er, $ec) = calc_span($self); + + if ($self->{select} eq 'b') { + delete $self->{selection} if $self->{selection}; + my $co = $self->line($cr)->offset_of($cr, $cc); + my $dollar = $self->{dollar} && $co >= $self->{dollar} - 1; + + my $r = $br; + while ($r <= $er) { + my $line = $self->line($r); + if ($bc < $line->l) { + $ec = $line->l if $dollar; + $self->{selection} .= substr($line->t, $bc, $ec - $bc); + my ($br, $bc) = $line->coord_of($bc); + my ($er, $ec) = $line->coord_of($ec <= $line->l ? $ec : $line->l); + $self->scr_xor_span($br, $bc, $er, $ec, urxvt::RS_RVid); + } elsif ($r == $cr) { + $reverse_cursor = 0; + } + $self->{selection} .= "\n" if $line->end < $er; + $r = $line->end + 1; + } + } else { + $self->scr_xor_span($br, $bc, $er, $ec, urxvt::RS_RVid); + } + + if ($reverse_cursor) { + # make the cursor visible again + $self->scr_xor_span($cr, $cc, $cr, $cc + 1, urxvt::RS_RVid); + } + } + + # scroll the current cursor position into visible area + if ($cr < $self->view_start()) { + $self->view_start($cr); + } elsif ($cr >= $self->view_start() + $self->nrow) { + $self->view_start($cr - $self->nrow + 1); + } + + () +} + + +sub activate { + my ($self, $search) = @_; + + $self->{active} = 1; + + $self->{select} = ''; + $self->{dollar} = 0; + $self->{move_to} = 0; + + if ($search) { + $self->{search} = '?'; + $self->{search_dir} = -1; + $self->{search_mode} = 1; + } else { + $self->{search} = ''; + $self->{search_mode} = 0; + } + + ($self->{oldcr}, $self->{oldcc}) = $self->screen_cur(); + $self->{old_view_start} = $self->view_start(); + $self->{old_pty_ev_events} = $self->pty_ev_events(urxvt::EV_NONE); + + my $line = $self->line($self->{oldcr}); + $self->{offset} = $line->offset_of($self->{oldcr}, $self->{oldcc}); + + $self->selection_beg(1, 0); + $self->selection_end(1, 0); + + $self->enable( + key_press => \&key_press, + refresh_begin => \&refresh, + refresh_end => \&refresh, + tt_write => \&tt_write, + ); + + if ($self->{offset} >= $line->l) { + $self->{offset} = $line->l > 0 ? $line->l - 1 : 0; + $self->screen_cur($line->coord_of($self->{offset})); + $self->want_refresh(); + } + + $self->{overlay_len} = 0; + status_area($self); + + () +} + + +sub deactivate { + my ($self) = @_; + + $self->selection_beg(1, 0); + $self->selection_end(1, 0); + + delete $self->{overlay} if $self->{overlay}; + delete $self->{selection} if $self->{selection}; + + $self->disable("key_press", "refresh_begin", "refresh_end", "tt_write"); + $self->screen_cur($self->{oldcr}, $self->{oldcc}); + $self->view_start($self->{old_view_start}); + $self->pty_ev_events($self->{old_pty_ev_events}); + + $self->want_refresh(); + + $self->{active} = 0; + + () +} + + +sub status_area { + my ($self, $extra) = @_; + my ($stat, $stat_len); + + if ($self->{search}) { + $stat_len = $self->ncol; + $stat = $self->{search} . ' ' x ($stat_len - length($self->{search})); + } else { + if ($self->{select}) { + $stat = "-V" . ($self->{select} ne 'n' ? uc($self->{select}) : "") . "- "; + } + + if ($self->top_row == 0) { + $stat .= "All"; + } elsif ($self->view_start() == $self->top_row) { + $stat .= "Top"; + } elsif ($self->view_start() == 0) { + $stat .= "Bot"; + } else { + $stat .= sprintf("%2d%%", + ($self->top_row - $self->view_start) * 100 / $self->top_row); + } + + $stat = "$extra $stat" if $extra; + $stat_len = length($stat); + } + + if (!$self->{overlay} || $self->{overlay_len} != $stat_len) { + delete $self->{overlay} if $self->{overlay}; + $self->{overlay} = $self->overlay(-1, -1, $stat_len, 1, + urxvt::OVERLAY_RSTYLE, 0); + $self->{overlay_len} = $stat_len; + } + + $self->{overlay}->set(0, 0, $self->special_encode($stat)); + $self->{overlay}->show(); + + () +} + + +sub toggle_select { + my ($self, $mode) = @_; + + if ($self->{select} eq $mode) { + $self->{select} = ''; + } else { + if (not $self->{select}) { + ($self->{ar}, $self->{ac}) = $self->screen_cur(); + } + $self->{select} = $mode; + } + + status_area($self); + $self->want_refresh(); + + () +} + + +sub calc_span { + my ($self) = @_; + my ($cr, $cc) = $self->screen_cur(); + my ($br, $bc, $er, $ec); + + if ($self->{select} eq 'b') { + $br = $self->line($cr)->beg; + $bc = $self->line($cr)->offset_of($cr, $cc); + $er = $self->line($self->{ar})->beg; + $ec = $self->line($self->{ar})->offset_of($self->{ar}, $self->{ac}); + ($br, $er) = ($er, $br) if $br > $er; + ($bc, $ec) = ($ec, $bc) if $bc > $ec; + } else { + if ($cr < $self->{ar}) { + ($br, $bc, $er, $ec) = ($cr, $cc, $self->{ar}, $self->{ac}); + } elsif ($cr > $self->{ar}) { + ($br, $bc, $er, $ec) = ($self->{ar}, $self->{ac}, $cr, $cc); + } else { + ($br, $er) = ($cr, $cr); + ($bc, $ec) = $cc < $self->{ac} ? ($cc, $self->{ac}) : ($self->{ac}, $cc); + } + } + + if ($self->{select} eq 'l') { + ($br, $er) = ($self->line($br)->beg, $self->line($er)->end); + ($bc, $ec) = (0, $self->ncol); + } else { + ++$ec; + } + + return ($br, $bc, $er, $ec); +} diff --git a/_urxvt/ext/url-select b/_urxvt/ext/url-select new file mode 100644 index 0000000..f4ddda8 --- /dev/null +++ b/_urxvt/ext/url-select @@ -0,0 +1,375 @@ +#! perl -w +# Author: Bert Muennich +# Website: http://www.github.com/muennich/urxvt-perls +# Based on: http://www.jukie.net/~bart/blog/urxvt-url-yank +# License: GPLv2 + +# Use keyboard shortcuts to select URLs. +# This should be used as a replacement for the default matcher extension, +# it also makes URLs clickable with the middle mouse button. + +# Usage: put the following lines in your .Xdefaults/.Xresources: +# URxvt.perl-ext-common: ...,url-select +# URxvt.keysym.M-u: perl:url-select:select_next + +# Use Meta-u to activate URL selection mode, then use the following keys: +# j/k: Select next downward/upward URL (also with arrow keys) +# g/G: Select first/last URL (also with home/end key) +# o/Return: Open selected URL in browser, Return: deactivate afterwards +# y: Copy (yank) selected URL and deactivate selection mode +# q/Escape: Deactivate URL selection mode + +# Options: +# URxvt.url-select.autocopy: If true, selected URLs are copied to PRIMARY +# URvxt.url-select.button: Mouse button to click-open URLs (default: 2) +# URxvt.url-select.launcher: Browser/command to open selected URL with +# URxvt.url-select.underline: If set to true, all URLs get underlined + +use strict; + +sub on_start { + my ($self) = @_; + + # read resource settings + if ($self->x_resource('url-select.launcher')) { + @{$self->{browser}} = split /\s+/, $self->x_resource('url-select.launcher'); + } else { + @{$self->{browser}} = ('x-www-browser'); + } + if ($self->x_resource('url-select.underline') eq 'true') { + $self->enable(line_update => \&line_update); + } + if ($self->x_resource('url-select.autocopy') eq 'true') { + $self->{autocopy} = 1; + } + + $self->{state} = 0; + + for my $mod (split '', $self->x_resource("url-select.button") || + $self->x_resource("matcher.button") || 2) { + if ($mod =~ /^\d+$/) { + $self->{button} = $mod; + } elsif ($mod eq "C") { + $self->{state} |= urxvt::ControlMask; + } elsif ($mod eq "S") { + $self->{state} |= urxvt::ShiftMask; + } elsif ($mod eq "M") { + $self->{state} |= $self->ModMetaMask; + } elsif ($mod ne "-" && $mod ne " ") { + warn("invalid button/modifier in $self->{_name}<$self->{argv}[0]>: $mod\n"); + } + } + + if ($self->x_resource('matcher.pattern')) { + @{$self->{pattern}} = ($self->x_resource('matcher.pattern')); + } elsif ($self->x_resource('matcher.pattern.1')) { + my $current = 1; + + while ($self->x_resource("matcher.pattern.$current")) { + push @{$self->{pattern}}, $self->x_resource("matcher.pattern.$current"); + $current++; + } + } else { + @{$self->{pattern}} = qr{ + (?:https?://|ftp://|news://|mailto:|file://|\bwww\.) + [\w\-\@;\/?:&=%\$.+!*\x27,~#]* + ( + \([\w\-\@;\/?:&=%\$.+!*\x27,~#]*\) # Allow a pair of matched parentheses + | # + [\w\-\@;\/?:&=%\$+*~] # exclude some trailing characters (heuristic) + )+ + }x; + } + + () +} + + +sub line_update { + my ($self, $row) = @_; + + my $line = $self->line($row); + my $text = $line->t; + my $rend = $line->r; + + for my $pattern (@{$self->{pattern}}) { + while ($text =~ /$pattern/g) { + my $url = $&; + my ($beg, $end) = ($-[0], $+[0] - 1); + + for (@{$rend}[$beg .. $end]) { + $_ |= urxvt::RS_Uline; + } + $line->r($rend); + } + } + + () +} + + +sub on_user_command { + my ($self, $cmd) = @_; + + if ($cmd eq 'url-select:select_next') { + if (not $self->{active}) { + activate($self); + } + select_next($self, -1); + } + + () +} + + +sub key_press { + my ($self, $event, $keysym) = @_; + my $char = chr($keysym); + + if ($keysym == 0xff1b || lc($char) eq 'q' || + (lc($char) eq 'c' && $event->{state} & urxvt::ControlMask)) { + deactivate($self); + } elsif ($keysym == 0xff0d || $char eq 'o') { + $self->exec_async(@{$self->{browser}}, ${$self->{found}[$self->{n}]}[4]); + deactivate($self) unless $char eq 'o'; + } elsif ($char eq 'y') { + my $found = $self->{found}[$self->{n}]; + $self->selection_beg(${$found}[0], ${$found}[1]); + $self->selection_end(${$found}[2], ${$found}[3]); + $self->selection_make($event->{time}); + $self->selection_beg(1, 0); + $self->selection_end(1, 0); + deactivate($self); + } elsif ($char eq 'k' || $keysym == 0xff52 || $keysym == 0xff51) { + select_next($self, -1, $event); + } elsif ($char eq 'j' || $keysym == 0xff54 || $keysym == 0xff53) { + select_next($self, 1, $event); + } elsif ($char eq 'g' || $keysym == 0xff50) { + $self->{row} = $self->top_row - 1; + delete $self->{found}; + select_next($self, 1, $event); + } elsif ($char eq 'G' || $keysym == 0xff57) { + $self->{row} = $self->nrow; + delete $self->{found}; + select_next($self, -1, $event); + } + + return 1; +} + + +sub on_button_press { + my ($self, $event) = @_; + + my $mask = $self->ModLevel3Mask | $self->ModMetaMask | + urxvt::ShiftMask | urxvt::ControlMask; + + if ($event->{button} == $self->{button} && ($event->{state} & $mask) == $self->{state}) { + $self->{button_pressed} = 1; + $self->{button_col} = $event->{col}; + $self->{button_row} = $event->{row}; + } + + () +} + +sub on_button_release { + my ($self, $event) = @_; + + if ($self->{button_pressed} && $event->{button} == $self->{button}) { + my $col = $event->{col}; + my $row = $event->{row}; + + $self->{button_pressed} = 0; + + if ($col == $self->{button_col} && $row == $self->{button_row}) { + my $line = $self->line($row); + my $text = $line->t; + + for my $pattern (@{$self->{pattern}}) { + while ($text =~ /$pattern/g) { + my ($url, $beg, $end) = ($&, $-[0], $+[0]); + --$end if $url =~ s/["')]$//; + + if ($col >= $beg && $col <= $end) { + $self->exec_async(@{$self->{browser}}, $url); + return 1; + } + } + } + } + } + + () +} + + +sub select_next { + # $dir < 0: up, > 0: down + my ($self, $dir, $event) = @_; + my $row = $self->{row}; + + if (($dir < 0 && $self->{n} > 0) || + ($dir > 0 && $self->{n} < $#{ $self->{found} })) { + # another url on current line + $self->{n} += $dir; + hilight($self); + if ($self->{autocopy}) { + my $found = $self->{found}[$self->{n}]; + $self->selection_beg(${$found}[0], ${$found}[1]); + $self->selection_end(${$found}[2], ${$found}[3]); + $self->selection_make($event->{time}); + $self->selection_beg(1, 0); + $self->selection_end(1, 0); + } + return; + } + + while (($dir < 0 && $row > $self->top_row) || + ($dir > 0 && $row < $self->nrow - 1)) { + my $line = $self->line($row); + $row = ($dir < 0 ? $line->beg : $line->end) + $dir; + $line = $self->line($row); + my $text = $line->t; + + for my $pattern (@{$self->{pattern}}) { + if ($text =~ /$pattern/g) { + delete $self->{found}; + + do { + my ($beg, $end) = ($-[0], $+[0]); + push @{$self->{found}}, [$line->coord_of($beg), + $line->coord_of($end), substr($text, $beg, $end - $beg)]; + } while ($text =~ /$pattern/g); + + $self->{row} = $row; + $self->{n} = $dir < 0 ? $#{$self->{found}} : 0; + hilight($self); + if ($self->{autocopy}) { + my $found = $self->{found}[$self->{n}]; + $self->selection_beg(${$found}[0], ${$found}[1]); + $self->selection_end(${$found}[2], ${$found}[3]); + $self->selection_make($event->{time}); + $self->selection_beg(1, 0); + $self->selection_end(1, 0); + } + return; + } + } + } + + deactivate($self) unless $self->{found}; + + () +} + + +sub hilight { + my ($self) = @_; + + if ($self->{found}) { + if ($self->{row} < $self->view_start() || + $self->{row} >= $self->view_start() + $self->nrow) { + # scroll selected url into visible area + my $top = $self->{row} - ($self->nrow >> 1); + $self->view_start($top < 0 ? $top : 0); + } + + status_area($self); + $self->want_refresh(); + } + + () +} + + +sub refresh { + my ($self) = @_; + + if ($self->{found}) { + $self->scr_xor_span(@{$self->{found}[$self->{n}]}[0 .. 3], urxvt::RS_RVid); + } + + () +} + + +sub status_area { + my ($self) = @_; + + my $row = $self->{row} < 0 ? + $self->{row} - $self->top_row : abs($self->top_row) + $self->{row}; + my $text = sprintf("%d,%d ", $row + 1, $self->{n} + 1); + + if ($self->top_row == 0) { + $text .= "All"; + } elsif ($self->view_start() == $self->top_row) { + $text .= "Top"; + } elsif ($self->view_start() == 0) { + $text .= "Bot"; + } else { + $text .= sprintf("%2d%", + ($self->top_row - $self->view_start) * 100 / $self->top_row); + } + + my $text_len = length($text); + + if ($self->{overlay_len} != $text_len) { + delete $self->{overlay} if $self->{overlay}; + $self->{overlay} = $self->overlay(-1, -1, $text_len, 1, + urxvt::OVERLAY_RSTYLE, 0); + $self->{overlay_len} = $text_len; + } + + $self->{overlay}->set(0, 0, $self->special_encode($text)); + $self->{overlay}->show(); + + () +} + + +sub tt_write { + return 1; +} + + +sub activate { + my ($self) = @_; + + $self->{active} = 1; + + $self->{row} = $self->view_start() + $self->nrow; + $self->{n} = 0; + $self->{overlay_len} = 0; + $self->{button_pressed} = 0; + + $self->{view_start} = $self->view_start(); + $self->{pty_ev_events} = $self->pty_ev_events(urxvt::EV_NONE); + + $self->enable( + key_press => \&key_press, + refresh_begin => \&refresh, + refresh_end => \&refresh, + tt_write => \&tt_write, + ); + + () +} + + +sub deactivate { + my ($self) = @_; + + $self->disable("key_press", "refresh_begin", "refresh_end", "tt_write"); + $self->view_start($self->{view_start}); + $self->pty_ev_events($self->{pty_ev_events}); + + delete $self->{overlay} if $self->{overlay}; + delete $self->{found} if $self->{found}; + + $self->want_refresh(); + + $self->{active} = 0; + + () +} diff --git a/_vifm/colors/Default b/_vifm/colors/Default new file mode 100644 index 0000000..c3c72dd --- /dev/null +++ b/_vifm/colors/Default @@ -0,0 +1,52 @@ +" You can edit this file by hand. +" The " character at the beginning of a line comments out the line. +" Blank lines are ignored. + +" The Default color scheme is used for any directory that does not have +" a specified scheme and for parts of user interface like menus. A +" color scheme set for a base directory will also +" be used for the sub directories. + +" The standard ncurses colors are: +" Default = -1 = None, can be used for transparency or default color +" Black = 0 +" Red = 1 +" Green = 2 +" Yellow = 3 +" Blue = 4 +" Magenta = 5 +" Cyan = 6 +" White = 7 + +" Available style values (some of them can be combined): +" bold +" underline +" reverse or inverse +" standout +" none + +" Vifm supports 256 colors you can use color numbers 0-255 +" (requires properly set up terminal: set your TERM environment variable +" (directly or using resources) to some color terminal name (e.g. +" xterm-256color) from /usr/lib/terminfo/; you can check current number +" of colors in your terminal with tput colors command) + +" highlight group cterm=style ctermfg=foreground_color ctermbg=background_color + +highlight Win cterm=none ctermfg=white ctermbg=black +highlight Directory cterm=bold ctermfg=cyan ctermbg=default +highlight Link cterm=bold ctermfg=yellow ctermbg=default +highlight BrokenLink cterm=bold ctermfg=red ctermbg=default +highlight Socket cterm=bold ctermfg=magenta ctermbg=default +highlight Device cterm=bold ctermfg=red ctermbg=default +highlight Fifo cterm=bold ctermfg=cyan ctermbg=default +highlight Executable cterm=bold ctermfg=green ctermbg=default +highlight Selected cterm=bold ctermfg=magenta ctermbg=default +highlight CurrLine cterm=bold ctermfg=default ctermbg=blue +highlight TopLine cterm=none ctermfg=black ctermbg=white +highlight TopLineSel cterm=bold ctermfg=black ctermbg=default +highlight StatusLine cterm=bold ctermfg=black ctermbg=white +highlight WildMenu cterm=underline,reverse ctermfg=white ctermbg=black +highlight CmdLine cterm=none ctermfg=white ctermbg=black +highlight ErrorMsg cterm=none ctermfg=red ctermbg=black +highlight Border cterm=none ctermfg=black ctermbg=white diff --git a/_vifm/colors/alycolors b/_vifm/colors/alycolors new file mode 100644 index 0000000..ddaacd6 --- /dev/null +++ b/_vifm/colors/alycolors @@ -0,0 +1,60 @@ +"" +"" vifm colorscheme +"" based on 'Default' & 'istib-solarized-dark' & 'juef-zenburn' +"" +"" Weitian LI +"" 2014/05/12 +"" + + +"" The standard ncurses colors are: +" Default = -1 = None (can be used for transparency or default color) +" Black = 0 +" Red = 1 +" Green = 2 +" Yellow = 3 +" Blue = 4 +" Magenta = 5 +" Cyan = 6 +" White = 7 + +"" Available style values (some of them can be combined): +" bold +" underline +" reverse/inverse +" standout +" none + +"" Vifm supports 256 colors you can use color numbers 0-255 +" (requires properly set up terminal: set your TERM environment variable +" (directly or using resources) to some color terminal name (e.g. +" xterm-256color) from /usr/lib/terminfo/; you can check current number +" of colors in your terminal with tput colors command) + +"" Syntax: +" highlight group cterm=style ctermfg=fg_color ctermbg=bg_color + + +highlight Win cterm=none ctermfg=default ctermbg=none + +highlight TopLine cterm=none ctermfg=yellow ctermbg=none +highlight TopLineSel cterm=bold ctermfg=magenta ctermbg=none +highlight StatusLine cterm=bold ctermfg=yellow ctermbg=none +highlight Border cterm=none ctermfg=default ctermbg=none + +highlight Selected cterm=bold ctermfg=magenta ctermbg=black +highlight CurrLine cterm=bold ctermfg=yellow ctermbg=blue + +highlight WildMenu cterm=bold,reverse ctermfg=yellow ctermbg=black +highlight CmdLine cterm=none ctermfg=white ctermbg=black +highlight ErrorMsg cterm=bold ctermfg=magenta ctermbg=black + +highlight Directory cterm=bold ctermfg=blue ctermbg=default +highlight Executable cterm=bold ctermfg=green ctermbg=default +highlight Link cterm=bold ctermfg=cyan ctermbg=default +highlight BrokenLink cterm=bold ctermfg=yellow ctermbg=red +highlight Device cterm=bold ctermfg=yellow ctermbg=default +highlight Socket cterm=bold ctermfg=magenta ctermbg=default +highlight Fifo cterm=none ctermfg=red ctermbg=default + +" vim: set ts=8 sw=4 tw=78 fenc=utf-8 ft=vifm: " diff --git a/_vifm/colors/dmilith-root b/_vifm/colors/dmilith-root new file mode 100644 index 0000000..393d02a --- /dev/null +++ b/_vifm/colors/dmilith-root @@ -0,0 +1,21 @@ +" vim: filetype=vifm : + +" Author: Daniel Dettlaff (a.k.a. dmilith) + +highlight Win cterm=none ctermfg=white ctermbg=black +highlight Directory cterm=bold ctermfg=cyan ctermbg=black +highlight Link cterm=bold ctermfg=yellow ctermbg=black +highlight BrokenLink cterm=bold ctermfg=red ctermbg=none +highlight Socket cterm=bold ctermfg=magenta ctermbg=black +highlight Device cterm=bold ctermfg=red ctermbg=black +highlight Fifo cterm=bold ctermfg=cyan ctermbg=none +highlight Executable cterm=bold ctermfg=green ctermbg=black +highlight Selected cterm=bold ctermfg=magenta ctermbg=black +highlight CurrLine cterm=bold ctermfg=white ctermbg=30 +highlight TopLine cterm=bold ctermfg=white ctermbg=red +highlight TopLineSel cterm=bold ctermfg=yellow ctermbg=red +highlight StatusLine cterm=bold ctermfg=white ctermbg=red +highlight WildMenu cterm=underline,reverse ctermfg=white ctermbg=black +highlight CmdLine cterm=none ctermfg=white ctermbg=black +highlight ErrorMsg cterm=none ctermfg=red ctermbg=black +highlight Border cterm=none ctermfg=black ctermbg=red diff --git a/_vifm/colors/dmilith-user b/_vifm/colors/dmilith-user new file mode 100644 index 0000000..06473fc --- /dev/null +++ b/_vifm/colors/dmilith-user @@ -0,0 +1,21 @@ +" vim: filetype=vifm : + +" Author: Daniel Dettlaff (a.k.a. dmilith) + +highlight Win cterm=none ctermfg=white ctermbg=black +highlight Directory cterm=bold ctermfg=cyan ctermbg=black +highlight Link cterm=bold ctermfg=yellow ctermbg=black +highlight BrokenLink cterm=bold ctermfg=red ctermbg=none +highlight Socket cterm=bold ctermfg=magenta ctermbg=black +highlight Device cterm=bold ctermfg=red ctermbg=black +highlight Fifo cterm=bold ctermfg=cyan ctermbg=none +highlight Executable cterm=bold ctermfg=green ctermbg=black +highlight Selected cterm=bold ctermfg=magenta ctermbg=black +highlight CurrLine cterm=bold ctermfg=white ctermbg=30 +highlight TopLine cterm=bold ctermfg=white ctermbg=blue +highlight TopLineSel cterm=bold ctermfg=yellow ctermbg=blue +highlight StatusLine cterm=bold ctermfg=white ctermbg=blue +highlight WildMenu cterm=underline,reverse ctermfg=white ctermbg=black +highlight CmdLine cterm=none ctermfg=white ctermbg=black +highlight ErrorMsg cterm=none ctermfg=red ctermbg=black +highlight Border cterm=none ctermfg=black ctermbg=blue diff --git a/_vifm/colors/istib-solarized-dark b/_vifm/colors/istib-solarized-dark new file mode 100644 index 0000000..b81415f --- /dev/null +++ b/_vifm/colors/istib-solarized-dark @@ -0,0 +1,25 @@ +" vim: filetype=vifm : + +" Author: Stéphane (a.k.a. istib) + +highlight Win cterm=none ctermfg=default ctermbg=none + +highlight TopLine cterm=none ctermfg=blue ctermbg=none +highlight TopLineSel cterm=none ctermfg=blue ctermbg=none +highlight StatusLine cterm=none ctermfg=blue ctermbg=none +highlight Border cterm=none ctermfg=blue ctermbg=none + +highlight Selected cterm=bold ctermfg=magenta ctermbg=default +highlight CurrLine cterm=bold ctermfg=default ctermbg=blue + +highlight WildMenu cterm=underline,reverse ctermfg=white ctermbg=black +highlight CmdLine cterm=none ctermfg=white ctermbg=black +highlight ErrorMsg cterm=none ctermfg=red ctermbg=black + +highlight Directory cterm=none ctermfg=cyan ctermbg=default +highlight Link cterm=none ctermfg=yellow ctermbg=default +highlight BrokenLink cterm=none ctermfg=red ctermbg=default +highlight Socket cterm=none ctermfg=magenta ctermbg=default +highlight Device cterm=none ctermfg=red ctermbg=default +highlight Fifo cterm=none ctermfg=cyan ctermbg=default +highlight Executable cterm=none ctermfg=green ctermbg=default diff --git a/_vifm/colors/juef-zenburn b/_vifm/colors/juef-zenburn new file mode 100644 index 0000000..d777c10 --- /dev/null +++ b/_vifm/colors/juef-zenburn @@ -0,0 +1,21 @@ +" vim: filetype=vifm : + +" Author: Svyatoslav Mishyn (a.k.a. juef) + +highlight Win cterm=none ctermfg=188 ctermbg=237 +highlight Directory cterm=none ctermfg=108 ctermbg=default +highlight CmdLine cterm=none ctermfg=188 ctermbg=237 +highlight ErrorMsg cterm=bold ctermfg=115 ctermbg=default +highlight TopLine cterm=none ctermfg=174 ctermbg=235 +highlight TopLineSel cterm=bold ctermfg=174 ctermbg=235 +highlight StatusLine cterm=bold ctermfg=144 ctermbg=235 +highlight Executable cterm=none ctermfg=172 ctermbg=default +highlight Selected cterm=none ctermfg=116 ctermbg=238 +highlight Border cterm=none ctermfg=default ctermbg=235 +highlight CurrLine cterm=none ctermfg=223 ctermbg=235 +highlight WildMenu cterm=bold,reverse ctermfg=144 ctermbg=235 +highlight Link cterm=none ctermfg=142 ctermbg=default +highlight BrokenLink cterm=none ctermfg=181 ctermbg=default +highlight Device cterm=none ctermfg=174 ctermbg=default +highlight Fifo cterm=none ctermfg=109 ctermbg=default +highlight Socket cterm=none ctermfg=magenta ctermbg=default diff --git a/_vifm/colors/reicheltd-light b/_vifm/colors/reicheltd-light new file mode 100644 index 0000000..6d633ff --- /dev/null +++ b/_vifm/colors/reicheltd-light @@ -0,0 +1,26 @@ +" vim: filetype=vifm : + +" Author: Daniel R. (a.k.a. reicheltd) + +highlight Win cterm=none ctermfg=236 ctermbg=255 +highlight Directory cterm=bold ctermfg=21 ctermbg=255 +highlight Link cterm=bold ctermfg=39 ctermbg=default + +highlight BrokenLink cterm=bold ctermfg=red ctermbg=default +highlight Socket cterm=bold ctermfg=magenta ctermbg=default +highlight Device cterm=bold ctermfg=blue ctermbg=default + +highlight Fifo cterm=bold ctermfg=cyan ctermbg=default +highlight Executable cterm=bold ctermfg=red ctermbg=default +highlight Selected cterm=bold ctermfg=200 ctermbg=default + +highlight CurrLine cterm=bold ctermfg=255 ctermbg=27 +highlight TopLine cterm=none ctermfg=236 ctermbg=255 +highlight TopLineSel cterm=bold ctermfg=236 ctermbg=255 + +highlight StatusLine cterm=bold ctermfg=236 ctermbg=255 +highlight WildMenu cterm=underline,reverse ctermfg=236 ctermbg=255 +highlight CmdLine cterm=none ctermfg=236 ctermbg=255 + +highlight ErrorMsg cterm=none ctermfg=red ctermbg=236 +highlight Border cterm=none ctermfg=236 ctermbg=255 diff --git a/_vifm/vifmrc b/_vifm/vifmrc new file mode 100644 index 0000000..3b4a1be --- /dev/null +++ b/_vifm/vifmrc @@ -0,0 +1,314 @@ +"" +"" ~/.vifm/vifmrc +"" +"" Weitian LI +"" 2014/05/12 +"" + +""" general settings {{{ +" This is the actual command used to start vi. The default is vim. +" If you would like to use another vi clone such Elvis or Vile +" you will need to change this setting. +set vicmd=vim +" set vicmd=elvis\ -G\ termcap +" set vicmd=vile + +" Trash Directory +" The default is to move files that are deleted with dd or :d to +" the trash directory. If you change this you will not be able to move +" files by deleting them and then using p to put the file in the new location. +" I recommend not changing this until you are familiar with vifm. +" This probably shouldn't be an option. +set trash + +" This is how many directories to store in the directory history. +set history=100 + +" Follow links on l or Enter. +set followlinks + +" With this option turned on you can run partially entered commands with +" unambiguous beginning using :! (e.g. :!Te instead of :!Terminal or :!Te). +set fastrun + +" Natural sort of (version) numbers within text. +set sortnumbers + +" Maximum number of changes that can be undone. +set undolevels=100 + +" If you installed the vifm.txt help file set vimhelp. +" If would rather use a plain text help file set novimhelp. +set novimhelp + +" If you would like to run an executable file when you +" press return on the file name set this. +set norunexec + +" Use KiB, MiB, ... instead of KB, MB, ... +set iec + +" Selected color scheme +"colorscheme Default +colorscheme alycolors + +" The FUSE_HOME directory will be used as a root dir for all FUSE mounts. +" Unless it exists with write/exec permissions set, vifm will attempt to +" create it. +set fusehome=/tmp/vifm_FUSE + +" Format for displaying time in file list. For example: +" TIME_STAMP_FORMAT=%m/%d-%H:%M +" See man date or man strftime for details. +set timefmt=%m/%d\ %H:%M + +" Show list of matches on tab complition in command-line mode +set wildmenu + +" Ignore case search unless it contains at least one uppercase letter +set ignorecase +set smartcase + +" Use increment searching (search while typing) +set incsearch + +" Don't highlight search results automatically +"set nohlsearch + +" Try to leave some space from cursor to upper/lower border in lists +set scrolloff=4 + +" Don't do to much requests to slow file systems +set slowfs=curlftpfs + +" Set custom status line look +set statusline=" %t%= %A %10u:%-7g %15s %20d " + +" What should be saved automatically between vifm runs +" Like in previous versions of vifm +" set vifminfo=options,filetypes,commands,bookmarks,dhistory,state,cs +" Like in vi +set vifminfo=dhistory,savedirs,chistory,state,tui,shistory, + \phistory,fhistory,dirstack,registers,bookmarks +""" settings }}} + +""" marks {{{ +" :mark mark /full/directory/path [filename] +mark h ~/ +mark b ~/bin/ +mark d ~/documents/ +mark m ~/music/ +mark o ~/office/ +mark p ~/pictures/ +mark u ~/unix/ +mark x ~/private/ +""" marks }}} + +""" mappings {{{ +" to speed up +nmap ; : + +nmap s :shell +nmap S :sort +nmap w :view +nmap o :!gvim --remote-tab-silent %f +nmap O :!gvim %f +" open file in the background using its default program +nmap gb :file &l + +" Yank current directory path into the clipboard +nmap yd :!echo %d | xclip %i + +" Yank current file path into the clipboard +nmap yf :!echo %c:p | xclip %i + +" Mappings for faster renaming +nmap I cw +nmap cc cw +nmap A cw + +" Opening console in current directory +nmap ,t :!xterm & + +" Opening vim to edit .vifmrc +nmap ,c :execute ':!vim $MYVIFMRC' | restart +" Opening gvim to edit .vifmrc +nmap ,C :!gvim --remote-tab-silent $MYVIFMRC & + +" Toggle wrap setting on ,w key +nmap ,w :set wrap! + +nmap :!less %f +nmap :edit +nmap :copy +nmap :move +nmap :mkdir +nmap :delete +""" mappings }}} + +""" command {{{ +" :com[mand] command_name action +" The following macros can be used in a command +" %a is replaced with the user arguments. +" %c the current file under the cursor. +" %C the current file under the cursor in the other directory. +" %f the current selected file, or files. +" %F the current selected file, or files in the other directory. +" %b same as %f %F. +" %d the current directory name. +" %D the other window directory name. +" %m run the command in a menu window +command df df -h %m 2> /dev/null +command diff vim -d %f %F +command zip zip -r %f.zip %f +command run !! ./%f +command make !!make +command vgrep vim "+grep %a" +""" command }}} + +""" filetype & fileview {{{ +" The file type is for the default programs to be used with +" a file extension. +" :filetype pattern1,pattern2 [{desc}]defaultprogram[ &],[{desc}]program2 +" :fileviewer pattern1,pattern2 consoleviewer +" The other programs for the file type can be accessed with the :file command +" The command macros %f, %F, %d, %F may be used in the commands. +" The % macro is ignored. To use a % you must put %%. + +" For automated FUSE mounts, you must register an extension with :file[x]type +" in one of following formats: +" +" :filetype extensions FUSE_MOUNT|some_mount_command using %SOURCE_FILE and %DESTINATION_DIR variables +" %SOURCE_FILE and %DESTINATION_DIR are filled in by vifm at runtime. +" A sample line might look like this: +" :filetype *.zip,*.jar,*.war,*.ear FUSE_MOUNT|fuse-zip %SOURCE_FILE %DESTINATION_DIR +" +" :filetype extensions FUSE_MOUNT2|some_mount_command using %PARAM and %DESTINATION_DIR variables +" %PARAM and %DESTINATION_DIR are filled in by vifm at runtime. +" A sample line might look like this: +" :filetype *.ssh FUSE_MOUNT2|sshfs %PARAM %DESTINATION_DIR +" %PARAM value is filled from the first line of file (whole line). +" Example first line for SshMount filetype: root@127.0.0.1:/ +" +" You can also add %CLEAR if you want to clear screen before running FUSE +" program. + +" Pdf +filetype *.pdf zathura %f,apvlv %f,xpdf %f +fileview *.pdf pdftotext -nopgbrk %c - + +" PostScript +filextype *.ps,*.ps.gz gv %c %i & + +" Djvu +filextype *.djvu apvlv %f + +" Audio +filetype *.wav,*.mp3,*.flac,*.ogg,*.m4a + \ {Play using ffplay} + \ ffplay %c, + \ {Play using MPlayer} + \ mplayer %f, +fileviewer *.mp3 mp3info + +" Video +filextype *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.vob,*.flv + \ {View using ffplay} + \ ffplay -fs %c, + \ {View using Dragon} + \ dragon %f, + \ {View using mplayer} + \ mplayer %f, +fileviewer *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.vob + \ ffprobe -pretty %c 2>&1 + +" Web +filetype *.html,*.htm links,mozilla,uzbl-browser %f %i & + +" Object +filetype *.o nm %f | less + +" Image +filextype *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm + \ {View in feh} + \ feh -FZ %d --start-at %d/%c 2>/dev/null &, + \ {View in sxiv} + \ sxiv, + \ {View in gpicview} + \ gpicview %c, +fileviewer *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm + \ convert -identify %f -verbose /dev/null + +" MD5 +filetype *.md5 + \ {Check MD5 hash sum} + \ md5sum -c %f, + +" FuseZipMount +filetype *.zip,*.jar,*.war,*.ear + \ {Mount with fuse-zip} + \ FUSE_MOUNT|fuse-zip %SOURCE_FILE %DESTINATION_DIR, + \ {View contents} + \ zip -sf %c | less, + \ tar -xf %c, +fileviewer *.zip,*.jar,*.war,*.ear zip -sf %c + +" ArchiveMount +filetype *.tar.bz2,*.tbz2,*.tgz,*.tar.gz + \ {Mount with archivemount} + \ FUSE_MOUNT|archivemount %SOURCE_FILE %DESTINATION_DIR, +fileviewer *.tgz,*.tar.gz tar -tzf %c +fileviewer *.tar.bz2,*.tbz2 tar -tjf %c + +" Rar2FsMount +filetype *.rar + \ {Mount with rar2fs} + \ FUSE_MOUNT|rar2fs %SOURCE_FILE %DESTINATION_DIR, + +" IsoMount +filetype *.iso + \ {Mount with fuseiso} + \ FUSE_MOUNT|fuseiso %SOURCE_FILE %DESTINATION_DIR, + +" SshMount +filetype *.ssh + \ {Mount with sshfs} + \ FUSE_MOUNT2|sshfs %PARAM %DESTINATION_DIR, + +" FtpMount +filetype *.ftp + \ {Mount with curlftpfs} + \ FUSE_MOUNT2|curlftpfs -o ftp_port=-,,disable_eprt %PARAM %DESTINATION_DIR, + +" Fuse7z +filetype *.7z + \ {Mount with fuse-7z} + \ FUSE_MOUNT|fuse-7z %SOURCE_FILE %DESTINATION_DIR, + +" Office files +filextype *.doc,*.docx,*.xls,*.xlsx libreoffice %f & +fileview *.docx, docx2txt.pl %f - + +" Qt projects +filextype *.pro qtcreator %f & + +" Directories +filextype */ + \ {View in thunar} + \ Thunar %f &, +fileview .*/,*/ tree %f + +" Open all other files with default system programs (you can also remove all +" :file[x]type commands above to ensure they don't interfere with system-wide +" settings). By default all unknown files are opened with 'vi[x]cmd' +" uncommenting one of lines below will result in ignoring 'vi[x]cmd' option +" for unknown file types. +" For *nix: +" filetype * xdg-open +" For OS X: +" filetype * open +" For Windows: +" filetype * start, explorer +""" filetype & fileview }}} + +" vim: set ts=8 sw=4 tw=78 fenc=utf-8 ft=vifm: " diff --git a/_xbindkeysrc b/_xbindkeysrc new file mode 100644 index 0000000..ef89ab1 --- /dev/null +++ b/_xbindkeysrc @@ -0,0 +1,104 @@ +# For the benefit of emacs users: -*- shell-script -*- +########################### +# xbindkeys configuration # +########################### +# +# Version: 1.8.4 +# +# If you edit this file, do not forget to uncomment any lines +# that you change. +# The pound(#) symbol may be used anywhere for comments. +# +# To specify a key, you can use 'xbindkeys --key' or +# 'xbindkeys --multikey' and put one of the two lines in this file. +# +# The format of a command line is: +# "command to start" +# associated key +# +# +# A list of keys is in /usr/include/X11/keysym.h and in +# /usr/include/X11/keysymdef.h +# The XK_ is not needed. +# +# List of modifier: +# Release, Control, Shift, Mod1 (Alt), Mod2 (NumLock), +# Mod3 (CapsLock), Mod4, Mod5 (Scroll). +# + +# The release modifier is not a standard X modifier, but you can +# use it if you want to catch release events instead of press events + +# By defaults, xbindkeys does not pay attention with the modifiers +# NumLock, CapsLock and ScrollLock. +# Uncomment the lines above if you want to pay attention to them. + +#keystate_numlock = enable +#keystate_capslock = enable +#keystate_scrolllock= enable + +#"xbindkeys_show" +# control+shift + q + +###### music control ###### {{{ +"mpc toggle" + m:0x0 + c:172 + XF86AudioPlay + +"mpc stop" + m:0x0 + c:174 + XF86AudioStop + +"mpc prev" + m:0x0 + c:173 + XF86AudioPrev + +"mpc next" + m:0x0 + c:171 + XF86AudioNext +###### music }}} + +###### volume control ###### {{{ +"amixer sset Master '5%+' unmute" + m:0x0 + c:123 + XF86AudioRaiseVolume + +"amixer sset Master '5%-' unmute" + m:0x0 + c:122 + XF86AudioLowerVolume + +"amixer sset Master toggle" + m:0x0 + c:121 + XF86AudioMute +###### volume }}} + +###### thinkpad ###### {{{ +## thinkpad special keys require 'thinkpad_acpi' module + +# ThinkVantage button +"dmenu_run" + m:0x0 + c:156 + XF86Launch1 + +"~/bin/i3lock_exit.sh lock" + m:0x10 + c:160 + Mod2 + XF86ScreenSaver + +#"(Scheme function)" +# m:0x10 + c:220 +# Mod2 + XF86WebCam + +"arandr" + m:0x10 + c:235 + Mod2 + XF86Display + +# TouchPadToggle +"synclient TouchpadOff=`synclient -l | grep -c 'TouchpadOff.*=.*0'`" + m:0x10 + c:199 + Mod2 + XF86TouchpadToggle + +###### thinkpad ###### }}} + +################################## +# End of xbindkeys configuration # +################################## diff --git a/_xinitrc b/_xinitrc new file mode 100644 index 0000000..f52892e --- /dev/null +++ b/_xinitrc @@ -0,0 +1,25 @@ +#!/bin/sh +# +# ~/.xinitrc +# + +# Run all system xinitrc shell scripts. +xinitdir="/etc/X11/xinit/xinitrc.d" +if [ -d "$xinitdir" ]; then + for script in $xinitdir/*; do + echo "Loading xinit script $script" + if [ -x "$script" -a ! -d "$script" ]; then + . "$script" + fi + done + unset $script +fi + +[ -f ~/.Xresources ] && xrdb -load ~/.Xresources + +# disable beep +xset b off + +# disable CapsLock +setxkbmap -option ctrl:nocaps + diff --git a/_xprofile b/_xprofile new file mode 100644 index 0000000..de18e9a --- /dev/null +++ b/_xprofile @@ -0,0 +1,7 @@ +# +# ~/.xprofile +# + +[ -f ~/.profile ] && . ~/.profile + +# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=sh: # diff --git a/_xspec/Xspec.init b/_xspec/Xspec.init new file mode 100644 index 0000000..47e12e4 --- /dev/null +++ b/_xspec/Xspec.init @@ -0,0 +1,166 @@ +# 120801 +# XSPEC Initial settings file. 03/2011 +# Valid setting lines consist of two strings in the format Key: Value +# leading and trailing blanks are ignored for the key, leading blanks/tabs ignored for +# the value. Invalid settings (no colon) are ignored, keys valid in format but not +# implemented are simply read but not used. +# +# +# Do not modify above this line +################################################ + +# +# User default local model directory +# example code may be found in the source tree at: +# ${PATH_TO_SRC}/src/XSModel/Model/LocalModelTemplate + +#LOCAL_MODEL_DIRECTORY: /path/to/your/local/model/dir + +################################################ +# +# options and commands for displaying helpfiles +# + + USE_ONLINE_HELP: false + + # Recognized local help formats: html pdf + # This is ignored when using online help + LOCAL_HELP_FORMAT: html + + # Recommended command for Adobe Acrobat version 7 and later: + PDF_COMMAND: acroread -openInNewWindow -tempFileTitle + + # Recommended command for Adobe Acrobat prior to version 7: + # PDF_COMMAND: acroread -useFrontEndProgram -tempFileTitle + + # Recommended command for Mac PDF viewing + # PDF_COMMAND: open + + # Recommended command for Cygwin PDF viewing + # PDF_COMMAND: xpdf -q + + # Recommended command for Mac html + # HTML_COMMAND: open + + HTML_COMMAND: firefox + +################################################# + +# +# setting for GUI mode. The code requires that the GUI setting +# starts with a 't' (case-insensitive) otherwise GUI mode is false +# and the command line mode is used. +# + +GUI: false + +# +# user-definable setting for the dummy response. Arguments required +# begin-range end-range, number of bins, logarithmic/linear. Defaults +# are {0.1,100,200,log} respectively. Setting for bin type must be "linear" +# if linear bins are to be created. +# + +DUMMY: 0.1 50. 50 log + + +# +# Chatter Level: Console chatter level then log chatter level. Currently (4/2001) +# logging has not been reimplemented. +# + +CHAT: 10 10 + +# +# photo absorption cross section table setting. +# possible values are vern, bcmc, obmc. + + +XSECT: bcmc + + +# +# solar abundance table indicator. Hard coded solar abundance vector. Choices are +# 'feld' Feldman, U., 1992. Physica Scripta, 46, 202. +# 'angr' is from Anders, E. & Grevesse, N., 1989. Geochimica and Cosmochimica Acta 53, 197. +# 'aneb' is from Anders, E. & Ebihara, 1982. Geochimica and Cosmochimica Acta 46, 2363. +# + +#ABUND: angr +ABUND: grsa + + +# +# fitting method (leven | anneal ...) +# + +METHOD: leven + +# +# statistic to be minimized (chi | cstat) +# + +STATISTIC: chi + +# +# weighting technique (standard | gehrels | churazov | model ) +# + +WEIGHT: standard + +# +# If true, fitting algorithm will calculate parameter derivatives +# numerically. If false, a faster analytic expression will be used, +# if applicable to the current fitting statistic. +# + +USE_NUMERICAL_DIFFERENTIATION: false + +# +# cosmology parameters ( H0, q0, lambda0 ) +# + +COSMO: 70. .0 .73 +# +# +# Default graphics package (PLT is currently the only option). +# + +GRAPH: plt + +# +# Default plotting device (e.g. for PGPLOT) +# + +PLOTDEVICE: /null + +# +# Y-axis plotting units when in setplot wave mode (angstrom, hz) +# + +WAVE_PLOT_UNITS: hz + +# +# User scripting directory +# + +USER_SCRIPT_DIRECTORY: $HOME/.xspec + +# +# Default setting for parameters' fit delta values. +# Valid options are: +# +# fixed +# proportional +# +# If set to 'fixed', the default values come from the settings in the +# model.dat model definition file. +# + +FIT_DELTAS: proportional .01 + +# +# Default setting for the AtomDB version number +# + +ATOMDB_VERSION: 2.0.2 diff --git a/_zshrc b/_zshrc new file mode 100644 index 0000000..8078788 --- /dev/null +++ b/_zshrc @@ -0,0 +1,86 @@ +## ~/.zshrc +## ZSH configuration file +## oh-my-zsh: http://ohmyz.sh/ + +# Path to your oh-my-zsh installation. +export ZSH=$HOME/.oh-my-zsh + +# Set name of the theme to load. +# Look in ~/.oh-my-zsh/themes/ +# Optionally, if you set this to "random", it'll load a random theme each +# time that oh-my-zsh is loaded. +#ZSH_THEME="robbyrussell" +ZSH_THEME="gentoo" + +# Example aliases +# alias zshconfig="mate ~/.zshrc" +# alias ohmyzsh="mate ~/.oh-my-zsh" + +# Uncomment the following line to use case-sensitive completion. +# CASE_SENSITIVE="true" + +# Uncomment the following line to disable bi-weekly auto-update checks. +DISABLE_AUTO_UPDATE="true" + +# Uncomment the following line to change how often to auto-update (in days). +# export UPDATE_ZSH_DAYS=13 + +# Uncomment the following line to disable colors in ls. +# DISABLE_LS_COLORS="true" + +# Uncomment the following line to disable auto-setting terminal title. +# DISABLE_AUTO_TITLE="true" + +# Uncomment the following line to disable command auto-correction. +# DISABLE_CORRECTION="true" + +# Uncomment the following line to display red dots whilst waiting for completion. +# COMPLETION_WAITING_DOTS="true" + +# Uncomment the following line if you want to disable marking untracked files +# under VCS as dirty. This makes repository status check for large repositories +# much, much faster. +# DISABLE_UNTRACKED_FILES_DIRTY="true" + +# Uncomment the following line if you want to change the command execution time +# stamp shown in the history command output. +# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" +# HIST_STAMPS="mm/dd/yyyy" + +# Would you like to use another custom folder than $ZSH/custom? +# ZSH_CUSTOM=/path/to/new-custom-folder + +# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) +# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ +# Example format: plugins=(rails git textmate ruby lighthouse) +#plugins=(fasd git suse tmux vi-mode) +plugins=(fasd git tmux vi-mode) + +source $ZSH/oh-my-zsh.sh + +# User configuration + +#export PATH="$HOME/bin:/usr/local/texlive/bin/x86_64-linux:/usr/lib64/mpi/gcc/openmpi/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/local/sbin:/usr/sbin:/sbin" +# export MANPATH="/usr/local/man:$MANPATH" + +# You may need to manually set your language environment +# export LANG=en_US.UTF-8 + +# Preferred editor for local and remote sessions +if [[ -n $SSH_CONNECTION ]]; then + export EDITOR='vim' +else + export EDITOR='vim' +fi + +# Compilation flags +# export ARCHFLAGS="-arch x86_64" + +# ssh +# export SSH_KEY_PATH="~/.ssh/dsa_id" + +# zsh local config +if [ -r ~/.zshrc.local ]; then + source ~/.zshrc.local +fi + diff --git a/_zshrc.local b/_zshrc.local new file mode 100644 index 0000000..9e5d50d --- /dev/null +++ b/_zshrc.local @@ -0,0 +1,113 @@ +## ~/.zshrc.local +## ZSH local configuration file +## +## Weitian LI +## 2014/05/31 + +### locale {{{ +export LANG="en_US.UTF-8" +export LC_CTYPE="zh_CN.UTF-8" +export LC_COLLATE="C" +### }}} + +### environments {{{ +if [ -d "$HOME/bin" ]; then + export PATH="$HOME/bin:$PATH" +fi +# admin +if groups | grep -qE '\b(wheel|adm|sudo)\b'; then + export PATH="$PATH:/usr/local/sbin:/usr/sbin:/sbin" +fi + +# GREP_OPTIONS deprecated +unset GREP_OPTIONS +alias grep='grep --color=auto' +### environments }}} + +### vi mode {{{ +# oh-my-zsh: plugin: vi-mode +# Vim's text-objects-ish for zsh: https://github.com/hchbaw/opp.zsh + +#bindkey -v +# Reduce delay to 0.1 seconds +export KEYTIMEOUT=1 +## Key Bindings +# Use vim cli mode +bindkey '^P' up-history +bindkey '^N' down-history +# backspace and ^h working even after +# returning from command mode +bindkey '^?' backward-delete-char +bindkey '^h' backward-delete-char +# ctrl-w removed word backwards +bindkey '^w' backward-kill-word +# ctrl-r starts searching history backward +bindkey '^r' history-incremental-search-backward +### vi mode }}} + +### python-virtualenv {{{ +if [ -x /usr/bin/virtualenvwrapper.sh ]; then + export WORKON_HOME="$HOME/.virtualenvs" + export PROJECT_HOME="$HOME/web" + source /usr/bin/virtualenvwrapper.sh +fi +### python-virtualenv }}} + +### astro {{{ +# backup LD_LIBRARY_PATH settings +LD_LIBRARY_PATH_BAK="${LD_LIBRARY_PATH}" + +## HEASOFT settings +export HEADAS="$HOME/local/heasoft/heasoft-6.16/x86_64-unknown-linux-gnu" +function heainit() { + if [ "x${CALDB}" = "x" ]; then + export CALDB="$HOME/local/CALDB" + export CALDBALIAS="${CALDB}/software/tools/alias_config.fits" + export CALDBCONFIG="${CALDB}/software/tools/caldb.config" + fi + HEA_STATE="`echo $PATH | tr ':' '\n' | grep 'heasoft'`" + if [ "x${HEA_STATE}" = "x" ]; then + source $HEADAS/headas-init.sh > /dev/null + fi + unset HEA_STATE + export LD_LIBRARY_PATH="${LD_LIBRARY_PATH_BAK}" +} + +## CIAO settings +export CIAO_PATH="$HOME/local/ciao/ciao-4.6" +function ciaoinit() { + HEA_STATE="`echo $PATH | tr ':' '\n' | grep 'heasoft'`" + CIAO_STATE="`echo $PATH | tr ':' '\n' | grep 'ciao'`" + if [ "x${HEA_STATE}" = "x" ]; then + heainit > /dev/null + fi + if [ "x${CIAO_STATE}" = "x" ]; then + source $CIAO_PATH/bin/ciao.bash + else + source $CIAO_PATH/bin/ciao.bash -o + fi + unset HEA_STATE + unset CIAO_STATE + export CIAO_LD_LIBRARY_PATH="${ASCDS_INSTALL}/ots/lib" +} + +## chandra_acis_process scripts +export MASS_PROFILE_DIR="$HOME/bin/mass" +export CHANDRA_SCRIPT_DIR="$HOME/bin" +### astro }}} + +### aliases {{{ +alias qmass='qdp summary_mass_profile.qdp' +alias qnfw='qdp nfw_fit_center.qdp' +alias qsbp='qdp sbp_fit_center.qdp' +alias qtpro='qdp wang2012_fit_center.qdp' +alias fitwang="${MASS_PROFILE_DIR}/fit_wang2012_model tcl_temp_profile.txt" +alias fitmass="${MASS_PROFILE_DIR}/fit_mass.sh" +alias fitnfw="${MASS_PROFILE_DIR}/fit_nfw_mass mass_int.dat" +alias fitsbp="${MASS_PROFILE_DIR}/fit_sbp.sh" +alias calclxfx="${MASS_PROFILE_DIR}/calc_lxfx_simple.sh" +alias getlxfx="${MASS_PROFILE_DIR}/get_lxfx_data.sh" +alias chcld="${CHANDRA_SCRIPT_DIR}/chandra_collect_data_v3.sh" +alias chr500="${CHANDRA_SCRIPT_DIR}/ciao_r500avgt_v3.sh" +### aliases }}} + -- cgit v1.2.2