
In this case is pausing clementineĭbus-send -type=method_call -dest= /Player Will do nothing"Įcho "Your position is " + $(qdbus /Player )Įcho "Your Clementine is stopped and will therefore do nothing" Status=$(qdbus /org/mpris/MediaPlayer2 .PlaybackStatus)Įcho "Your Clementine is already paused. # Set and assign value to variable (can have the following values Playing, Paused, Stopped - perhaps more) # $DBUS has a string similar to this one DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-VSMkpporJH,guid=56f3493fc79f62ebfb7c05675528c737ĭBUS=$(cat /proc/$CLEMENTINEPID/environ | strings | sed -n "/DBUS_SESSION_BUS_ADDRESS/,/ORACLE_BASE/p" | head -n 1) Note part sed -n - this is peculiar to my environment (see my previous posts).
#Clementine player group forum code#
# run all code below as particular user see Qdbus version: 4:4.8.6+git155-g716fbae+dfsg-1Ĭode: Select all # obtain PID of running clementine (for the particular user) notice -x as it is necessary to obtain exact macth (Clementine has also process clementine-tagreader)ĬLEMENTINEPID=$(pgrep -u USER_NAME -x clementine) Libstrigiqtdbusclient0 version: 0.7.8-1.2+b2 Libkdepimdbusinterfaces4 version: 4:4.14.2-2 This script used to work, but I am not sure when it has stopped working.Ĭode: Select all dpkg -l | grep dbus | awk ' So executed script is running as a root user and in it is only executing relevant part of code as a different user. I am executing above code as a part of startup/shutdown/suspend script, which I am running as a root. I have checked former statement with a help of qdbusviewerĪnd it is displaying completely different session buses than qdbusviewer executed from a user's konsole. It seems that qdbus executed via su/sudo can no longer access user qt applications. Now it seems that qdbus is running in a different session when executing command via su (or sudo). Su username -c "qdbus -literal /Player " Su username -c "amarok &" # username is logged in kde
