aliases 1.7 KB

12345678910111213141516171819202122232425262728
  1. # Here are some bash aliases from my .bashrc
  2. # Using these aliases - I can control cmus from the terminal with a single short command, instead of "cmus-remote {parameters}"
  3. # From some of the commands, I also get some feedback from my "nowplay" script.
  4. alias now='nowplay' # call nowplay script
  5. alias play='cmus-remote -p;nowplay' # play a song and call nowplay to display the name of the current song
  6. alias pause='cmus-remote -u' # pause/resume
  7. alias resume='cmus-remote -u;nowplay' # pause/resume and call nowplay to display the name of the current song
  8. alias stop='cmus-remote -s' # stop playback
  9. alias next='cmus-remote -n;nowplay' # next track and nowplay to display the current song
  10. alias prev='cmus-remote -r;nowplay' # prev track and nowplay to display the current song
  11. alias cmup='cmus-remote -v +10%' # volume up by 10%
  12. alias cmdown='cmus-remote -v -10%' # volume down by 10%
  13. alias cmaddl='cmus-remote -l' # add items to the library e.g. cmaddl ~/Music/Kinasis/Divine\ Self\ Invention/ # would add my old bands album to the library
  14. alias cmaddp='cmus-remote -P' # add items to the currently selected playlist
  15. #toggle shuffle/repeat and output whether shuffle is enabled or disabled
  16. alias shuffle="cmus-remote -S; echo \"Shuffle: \$(cmus-remote -Q | \\grep shuffle | awk '{ print \$3 }')\""
  17. alias repeat="cmus-remote -R; echo \"Repeat: \$(cmus-remote -Q | \\grep repeat | awk '{ print \$3 }')\"" # toggle repeat
  18. # Shuffle function for cmus - alternative to the shuffle alias in the above section
  19. # Toggle cmus's shuffle functionality and outputs the state
  20. shf()
  21. {
  22. cmus-remote -S;
  23. echo "Shuffle: $(cmus-remote -Q | \grep shuffle | awk '{ print $3 }')"
  24. }