/usr/share/konversation/scripts/gauge is in konversation-data 1.6-0ubuntu1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | #!/usr/bin/env bash
SERVER=$1
TARGET=$2
shift
shift
PERCENTAGE=$1
if [ ! $TARGET ]
then
qdbus org.kde.konversation /irc error "Can't write into status view."
else
if [ ! $PERCENTAGE ]
then
qdbus org.kde.konversation /irc error "USAGE: $0 <percentage>"
else
PERCENTAGE=`echo $PERCENTAGE | sed 's/^0\+//'`
LEFT=$(($PERCENTAGE/5))
RIGHT=$((20-$LEFT))
if [[ $PERCENTAGE -lt 0 ]]; then
qdbus org.kde.konversation /irc error "Percentage has to be bigger than 0"
exit
fi
if [[ $PERCENTAGE -gt 100 ]]; then
qdbus org.kde.konversation /irc error "Percentage has to be smaller than 100"
exit
fi
if [ $PERCENTAGE = 50 ]
then
METER="|"
else
if [[ $PERCENTAGE -lt 50 ]]
then
METER="\\"
else
METER="/"
fi
fi
for (( i=$LEFT ; $i != 0 ; i-- ))
do
OUTPUT="$OUTPUT,"
done
OUTPUT="$OUTPUT$METER"
for (( i=$RIGHT ; $i != 0 ; i-- ))
do
OUTPUT="$OUTPUT,"
done
OUTPUT=`echo $OUTPUT | sed 's/,/ /g'`
OUTPUT="[$OUTPUT] $PERCENTAGE%"
if [ $PERCENTAGE = 100 ]
then
OUTPUT="$OUTPUT *ding*"
fi
qdbus org.kde.konversation /irc say $SERVER "$TARGET" "Beer load $OUTPUT"
fi
fi
|