diff --git a/zshrc.org b/zshrc.org index 3292943..22cd4e7 100644 --- a/zshrc.org +++ b/zshrc.org @@ -54,131 +54,124 @@ to different files according to the function `org-tags-to-filenames', defined in the previous section. *** Include :daily:pi:android: - First, include a script that sets a number of confidential data (e.g. API keys and such) - #+begin_src sh - source ~/.config/confidential.sh - # This defines a number of env variables: - # ANDROID_A3=xxxx - # ANDROID_BLU=xxx - # ANDROID_IP=xxx.xxx.xxx.xxx - #+end_src - Then, add helper directory to fpath - #+begin_src sh +First, include a script that sets a number of confidential data (e.g. API keys and such) +#+begin_src sh + source ~/.config/confidential.sh + # This defines a number of env variables: + # ANDROID_A3=xxxx + # ANDROID_BLU=xxx + # ANDROID_IP=xxx.xxx.xxx.xxx +#+end_src +Then, add helper directory to fpath +#+begin_src sh fpath=(~/clones/zshrc/ $fpath) - #+end_src +#+end_src *** KDE helpers :daily: - Define a number of KDE helpers. +Define a number of KDE helpers. - ~kde-current-activity~ returns the id of the current activity - ~kde-current-activity-name~ returns the name of the current activity The other two swap between build and src dirs on my local git checkout - #+begin_src sh - kde-current-activity () { - qdbus org.kde.ActivityManager /ActivityManager/Activities org.kde.ActivityManager.Activities.CurrentActivity - } +#+begin_src sh + kde-current-activity () { + qdbus org.kde.ActivityManager /ActivityManager/Activities org.kde.ActivityManager.Activities.CurrentActivity + } - kde-current-activity-name () { - qdbus org.kde.ActivityManager /ActivityManager/Activities org.kde.ActivityManager.Activities.ActivityName `kde-current-activity` - } - kde_src_basedir="/scratch/src/kde" - kde_build_basedir="/scratch/src/kde/build" + kde-current-activity-name () { + qdbus org.kde.ActivityManager /ActivityManager/Activities org.kde.ActivityManager.Activities.ActivityName `kde-current-activity` + } + kde_src_basedir="/scratch/src/kde" + kde_build_basedir="/scratch/src/kde/build" - kde-cd-build () { - cd $(pwd | sed -e "s+$kde_src_basedir+$kde_build_basedir+") - } + kde-cd-build () { + cd $(pwd | sed -e "s+$kde_src_basedir+$kde_build_basedir+") + } - kde-cd-src () { - cd $(pwd | sed -e "s+$kde_build_basedir+$kde_src_basedir+") - } - #+end_src + kde-cd-src () { + cd $(pwd | sed -e "s+$kde_build_basedir+$kde_src_basedir+") + } +#+end_src **** TODO See if we can use zsh expansion instead of sed -:PROPERTIES: -:CREATED: [2021-05-01 Sat 10:24] -:END: *** Android helpers :daily: These are various helpers to drive my current Android phone when connected to the box. - #+begin_src sh - - run-task () { - adb -s $ANDROID_CUR shell am broadcast --user 0 -a net.dinglish.tasker.run_task -e task "$1" - } - - android-remote-keyboard() - { - # should set this up in a tmux session - adb -s $ANDROID_CUR shell ime set de.onyxbits.remotekeyboard/.RemoteKeyboardService; - adb -s $ANDROID_CUR forward tcp:6023 tcp:2323; - sleep 1; - telnet 127.0.0.1 6023 - } - android-remote-keyboard-wifi() - { - # should set this up in a tmux session - adb -s $ANDROID_IP:5555 shell ime set de.onyxbits.remotekeyboard/.RemoteKeyboardService; - adb -s $ANDROID_IP:5555 forward tcp:6023 tcp:2323; - sleep 1; - telnet 127.0.0.1 6023 - } - - - android-remote-keyboard-blu() - { - # should set this up in a tmux session - adb -s $ANDROID_BLU shell ime set de.onyxbits.remotekeyboard/.RemoteKeyboardService; - adb -s $ANDROID_BLU forward tcp:6028 tcp:2323; - sleep 1; - telnet 127.0.0.1 6028 - } - - setup-ipwebcam() - { - adb -s $ANDROID_BLU forward tcp:8097 tcp:8080 - ffmpeg -i http://localhost:8097/video -map 0:v -pix_fmt yuv420p -f v4l2 /dev/video2 - adb -s $ANDROID_BLU forward --remove tcp:8097 - } - -setup-pi-webcam() -{ - ffmpeg -i http://192.168.0.41:8080/stream/video.mjpeg -map 0:v -pix_fmt yuv420p -f v4l2 /dev/video2 -} - #+end_src +#+begin_src sh + run-task () { + adb -s $ANDROID_CUR shell am broadcast --user 0 -a net.dinglish.tasker.run_task -e task "$1" + } + + android-remote-keyboard() + { + # should set this up in a tmux session + adb -s $ANDROID_CUR shell ime set de.onyxbits.remotekeyboard/.RemoteKeyboardService; + adb -s $ANDROID_CUR forward tcp:6023 tcp:2323; + sleep 1; + telnet 127.0.0.1 6023 + } + android-remote-keyboard-wifi() + { + # should set this up in a tmux session + adb -s $ANDROID_IP:5555 shell ime set de.onyxbits.remotekeyboard/.RemoteKeyboardService; + adb -s $ANDROID_IP:5555 forward tcp:6023 tcp:2323; + sleep 1; + telnet 127.0.0.1 6023 + } + + + android-remote-keyboard-blu() + { + # should set this up in a tmux session + adb -s $ANDROID_BLU shell ime set de.onyxbits.remotekeyboard/.RemoteKeyboardService; + adb -s $ANDROID_BLU forward tcp:6028 tcp:2323; + sleep 1; + telnet 127.0.0.1 6028 + } + + setup-ipwebcam() + { + adb -s $ANDROID_BLU forward tcp:8097 tcp:8080 + ffmpeg -i http://localhost:8097/video -map 0:v -pix_fmt yuv420p -f v4l2 /dev/video2 + adb -s $ANDROID_BLU forward --remove tcp:8097 + } + + setup-pi-webcam() + { + ffmpeg -i http://192.168.0.41:8080/stream/video.mjpeg -map 0:v -pix_fmt yuv420p -f v4l2 /dev/video2 + } +#+end_src **** TODO The last bit is really pi material -:PROPERTIES: -:CREATED: [2021-05-01 Sat 10:35] -:END: *** Misc helpers :pi:daily:android: - - tmux guard +- tmux guard This function checks if we are in a tmux session before executing the command; otherwise print an error and bail out #+begin_src sh tmux-guard() + { + if [[ -v TMUX ]]; then + $@ + else + echo tmux-guard: ensure you are in a tmux session to run $@ + fi + } +#+end_src +- wttr.in +#+begin_src sh + wttr() { - if [[ -v TMUX ]]; then - $@ - else - echo tmux-guard: ensure you are in a tmux session to run $@ - fi + local location=Toronto + [[ $(tput cols) -le 124 ]] && local narrow=n; + curl -H "Accept-Language: ${LANG%_*}" wttr.in/"${1:-$location}?T$narrow" } #+end_src - - wttr.in - #+begin_src sh - wttr() - { - local location=Toronto - [[ $(tput cols) -le 124 ]] && local narrow=n; - curl -H "Accept-Language: ${LANG%_*}" wttr.in/"${1:-$location}?T$narrow" - } - #+end_src - - - This is an helper for moving a file to some other place and adding - a link back to the original position. ~bl~ stands for backlink + +- This is an helper for moving a file to some other place and adding a + link back to the original position. ~bl~ stands for backlink BIG FAT WARNING: this needs to specify an actual file as a destination (similar to ln) adding a directory would not work. @@ -190,302 +183,292 @@ BIG FAT WARNING: this needs to specify an actual file as a destination } #+end_src *** konsole helpers :daily: - #+begin_src sh - function set-terminal-title() { - echo -en "\e]2;$@\a" - } +#+begin_src sh + function set-terminal-title() { + echo -en "\e]2;$@\a" + } - function get-konsole-title() { - qdbus "${KONSOLE_DBUS_SERVICE}" "${KONSOLE_DBUS_SESSION}" tabTitleFormat 0 - } + function get-konsole-title() { + qdbus "${KONSOLE_DBUS_SERVICE}" "${KONSOLE_DBUS_SESSION}" tabTitleFormat 0 + } - function set-konsole-title() { - qdbus "${KONSOLE_DBUS_SERVICE}" "${KONSOLE_DBUS_SESSION}" setTabTitleFormat 0 $1 - } + function set-konsole-title() { + qdbus "${KONSOLE_DBUS_SERVICE}" "${KONSOLE_DBUS_SESSION}" setTabTitleFormat 0 $1 + } - function set-konsole-pomo-title() { - previous_title=$(get-konsole-title) - set-konsole-title "pomodoro"; - } + function set-konsole-pomo-title() { + previous_title=$(get-konsole-title) + set-konsole-title "pomodoro"; + } - function restore-konsole-title() { - set-konsole-title ${previous_title} - } - #+end_src + function restore-konsole-title() { + set-konsole-title ${previous_title} + } +#+end_src *** emacs helpers :daily: +#+begin_src sh + SOLARIZED="true" + export EMACS="/home/jacopods/.emacs.d/emacsclient-activities" - #+begin_src sh - SOLARIZED="true" - export EMACS="/home/jacopods/.emacs.d/emacsclient-activities" - - # Emacs stuff - eca() - { - if [[ "$SSH_CONNECTION" != '' ]]; then - EMACS_ARGUMENTS="-t" - else - EMACS_ARGUMENTS="-n" - fi - $EMACS $EMACS_ARGUMENTS $@ - } - - magit() { - # TODO: add parameter just in case - eca -e "(magit-status \"$(pwd)\")" - } - - μ() { - eca -e "(mu4e)" - } - - bindkey -s '^X^G' 'magit\n' - - agenda() { - # TODO: add parameter just in case - eca -e "(org-agenda-list)" - } - - kill-emacs() { - eca -e "(kill-emacs)" - } - - #+end_src -*** oh-my-zsh setup :daily:pi:android: - #+begin_src sh + # Emacs stuff + eca() + { + if [[ "$SSH_CONNECTION" != '' ]]; then + EMACS_ARGUMENTS="-t" + else + EMACS_ARGUMENTS="-n" + fi + $EMACS $EMACS_ARGUMENTS $@ + } + + magit() { + # TODO: add parameter just in case + eca -e "(magit-status \"$(pwd)\")" + } - # Path to your oh-my-zsh configuration. - ZSH=$HOME/.oh-my-zsh + μ() { + eca -e "(mu4e)" + } - # Set name of the theme to load. - # Look in ~/.oh-my-zsh/themes/ - ZSH_THEME="gentoo-wilder" + bindkey -s '^X^G' 'magit\n' - # Set to this to use case-sensitive completion - CASE_SENSITIVE="true" + agenda() { + # TODO: add parameter just in case + eca -e "(org-agenda-list)" + } - # Uncomment this to disable bi-weekly auto-update checks - # DISABLE_AUTO_UPDATE="true" + kill-emacs() { + eca -e "(kill-emacs)" + } - # Uncomment to change how often before auto-updates occur? (in days) - # export UPDATE_ZSH_DAYS=13 +#+end_src +*** oh-my-zsh setup :daily:pi:android: +#+begin_src sh + # Path to your oh-my-zsh configuration. + ZSH=$HOME/.oh-my-zsh - # Uncomment following line if you want to disable colors in ls - # DISABLE_LS_COLORS="true" + # Set name of the theme to load. + # Look in ~/.oh-my-zsh/themes/ + ZSH_THEME="gentoo-wilder" - # Uncomment following line if you want to disable autosetting terminal title. - DISABLE_AUTO_TITLE="true" + # Set to this to use case-sensitive completion + CASE_SENSITIVE="true" - # Uncomment following line if you want to disable command autocorrection - # DISABLE_CORRECTION="true" + # Uncomment this to disable bi-weekly auto-update checks + # DISABLE_AUTO_UPDATE="true" - # Uncomment following line if you want red dots to be displayed while waiting for completion - # COMPLETION_WAITING_DOTS="true" + # Uncomment to change how often before auto-updates occur? (in days) + # export UPDATE_ZSH_DAYS=13 - # Uncomment 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. + # Uncomment following line if you want to disable colors in ls + # DISABLE_LS_COLORS="true" - DISABLE_UNTRACKED_FILES_DIRTY="true" + # Uncomment following line if you want to disable autosetting terminal title. + DISABLE_AUTO_TITLE="true" - eval `dircolors ~/.dir_colors` + # Uncomment following line if you want to disable command autocorrection + # DISABLE_CORRECTION="true" - setopt AUTO_PUSHD - setopt PUSHD_MINUS - setopt BASH_AUTO_LIST - setopt RM_STAR_WAIT + # Uncomment following line if you want red dots to be displayed while waiting for completion + # COMPLETION_WAITING_DOTS="true" - setopt AUTO_NAME_DIRS - setopt CDABLE_VARS - # Uncomment following line if you want to shown in the command execution time stamp - # in the history command output. The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"| - # yyyy-mm-dd - # HIST_STAMPS="mm/dd/yyyy" + # Uncomment 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. - # 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=(git colorize wd history-substring-search) + DISABLE_UNTRACKED_FILES_DIRTY="true" - source $ZSH/oh-my-zsh.sh - #source $ZSH/z.sh + eval `dircolors ~/.dir_colors` - if [[ "$TERM" == "dumb" ]] - then - unsetopt zle - unsetopt prompt_cr - unsetopt prompt_subst - unfunction precmd - unfunction preexec - PS1='$ ' - fi + setopt AUTO_PUSHD + setopt PUSHD_MINUS + setopt BASH_AUTO_LIST + setopt RM_STAR_WAIT - # try to use system colors for completion - zstyle ':completion:*' list-colors "${(@s.:.)LS_COLORS}" + setopt AUTO_NAME_DIRS + setopt CDABLE_VARS + # Uncomment following line if you want to shown in the command execution time stamp + # in the history command output. The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"| + # yyyy-mm-dd + # HIST_STAMPS="mm/dd/yyyy" - # reset default oh-my-zsh matcher-list - zstyle ':completion:*' matcher-list '' + # 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=(git colorize wd history-substring-search) - # smart: ignore parent directory when completing ../ + source $ZSH/oh-my-zsh.sh + #source $ZSH/z.sh - zstyle ':completion:*:(cd|mv|cp):*' ignore-parents parent pwd - zstyle ':completion:*:(rm|kill|diff):*' ignore-line yes + if [[ "$TERM" == "dumb" ]] + then + unsetopt zle + unsetopt prompt_cr + unsetopt prompt_subst + unfunction precmd + unfunction preexec + PS1='$ ' + fi - autoload -U compinit && compinit + # try to use system colors for completion + zstyle ':completion:*' list-colors "${(@s.:.)LS_COLORS}" - # User configuration + # reset default oh-my-zsh matcher-list + zstyle ':completion:*' matcher-list '' - export PATH="/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/games/bin" + # smart: ignore parent directory when completing ../ - # rationalise-dot; useful for cd ......./whatever - rationalise-dot() { - if [[ $LBUFFER = *.. ]]; then - LBUFFER+=/.. - else - LBUFFER+=. - fi - } - zle -N rationalise-dot - bindkey . rationalise-dot + zstyle ':completion:*:(cd|mv|cp):*' ignore-parents parent pwd + zstyle ':completion:*:(rm|kill|diff):*' ignore-line yes - bindkey -s '^[(' '()^B' - bindkey -s '^[{' '{}^B' - # Make ctrl-Backspace work - bindkey "\e[9;5~" backward-delete-word + autoload -U compinit && compinit - autoload zmv - #+end_src -*** TODO editor env variables :daily: - This needs to be diff'd among the versions - #+begin_src sh + # User configuration - # editor stuff + export PATH="/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/games/bin" - export EDITOR="$EMACS -n" - export VISUAL=$EDITOR - export GIT_EDITOR=$EMACS - export SUDO_EDITOR=$EMACS - #+end_src + # rationalise-dot; useful for cd ......./whatever + rationalise-dot() { + if [[ $LBUFFER = *.. ]]; then + LBUFFER+=/.. + else + LBUFFER+=. + fi + } + zle -N rationalise-dot + bindkey . rationalise-dot + + bindkey -s '^[(' '()^B' + bindkey -s '^[{' '{}^B' + # Make ctrl-Backspace work + bindkey "\e[9;5~" backward-delete-word + + autoload zmv +#+end_src +*** TODO editor env variables :daily: +This needs to be diff'd among the versions +#+begin_src sh + # editor stuff + + export EDITOR="$EMACS -n" + export VISUAL=$EDITOR + export GIT_EDITOR=$EMACS + export SUDO_EDITOR=$EMACS +#+end_src *** git helpers :daily: - #+begin_src sh - git-create-pi-remote () { - REPO_NAME=$(basename "`pwd`") - source ~/scripts/git-init-pi4.sh "$REPO_NAME.git" - git remote add π "git@ssh.jacopods.xyz:repos/$REPO_NAME.git" - } - - git-create-thinkspoon-remote () { - REPO_NAME=$(basename "`pwd`") - source ~/scripts/git-init-thinkspoon.sh "$REPO_NAME.git" - git remote add thinkspoon "git@thinkspoon.local:repos/$REPO_NAME.git" - } - - git-current-branch () { - git status -b | head -n 1 | awk {'print $3'} - } - #+end_src +#+begin_src sh + git-create-pi-remote () { + REPO_NAME=$(basename "`pwd`") + source ~/scripts/git-init-pi4.sh "$REPO_NAME.git" + git remote add π "git@ssh.jacopods.xyz:repos/$REPO_NAME.git" + } + + git-create-thinkspoon-remote () { + REPO_NAME=$(basename "`pwd`") + source ~/scripts/git-init-thinkspoon.sh "$REPO_NAME.git" + git remote add thinkspoon "git@thinkspoon.local:repos/$REPO_NAME.git" + } + + git-current-branch () { + git status -b | head -n 1 | awk {'print $3'} + } +#+end_src **** TODO Create a script to add an arbitrary remote -:PROPERTIES: -:CREATED: [2021-05-01 Sat 16:26] -:END: *** Aliases :pi:android:daily: - - #+begin_src sh - ## Aliases - alias emacs="eca" - alias e="eca" - alias E=sudoedit - alias mplayer="mpv" - alias mpv="mpv --no-audio-display" - alias mpv-pomodoro="mpv --script=~/scripts/mpv/auto-pomodoro.lua" - alias top="urxvt -e htop &" - alias mk="~/scripts/latex-mk $@" - alias neofetch="~/clones/neofetch/neofetch --source ~/clones/neofetch/ascii/gentoo-one --separator ' ▏' --bold off --colors 13 12 5 1 12 12 | sed -e 's/bree/Bree/g' | sed -e 's/2560x/2560×/'" - alias dock="~/scripts/dock-a3.sh" - alias xou="source /home/jacopods/scripts/setwacom.sh;/home/jacopods/clones/xournalpp/build/xournalpp" - alias xmp="/home/jacopods/clones/xmp-cli/src/xmp" - alias alexa="/home/jacopods/clones/alexa-remote-control/alexa_remote_control.sh" - #+end_src +#+begin_src sh + ## Aliases + alias emacs="eca" + alias e="eca" + alias E=sudoedit + alias mplayer="mpv" + alias mpv="mpv --no-audio-display" + alias mpv-pomodoro="mpv --script=~/scripts/mpv/auto-pomodoro.lua" + alias top="urxvt -e htop &" + alias mk="~/scripts/latex-mk $@" + alias neofetch="~/clones/neofetch/neofetch --source ~/clones/neofetch/ascii/gentoo-one --separator ' ▏' --bold off --colors 13 12 5 1 12 12 | sed -e 's/bree/Bree/g' | sed -e 's/2560x/2560×/'" + alias dock="~/scripts/dock-a3.sh" + alias xou="source /home/jacopods/scripts/setwacom.sh;/home/jacopods/clones/xournalpp/build/xournalpp" + alias xmp="/home/jacopods/clones/xmp-cli/src/xmp" + alias alexa="/home/jacopods/clones/alexa-remote-control/alexa_remote_control.sh" +#+end_src **** Aliases for the pi :pi: #+begin_src sh alias hugo="/snap/bin/hugo" #+end_src *** Pomodoro helpers :daily:pi:android: +#+begin_src sh + termdown_bin=/home/jacopods/.local/bin/termdown + + alias pomo="$termdown_bin 25m -aW -f 3x5 -c 180 -b -q 10 -s $@" + alias heirloom="$termdown_bin -s 37m -aW -f 3x5 -c 300 -b -q 10 $@" + alias pomodorino="$termdown_bin 14m -aW -f 3x5 -c 120 -b -q 10 -s $@" + alias pomodoro=pomo + alias pomo-break="$termdown_bin 5m -aW -f 3x5 -c 60 -b -q 10 $@" + alias pomodorino-break="$termdown_bin 2m30s -aW -f 3x5 -c 45 -b -q 10 $@" + + alias kb=/home/jacopods/hack/kb/kb + alias unlock-android='~/scripts/unlock-android.sh' #$(cat ~/scripts/unlock-android.gpg | gpg 2>/dev/null)' + alias kbd-android="" + alias K=/home/jacopods/tmp/keymaps/remap-keyboard - #+begin_src sh - termdown_bin=/home/jacopods/.local/bin/termdown - - alias pomo="$termdown_bin 25m -aW -f 3x5 -c 180 -b -q 10 -s $@" - alias heirloom="$termdown_bin -s 37m -aW -f 3x5 -c 300 -b -q 10 $@" - alias pomodorino="$termdown_bin 14m -aW -f 3x5 -c 120 -b -q 10 -s $@" - alias pomodoro=pomo - alias pomo-break="$termdown_bin 5m -aW -f 3x5 -c 60 -b -q 10 $@" - alias pomodorino-break="$termdown_bin 2m30s -aW -f 3x5 -c 45 -b -q 10 $@" - - alias kb=/home/jacopods/hack/kb/kb - alias unlock-android='~/scripts/unlock-android.sh' #$(cat ~/scripts/unlock-android.gpg | gpg 2>/dev/null)' - alias kbd-android="" - alias K=/home/jacopods/tmp/keymaps/remap-keyboard - - alias quercus="falkon q.utoronto.ca" - - #alias portal="chromium portal.utoronto.ca" - alias ls=' exa' - alias sl=' exa' # a frequent typo - alias c=' cd' - alias cd=' cd' - - alias o="xdg-open" - - alias skype="skypeforlinux" - alias ta="tmux attach" - alias acroread="env WINEPREFIX=$HOME/.wine32 WINEARCH='win32' wine ~/.wine32/drive_c/Program\ Files/Adobe/Reader\ 11.0/Reader/AcroRd32.exe >/dev/null 2>/dev/null" - - run-silent() { - "$@" 2>/dev/null - } - - alias git-init-coxeter="source ~/scripts/git-init-coxeter.sh" - - alias -s pdf='run-silent okular' - alias -s djvu='run-silent okular' - alias -s tex=emacs - - alias d.u='ssh dropbox.utoronto "~/dropbox.py"' - - alias -g C='| xclip' - - # this function is a poor-man eselect for configuration files - # it mv's filename to filename_ or viceversa - uv() { - if [[ -f $1 ]]; then - if [[ ${1:(-1)} == '_' ]]; then - mv -i $1 ${1%_} - else - mv -i $1 $1_ - fi - else - echo $0: \'$1\': no such file or directory - return 1 - fi - } - - hash -d Papers="/home/jacopods/work/Papers" - hash -d Books="/home/jacopods/work/Books" - hash -d kde="/scratch/kde/src" - hash -d kde5="/scratch/kde/src5" - - #+end_src + alias ls=' exa' + alias sl=' exa' # a frequent typo + alias c=' cd' + alias cd=' cd' + + alias o="xdg-open" + + alias skype="skypeforlinux" + alias ta="tmux attach" + alias acroread="env WINEPREFIX=$HOME/.wine32 WINEARCH='win32' wine ~/.wine32/drive_c/Program\ Files/Adobe/Reader\ 11.0/Reader/AcroRd32.exe >/dev/null 2>/dev/null" + + run-silent() { + "$@" 2>/dev/null + } + + alias git-init-coxeter="source ~/scripts/git-init-coxeter.sh" + + alias -s pdf='run-silent okular' + alias -s djvu='run-silent okular' + alias -s tex=emacs + + alias d.u='ssh dropbox.utoronto "~/dropbox.py"' + + alias -g C='| xclip' + + # this function is a poor-man eselect for configuration files + # it mv's filename to filename_ or viceversa + uv() { + if [[ -f $1 ]]; then + if [[ ${1:(-1)} == '_' ]]; then + mv -i $1 ${1%_} + else + mv -i $1 $1_ + fi + else + echo $0: \'$1\': no such file or directory + return 1 + fi + } +#+end_src +*** Named directories :daily: +#+begin_src sh + hash -d Papers="/home/jacopods/work/Papers" + hash -d Books="/home/jacopods/work/Books" + hash -d kde="/scratch/kde/src" + hash -d kde5="/scratch/kde/src5" +#+end_src *** Un-tarmak bindings :daily: - #+begin_src sh - bindkey "^t" forward-char - bindkey "^[t" forward-word +#+begin_src sh + bindkey "^t" forward-char + bindkey "^[t" forward-word - bindkey "^g" transpose-chars - bindkey "^[g" transpose-words - #+end_src + bindkey "^g" transpose-chars + bindkey "^[g" transpose-words +#+end_src **** TODO Rearrange this bit :PROPERTIES: