zsh: add alias and sdocker all X11 and usb access

This commit is contained in:
Mathieu Maret 2022-03-09 10:14:24 +01:00
parent a657ce8087
commit 870d7840d2
2 changed files with 7 additions and 2 deletions

View File

@ -20,7 +20,8 @@ alias ..='cd ..'
alias ../..='cd ../..'
alias ../../..='cd ../../..'
alias greptag='grep --exclude=tags --exclude=cscope.out'
alias logcat="adb logcat"
alias logcat="adb logcat -v time"
alias remount="adb root && adb remount"
alias xte='nohup xterm &' # xte lancera un xterm qui ne se fermera pas si on ferme le terminal
alias minicom='minicom -c on'
alias vims='vim --servername vimserver'

View File

@ -90,6 +90,10 @@ if [[ $BATTERY -gt 0 ]] ; then
fi
}
repofind () {
find . -name .repo -prune -o -name .git -prune -o "$@" -print0
}
mgrep () {
find . -name .repo -prune -o -name .git -prune -o -path ./out -prune -o -regextype posix-egrep -iregex '(.*\/Makefile|.*\/Makefile\..*|.*\.make|.*\.mak|.*\.mk|CMakeLists.txt)' -type f -print0 | xargs -0 grep --color -n "$@"
}
@ -274,7 +278,7 @@ sdocker (){
img=$(docker ps -a | grep $1 | awk '{print $1}' | head -1);
if [ -z $img ]; then
echo "Running a new container"
docker run ${AOSP_ARGS} ${=SSH_AUTH_ARGS} -v ${AOSP_IMAGE}:/aosp/Project -v /home/mathieu/pixium/:/aosp/pixium/ -v /local/:/local/ -v /media/mmaret/data:/aosp/data -v /home/mathieu/miyoo/:/aosp/miyoo --user="$(id -u):$(id -g)" $1
docker run ${AOSP_ARGS} ${=SSH_AUTH_ARGS} -h $(hostname) -e DISPLAY=${DISPLAY} --privileged -v /dev/bus/usb:/dev/bus/usb -v /tmp/.X11-unix/:/tmp/.X11-unix/ -v ${AOSP_IMAGE}:/aosp/Project -v $HOME/Sources/:/aosp/Sources/ -v /local/:/local/ --user="$(id -u):$(id -g)" $1
else
echo "Starting $img"
docker start -i -a $img