Skip to content

Commit

Permalink
fix version check
Browse files Browse the repository at this point in the history
  • Loading branch information
graysky2 committed Sep 12, 2019
1 parent 26a9ee5 commit 6242df0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion MIT
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2013-2017 graysky
Copyright (c) 2013-2019 graysky

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = 1.66
VERSION = 1.67
PN = pulseaudio-ctl

PREFIX ?= /usr
Expand Down
5 changes: 2 additions & 3 deletions common/pulseaudio-ctl.in
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ exit 1; }

# really crude pactl version check since commands are different for different
# versions of pactl. sorry users of PA <5
PAVERSION=$(pactl --version | grep pactl | pactl --version | grep pactl | sed -e 's/^pactl //' -e 's/\([0-9.]\+\).*/\1/')
PAVERSION=$(pactl --version | grep pactl | sed -e 's/^pactl //' -e 's/\([0-9.]\+\).\([0-9.]\+\)$/\1/')
if [[ ${PAVERSION%%.*} -lt 5 ]]; then
# really old versions
PCV=0
Expand Down Expand Up @@ -305,7 +305,7 @@ case "$1" in
*)
# send to notify-send if enabled
[[ $USEN -eq 1 ]] &&
notify-send -a pulseaudio-ctl -t 8000 --hint=int:transient:1 "Pulseaudio Settings" "Volume level : $CURVOL %\nIs sink muted : $MUTED\nIs source muted : $SOURCE_MUTED\nDetected sink : $SINK\nDetected source : $SOURCE\nPulse version : $PAVERSION" --icon=multimedia-volume-control
notify-send -a pulseaudio-ctl -t 8000 --hint=int:transient:1 "Pulseaudio Settings" "Volume level : $CURVOL %\nIs sink muted : $MUTED\nIs source muted : $SOURCE_MUTED\nDetected sink : $SINK\nDetected source : $SOURCE\n" --icon=multimedia-volume-control
# add pretty colors for mute status for CLI only
[[ "$MUTED" = "yes" ]] && MUTED="${NRM}${RED}$MUTED${NRM}" ||
MUTED="${NRM}${GRN}$MUTED${NRM}"
Expand All @@ -331,7 +331,6 @@ case "$1" in
echo -e " ${BLD}Is source muted : $SOURCE_MUTED"
echo -e " ${BLD}Detected sink : ${NRM}${BLU}$SINK${NRM}"
echo -e " ${BLD}Detected source : ${NRM}${BLU}$SOURCE${NRM}"
echo -e " ${BLD}Pulse version : ${NRM}${BLU}$PAVERSION${NRM}"
;;
esac

Expand Down

0 comments on commit 6242df0

Please sign in to comment.