From 59fecb0c2aea47617a0c6f72e232fad1ae495bc0 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Thu, 27 Oct 2016 23:16:26 -0700 Subject: [PATCH] a few new functions --- .bashrc | 50 +++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 47 insertions(+), 3 deletions(-) diff --git a/.bashrc b/.bashrc index 6889b83..3725a9f 100644 --- a/.bashrc +++ b/.bashrc @@ -337,6 +337,13 @@ a() { ack() { ack-grep "$@"; } +astudio() { + # googling android emulator libGL error: failed to load driver: r600 + # lead to http://stackoverflow.com/a/36625175/14456 + export ANDROID_EMULATOR_USE_SYSTEM_LIBS=1 + /a/opt/android-studio/bin/studio.sh "$@" &r; +} + bashrcpush () { local startdir="$PWD" cd ~ @@ -649,6 +656,14 @@ and works in older versions of git which did not have that." echo "${p%%/.git}" } +# quit will prompt if the program crashes. +gmacs() { gdb -ex=r -ex=quit --args emacs "$@"; r; } + +gse() { + git send-email --notes '--envelope-sender=' \ + --suppress-cc=self "$@" +} + gr() { grep -iIP --color=auto "$@" } @@ -661,6 +676,18 @@ grr() { fi } +hstatus() { + # do git status on published repos + cd /a/bin/githtml + for x in !(forks) forks/* ian-specific/*; do + cd `readlink -f $x`/.. + hr + echo $x + i status + cd /a/bin/githtml + done +} + hl() { # history limit. Write extra history to archive file. # todo: this is not working or not used currently local max_lines linecount tempfile prune_lines x @@ -709,9 +736,10 @@ ic() { } -ifn () { +ifn() { # insensitive find - find -L . -iname "*$**" 2>/dev/null + find -L . -not \( -name .svn -prune -o -name .git -prune \ + -o -name .hg -prune \) -iname "*$**" 2>/dev/null } @@ -959,6 +987,13 @@ sb() { # sudo bash -c } complete -F _root_command s sb +scssl() { + # s gem install scss-lint + pushd /a/opt/thoughtbot-guides + git pull --stat + popd + scss-lint -c /a/opt/thoughtbot-guides/style/sass/.scss-lint.yml "$@" +} ser() { local s; [[ $EUID != 0 ]] && s=sudo @@ -1095,7 +1130,7 @@ te() { tm() { # timer in minutes - (sleep $(calc "$@ * 60") && mpv --volume 50 /a/bin/data/alarm.mp3) > /dev/null 2>&1 & + (sleep $(calc "$@ * 60") && mpv --volume 50 /a/bin/data/alarm.mp3 --loop=no) > /dev/null 2>&1 & } ts() { # start editing a new file @@ -1457,6 +1492,15 @@ fi path_add --end ~/.npm-global + +# didn't get drush working, if I did, this seems like the +# only good thing to include for it. +# Include Drush completion. +# if [ -f "/home/ian/.drush/drush.complete.sh" ] ; then +# source /home/ian/.drush/drush.complete.sh +# fi + + # https://wiki.archlinux.org/index.php/Xinitrc#Autostart_X_at_login # i added an extra condition as gentoo xorg guide says depending on # $DISPLAY is fragile. -- 2.30.2