diff --git a/plugins/ubuntu/readme.md b/plugins/ubuntu/readme.md index 5ad4bbcd2..1501afcc8 100644 --- a/plugins/ubuntu/readme.md +++ b/plugins/ubuntu/readme.md @@ -1,21 +1,83 @@ This plugin was created because the aliases in the debian plugin are inconsistent and hard to remember. Also this apt-priority detection that switched between apt-get and aptitude was dropped to keep it simpler. This plugin uses apt-get for everything but a few things that are only possible with aptitude I guess. Ubuntu does not have aptitude installed by default. -acs = Apt-Cache Search -acp = Apt-Cache Policy +# Apt-Get Aliases -ag = sudo Apt-Get -agi = sudo Apt-Get Install -agd = sudo Apt-Get Dselect-upgrade -By now you already can guess almost all aliases +## Single Command Aliases -There are two exeptions since ... -agu = sudo Apt-Get Update - we have ... -agug = sudo Apt-Get UpGrade - as the exceptional 4 letter alias for a single command. +| Alias | Command | +| :----- | :------------------------------- | +| `acps` | `apt-cache policy` | +| `acs` | `apt-cache search` | +| `afs` | `apt-file search --regexp` | +| `afu` | `sudo apt-file update` | +| `ag` | `sudo apt-get` | +| `aga` | `sudo apt-get autoclean` | +| `agar` | `sudo apt-get autoremove` | +| `agb` | `sudo apt-get build-dep` | +| `agc` | `sudo apt-get clean` | +| `agd` | `sudo apt-get dselect-upgrade` | +| `agdu` | `sudo apt-get dist-upgrade` | +| `agi` | `sudo apt-get install` | +| `agp` | `sudo apt-get purge` | +| `agr` | `sudo apt-get remove` | +| `agu` | `sudo apt-get update` | +| `agug` | `sudo apt-get ugrade` | +| `ags` | `apt-get source` | +| `ppap` | `sudo ppa-purge` | -afs = Apt-File Search --regexp - this has the regexp switch on without being represented in the alias, I guess this makes sense since the debian plugin has it, I never used that command. +## Multi-Command Aliases -Then there are the 2 other 4 letter aliases for combined commands, that are straight forward and easy to remember. -aguu = sudo Apt-Get Update && sudo apt-get Upgrade - better then adg or not? -agud = sudo Apt-Get Update && sudo apt-get Dist-upgrade +| Alias | Command | +| :------------------- | :--------------------------------------------- | +| `agud` | `agu && agdu` | +| `aguu` | `agu && agu` | +| `safe-upgrade-clean` | `agu && agdu && agar && aga` | -For a full list aliases and the functions just watch the plugins code https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/ubuntu/ubuntu.plugin.zsh, look at the comments if you want to switch from the debian plugin. Ubuntu, Mint and & co users will like the new aar function to install packages from ppas with a single command. +## Special Commands + +This commands are a little bit more complicated, so the actual commands will be ommited from this README. Check the actual source in the `ubuntu.plugin.zsh` file. + + +| Alias | Description | +| :----- | :------------------------------- | +| `kclean` | Removes ALL kernel images and headers EXCEPT the one in use. | +| `allpkgs` | Prints all installed packages in your system. | +| `mydeb` | Creates a basic `.deb` package. | +| `aar` | Adds a PPA repository and installs a package. Usage: `aar ppa:xxxxxx/xxxxxx [packagename]` | +| `apt-history` | Prints apt history. Usage: apt-history install|upgrade|remove|rollback|list | +| `kerndeb` | Shortcut for kernel-package building. | +| `apt-list-packages` | Lists installed packages sorted by size. | + +# Spotify Control Commands + +A variety of commands to control your Spotify client from the commodity of your console using dark magic*. + +\* May contain `dbus` and `curl` dark magic. + +## Requirements + +You still need to have the Spotify client installed and open to make this commands work properly. + +You can download the client from here: https://www.spotify.com/download/ + +## Usage + +`spotify-ctl [command]` + +| Commands | Description | +| :----------- | :--------------------------------------------------------- | +| `play` | Play Spotify | +| `pause` | Pause Spotify | +| `playpause` | Toggles betwen play/pause | +| `next` | Go to next track | +| `prev` | Go to previous track | +| `current` | Displays the current track metadata | +| `metadata` | Displays the current track raw metadata | +| `eval` | Returns the current track metadata as a shell variables SPOTIFY_(title|album|artist|trackid|trackNumber) | +| `art` | Prints the URL to the current track's album artwork | +| `url` | Prints the URL for the current track | +| `http` | Open the current track in a web browser | +| `open ` | Opens a Spotify URI in the client" | +| `search ` | Start playing the best search result for the given query | +| `help` | Displays the help text | +| `` | `spotify-ctl foo` will search for `foo` | diff --git a/plugins/ubuntu/ubuntu.plugin.zsh b/plugins/ubuntu/ubuntu.plugin.zsh index e78ba1f81..d30cb9abc 100644 --- a/plugins/ubuntu/ubuntu.plugin.zsh +++ b/plugins/ubuntu/ubuntu.plugin.zsh @@ -32,6 +32,7 @@ alias aga='sudo apt-get autoclean' # aac alias agb='sudo apt-get build-dep' # abd alias agc='sudo apt-get clean' # adc alias agd='sudo apt-get dselect-upgrade' # ads +alias agdu='sudo apt-get dist-upgrade' alias agi='sudo apt-get install' # ai alias agp='sudo apt-get purge' # ap alias agr='sudo apt-get remove' # ar @@ -46,6 +47,7 @@ compdef _aga aga='sudo apt-get autoclean' compdef _agb agb='sudo apt-get build-dep' compdef _agc agc='sudo apt-get clean' compdef _agd agd='sudo apt-get dselect-upgrade' +compdef _agdu agdu='sudo apt-get dist-upgrade' compdef _agi agi='sudo apt-get install' compdef _agp agp='sudo apt-get purge' compdef _agr agr='sudo apt-get remove' @@ -55,6 +57,10 @@ compdef _agug agug='sudo apt-get upgrade' compdef _aguu aguu='sudo apt-get update && sudo apt-get upgrade' compdef _agar agar='sudo apt-get autoremove' +# Update/Upgrade all your packages and remove all unused packages safely +alias safe-upgrade-clean='sudo apt-get update && sudo apt-get dist-upgrade \ + && sudo apt-get autoremove && sudo apt-get autoclean' + # Remove ALL kernel images and headers EXCEPT the one in use alias kclean='sudo aptitude remove -P ?and(~i~nlinux-(ima|hea) \ ?not(~n`uname -r`))' @@ -241,7 +247,7 @@ function spotify-ctl { # Prints usage information. function sp-help { - echo "Usage: soptify-ctl [command]" + echo "Usage: spotify-ctl [command]" echo "Control a running Spotify instance from the command line." echo "" echo " spotify-ctl play - Play Spotify" @@ -250,15 +256,15 @@ function spotify-ctl { echo " spotify-ctl next - Go to next track" echo " spotify-ctl prev - Go to previous track" echo "" - echo " spotify-ctl current - Format the currently playing track" - echo " spotify-ctl metadata - Dump the current track's metadata" - echo " spotify-ctl eval - Return the metadata as a shell script" - echo " spotify-ctl art - Print the URL to the current track's album artwork" + echo " spotify-ctl current - Displays the current track metadata" + echo " spotify-ctl metadata - Displays the current track raw metadata" + echo " spotify-ctl eval - Returns the current track metadata as a shell variables. SPOTIFY_(title|album|artist|trackid|trackNumber)" + echo " spotify-ctl art - Prints the URL to the current track's album artwork" echo "" - echo " spotify-ctl url - Print the HTTP URL for the currently playing track" - echo " spotify-ctl http - Open the HTTP URL in a web browser" + echo " spotify-ctl url - Prints the URL for the currently playing track" + echo " spotify-ctl http - Open the current track in a web browser" echo "" - echo " spotify-ctl open - Open a spotify: uri" + echo " spotify-ctl open - Opens a Spotify URI in the client" echo " spotify-ctl search - Start playing the best search result for the given query" echo "" echo " spotify-ctl help - Show this information"