8f47c96453a229ad5488bbd1e4ee8b7c522b6a15
- Author
- mahi97 <mohammadmahdi76@gmail.com>
- Committer
- mahi97 <mohammadmahdi76@gmail.com>
- Date
Message
volume up/down added
Diff
1diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh
2index 948d69a29eaf6fb6300a146989d9ff6c77506c07..386507dbc90228630c9954ddd7524c183a7487ce 100644
3--- a/plugins/osx/osx.plugin.zsh
4+++ b/plugins/osx/osx.plugin.zsh
5@@ -327,6 +327,22 @@ function spotify() {
6 if [[ "$2" = "show" || "$2" = "" ]]; then
7 echo "Current Spotify volume level is $vol.";
8 break ;
9+ elif [ "$2" = "up" ]; then
10+ if [ "$vol" -le 90 ]; then
11+ newvol=$(( vol+10 ));
12+ echo "Increasing Spotify volume to $newvol.";
13+ else
14+ newvol=100;
15+ echo "Spotify volume level is at max.";
16+ fi
17+ elif [ "$2" = "down" ]; then
18+ if [ "$vol" -ge 10 ]; then
19+ newvol=$(( vol-10 ));
20+ echo "Reducing Spotify volume to $newvol.";
21+ else
22+ newvol=0;
23+ echo "Spotify volume level is at min.";
24+ fi
25 elif [ "$2" -ge 0 ]; then
26 newvol=$2;
27 fi