diff options
-rw-r--r-- | XCompose | 3 | ||||
-rw-r--r-- | bashrc | 55 | ||||
-rw-r--r-- | environment | 2 | ||||
-rwxr-xr-x | local/bin/update-dwm-bar | 11 | ||||
-rw-r--r-- | vimrc | 32 | ||||
-rw-r--r-- | zshrc | 1 |
6 files changed, 48 insertions, 56 deletions
@@ -27,6 +27,7 @@ include "/usr/share/X11/locale/en_US.UTF-8/Compose" #<Multi_key> <r> <X> : "Ж" #<Multi_key> <r> <Y> : "Й" #<Multi_key> <r> <Z> : "З" +<Multi_key> <x> <i> <e> : "谢谢" # USEFUL STUFF <Multi_key> <d> <o> <t> : "·" # Mid dot for multiplication or units @@ -77,6 +78,8 @@ include "/usr/share/X11/locale/en_US.UTF-8/Compose" <Multi_key> <F> <L> <I> <P> : "(╯°□°)╯︵ ┻━┻" <Multi_key> <p> <u> <t> : "ノ( ゜-゜ノ)" <Multi_key> <d> <o> <n> <g> : "ヽ༼ຈلຈ༽ノ" +<Multi_key> <t> <i> <n> <y> : "🤏" +<Multi_key> <e> <y> <e> <s> : "👀" # BLACKBOARD BOLD UPPERCASE, 1 0 <Multi_key> <B> <A> : "𝔸" @@ -1,50 +1,19 @@ #!/usr/bin/bash -c_off='\e[0m' -c_bold='\e[1m' -c_black='\e[30m' -c_red='\e[31m' -c_green='\e[32m' -c_yellow='\e[33m' -c_blue='\e[34m' -c_purple='\e[35m' -c_cyan='\e[36m' -c_white='\e[37m' - export HISTSIZE=10000 export HISTTIMEFORMAT="%y-%m-%d %T " -source /usr/share/git/completion/git-prompt.sh - -if [ "$TERM" == "st-256color" ]; then - # Quick fix for ctrl+arrow key in st - echo $(tput smkx) > /dev/tty -fi - -############### -PS1="${c_bold}${c_yellow}\ -┌[${c_green}\u${c_yellow}@${c_blue}\h${c_yellow}][${c_purple}\W${c_yellow}"'$(__git_ps1 " (%s)")'"] ${c_black}<\d \t>${c_yellow}\n\ -└╼ \[${c_off}\]" -############### - -source ~/.aliases -source ~/.environment - -echo Running $(uname) $(uname -r) on $(uname -n) \($(uname -m)\) - -if [ -f ~/todo ]; then - echo To do: - cat ~/todo -fi - -if [ -f ~/.cache/weather/forecast ]; then - echo "" - echo Weather: - cat ~/.cache/weather/forecast | while read -r l ; do echo " "$l ; done -fi +case $- in + *i*) + # interactive, continue fancy stuff. Printing anything when a + # non-interactive session is active breaks scp and other utils + source ~/.aliases + source ~/.environment -[ -d ~/Maildir/new/ ] && [ "$(ls ~/Maildir/new/)" ] && echo 'New mail' + echo Running $(uname) $(uname -r) on $(uname -n) \($(uname -m)\) + ;; + *) + # non-interactive, don't do anything fancy + ;; +esac -[ -z "$(ls -A ~/.cache/currency 2>/dev/null)" ] || for c in ~/.cache/currency/* ; do - echo "$(cat $c) (at $(date -d $(stat -c %Y $c) +"%a %d %H:%M"))" -done diff --git a/environment b/environment index e10a5c8..4952a08 100644 --- a/environment +++ b/environment @@ -1,7 +1,7 @@ #!/bin/sh bin_available() { - where "$1" | grep -vq ccache + hash "$1" 2>/dev/null } export GPG_TTY=$(tty) diff --git a/local/bin/update-dwm-bar b/local/bin/update-dwm-bar index e9156b1..a9fdf92 100755 --- a/local/bin/update-dwm-bar +++ b/local/bin/update-dwm-bar @@ -4,9 +4,6 @@ DELAY=20 sep=$(echo -e '\u2502') while true; do - if hash upsc 2>/dev/null; then - ups="UPS: $(upsc eaton5e@zoidberg battery.charge)% $sep " - fi currency= if [ ! -z "$(ls -A ~/.cache/currency/)" ] ; then for c in ~/.cache/currency/* ; do @@ -32,14 +29,8 @@ while true; do esac bat_string="$bat_icon $bat $sep " fi - thermal_string="🌡" - for zone in /sys/class/thermal/thermal_zone* ; do - temp="$(cat $zone/temp)" - thermal_string="$thermal_string $(($temp / 1000))," - done - thermal_string="${thermal_string%,} °C" datetime_string=$(date "+%A $sep %d %h %Y $sep %_I:%M %p (UTC%:::z)") - xsetroot -name " $currency$ups$thermal_string $sep $bat_string$datetime_string" || exit + xsetroot -name " $bat_string$datetime_string" || exit sleep "$DELAY" done @@ -34,6 +34,7 @@ inoremap jj <ESC> inoremap jk <ESC> nnoremap o ox<BS> nnoremap O Ox<BS> +set pastetoggle=<F2> function! ToggleHlsearch() if &hlsearch @@ -51,11 +52,13 @@ nnoremap <C-_> :call ToggleHlsearch()<cr> hi Todo ctermbg=DarkGreen ctermfg=Black -set expandtab +"set expandtab autocmd BufRead,BufNewFile *.cli setfiletype xml +autocmd BufRead,BufNewFile *.bnf setfiletype bnf "autocmd FileType c setlocal expandtab autocmd FileType make set noexpandtab -autocmd FileType cpp setlocal expandtab +"autocmd FileType cpp setlocal expandtab +autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab autocmd FileType bitbake setlocal expandtab autocmd FileType python setlocal expandtab autocmd FileType haskell setlocal expandtab @@ -87,3 +90,28 @@ highlight DiffAdd cterm=bold ctermfg=233 ctermbg=101 gui=none guifg=bg guibg highlight DiffDelete cterm=bold ctermfg=175 ctermbg=175 gui=none guifg=bg guibg=Red highlight DiffChange cterm=bold ctermfg=234 ctermbg=101 gui=none guifg=bg guibg=Red highlight DiffText cterm=none ctermfg=242 ctermbg=0 gui=none guifg=bg guibg=Red + +let g:previousmode = 'i' +function PushModeSwitchNormal() abort + let g:previousmode = mode() + " important: l so that we don't walk backward every time clutch is pushed + return "\<C-\>\<C-n>l" +endfunction + +function PopMode() abort + return g:previousmode +endfunction + +inoremap <expr> <F11> PushModeSwitchNormal() +vnoremap <expr> <F11> PushModeSwitchNormal() +xnoremap <expr> <F11> PushModeSwitchNormal() +snoremap <expr> <F11> PushModeSwitchNormal() +onoremap <expr> <F11> PushModeSwitchNormal() +inoremap <F12> <Nop> +vnoremap <F12> <Nop> +xnoremap <F12> <Nop> +snoremap <F12> <Nop> +onoremap <F12> <Nop> +nnoremap <expr> <F12> PopMode() + +au FileType gitcommit setlocal tw=72 @@ -25,6 +25,7 @@ key[Delete]="$terminfo[kdch1]" # Emacs-like bindings default bindkey -e +bindkey "^R" history-incremental-search-backward # setup key accordingly [[ -n "$key[Home]" ]] && bindkey -- "$key[Home]" beginning-of-line |