e1bcd770b28ee0b3fafbde87f4f51d06f8842341

Author
Robby Russell <robby@planetargon.com>
Committer
Robby Russell <robby@planetargon.com>
Date

Message

Merge pull request #3601 from nextgenthemes/master

Create Ubuntu/Debian/Mint/... plugin, based on Debian plugin

Diff

This diff is truncated to protect this page.

  1diff --git a/plugins/ubuntu/readme.md b/plugins/ubuntu/readme.md
  2new file mode 100644
  3index 0000000000000000000000000000000000000000..c9ef61f4e4a76d6969cb33e2f516afb10b674c38
  4--- /dev/null
  5+++ b/plugins/ubuntu/readme.md
  6@@ -0,0 +1,21 @@
  7diff --git a/plugins/ubuntu/ubuntu.plugin.zsh b/plugins/ubuntu/ubuntu.plugin.zsh
  8new file mode 100644
  9index 0000000000000000000000000000000000000000..0211d33742577092cf8902b4e83cb0761d9d7433
 10--- /dev/null
 11+++ b/plugins/ubuntu/ubuntu.plugin.zsh
 12@@ -0,0 +1,141 @@
 13+# Authors:
 14+# https://github.com/AlexBio
 15+# https://github.com/dbb
 16+# https://github.com/Mappleconfusers
 17+# Nicolas Jonas nextgenthemes.com
 18+#
 19+# Debian, Ubuntu and friends related zsh aliases and functions for zsh
 20+
 21+alias acs='apt-cache search'
 22+compdef _acs acs='apt-cache search'
 23+
 24+alias afs='apt-file search --regexp'
 25+compdef _afs afs='apt-file search --regexp'
 26+
 27+# These are apt-get only
 28+alias ags='apt-get source'   # asrc
 29+compdef _ags ags='apt-get source'
 30+
 31+alias acp='apt-cache policy' # app
 32+compdef _acp acp='apt-cache policy'
 33+
 34+# superuser operations ######################################################
 35+alias afu='sudo apt-file update'
 36+compdef _afu afu='sudo apt-file update'
 37+
 38+alias ppap='sudo ppa-purge'
 39+compdef _ppap ppap='sudo ppa-purge'
 40+
 41+alias ag='sudo apt-get'            # age - but without sudo
 42+alias aga='sudo apt-get autoclean' # aac
 43+alias agb='sudo apt-get build-dep' # abd
 44+alias agc='sudo apt-get clean'     # adc
 45+alias agd='sudo apt-get dselect-upgrade' # ads
 46+alias agi='sudo apt-get install'  # ai
 47+alias agp='sudo apt-get purge'    # ap
 48+alias agr='sudo apt-get remove'   # ar
 49+alias agu='sudo apt-get update'   # ad
 50+alias agud='sudo apt-get update && sudo apt-get dist-upgrade' #adu
 51+alias agug='sudo apt-get upgrade' # ag
 52+alias aguu='sudo apt-get update && sudo apt-get upgrade'      #adg
 53+
 54+compdef _ag ag='sudo apt-get'
 55+compdef _aga aga='sudo apt-get autoclean'
 56+compdef _agb agb='sudo apt-get build-dep'
 57+compdef _agc agc='sudo apt-get clean'
 58+compdef _agd agd='sudo apt-get dselect-upgrade'
 59+compdef _agi agi='sudo apt-get install'
 60+compdef _agp agp='sudo apt-get purge'
 61+compdef _agr agr='sudo apt-get remove'
 62+compdef _agu agu='sudo apt-get update'
 63+compdef _agud agud='sudo apt-get update && sudo apt-get dist-upgrade'
 64+compdef _agug agug='sudo apt-get upgrade'
 65+compdef _aguu aguu='sudo apt-get update && sudo apt-get upgrade'
 66+
 67+# Remove ALL kernel images and headers EXCEPT the one in use
 68+alias kclean='sudo aptitude remove -P ?and(~i~nlinux-(ima|hea) \
 69+	?not(~n`uname -r`))'
 70+
 71+# Misc. #####################################################################
 72+# print all installed packages
 73+alias allpkgs='aptitude search -F "%p" --disable-columns ~i'
 74+
 75+# Create a basic .deb package
 76+alias mydeb='time dpkg-buildpackage -rfakeroot -us -uc'
 77+
 78+# apt-add-repository with automatic install/upgrade of the desired package
 79+# Usage: aar ppa:xxxxxx/xxxxxx [packagename]
 80+# If packagename is not given as 2nd arument the function will ask for it and guess the defaupt by taking
 81+# the part after the / from the ppa name wich is sometimes the right name for the package you want to install
 82+aar() {
 83+	if [ -n "$2" ]; then
 84+		PACKAGE=$2
 85+	else
 86+		read "PACKAGE?Type in the package name to install/upgrade with this ppa [${1##*/}]: "
 87+	fi
 88+	
 89+	if [ -z "$PACKAGE" ]; then
 90+		PACKAGE=${1##*/}
 91+	fi
 92+	
 93+	sudo apt-add-repository $1 && sudo apt-get update
 94+	sudo apt-get install $PACKAGE
 95+}
 96+
 97+# Prints apt history
 98+# Usage:
 99+#   apt-history install
100+#   apt-history upgrade
101+#   apt-history remove
102+#   apt-history rollback
103+#   apt-history list
104+# Based On: http://linuxcommando.blogspot.com/2008/08/how-to-show-apt-log-history.html
105+apt-history () {
106+  case "$1" in
107+    install)
108+      zgrep --no-filename 'install ' $(ls -rt /var/log/dpkg*)
109+      ;;
110+    upgrade|remove)
111+      zgrep --no-filename $1 $(ls -rt /var/log/dpkg*)