Codes divers: Check-in [5b1268a20c]

Divers bouts de code de ma composition

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Improvement of audiocmd
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:5b1268a20cacd7d74f1b7524c1025ab0d02e5150
User & Date: milouse 2019-08-22 11:38:46
Context
2019-08-28
06:33
Add resources for the Manoir du Val escape game (august 2019) check-in: 4fc14d920a user: milouse tags: trunk
2019-08-22
11:38
Improvement of audiocmd check-in: 5b1268a20c user: milouse tags: trunk
2019-06-05
14:12
Upgrade betterodoo check-in: d40ec55acb user: milouse tags: trunk
Changes

Changes to audiocmd.

23
24
25
26
27
28
29
30




31
32
33
34
35
36
37
...
106
107
108
109
110
111
112


113
114

115
116
117
118
119
120
121
122
...
161
162
163
164
165
166
167


168
169

170

171
172
173
174
175
176
177

  exit
fi

PREFIX=
[ -n "$2" ] && PREFIX="$2"
LONG_DISPLAY=no
[ "$PREFIX" = 'long' ] && LONG_DISPLAY=yes && PREFIX=





MPRISPLAYER=

if pgrep -u "$USER" spotify &> /dev/null; then
    MPRISPLAYER=spotify
elif pgrep -u "$USER" goodvibes &> /dev/null; then
    MPRISPLAYER=Goodvibes
................................................................................
            fi
            if [ -n "$MPRISALBUM" -a -n "$MPRISTITLE" ]; then
                MPRISTITLE="$MPRISALBUM - $MPRISTITLE"
            fi

            if [ -n "$MPRISTITLE" ]; then
                # old symbol: ▸ / ∿ ☁ ⚟ ✕


                [ -n "$PREFIX" ] && [ "$MPRISSTATUS" = 'Playing' ] && PREFIX="${PREFIX}∿ "
                [ -n "$PREFIX" ] && [ "$MPRISSTATUS" = 'Paused' ] && PREFIX="${PREFIX}✕ "

                echo "${PREFIX}${MPRISTITLE}"
            fi
        fi
        exit ;;

    *) exit 1
  esac
  $DBUSCMD "org.mpris.MediaPlayer2.Player.$action"
................................................................................
          if [ "$LONG_DISPLAY" = 'no' -a ${#MPRISTITLE} -gt 20 ]; then
              MPRISTITLE=${MPRISTITLE:0:20}"…"
          fi
          if [ -n "$MPRISALBUM" -a -n "$MPRISTITLE" ]; then
              MPRISTITLE="$MPRISALBUM - $MPRISTITLE"
          fi



          [ -n "$PREFIX" ] && [ "$MPCSTATUS" = 'Playing' ] && PREFIX="${PREFIX}∿ "
          [ -n "$PREFIX" ] && [ "$MPCSTATUS" = 'Paused' ] && PREFIX="${PREFIX}✕ "

          echo -n "$PREFIX"

          if [ -n "$MPRISTITLE" ]; then
              echo "$MPRISTITLE"
          else
            mpc -h "$MPDHOST" -f "%file%" "$1"
          fi

      else







|
>
>
>
>







 







>
>
|
|
>
|







 







>
>
|
|
>
|
>







23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
...
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
...
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188

  exit
fi

PREFIX=
[ -n "$2" ] && PREFIX="$2"
LONG_DISPLAY=no
if [ "$PREFIX" = 'long' ]; then
    LONG_DISPLAY=yes
    PREFIX=
    [ -n "$3" ] && PREFIX="$3"
fi

MPRISPLAYER=

if pgrep -u "$USER" spotify &> /dev/null; then
    MPRISPLAYER=spotify
elif pgrep -u "$USER" goodvibes &> /dev/null; then
    MPRISPLAYER=Goodvibes
................................................................................
            fi
            if [ -n "$MPRISALBUM" -a -n "$MPRISTITLE" ]; then
                MPRISTITLE="$MPRISALBUM - $MPRISTITLE"
            fi

            if [ -n "$MPRISTITLE" ]; then
                # old symbol: ▸ / ∿ ☁ ⚟ ✕
                SYMBOL=
                if [ "$LONG_DISPLAY" = 'yes' ]; then
                    [ "$MPRISSTATUS" = 'Playing' ] && SYMBOL="∿ "
                    [ "$MPRISSTATUS" = 'Paused' ] && SYMBOL="✕ "
                fi
                echo "${PREFIX}${SYMBOL}${MPRISTITLE}"
            fi
        fi
        exit ;;

    *) exit 1
  esac
  $DBUSCMD "org.mpris.MediaPlayer2.Player.$action"
................................................................................
          if [ "$LONG_DISPLAY" = 'no' -a ${#MPRISTITLE} -gt 20 ]; then
              MPRISTITLE=${MPRISTITLE:0:20}"…"
          fi
          if [ -n "$MPRISALBUM" -a -n "$MPRISTITLE" ]; then
              MPRISTITLE="$MPRISALBUM - $MPRISTITLE"
          fi

          SYMBOL=
          if [ "$LONG_DISPLAY" = 'yes' ]; then
              [ "$MPCSTATUS" = 'Playing' ] && SYMBOL="∿ "
              [ "$MPCSTATUS" = 'Paused' ] && SYMBOL="✕ "
          fi
          echo -n "${PREFIX}${SYMBOL}"

          if [ -n "$MPRISTITLE" ]; then
              echo "$MPRISTITLE"
          else
            mpc -h "$MPDHOST" -f "%file%" "$1"
          fi

      else