Login Hasło

#1 2009.08.18 15:44:34

kodzik
Użytkownik
Skąd: Sieradz / Wrocław
Zarejestrowany: 2007.09.24
Posty: 34
System: Debian Sid/Experimental amd64
Fluxbox: Z experimentala

$battery i conky

Witam

Aktualnie używam Gnome-power-manager jako menedżera baterii. Jednak chciałbym się go pozbyć na rzecz conky. Niestety zmienna $battery nie działa najlepiej.

Jako, że moja bateria nie jest wykrywana jako BAT0 (domyślne ustawienia conky) wpis od baterii wygląda tak:

Kod:

${battery BAT1}

Na starym laptopie takie coś pomogło.

Jednak na aktualnym grymasi sad Po wypięciu kabla zasilającego z lapka status baterii zmienia się z AC na FULL i tak zostaje aż do rozładowania. Powinno być DISCHARGING ileśtam%. To samo dzieje się przy zmiennej $battery_time . Przy użyciu zmiennej $battery_bar pasek stanu aktualizuje się normalnie. Jednak wolałbym mieć zmienną $battery i $battery_time w użyciu smile

Debian sid/exp amd64 2.6.31-rc6
Conky=> z sida
Config conky:

Kod:

# set to yes if you want Conky to be forked in the background 
background yes

# X font when Xft is disabled, you can pick one with program xfontsel 
#font 5x7 
#font 6x10 
#font 7x13 
#font 8x13 
#font 9x15 
#font *mintsmild.se* 
font -dejavu-dejavu sans mono-medium-r-normal-*-*-90-75-75-*-*-iso8859-2 


# Use Xft? 
use_xft yes

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

# Text alpha when using Xft 
xftalpha 1.0 

# Print everything to console? 
# out_to_console no 

# mail spool 
#mail_spool $MAIL 

# Update interval in seconds 
update_interval 0.5 
maximum_width 300

# This is the number of times Conky will update before quitting. 
# Set to zero to run forever. 
total_run_times 0 

# Create own window instead of using desktop (required in nautilus) 
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

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

# Minimum size of text area 
minimum_size 148 5 

# Draw shades? 
draw_shades yes 

# Draw outlines? 
draw_outline no 

# Draw borders around text 
draw_borders no 

# Stippled borders? 
stippled_borders 1 

# border margins 
border_margin 1 

# border width 
border_width 0 

# Default colors and also border colors 
default_color darkgrey 
default_shade_color black 
default_outline_color darkgrey 

# Text alignment, other possible values are commented 
#alignment top_left 
#alignment top_right 
#alignment bottom_left 
alignment bottom_right 

# Gap between borders of screen and text 
# same thing as passing -x at command line 
#gap_x 830 
gap_y 40

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

# number of cpu samples to average 
# set to 1 to disable averaging 
cpu_avg_samples 2 

# number of net samples to average 
# set to 1 to disable averaging 
net_avg_samples 2 

# Force UTF8? note that UTF8 support required XFT 
override_utf8_locale yes 


# Add spaces to keep things from moving about?  This only affects certain objects. 
use_spacer right 
#Note: doesn't work in conky 1.2 =( 

#   mldonkey_hostname     Hostname for mldonkey stuff, defaults to localhost 
#   mldonkey_port         Mldonkey port, 4001 default 
#   mldonkey_login        Mldonkey login, default none 
#   mldonkey_password     Mldonkey password, default none 


# stuff after 'TEXT' will be formatted on screen 

TEXT
${color }Kernel:${alignr}${color }$kernel
${color }Uptime:${alignr}${color }$uptime

${color }${execpi 60 ~/.skrypty/pogodynka} 

${color }CPU 1:${alignr}${color }${freq cpu0 }MHz ${cpu cpu0}%
${cpugraph cpu0 10,147 666666 999999}
${color }CPU 2:${alignr}${color }${freq cpu1 }MHz ${cpu cpu1}%
${cpugraph cpu1 10,147 666666 999999}

${color }Ram:${alignr}${color } $memperc% $mem/$memmax 
${membar 3,147}
${color }Swap:${alignr}${color } $swapperc% $swap/$swapmax 
${swapbar 3,147}

${color }Boot:${alignr}${color }${fs_free /boot}/${fs_size /boot}
${fs_bar 3,147 /boot}
${color }Root:${alignr}${color }${fs_free /}/${fs_size /}
${fs_bar 3,147 /}
${color }Home:${alignr}${color }${fs_free /home}/${fs_size /home}
${fs_bar 3,147 /home}

${color }LAN:
${color }IP: ${alignr}${color }${addr eth0}
${color }Up: ${color }${upspeed eth0} ${alignr}${color }Down: ${color }${downspeed eth0}
${upspeedgraph eth0 10,117 666666 999999} ${alignr}${downspeedgraph eth0 10,117 666666 999999}

${color }Wifi:
${color }IP: ${alignr}${color }${addr wlan0}
${color }Up: ${color }${upspeed wlan0} ${alignr}${color }Down: ${color }${downspeed wlan0}
${upspeedgraph wlan0 10,117 666666 999999} ${alignr}${downspeedgraph wlan0 10,117 666666 999999}

${color }HTOP:
${color } Process:${alignr} ${color }CPU%   ${color }MEM%
${color } ${top name 1} ${alignr} ${color }${top cpu 1} ${color }${top mem 1}
${color } ${top name 2} ${alignr} ${color }${top cpu 2} ${color }${top mem 2}
${color } ${top name 3} ${alignr} ${color }${top cpu 3} ${color }${top mem 3}
${color } ${top name 4} ${alignr} ${color }${top cpu 4} ${color }${top mem 4}
${color } ${top name 5} ${alignr} ${color }${top cpu 5} ${color }${top mem 5}

Jakieś pomysły, jak sprawić by conky lubił moją baterię ?smile Bardzo mi na tym zależy.

Pozdrawiam


software is like sex.. it's better when it's free..

Offline

 

#2 2009.08.18 20:55:05

parrotlarch
pijak
Skąd: Olsztyn
Zarejestrowany: 2007.08.28
Posty: 180
System: Debian stable, Ubuntu LTS
Fluxbox: 1.3.5-2

Re: $battery i conky

u mnie takie coś załatwia sprawę:

Kod:

${battery_percent BAT1}% ${color white}-- ${battery_time BAT1}

Zdzisław Dyrman...zasadniczo

Offline

 

#3 2009.08.18 23:09:42

kodzik
Użytkownik
Skąd: Sieradz / Wrocław
Zarejestrowany: 2007.09.24
Posty: 34
System: Debian Sid/Experimental amd64
Fluxbox: Z experimentala

Re: $battery i conky

W tym rzecz, że battery_time ciągle pokazuje unknown..


software is like sex.. it's better when it's free..

Offline

 

#4 2009.08.22 17:07:13

yoyoo2
Użytkownik
Zarejestrowany: 2009.01.17
Posty: 70

Re: $battery i conky

Kod:

bat=`cat /proc/acpi/battery/BAT0/state | grep remaining | cut --bytes=26-30`
state=`cat /proc/acpi/ac_adapter/ACAD/state | cut --bytes=26-34`
echo $[$bat/480+1]"%    ("$state")"

ja mam taki baszoskrypt, myśle że idea jest jasna

Offline

 

Stopka forum

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson