Codes divers: Check-in [c9aa8fc8b0]

Divers bouts de code de ma composition

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

Overview
Comment:Spotify current status over dbus seems to be fixed
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:c9aa8fc8b054df4bbc64b3ac66eb0481ecea3b48
User & Date: milouse 2019-10-18 14:37:32
Context
2019-11-12
16:23
Upgrade betterodoo check-in: 43e3dea217 user: milouse tags: trunk
2019-10-18
14:37
Spotify current status over dbus seems to be fixed check-in: c9aa8fc8b0 user: milouse tags: trunk
2019-08-28
06:33
Add resources for the Manoir du Val escape game (august 2019) check-in: 4fc14d920a user: milouse tags: trunk
Changes

Changes to audiocmd.

56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
    Next|next) action=Next ;;

    Prev|prev) action=Previous ;;

    Stop|stop) action=Stop ;;

    Current|current|Status|status)
        # The following seems broken... Have to investigate why
        # string:PlaybackStatus does not work (timeout) with spotify
        # dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:org.mpris.MediaPlayer2.Player string:PlaybackStatus

        if [ "$MPRISPLAYER" = 'spotify' ]; then
            # Hacky stuff using pacmd for spotify
            # Spotify running for pulseaudio ?
            TOTALCOUNT=$(pacmd list-sink-inputs | grep -c index)
            SINKCOUNT=$(pacmd list-sink-inputs | grep -c 'state: RUNNING')
            if [ $TOTALCOUNT -gt 1 ]; then
                MPRISSTATUS=unknown
            elif [ $SINKCOUNT = 1 ]; then
                MPRISSTATUS=Playing
            else
              MPRISSTATUS=Paused
            fi

        else
            MPRISSTATUS=$($DBUSCMD $DBUSGETSTRING string:PlaybackStatus | grep variant | cut -d'"' -f2)
        fi

        if [ "$1" = 'Status' -o "$1" = 'status' ]; then
            echo "${PREFIX}${MPRISSTATUS}"
            exit
        fi

        if [ "$MPRISSTATUS" = 'Playing' ] || [ "$MPRISSTATUS" = 'Paused' ]; then







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<







56
57
58
59
60
61
62


















63

64
65
66
67
68
69
70
    Next|next) action=Next ;;

    Prev|prev) action=Previous ;;

    Stop|stop) action=Stop ;;

    Current|current|Status|status)


















        MPRISSTATUS=$($DBUSCMD $DBUSGETSTRING string:PlaybackStatus | grep variant | cut -d'"' -f2)


        if [ "$1" = 'Status' -o "$1" = 'status' ]; then
            echo "${PREFIX}${MPRISSTATUS}"
            exit
        fi

        if [ "$MPRISSTATUS" = 'Playing' ] || [ "$MPRISSTATUS" = 'Paused' ]; then