It's a type of Planche
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

12 行
600B

  1. #!/usr/bin/env bash
  2. firefox_mpris_dbus=$(dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.ListNames | grep -Po "org.mpris.*firefox[^\"]+")
  3. if [ -n $firefox_mpris_dbus ]; then
  4. playback_string=$(dbus-send --print-reply --dest=${firefox_mpris_dbus} /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'PlaybackStatus' | grep -Po "(?<=string \")[^\"]+")
  5. echo "Firefox MPRIS Instance ${firefox_mpris_dbus} has playback status ${playback_string}"
  6. else
  7. echo "Firefox MPRIS Instance not found!"
  8. fi