Nowe posty

xx Dystrybucja pod HP Omen (6)
Wczoraj o 23:30:08
xx [Poradnik] Wyszukiwanie Sterowników (2)
Wczoraj o 21:08:23
lamp Problem z Linux Lite po instalacji (0)
Wczoraj o 19:50:30
xx Ile pingwinów? (1)
Wczoraj o 08:59:24
xx konfiguracja pale moon (0)
2024-03-24, 21:53:42
xx Plasma 6 w Neonie ssie trochę mniej ... (10)
2024-03-23, 02:38:11
xx problem z instalacja sterowników do karty sieciowej (3)
2024-03-18, 18:10:16
xx Plik abc.001 (1)
2024-03-17, 17:48:27
xx Zlecę dopracowanie programu w MatLab (0)
2024-03-13, 15:28:40
xx Linux Mint 21.3 XFCE brak dźwieku po paru minutach (karta muzyczna zintegrowana) (5)
2024-03-12, 23:07:01

Autor Wątek: conky problem z MOC  (Przeczytany 7023 razy)

lwiaros

  • Gość
conky problem z MOC
« dnia: 2013-07-13, 18:57:04 »
czemu conky nie działa wyświetlanie informacji o muzyce odtwarzanej przez MOC
specyfikacia podaje
 moc_album
              Album of the current MOC song


       moc_artist
              Artist of the current MOC song


       moc_bitrate
              Bitrate in the current MOC song


       moc_curtime
              Current time of the current MOC song


       moc_file
              File name of the current MOC song


       moc_rate
              Rate of the current MOC song


       moc_song
              The current song name being played in MOC.


       moc_state
              Current state of MOC; playing, stopped etc.


       moc_timeleft
              Time left in the current MOC song


       moc_title
              Title of the current MOC song


       moc_totaltime
              Total length of the current MOC song
posiadam conky 1.9

snajper_8383

  • Gość
conky problem z MOC
« Odpowiedź #1 dnia: 2013-07-14, 13:38:57 »
A jak wygląda twój plik konfiguracyjny do conky?

lwiaros

  • Gość
conky problem z MOC
« Odpowiedź #2 dnia: 2013-07-14, 20:36:25 »
oto conkyrc
# set to yes if you want Conky to be forked in the background
background no

cpu_avg_samples 2
net_avg_samples 2

out_to_console no

# X font when Xft is disabled, you can pick one with program xfontsel
#font 7x12
#font 6x10
#font 7x13
#font 8x13
#font 7x12
#font *mintsmild.se*
#font -*-*-*-*-*-*-34-*-*-*-*-*-*-*
#font -artwiz-snap-normal-r-normal-*-*-100-*-*-p-*-iso8859-1

# Use Xft?
use_xft yes

# Xft font when Xft is enabled
xftfont Bitstream Vera Sans Mono:size=8

own_window_transparent no
own_window_colour hotpink
# Text alpha when using Xft
xftalpha 0.8

on_bottom yes

# mail spool
mail_spool $MAIL

# Update interval in seconds
update_interval 1
# Create own window instead of using desktop (required in nautilus)
own_window no

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer no

# Minimum size of text area
#minimum_size 280 5
#maximum_width 150

# Draw shades?
draw_shades no

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no

# Stippled borders?
stippled_borders 10

# border margins
border_margin 4

# border width
border_width 1

# Default colors and also border colors
default_color white
default_shade_color white
default_outline_color white

# Text alignment, other possible values are commented
#alignment top_left
#minimum_size 10 10
gap_x 13
gap_y 13
#alignment top_right
alignment tr
#alignment bottom_right

# Gap between borders of screen and text

# Add spaces to keep things from moving about?  This only affects certain objects.
use_spacer no

# Subtract file system buffers from used memory?
no_buffers yes

# set to yes if you want all text to be in uppercase
uppercase no

# boinc (seti) dir
# seti_dir /opt/seti

# Possible variables to be used:
#
#      Variable         Arguments                  Description                
#  acpiacadapter                     ACPI ac adapter state.                  
#  acpifan                           ACPI fan state                          
#  acpitemp                          ACPI temperature.                        
#  adt746xcpu                        CPU temperature from therm_adt746x      
#  adt746xfan                        Fan speed from therm_adt746x            
#  battery           (num)           Remaining capasity in ACPI or APM        
#                                    battery. ACPI battery number can be      
#                                    given as argument (default is BAT0).    
#  buffers                           Amount of memory buffered                
#  cached                            Amount of memory cached                  
#  color             (color)         Change drawing color to color            
#  cpu                               CPU usage in percents                    
#  cpubar            (height)        Bar that shows CPU usage, height is      
#                                    bar's height in pixels                  
#  downspeed         net             Download speed in kilobytes              
#  downspeedf        net             Download speed in kilobytes with one    
#                                    decimal                                  
#  exec              shell command   Executes a shell command and displays    
#                                    the output in torsmo. warning: this      
#                                    takes a lot more resources than other    
#                                    variables. I'd recommend coding wanted  
#                                    behaviour in C and posting a patch :-).  
#  execi             interval, shell Same as exec but with specific interval.
#                    command         Interval can't be less than              
#                                    update_interval in configuration.        
#  fs_bar            (height), (fs)  Bar that shows how much space is used on
#                                    a file system. height is the height in  
#                                    pixels. fs is any file on that file      
#                                    system.                                  
#  fs_free           (fs)            Free space on a file system available    
#                                    for users.                              
#  fs_free_perc      (fs)            Free percentage of space on a file      
#                                    system available for users.              
#  fs_size           (fs)            File system size                        
#  fs_used           (fs)            File system used space                  
#  hr                (height)        Horizontal line, height is the height in
#                                    pixels                                  
#  i2c               (dev), type, n  I2C sensor from sysfs (Linux 2.6). dev  
#                                    may be omitted if you have only one I2C  
#                                    device. type is either in (or vol)      
#                                    meaning voltage, fan meaning fan or temp
#                                    meaning temperature. n is number of the  
#                                    sensor. See /sys/bus/i2c/devices/ on    
#                                    your local computer.                    
#  kernel                            Kernel version                          
#  loadavg           (1), (2), (3)   System load average, 1 is for past 1    
#                                    minute, 2 for past 5 minutes and 3 for  
#                                    past 15 minutes.                        
#  machine                           Machine, i686 for example                
#  mails                             Mail count in mail spool. You can use    
#                                    program like fetchmail to get mails from
#                                    some server using your favourite        
#                                    protocol. See also new_mails.            
#  mem                               Amount of memory in use                  
#  membar            (height)        Bar that shows amount of memory in use  
#  memmax                            Total amount of memory                  
#  memperc                           Percentage of memory in use              
#  new_mails                         Unread mail count in mail spool.        
#  nodename                          Hostname                                
#  outlinecolor      (color)         Change outline color                    
#  pre_exec          shell command   Executes a shell command one time before
#                                    torsmo displays anything and puts output
#                                    as text.                                
#  processes                         Total processes (sleeping and running)  
#  running_processes                 Running processes (not sleeping),        
#                                    requires Linux 2.6                      
#  shadecolor        (color)         Change shading color                    
#  stippled_hr       (space),        Stippled (dashed) horizontal line        
#                    (height)        
#  swapbar           (height)        Bar that shows amount of swap in use    
#  swap                              Amount of swap in use                    
#  swapmax                           Total amount of swap                    
#  swapperc                          Percentage of swap in use                
#  sysname                           System name, Linux for example          
#  time              (format)        Local time, see man strftime to get more
#                                    information about format                
#  totaldown         net             Total download, overflows at 4 GB on    
#                                    Linux with 32-bit arch and there doesn't
#                                    seem to be a way to know how many times  
#                                    it has already done that before torsmo  
#                                    has started.                            
#  totalup           net             Total upload, this one too, may overflow
#  updates                           Number of updates (for debugging)        
#  upspeed           net             Upload speed in kilobytes                
#  upspeedf          net             Upload speed in kilobytes with one      
#                                    decimal                                  
#  uptime                            Uptime                                  
#  uptime_short                      Uptime in a shorter format              
#
#  seti_prog                         Seti@home current progress
#  seti_progbar      (height)        Seti@home current progress bar
#  seti_credit                       Seti@hoome total user credit


# variable is given either in format $variable or in ${variable}. Latter
# allows characters right after the variable and must be used in network
# stuff because of an argument
#${font Dungeon:style=Bold:pixelsize=10}I can change the font as well
#${font Verdana:size=10}as many times as I choose
#${font Perry:size=10}Including UTF-8,
#${font Luxi Mono:size=10}justo como este texto que o google traduz fĂŞz o portuguĂŞs
# stuff after 'TEXT' will be formatted on screen
#${font Grunge:size=12}${time %a  %b  %d}${alignr -25}${time %k:%M}

TEXT
$nodename - $sysname $kernel on $machine
$stippled_hr
${color lightgrey}Uptime:$color $uptime ${color lightgrey}- Load:$color $loadavg
${color lightgrey}CPU Usage:${color #5000a0} ${cpu}% ${cpubar}
${color black}${cpugraph 000000 5000a0}
${color lightgrey}RAM Usage:$color $mem/$memmax - $memperc% $membar
${color lightgrey}Swap Usage:$color $swap/$swapmax - $swapperc% ${swapbar}
${color lightgrey}Processes:$color $processes  ${color grey}Running:$color $running_processes
$color$stippled_hr
${color lightgrey}Networking:
 Down:${color #8844ee} ${downspeed eth0} k/s${color lightgrey} ${offset 70}Up:${color #22ccff} ${upspeed eth0} k/s
${color black}${downspeedgraph eth0 32,150 ff0000 0000ff} $alignr${color black}${upspeedgraph eth0 32,150 0000ff ff0000}
${color lightgrey}File systems:
 / $color${fs_used /}/${fs_size /} ${fs_bar /}
${color lightgrey}Temperatures:
 CPU:$color ${i2c temp 2}C${color grey} - MB:$color ${i2c temp 1}C
${color}Name              PID     CPU%   MEM%
${color #ddaa00} ${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1}
${color lightgrey} ${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2}
${color lightgrey} ${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3}
${color}Mem usage
${color #ddaa00} ${top_mem name 1} ${top_mem pid 1} ${top_mem cpu 1} ${top_mem mem 1}
${color lightgrey} ${top_mem name 2} ${top_mem pid 2} ${top_mem cpu 2} ${top_mem mem 2}
${color lightgrey} ${top_mem name 3} ${top_mem pid 3} ${top_mem cpu 3} ${top_mem mem 3}
${moc_song}
${moc_artist}

snajper_8383

  • Gość
conky problem z MOC
« Odpowiedź #3 dnia: 2013-07-14, 22:56:21 »
I jeszcze jedno masz zrobione tagi w plikach muzycznych których słuchasz? Jak masz uruchomiony program mocp, to otwórz terminal i wydaj polecenie mocp -i i zobacz czy masz tytuł i wykonawce.

lwiaros

  • Gość
conky problem z MOC
« Odpowiedź #4 dnia: 2013-07-15, 07:10:36 »
wszystko jest są tagi//snajper_8383// u ciebie w conky działa pobieranie informacji z moc
Title: 1 Selena Gomez - Come & Get It
Artist: Selena Gomez
SongTitle: Come & Get It
Album:
TotalTime: 03:46
TimeLeft: 03:40
TotalSec: 226
CurrentTime: 00:06
CurrentSec: 6
Bitrate: 128Kbps
Rate: 44KHz
chyba z moc będzie taka sam sytuacja jak z hddtemp, komenda nie działa właściwie, trzeba to będzie zrobić inaczej

snajper_8383

  • Gość
conky problem z MOC
« Odpowiedź #5 dnia: 2013-07-15, 10:45:17 »
Ja napisałem sobie taki skypt:
#!/bin/bash
PROCNAME=mocp
if [[ $(pgrep -u $USER $PROCNAME) ]]
then
    state=$(mocp -i | grep -i '\\bstate' | awk '{print $2}')
    artist=$(mocp -i | grep -i '\\bartist\\b' | sed 's\\_\\ \\g')
    title=$(mocp -i | grep -i '\\bsongtitle\\b' | sed 's\\_\\ \\g')
    album=$(mocp -i | grep -i '\\balbum\\b' | sed 's\\_\\ \\g')
    total=$(mocp -i | grep -i '\\btotaltime\\b')
    #current=$(mocp -i | grep -i '\\bcurrenttime\\b')
    if [ "$state" == "PLAY" ]
    then
echo '${voffset 12}'$artist
echo '${voffset 5}'$title
echo '${voffset 5}'$album
echo '${voffset 5}'$total
#echo '${voffset 5}'$current
    elif [ "$state" == "PAUSE" ]
    then
echo '${voffset 12}Artist: pause'
echo '${voffset 5}Title: pause'
echo '${voffset 5}Album: pause'
echo '${voffset 5}TotalTime: pause'
#echo '${voffset 5}CurrentTime: pause'
    else
echo '${voffset 12}Artist: stop'
echo '${voffset 5}Title: stop'
echo '${voffset 5}Album: stop'
echo '${voffset 5}TotalTime: stop'
#echo '${voffset 5}CurrentTime: default'
    fi
else
echo '${voffset 12}Artist: none'
echo '${voffset 5}Title: none'
echo '${voffset 5}Album: none'
echo '${voffset 5}TotalTime: none'
#echo '${voffset 5}CurrentTime: none'
fi
A w conky uruchamiam go tak:
${execpi 7 ~/sciezka_do_skryptu/nazwa_skryptu}
U mnie działa wyświetlanie, tylko to wyświetlanie w conky nie działa za dobrze, cały czas miga z tytułu utworu na "no song". Dlatego ja osobiście wolę korzystać z skryptu.

lwiaros

  • Gość
conky problem z MOC
« Odpowiedź #6 dnia: 2013-07-15, 16:20:04 »
Cytat: snajper_8383
${execpi 7 ~/sciezka_do_skryptu/nazwa_skryptu}
U mnie działa wyświetlanie, tylko to wyświetlanie w conky nie działa za dobrze, cały czas miga z tytułu utworu na "no song". Dlatego ja osobiście wolę korzystać z skryptu.
powino by“ execi 7 ~/scieżka

fajny skrypt ale się pospieszyłem i napisałem własny prosty skrypt
#!/bin/bash
function tagi
{
title=`mocp -i |grep -w Title |cut -d : -f2`
songtitle=`mocp -i |grep -w SongTitle |cut -d : -f2`
artist=`mocp -i |grep -w Artist |cut -d : -f2`
rate=`mocp -i |grep -w Rate |cut -d : -f2`
bitrate=`mocp -i |grep -w Bitrate |cut -d : -f2`
totaltime=`mocp -i |grep -w TotalTime |cut -d : -f2-`
currenttime=`mocp -i |grep -w CurrentTime |cut -d : -f2-`
echo "tytuł:$songtitle $currenttime"
echo  "wykonawca: $artist"
echo $totaltime $currenttime $bitrate $rate
}
state=`mocp -i |grep -w State |cut -d : -f2`
if [ $state=PLAY ]
 then
  tagi
fi
A jeszcze jedno widać że twórcy opuścili się z pracą nad Conky , fajny monitor ale co z tego jak niedopracowany, strona polska to samo padła conky.pl. Biedzie jak z Slax Linux społeczność przejmie ster , a twórcy się obudza, albo i nie.
Pozdrawiam