mirror of
https://github.com/elenapan/dotfiles.git
synced 2026-04-06 10:06:45 +08:00
fixed comments and removed debug related prints
This commit is contained in:
parent
959be4bcd4
commit
4b3f733b29
1 changed files with 3 additions and 14 deletions
|
|
@ -17,11 +17,11 @@ i=1
|
|||
while :
|
||||
do
|
||||
# For debugging purposes
|
||||
printf "|%02d|" $i
|
||||
# printf "|%02d|" $i
|
||||
|
||||
INPUT="$(wmctrl -l | grep -v "wmctrl" | grep -m 1 $1 | awk -v skipstart=3 -v skipend=0 '{delim = ""; for (i=skipstart+1;i<=NF-skipend;i++) {printf delim "%s", $i; delim = OFS};}')"
|
||||
|
||||
# If the song has changed, start from the beginning
|
||||
# If the output has changed, start from the beginning
|
||||
if [[ "$INPUT" != "$OLD_INPUT" ]]; then
|
||||
i=1
|
||||
fi
|
||||
|
|
@ -51,14 +51,6 @@ do
|
|||
else
|
||||
LOOPTAIL="$(echo $INPUT | cut -c -$LIMIT)"
|
||||
FULLSTRING="$(echo "$INPUT$SEPERATOR$LOOPTAIL")"
|
||||
#FULLSTRING="$(echo $INPUT | sed "s/$/$SEPERATOR/" | sed "s/$/$LOOPTAIL/" )"
|
||||
|
||||
|
||||
# This is to prevent the bug when song changes and current i is larger than current song length
|
||||
# (Not needed anymore, this bug was fixed differently)
|
||||
# if [ $i -gt "${#FULLSTRING}" ]; then
|
||||
# i=1
|
||||
# fi
|
||||
|
||||
echo -n " "
|
||||
# Show only LIMIT characters, from i to i+LIMIT. Output scrolls due to incrementing i
|
||||
|
|
@ -78,7 +70,4 @@ do
|
|||
echo ""
|
||||
|
||||
sleep 1
|
||||
done
|
||||
|
||||
# general method to exlude fields
|
||||
# awk -v skipstart=1 -v skipend=1 '{delim = ""; for (i=skipstart+1;i<=NF-skipend;i++) {printf delim "%s", $i; delim = OFS}; printf "\n"}'
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue