From 1d2434edbb08154f71f9c48ea03176258497bbf4 Mon Sep 17 00:00:00 2001 From: Sebastian Reichel Date: Sun, 14 Jul 2019 16:46:01 +0200 Subject: update --- zshrc | 128 ++++++++++++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 89 insertions(+), 39 deletions(-) diff --git a/zshrc b/zshrc index a6c3633..0d58ba4 100644 --- a/zshrc +++ b/zshrc @@ -47,6 +47,18 @@ alias grep='grep --color=auto' alias less="less -r" alias anki='anki -b' +swaymsg -t get_version >/dev/null 2>&1 +if [ $? -eq 0 ] ; then + # Use nvim in wayland for clipboard support + alias vim="nvim -p" + export EDITOR=nvim + alias mpv="mpv --gpu-context=wayland" +else + # vim: open multiple files in tabs by default + alias vim="vim -p" + export EDITOR=vim +fi + # method to load xilinx env alias xilinx-env="emulate sh ; source /opt/Xilinx/14.7/ISE_DS/settings64.sh ; emulate zsh" alias vivado-env="emulate sh ; source /opt/Xilinx/Vivado/2014.1/settings64.sh ; emulate zsh" @@ -59,18 +71,18 @@ alias l=ls alias ll=ls -la alias gq="background geeqie" alias ev="background evince" -alias mpa="mpv -vo=null" +alias mpa="mpv -vo=null --ytdl-format=bestaudio" alias cdg="cd \$(git root)" -# vim: open multiple files in tabs by default -alias vim="vim -p" +alias ccugit="git -c sendemail.from='Sebastian Reichel ' -c user.email='sebastian.reichel@collabora.com'" # improved calender alias cal="ccal -e -f" # connect to USB tty with 115200 baud -alias cusb="cu -s 115200 -l /dev/ttyUSB0" -alias cacm="cu -s 115200 -l /dev/ttyACM0" +alias cusb="picocom -b 115200 /dev/ttyUSB0" +alias cacm="picocom -b 115200 /dev/ttyACM0" +alias smoothie="picocom -b 115200 --echo /dev/smoothie0" # suffix aliases alias -s jpg="background gpicview" @@ -92,22 +104,14 @@ alias -s flv="background mpv" alias -s exe="wine" alias -s vala="vim" alias -s txt="vim" -alias -s doc="libreoffice" alias -s pho="gerbv" - -# iptv (HD) -alias -g tv:ard="rtp://239.35.10.1:10000" -alias -g tv:zdf="rtp://239.35.10.2:10000" -alias -g tv:arte="rtp://239.35.10.3:10000" -alias -g tv:kika="rtp://239.35.10.11:10000" -alias -g tv:3sat="rtp://239.35.10.47:10000" -alias -g tv:phoenix="rtp://239.35.10.48:10000" -alias -g tv:ndr="rtp://239.35.10.50:10000" -alias -g tv:sdr="rtp://239.35.10.52:10000" -alias -g tv:wdr="rtp://239.35.10.53:10000" -alias -g tv:zdfkultur="rtp://239.35.10.54:10000" -alias -g tv:zdfneo="rtp://239.35.10.55:10000" -alias -g tv:zdfinfo="rtp://239.35.10.56:10000" +alias -s doc="background libreoffice" +alias -s xlsx="background libreoffice" +alias -s odt="background libreoffice" +alias -s ods="background libreoffice" +alias -s docx="background libreoffice" +alias -s ppt="background libreoffice" +alias -s odp="background libreoffice" # usage: 'aptitude search non-debian' alias -g non-debian='~S~i!~Odebian' @@ -125,12 +129,12 @@ export TERM=xterm-256color elif [ $TERM = "screen" ] ; then export TERM=screen-256color fi -export EDITOR=vim export PAGER=vimpager -export BROWSER=chromium +export BROWSER=firefox # path /sbin for ifconfig etc. export PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin +export GOPATH=$HOME/src/go # function to spawn a program in the background background() { @@ -151,50 +155,84 @@ function chpwd_profiles() { } chpwd_functions=( ${chpwd_functions} chpwd_profiles ) +function tmux_attached { + if [ ! $TMUX ] ; then + return 1 + fi + + TMUXSESSIONID=$(echo $TMUX | cut -d , -f 3) + TMUXATTACHED=$(tmux ls -F "#{session_id}: #{?session_attached,1,0}" | grep "\$${TMUXSESSIONID}: " | sed "s~\$${TMUXSESSIONID}: ~~g") + + if [ "x$TMUXATTACHED" == "1" ] ; then + return 0 + else + return 1 + fi +} + # update title function precmd { vcs_info title "%n@%m %~" if [ $TMUX ] ; then - export `tmux showenv WINDOWID` + if [ tmux_attached ] ; then + export `tmux showenv WINDOWID` + else + WINDOWID="" + fi + else + export WINDOWID=$(pid2winid $PPID) fi if [[ "x$WINDOWID" != "x" ]] ; then - xseticon -id $WINDOWID "/usr/share/pixmaps/terminal-tango.png" + xseticon -id $WINDOWID "/home/sre/.zsh/icons/terminal.png" fi } function preexec { title "$1" + + if [ $TMUX ] ; then + export `tmux showenv WINDOWID` + else + export WINDOWID=$(pid2winid $PPID) + fi + if [ "x$WINDOWID" = "x" ] ; then return 0 fi if [[ "$1" == "mutt" ]] ; then - xseticon -id $WINDOWID "/usr/share/icons/Tango/22x22/apps/email.png" + xseticon -id $WINDOWID "/home/sre/.zsh/icons/email.png" elif [[ `echo "$1" | grep "vim"` != "" ]] ; then - xseticon -id $WINDOWID "/usr/share/pixmaps/vim-32.png" + xseticon -id $WINDOWID "/home/sre/.zsh/icons/vim.png" elif [[ `echo "$1" | grep "ssh"` != "" ]] ; then - xseticon -id $WINDOWID "/usr/share/pixmaps/openssh.png" - elif [[ `echo "$1" | grep "apt-get "` != "" ]] ; then - xseticon -id $WINDOWID "/usr/share/icons/Tango/22x22/apps/system-installer.png" + xseticon -id $WINDOWID "/home/sre/.zsh/icons/ssh.png" + elif [[ `echo "$1" | grep "apt "` != "" ]] ; then + xseticon -id $WINDOWID "/home/sre/.zsh/icons/install.png" elif [[ `echo "$1" | grep "mpv"` != "" ]] ; then - xseticon -id $WINDOWID "/usr/share/icons/hicolor/32x32/apps/mpv.png" + xseticon -id $WINDOWID "/home/sre/.zsh/icons/mpv.png" elif [[ `echo "$1" | grep "mpa "` != "" ]] ; then - xseticon -id $WINDOWID "/usr/share/icons/hicolor/32x32/apps/mpv.png" + xseticon -id $WINDOWID "/home/sre/.zsh/icons/mpv.png" elif [[ "$1" == "htop" ]] ; then - xseticon -id $WINDOWID "/usr/share/pixmaps/htop.png" + xseticon -id $WINDOWID "/home/sre/.zsh/icons/htop.png" elif [[ `echo "$1" | grep "make"` != "" ]] ; then - xseticon -id $WINDOWID "/usr/share/icons/gnome/24x24/categories/package_development.png" + xseticon -id $WINDOWID "/home/sre/.zsh/icons/pkg-devel.png" elif [[ `echo "$1" | grep "git-pbuilder"` != "" ]] ; then - xseticon -id $WINDOWID "/usr/share/icons/gnome/24x24/categories/package_development.png" + xseticon -id $WINDOWID "/home/sre/.zsh/icons/pkg-devel.png" elif [[ `echo "$1" | grep "gbp buildpackage"` != "" ]] ; then - xseticon -id $WINDOWID "/usr/share/icons/gnome/24x24/categories/package_development.png" + xseticon -id $WINDOWID "/home/sre/.zsh/icons/pkg-devel.png" elif [[ `echo "$1" | grep "git "` != "" ]] ; then - xseticon -id $WINDOWID "/usr/share/pixmaps/git.png" + xseticon -id $WINDOWID "/home/sre/.zsh/icons/git.png" elif [[ "$1" == "cusb" ]] ; then - xseticon -id $WINDOWID "/usr/share/pixmaps/serial.png" + xseticon -id $WINDOWID "/home/sre/.zsh/icons/serial.png" + elif [[ "$1" == "picocom" ]] ; then + xseticon -id $WINDOWID "/home/sre/.zsh/icons/serial.png" + elif [[ "$1" == "bitbake" ]] ; then + xseticon -id $WINDOWID "/home/sre/.zsh/icons/yocto.png" + elif [[ "$1" == "ikhal" ]] ; then + xseticon -id $WINDOWID "/home/sre/.zsh/icons/calendar.png" fi } @@ -218,11 +256,16 @@ zstyle ':vcs_info:*' enable bzr git hg svn # tinyos directory specific configuration zstyle ':chpwd:profiles:/home/sre/src/linux(|/|/*)' profile linux zstyle ':chpwd:profiles:/home/sre/src/linux-next(|/|/*)' profile linux +zstyle ':chpwd:profiles:/home/sre/src/linux-droid(|/|/*)' profile linux zstyle ':chpwd:profiles:/home/sre/src/linux-stable(|/|/*)' profile linux zstyle ':chpwd:profiles:/home/sre/src/linux-hsi(|/|/*)' profile linux zstyle ':chpwd:profiles:/home/sre/src/linux-n900(|/|/*)' profile linux +zstyle ':chpwd:profiles:/home/sre/src/linux-hackspace(|/|/*)' profile linux +zstyle ':chpwd:profiles:/home/sre/src/linux-misc-fixes(|/|/*)' profile linux +zstyle ':chpwd:profiles:/home/sre/src/linux-n950-display(|/|/*)' profile linux zstyle ':chpwd:profiles:/home/sre/src/linux-power-supply(|/|/*)' profile linux zstyle ':chpwd:profiles:/home/sre/src/zybo/linux(|/|/*)' profile linux +zstyle ':chpwd:profiles:/home/sre/src/n950/linux(|/|/*)' profile linux chpwd_profile_linux() { [[ ${profile} == ${CHPWD_PROFILE} ]] && return 1 @@ -248,6 +291,8 @@ export DEBEMAIL="sre@debian.org" export DEBSIGN_MAINT="sre@debian.org" export DEBCHANGE_RELEASE_HEURISTIC=changelog +export LC_TIME=de_DE.UTF-8 + # fix java fonts export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=gasp' @@ -259,5 +304,10 @@ have() have="yes" } -source /etc/bash_completion.d/pmount -source /etc/bash_completion.d/youtube-dl.bash-completion +alias pmount="udevil mount" +alias pumount="udevil umount" +alias acs="ssh keyholder@ktt-acs" +alias acs-machining="ssh keyholder@ktt-acs-machining" +alias wpa_cli="wpa_cli -i wlp3s0" +alias real-mount='mount | grep -v -e "on /sys" -e "on /proc" -e "on /run" -e "on /dev"' +alias signal-desktop="docker run --rm -d -v /tmp/.X11-unix/:/tmp/.X11-unix -v $HOME/.signal:/root -e DISPLAY -e XAUTHORITY -v $XAUTHORITY:$XAUTHORITY --net=host signal" -- cgit v1.2.3