#1 Le 20/06/2021, à 15:05
- soujaa
Ajouter une pochette d'album dans le conky Guayadeque
Bonmatin amis ubunteros
J'ai modifier un conky clementine afin de de le faire fonctionner avec Quayadeque.
Mais j'arrive pas a faire apparaître la pochette de album en cours de lecture dans le conky.
La ligne ci-dessous permet de montrer la pochette. Mais je suis incapable de l'ajouter au script.
qdbus org.mpris.guayadeque /\Player org.freedesktop.MediaPlayer.GetMetadata | grep arturl
Le conkyrc file
###############################
###############################
### Conky theme ###
### Guayadeque ###
### ###
###############################
###############################
alignment top_middle
background no
gap_x 510
gap_y 670
minimum_size 0 0
maximum_width 1366
own_window_colour 000000
own_window yes
own_window_class Conky
own_window_type desktop
own_window_transparent yes
own_window_argb_visual yes
#own_window_argb_value 0
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
draw_shades no
color0 006400
color1 FF0000
color2 FDDA24
default_bar_size 360 5
uppercase no
use_spacer none
override_utf8_locale yes
use_xft yes
xftfont Cantarell:size=12
xftalpha 1
double_buffer yes
update_interval 1.0
own_window_argb_value 0
TEXT
${voffset -4}${color1}${hr}${color}${if_running guayadeque}
${color0}${color2}${alignr}${exec qdbus org.mpris.guayadeque /\
Player org.freedesktop.MediaPlayer.GetMetadata | grep artist | cut -f2- -d" "}
${color1}${alignr}${exec qdbus org.mpris.guayadeque /\
Player org.freedesktop.MediaPlayer.GetMetadata | grep album | cut -f2- -d" "}
${color0}${alignr}${exec qdbus org.mpris.guayadeque /\
Player org.freedesktop.MediaPlayer.GetMetadata | grep title | cut -f2- -d" "}
${execbar sh /home/assoua/.conky/script_guaya}
${voffset 30}${color2}${hr}${else}
${color2}${voffset -4}${hr}${color}${endif}${font}
Le script guayadeque
#!/bin/bash
# Filename: guayadeque-progbar
# Author: robz
# Version: 290611
# Provide data to allow conky to draw a progress bar for Guayadeque.
# Something I noticed relevent to the preceding Rhythmbox script, is that it's
# not nesessary to check for a running instance of the music player, Conky
# already does that with the ${if_running} statment doh.
# Name of current album
album = commands.getoutput("mpc --format %artist%+%album% | head -n 1")
# If tags are empty, use noimg.
if album == "":
if os.path.exists(conkycover):
os.remove(conkycover)
if os.path.exists(noimg):
shutil.copy(noimg, conkycover)
else:
print "Image not found!"
else:
filename = imgpath + album + ".jpg"
if os.path.exists("/tmp/nowplaying") and os.path.exists("/tmp/cover"):
nowplaying = open("/tmp/nowplaying").read()
if nowplaying == album:
pass
else:
copycover(album, filename, cover, noimg)
open("/tmp/nowplaying", "w").write(album)
else:
copycover(album, filename, cover, noimg)
open("/tmp/nowplaying", "w").write(album)
# Get song duration and position from "q/dbus" - this will be in milliseconds.
DUR=$(qdbus org.mpris.guayadeque /\Player org.freedesktop.MediaPlayer.GetMetadata | awk '/mtime/ {print $2}')
POS=$(dbus-send --print-reply --type=method_call --dest=org.mpris.guayadeque /\Player org.freedesktop.MediaPlayer.PositionGet | awk '/int32/ {print $2}')
echo $((100000*POS/DUR)) # Convert to percent.
Additionnellement, avoir une barre de progression serai merveilleux .
Merci de votre aide
Hors ligne