1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-12-26 04:17:33 +00:00

Merge branch 'master' into imlib2

Conflicts:
	configure.ac.in
	src/conky.c
This commit is contained in:
Brenden Matthews 2009-05-01 23:29:21 -06:00
commit a98a927116
89 changed files with 2998 additions and 4200 deletions

View File

@ -5,5 +5,5 @@ All code written since the fork of torsmo is licensed under the GPL (see
LICENSE.GPL for a copy), except where noted differently (such as in portmon code, timed thread code, and audacious code which are LGPL, and prss which is an MIT-style license).
Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS)
Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS)
All rights reserved.

View File

@ -1,3 +1,49 @@
2009-05-01
* Added diskio_avg_samples patch (thanks Yeon-Hyeong)
* Fixed $texeci regression
2009-04-30
* Added $combine, a var that places 2 other vars next to each other, even if they
have a output of multiple lines. This also makes the moving of RSS-itemes with
$goto (see change from 2009-04-19) no longer necessary.
2009-04-28
* Various XMMS2 updates (thanks Lassi)
* Make ALSA mixers available on Linux, and added $if_mixer_mute (thanks
2009-04-19
* Make it possible to place spaces in front of RSS-items as a workaround
for the problem that $goto only moves the first RSS-item. This is only a
workaround and should be replaced by a permanent fix that makes $goto move
all RSS-items !
2009-04-13
* Fix broken compilation without X11
2009-04-09
* Added default_bar/graph/gauge_size config options (thanks wire64 for the
idea)
2009-03-24
* Added eval text object to realise double parsing
2009-03-15
* Added gauge widget patch, sf.net id #2676128 (thanks Aner)
2009-05-01
* Conky 1.7.0 "Hungry Hobo" released!
2009-04-28
* Various XMMS2 updates (thanks Lassi)
2009-04-09
* Fix broken xmms2 compilation (thanks fusetak)
* Minor fix for fs_used_perc, fs_free and fs_free_perc (thanks
lightpriest)
2009-03-28
* Applied FreeBSD patches (thanks Nikos)
2009-03-16
* Fix bug with wacky netstat values on startup
@ -174,7 +220,7 @@
2008-06-28
* Added sysfs AC adapter support patch (thanks Byron)
* Added support for EVE-Online skill monitoring (thanks Asbjørn)
* Added support for EVE-Online skill monitoring (thanks Asbjørn)
2008-06-25
* new variables smapi_bat_temp and smapi_bat_power
@ -244,7 +290,7 @@
2008-04-29
* own_window_type dock patch (thanks Morgan).
* Fix for $if_up memleak (thanks Micha¿).
* Fix for $if_up memleak (thanks Micha¿).
2008-04-12
* Added patch for the following (thanks larsko):
@ -1212,10 +1258,10 @@
* Version 0.17 released
2004-05-23
* battery number for ACPI battery (thanks Leszek Krupiñski)
* battery number for ACPI battery (thanks Leszek Krupiñski)
* default battery is now BAT0 instead of BAT1, set ${battery 1} if
the old battery thing worked
* bug fix on load average reporting (thanks Leszek Krupiñski)
* bug fix on load average reporting (thanks Leszek Krupiñski)
* outlines to text, draw_outline and default_outline_color
configurations and $outlinecolor (thanks adi)
* $acpifan, $acpiacadapter, $uptime_short (thanks adi)
@ -1271,5 +1317,5 @@
* Version 0.15 released
2004-05-06
* SIGHUP reloads config file (thanks Jørgen P. Tjernø)
* SIGHUP reloads config file (thanks Jørgen P. Tjernø)
* Some other stuff

View File

@ -1,244 +0,0 @@
<?xml version = '1.0'?>
<kdevelop>
<general>
<author>Brenden Matthews</author>
<email>brenden@rty.ca</email>
<version>$VERSION$</version>
<projectmanagement>KDevAutoProject</projectmanagement>
<primarylanguage>C</primarylanguage>
<ignoreparts/>
<projectdirectory>.</projectdirectory>
<absoluteprojectpath>false</absoluteprojectpath>
<description/>
<versioncontrol/>
</general>
<kdevautoproject>
<general>
<activetarget>conky</activetarget>
<useconfiguration>debug</useconfiguration>
</general>
<run>
<mainprogram>conky</mainprogram>
<directoryradio>build</directoryradio>
<customdirectory>/</customdirectory>
<programargs/>
<terminal>false</terminal>
<autocompile>true</autocompile>
<envvars/>
<runarguments>
<conky/>
</runarguments>
</run>
<configurations>
<optimized>
<builddir>optimized</builddir>
<ccompiler>kdevgccoptions</ccompiler>
<cxxcompiler>kdevgppoptions</cxxcompiler>
<f77compiler>kdevpgf77options</f77compiler>
<cflags>-fomit-frame-pointer -O2 -fexceptions</cflags>
<envvars/>
<configargs>--prefix=/usr --enable-mpd --enable-xft --enable-seti --enable-double-buffer --enable-own-window --enable-metar --enable-mldonkey</configargs>
<topsourcedir/>
<cppflags/>
<ldflags/>
<ccompilerbinary/>
<cxxcompilerbinary/>
<f77compilerbinary/>
<cxxflags/>
<f77flags/>
</optimized>
<debug>
<configargs>--enable-debug=full --prefix=/usr --enable-mpd --enable-xft --enable-seti --enable-double-buffer --enable-own-window --enable-metar --enable-mldonkey --enable-x11</configargs>
<builddir>debug</builddir>
<ccompiler>kdevgccoptions</ccompiler>
<cxxcompiler>kdevgppoptions</cxxcompiler>
<f77compiler>kdevpgf77options</f77compiler>
<cflags>-O2 -Wall -fexceptions -fomit-frame-pointer -fshort-enums -ggdb</cflags>
<envvars/>
<topsourcedir/>
<cppflags/>
<ldflags/>
<ccompilerbinary/>
<cxxcompilerbinary/>
<f77compilerbinary/>
<cxxflags/>
<f77flags/>
</debug>
<debug-no-x>
<envvars/>
<configargs>--enable-debug=full --prefix=/usr --enable-mpd --enable-xft --enable-seti --enable-double-buffer --enable-own-window --enable-metar --enable-mldonkey --disable-x11 --without-x</configargs>
<builddir>debug-no-x</builddir>
<topsourcedir/>
<cppflags/>
<ldflags/>
<ccompiler>kdevgccoptions</ccompiler>
<cxxcompiler>kdevgppoptions</cxxcompiler>
<f77compiler>kdevpgf77options</f77compiler>
<ccompilerbinary/>
<cxxcompilerbinary/>
<f77compilerbinary/>
<cflags>-O2 -Wall -fexceptions -fomit-frame-pointer -fshort-enums -ggdb</cflags>
<cxxflags/>
<f77flags/>
</debug-no-x>
</configurations>
<make>
<envvars>
<envvar value="1" name="WANT_AUTOCONF_2_5" />
<envvar value="1" name="WANT_AUTOMAKE_1_6" />
</envvars>
<abortonerror>true</abortonerror>
<numberofjobs>1</numberofjobs>
<dontact>false</dontact>
<makebin/>
<prio>0</prio>
</make>
</kdevautoproject>
<kdevdebugger>
<general>
<dbgshell>/usr/bin/libtool</dbgshell>
<programargs/>
<gdbpath>/usr/bin/</gdbpath>
<configGdbScript/>
<runShellScript/>
<runGdbScript/>
<breakonloadinglibs>true</breakonloadinglibs>
<separatetty>false</separatetty>
<floatingtoolbar>false</floatingtoolbar>
</general>
<display>
<staticmembers>false</staticmembers>
<demanglenames>true</demanglenames>
<outputradix>10</outputradix>
</display>
</kdevdebugger>
<kdevdoctreeview>
<ignoretocs>
<toc>ada</toc>
<toc>ada_bugs_gcc</toc>
<toc>bash</toc>
<toc>bash_bugs</toc>
<toc>clanlib</toc>
<toc>fortran_bugs_gcc</toc>
<toc>gnome1</toc>
<toc>gnustep</toc>
<toc>gtk</toc>
<toc>gtk_bugs</toc>
<toc>haskell</toc>
<toc>haskell_bugs_ghc</toc>
<toc>java_bugs_gcc</toc>
<toc>java_bugs_sun</toc>
<toc>kde2book</toc>
<toc>libstdc++</toc>
<toc>opengl</toc>
<toc>pascal_bugs_fp</toc>
<toc>php</toc>
<toc>php_bugs</toc>
<toc>perl</toc>
<toc>perl_bugs</toc>
<toc>python</toc>
<toc>python_bugs</toc>
<toc>qt-kdev3</toc>
<toc>ruby</toc>
<toc>ruby_bugs</toc>
<toc>sdl</toc>
<toc>stl</toc>
<toc>sw</toc>
<toc>w3c-dom-level2-html</toc>
<toc>w3c-svg</toc>
<toc>w3c-uaag10</toc>
<toc>wxwidgets_bugs</toc>
</ignoretocs>
<ignoreqt_xml>
<toc>Guide to the Qt Translation Tools</toc>
<toc>Qt Assistant Manual</toc>
<toc>Qt Designer Manual</toc>
<toc>Qt Reference Documentation</toc>
<toc>qmake User Guide</toc>
</ignoreqt_xml>
<ignoredoxygen>
<toc>KDE Libraries (Doxygen)</toc>
</ignoredoxygen>
</kdevdoctreeview>
<kdevfilecreate>
<filetypes/>
<useglobaltypes>
<type ext="c" />
<type ext="h" />
</useglobaltypes>
</kdevfilecreate>
<kdevcppsupport>
<references/>
<codecompletion>
<includeGlobalFunctions>true</includeGlobalFunctions>
<includeTypes>true</includeTypes>
<includeEnums>true</includeEnums>
<includeTypedefs>false</includeTypedefs>
<automaticCodeCompletion>true</automaticCodeCompletion>
<automaticArgumentsHint>true</automaticArgumentsHint>
<automaticHeaderCompletion>true</automaticHeaderCompletion>
<codeCompletionDelay>250</codeCompletionDelay>
<argumentsHintDelay>400</argumentsHintDelay>
<headerCompletionDelay>250</headerCompletionDelay>
</codecompletion>
<creategettersetter>
<prefixGet/>
<prefixSet>set</prefixSet>
<prefixVariable>m_,_</prefixVariable>
<parameterName>theValue</parameterName>
<inlineGet>true</inlineGet>
<inlineSet>true</inlineSet>
</creategettersetter>
</kdevcppsupport>
<kdevfileview>
<groups>
<hidenonprojectfiles>false</hidenonprojectfiles>
<hidenonlocation>false</hidenonlocation>
</groups>
<tree>
<hidepatterns>*.o,*.lo,CVS</hidepatterns>
<hidenonprojectfiles>false</hidenonprojectfiles>
</tree>
</kdevfileview>
<cppsupportpart>
<filetemplates>
<interfacesuffix>.h</interfacesuffix>
<implementationsuffix>.cpp</implementationsuffix>
</filetemplates>
</cppsupportpart>
<kdevdocumentation>
<projectdoc>
<docsystem/>
<docurl/>
<usermanualurl/>
</projectdoc>
</kdevdocumentation>
<ctagspart>
<customArguments/>
<customTagfilePath/>
</ctagspart>
<dist>
<custom>false</custom>
<bzip>false</bzip>
<archname/>
<appname>Conky.kdevelop</appname>
<version>$VERSION$</version>
<release/>
<vendor/>
<licence/>
<summary/>
<group/>
<packager/>
<description/>
<changelog/>
<devpackage>false</devpackage>
<docspackage>false</docspackage>
<appicon>false</appicon>
<arch>0</arch>
<genHTML>false</genHTML>
<useRPM>false</useRPM>
<ftpkde>false</ftpkde>
<appskde>false</appskde>
<url/>
</dist>
</kdevelop>

View File

@ -1,5 +1,5 @@
Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
Copyright (c) 2005-2007 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS)
Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS)
All rights reserved.
Redistribution and use in source and binary forms, with or without

View File

@ -7,7 +7,7 @@
# Please see COPYING for details
#
# Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
# Copyright (c) 2005-2007 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS)
# Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS)
# All rights reserved.
#
# This program is free software: you can redistribute it and/or modify

2350
README

File diff suppressed because it is too large Load Diff

View File

@ -1,103 +0,0 @@
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header$
inherit eutils
DESCRIPTION="Conky is an advanced, highly configurable system monitor for X"
HOMEPAGE="http://conky.sf.net"
SRC_URI="mirror://sourceforge/conky/${P}.tar.bz2"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86 ~alpha"
IUSE="truetype X ipv6 bmpx bmp xmms infopipe audacious"
DEPEND_COMMON="
virtual/libc
X? (
|| ( ( x11-libs/libICE
x11-libs/libXext
x11-libs/libX11
x11-libs/libSM
x11-libs/libXrender
x11-libs/libXft
)
virtual/x11
)
truetype? ( >=media-libs/freetype-2 )
bmpx? ( media-sound/bmpx
>=sys-apps/dbus-0.35
)
bmp? ( media-sound/beep-media-player )
audacious? ( media-sound/audacious )
infopipe? ( || ( media-plugins/xmms-infopipe media-plugins/bmp-infopipe ) )
xmms? ( media-sound/xmms )
)"
RDEPEND="${DEPEND_COMMON}"
DEPEND="
${DEPEND_COMMON}
X? (
|| ( ( x11-libs/libXt
x11-proto/xextproto
x11-proto/xproto
)
virtual/x11
)
)
sys-apps/grep
sys-apps/sed"
src_compile() {
local mymake
if useq ipv6 ; then
ewarn
ewarn "You have the ipv6 USE flag enabled. Please note that"
ewarn "using the ipv6 USE flag with Conky disables the port"
ewarn "monitor."
ewarn
epause
else
mymake="MPD_NO_IPV6=noipv6"
fi
local myconf
myconf="--enable-double-buffer --enable-own-window --enable-proc-uptime \
--enable-mpd --enable-mldonkey"
econf \
${myconf} \
$(use_enable truetype xft) \
$(use_enable X x11) \
$(use_enable bmpx) \
$(use_enable bmp) \
$(use_enable xmms) \
$(use_enable audacious) \
$(use_enable infopipe) \
$(use_enable !ipv6 portmon) || die "econf failed"
emake ${mymake} || die "compile failed"
}
src_install() {
emake DESTDIR=${D} install || die "make install failed"
dodoc ChangeLog AUTHORS README doc/conkyrc.sample doc/variables.html
dodoc doc/docs.html doc/config_settings.html
}
pkg_postinst() {
einfo 'Default configuration file is "~/.conkyrc"'
einfo "you can find a sample configuration file in"
einfo "/usr/share/doc/${PF}/conkyrc.sample.gz"
einfo
einfo "For more info on Conky's new features,"
einfo "please look at the README and ChangeLog:"
einfo "/usr/share/doc/${PF}/README.gz"
einfo "/usr/share/doc/${PF}/ChangeLog.gz"
einfo "There are also pretty html docs available"
einfo "on Conky's site or in /usr/share/doc/${PF}"
einfo
einfo "Check out app-vim/conky-syntax for conkyrc"
einfo "syntax highlighting in Vim"
einfo
}

View File

@ -1,109 +0,0 @@
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header$
inherit eutils
DESCRIPTION="Conky is an advanced, highly configurable system monitor for X"
HOMEPAGE="http://conky.sf.net"
SRC_URI="mirror://sourceforge/conky/${P}.tar.bz2"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86"
IUSE="truetype X ipv6 bmpx bmp xmms infopipe audacious"
DEPEND_COMMON="
virtual/libc
X? (
|| ( ( x11-libs/libICE
x11-libs/libXext
x11-libs/libX11
x11-libs/libSM
x11-libs/libXrender
x11-libs/libXft
)
virtual/x11
)
truetype? ( >=media-libs/freetype-2 )
bmpx? ( media-sound/bmpx
>=sys-apps/dbus-0.35
)
bmp? ( media-sound/beep-media-player )
audacious? ( media-sound/audacious )
infopipe? ( media-plugins/xmms-infopipe )
xmms? ( media-sound/xmms )
)"
RDEPEND="${DEPEND_COMMON}"
DEPEND="
${DEPEND_COMMON}
X? (
|| ( ( x11-libs/libXt
x11-proto/xextproto
x11-proto/xproto
)
virtual/x11
)
)
sys-apps/grep
sys-apps/sed"
src_unpack() {
unpack ${A}
cd ${S}
epatch ${FILESDIR}/conky-sigaction.patch
}
src_compile() {
local mymake
if useq ipv6 ; then
ewarn
ewarn "You have the ipv6 USE flag enabled. Please note that"
ewarn "using the ipv6 USE flag with Conky disables the port"
ewarn "monitor."
ewarn
epause
else
mymake="MPD_NO_IPV6=noipv6"
fi
local myconf
myconf="--enable-double-buffer --enable-own-window --enable-proc-uptime \
--enable-mpd --enable-mldonkey"
econf \
${myconf} \
$(use_enable truetype xft) \
$(use_enable X x11) \
$(use_enable bmpx) \
$(use_enable bmp) \
$(use_enable xmms) \
$(use_enable audacious) \
$(use_enable infopipe) \
$(use_enable !ipv6 portmon) || die "econf failed"
emake ${mymake} || die "compile failed"
}
src_install() {
emake DESTDIR=${D} install || die "make install failed"
dodoc ChangeLog AUTHORS README doc/conkyrc.sample doc/variables.html
dodoc doc/docs.html doc/config_settings.html
}
pkg_postinst() {
einfo 'Default configuration file is "~/.conkyrc"'
einfo "you can find a sample configuration file in"
einfo "/usr/share/doc/${PF}/conkyrc.sample.gz"
einfo
einfo "For more info on Conky's new features,"
einfo "please look at the README and ChangeLog:"
einfo "/usr/share/doc/${PF}/README.gz"
einfo "/usr/share/doc/${PF}/ChangeLog.gz"
einfo "There are also pretty html docs available"
einfo "on Conky's site or in /usr/share/doc/${PF}"
einfo
einfo "Check out app-vim/conky-syntax for conkyrc"
einfo "syntax highlighting in Vim"
einfo
}

View File

@ -1,104 +0,0 @@
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header$
inherit eutils
DESCRIPTION="Conky is an advanced, highly configurable system monitor for X"
HOMEPAGE="http://conky.sf.net"
SRC_URI="mirror://sourceforge/conky/${P}.tar.bz2"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86"
IUSE="truetype X ipv6 bmpx bmp xmms xmms2 infopipe audacious"
DEPEND_COMMON="
virtual/libc
X? (
|| ( ( x11-libs/libICE
x11-libs/libXext
x11-libs/libX11
x11-libs/libSM
x11-libs/libXrender
x11-libs/libXft
)
virtual/x11
)
truetype? ( >=media-libs/freetype-2 )
bmpx? ( media-sound/bmpx
>=sys-apps/dbus-0.35
)
bmp? ( media-sound/beep-media-player )
audacious? ( media-sound/audacious )
infopipe? ( media-plugins/xmms-infopipe )
xmms? ( media-sound/xmms )
xmms2? ( media-sound/xmms2 )
)"
RDEPEND="${DEPEND_COMMON}"
DEPEND="
${DEPEND_COMMON}
X? (
|| ( ( x11-libs/libXt
x11-proto/xextproto
x11-proto/xproto
)
virtual/x11
)
)
sys-apps/grep
sys-apps/sed"
src_compile() {
local mymake
if useq ipv6 ; then
ewarn
ewarn "You have the ipv6 USE flag enabled. Please note that"
ewarn "using the ipv6 USE flag with Conky disables the port"
ewarn "monitor."
ewarn
epause
else
mymake="MPD_NO_IPV6=noipv6"
fi
local myconf
myconf="--enable-double-buffer --enable-own-window --enable-proc-uptime \
--enable-mpd --enable-mldonkey"
econf \
${myconf} \
$(use_enable truetype xft) \
$(use_enable X x11) \
$(use_enable bmpx) \
$(use_enable bmp) \
$(use_enable xmms) \
$(use_enable xmms2) \
$(use_enable audacious) \
$(use_enable infopipe) \
$(use_enable !ipv6 portmon) || die "econf failed"
emake ${mymake} || die "compile failed"
}
src_install() {
make DESTDIR=${D} install || die "make install failed"
dodoc ChangeLog AUTHORS README doc/conkyrc.sample
dohtml doc/variables.html doc/docs.html doc/config_settings.html
}
pkg_postinst() {
einfo 'Default configuration file is "~/.conkyrc"'
einfo "you can find a sample configuration file in"
einfo "/usr/share/doc/${PF}/conkyrc.sample.gz"
einfo
einfo "For more info on Conky's new features,"
einfo "please look at the README and ChangeLog:"
einfo "/usr/share/doc/${PF}/README.gz"
einfo "/usr/share/doc/${PF}/ChangeLog.gz"
einfo "There are also pretty html docs available"
einfo "on Conky's site or in /usr/share/doc/${PF}"
einfo
einfo "Check out app-vim/conky-syntax for conkyrc"
einfo "syntax highlighting in Vim"
einfo
}

View File

@ -1,102 +0,0 @@
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
inherit eutils
DESCRIPTION="Conky is an advanced, highly configurable system monitor for X"
HOMEPAGE="http://conky.sf.net"
SRC_URI="mirror://sourceforge/conky/${P}.tar.bz2"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86"
IUSE="truetype X ipv6 audacious bmpx hddtemp mpd vim-syntax"
DEPEND_COMMON="
virtual/libc
X? (
|| ( ( x11-libs/libICE
x11-libs/libXext
x11-libs/libX11
x11-libs/libSM
x11-libs/libXrender
x11-libs/libXdamage
x11-libs/libXft
)
virtual/x11
)
truetype? ( >=media-libs/freetype-2 )
audacious? ( >=media-sound/audacious-0.1 )
bmpx? ( media-sound/bmpx
>=sys-apps/dbus-0.35
)
)"
RDEPEND="${DEPEND_COMMON}
hddtemp? ( app-admin/hddtemp )
mpd? ( media-sound/mpd )"
DEPEND="
${DEPEND_COMMON}
X? (
|| ( ( x11-libs/libXt
x11-proto/xextproto
x11-proto/xproto
)
virtual/x11
)
)
sys-apps/grep
sys-apps/sed"
PDEPEND="vim-syntax? ( app-vim/conky-syntax )"
src_compile() {
local mymake
if useq ipv6 ; then
ewarn
ewarn "You have the ipv6 USE flag enabled. Please note that using"
ewarn "the ipv6 USE flag with Conky disables the port monitor."
epause
else
mymake="MPD_NO_IPV6=noipv6"
fi
local myconf
myconf="--enable-own-window --enable-proc-uptime"
use X && myconf="${myconf} --enable-x11 --enable-double-buffer --enable-xdamage"
econf \
${myconf} \
$(use_enable truetype xft) \
$(use_enable audacious) \
$(use_enable bmpx) \
$(use_enable hddtemp ) \
$(use_enable mpd) \
$(use_enable !ipv6 portmon) || die "econf failed"
emake ${mymake} || die "compile failed"
}
src_install() {
emake DESTDIR=${D} install || die "make install failed"
dodoc ChangeLog AUTHORS README doc/conkyrc.sample
dohtml doc/docs.html doc/config_settings.html doc/variables.html
}
pkg_postinst() {
einfo 'Default configuration file is "~/.conkyrc"'
einfo "You can find a sample configuration file in"
einfo "/usr/share/doc/${PF}/conkyrc.sample.gz"
einfo
einfo "For more info on Conky's new features,"
einfo "please look at the README and ChangeLog:"
einfo "/usr/share/doc/${PF}/README.gz"
einfo "/usr/share/doc/${PF}/ChangeLog.gz"
einfo "There are also pretty html docs available"
einfo "on Conky's site or in /usr/share/doc/${PF}"
einfo
einfo "Also see http://www.gentoo.org/doc/en/conky-howto.xml"
einfo
einfo "Check out app-vim/conky-syntax for conkyrc"
einfo "syntax highlighting in Vim"
einfo
}

View File

@ -1,109 +0,0 @@
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
inherit eutils
# used for epause
DESCRIPTION="Conky is an advanced, highly configurable system monitor for X"
HOMEPAGE="http://conky.sf.net"
SRC_URI="mirror://sourceforge/conky/${P}.tar.bz2"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86"
IUSE="truetype X ipv6 audacious bmpx hddtemp mpd vim-syntax"
DEPEND_COMMON="
virtual/libc
X? (
|| ( ( x11-libs/libICE
x11-libs/libXext
x11-libs/libX11
x11-libs/libSM
x11-libs/libXrender
x11-libs/libXdamage
x11-libs/libXft
)
virtual/x11
)
truetype? ( >=media-libs/freetype-2 )
audacious? ( >=media-sound/audacious-0.1 )
bmpx? ( media-sound/bmpx
>=sys-apps/dbus-0.35
)
)"
RDEPEND="${DEPEND_COMMON}
hddtemp? ( app-admin/hddtemp )
mpd? ( media-sound/mpd )
vim-syntax? ( || ( app-editors/vim
app-editors/gvim ) )"
DEPEND="
${DEPEND_COMMON}
X? (
|| ( ( x11-libs/libXt
x11-proto/xextproto
x11-proto/xproto
)
virtual/x11
)
)"
src_compile() {
local mymake
if useq ipv6 ; then
ewarn
ewarn "You have the ipv6 USE flag enabled. Please note that using"
ewarn "the ipv6 USE flag with Conky disables the port monitor."
epause
else
mymake="MPD_NO_IPV6=noipv6"
fi
local myconf
myconf="--enable-own-window --enable-proc-uptime"
use X && myconf="${myconf} --enable-x11 --enable-double-buffer --enable-xdamage"
econf \
${myconf} \
$(use_enable truetype xft) \
$(use_enable audacious) \
$(use_enable bmpx) \
$(use_enable hddtemp ) \
$(use_enable mpd) \
$(use_enable !ipv6 portmon) || die "econf failed"
emake ${mymake} || die "compile failed"
}
src_install() {
emake DESTDIR="${D}" install || die "make install failed"
dodoc ChangeLog AUTHORS README doc/conkyrc.sample
dohtml doc/docs.html doc/config_settings.html doc/variables.html
if use vim-syntax; then
insinto /usr/share/vim/vimfiles/ftdetect
doins "${S}"/extras/vim/ftdetect/conkyrc.vim
insinto /usr/share/vim/vimfiles/syntax
doins "${S}"/extras/vim/syntax/conkyrc.vim
fi
}
pkg_postinst() {
einfo 'Default configuration file is "~/.conkyrc"'
einfo "You can find a sample configuration file in"
einfo "/usr/share/doc/${PF}/conkyrc.sample.gz"
einfo
einfo "For more info on Conky's new features,"
einfo "please look at the README and ChangeLog:"
einfo "/usr/share/doc/${PF}/README.gz"
einfo "/usr/share/doc/${PF}/ChangeLog.gz"
einfo "There are also pretty html docs available"
einfo "on Conky's site or in /usr/share/doc/${PF}"
einfo
einfo "Also see http://www.gentoo.org/doc/en/conky-howto.xml"
einfo
einfo "Vim syntax highlighting for conkyrc now enabled with"
einfo "USE=vim-syntax"
einfo
}

View File

@ -1,108 +0,0 @@
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-admin/conky/conky-1.4.5.ebuild,v 1.11 2007/07/22 08:19:13 omp Exp $
inherit eutils
# used for epause
DESCRIPTION="Conky is an advanced, highly configurable system monitor for X"
HOMEPAGE="http://conky.sf.net"
SRC_URI="mirror://sourceforge/conky/${P}.tar.bz2"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~alpha amd64 ppc ppc64 sparc x86"
IUSE="truetype X ipv6 audacious bmpx hddtemp mpd vim-syntax"
DEPEND_COMMON="
virtual/libc
X? (
x11-libs/libICE
x11-libs/libXext
x11-libs/libX11
x11-libs/libSM
x11-libs/libXrender
x11-libs/libXdamage
x11-libs/libXft
truetype? ( >=media-libs/freetype-2 )
audacious? ( >=media-sound/audacious-0.1 )
bmpx? ( media-sound/bmpx
>=sys-apps/dbus-0.35
)
)
!ipv6? ( >=dev-libs/glib-2.0 )"
RDEPEND="${DEPEND_COMMON}
hddtemp? ( app-admin/hddtemp )
mpd? ( media-sound/mpd )
vim-syntax? ( || ( app-editors/vim
app-editors/gvim ) )"
DEPEND="
${DEPEND_COMMON}
X? (
x11-libs/libXt
x11-proto/xextproto
x11-proto/xproto
)"
src_compile() {
local mymake
if useq ipv6 ; then
ewarn
ewarn "You have the ipv6 USE flag enabled. Please note that using"
ewarn "the ipv6 USE flag with Conky disables the port monitor."
epause
else
mymake="MPD_NO_IPV6=noipv6"
fi
local myconf
myconf="--enable-proc-uptime"
if useq X; then
myconf="${myconf} --enable-x11 --enable-double-buffer --enable-xdamage --enable-own-window"
myconf="${myconf} $(use_enable truetype xft)"
else
myconf="${myconf} --disable-x11 --disable-double-buffer --disable-xdamage --disable-own-window"
myconf="${myconf} --disable-xft"
fi
econf \
${myconf} \
$(use_enable audacious) \
$(use_enable bmpx) \
$(use_enable hddtemp ) \
$(use_enable mpd) \
$(use_enable !ipv6 portmon) || die "econf failed"
emake ${mymake} || die "compile failed"
}
src_install() {
emake DESTDIR="${D}" install || die "make install failed"
dodoc ChangeLog AUTHORS README doc/conkyrc.sample
dohtml doc/docs.html doc/config_settings.html doc/variables.html
if use vim-syntax; then
insinto /usr/share/vim/vimfiles/ftdetect
doins "${S}"/extras/vim/ftdetect/conkyrc.vim
insinto /usr/share/vim/vimfiles/syntax
doins "${S}"/extras/vim/syntax/conkyrc.vim
fi
}
pkg_postinst() {
elog 'Default configuration file is "~/.conkyrc"'
elog "You can find a sample configuration file in"
elog "/usr/share/doc/${PF}/conkyrc.sample.gz"
elog
elog "For more info on Conky's new features,"
elog "please look at the README and ChangeLog:"
elog "/usr/share/doc/${PF}/README.gz"
elog "/usr/share/doc/${PF}/ChangeLog.gz"
elog "There are also pretty html docs available"
elog "on Conky's site or in /usr/share/doc/${PF}"
elog
elog "Also see http://www.gentoo.org/doc/en/conky-howto.xml"
elog
elog "Vim syntax highlighting for conkyrc now enabled with"
elog "USE=vim-syntax"
elog
}

View File

@ -1,107 +0,0 @@
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-admin/conky/conky-1.4.5.ebuild,v 1.11 2007/07/22 08:19:13 omp Exp $
inherit eutils
# used for epause
DESCRIPTION="Conky is an advanced, highly configurable system monitor for X"
HOMEPAGE="http://conky.sf.net"
SRC_URI="mirror://sourceforge/conky/${P}.tar.bz2"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~alpha amd64 ppc ppc64 sparc x86"
IUSE="truetype X ipv6 audacious bmpx hddtemp mpd vim-syntax"
DEPEND_COMMON="
virtual/libc
X? (
x11-libs/libICE
x11-libs/libXext
x11-libs/libX11
x11-libs/libSM
x11-libs/libXrender
x11-libs/libXdamage
x11-libs/libXft
truetype? ( >=media-libs/freetype-2 )
audacious? ( >=media-sound/audacious-0.1 )
bmpx? ( media-sound/bmpx
>=sys-apps/dbus-0.35
)
)
!ipv6? ( >=dev-libs/glib-2.0 )"
RDEPEND="${DEPEND_COMMON}
hddtemp? ( app-admin/hddtemp )
vim-syntax? ( || ( app-editors/vim
app-editors/gvim ) )"
DEPEND="
${DEPEND_COMMON}
X? (
x11-libs/libXt
x11-proto/xextproto
x11-proto/xproto
)"
src_compile() {
local mymake
if useq ipv6 ; then
ewarn
ewarn "You have the ipv6 USE flag enabled. Please note that using"
ewarn "the ipv6 USE flag with Conky disables the port monitor."
epause
else
mymake="MPD_NO_IPV6=noipv6"
fi
local myconf
myconf="--enable-proc-uptime"
if useq X; then
myconf="${myconf} --enable-x11 --enable-double-buffer --enable-xdamage --enable-own-window"
myconf="${myconf} $(use_enable truetype xft)"
else
myconf="${myconf} --disable-x11 --disable-double-buffer --disable-xdamage --disable-own-window"
myconf="${myconf} --disable-xft"
fi
econf \
${myconf} \
$(use_enable audacious) \
$(use_enable bmpx) \
$(use_enable hddtemp ) \
$(use_enable mpd) \
$(use_enable !ipv6 portmon) || die "econf failed"
emake ${mymake} || die "compile failed"
}
src_install() {
emake DESTDIR="${D}" install || die "make install failed"
dodoc ChangeLog AUTHORS README doc/conkyrc.sample
dohtml doc/docs.html doc/config_settings.html doc/variables.html
if use vim-syntax; then
insinto /usr/share/vim/vimfiles/ftdetect
doins "${S}"/extras/vim/ftdetect/conkyrc.vim
insinto /usr/share/vim/vimfiles/syntax
doins "${S}"/extras/vim/syntax/conkyrc.vim
fi
}
pkg_postinst() {
elog 'Default configuration file is "~/.conkyrc"'
elog "You can find a sample configuration file in"
elog "/usr/share/doc/${PF}/conkyrc.sample.gz"
elog
elog "For more info on Conky's new features,"
elog "please look at the README and ChangeLog:"
elog "/usr/share/doc/${PF}/README.gz"
elog "/usr/share/doc/${PF}/ChangeLog.gz"
elog "There are also pretty html docs available"
elog "on Conky's site or in /usr/share/doc/${PF}"
elog
elog "Also see http://www.gentoo.org/doc/en/conky-howto.xml"
elog
elog "Vim syntax highlighting for conkyrc now enabled with"
elog "USE=vim-syntax"
elog
}

View File

@ -1,110 +0,0 @@
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-admin/conky/conky-1.4.5.ebuild,v 1.11 2007/07/22 08:19:13 omp Exp $
inherit eutils
# used for epause
DESCRIPTION="Conky is an advanced, highly configurable system monitor for X"
HOMEPAGE="http://conky.sf.net"
SRC_URI="mirror://sourceforge/conky/${P}.tar.bz2"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~alpha amd64 ppc ppc64 sparc x86"
IUSE="truetype X ipv6 audacious bmpx hddtemp mpd vim-syntax"
DEPEND_COMMON="
virtual/libc
X? (
x11-libs/libICE
x11-libs/libXext
x11-libs/libX11
x11-libs/libSM
x11-libs/libXrender
x11-libs/libXdamage
x11-libs/libXft
truetype? ( >=media-libs/freetype-2 )
audacious? ( >=media-sound/audacious-0.1 )
bmpx? ( media-sound/bmpx
>=sys-apps/dbus-0.35
)
)
wlan? ( net-wireless/wireless-tools )
!ipv6? ( >=dev-libs/glib-2.0 )"
RDEPEND="${DEPEND_COMMON}
hddtemp? ( app-admin/hddtemp )
vim-syntax? ( || ( app-editors/vim
app-editors/gvim ) )"
DEPEND="
${DEPEND_COMMON}
X? (
x11-libs/libXt
x11-proto/xextproto
x11-proto/xproto
)"
src_compile() {
local mymake
if useq ipv6 ; then
ewarn
ewarn "You have the ipv6 USE flag enabled. Please note that using"
ewarn "the ipv6 USE flag with Conky disables the port monitor."
epause
else
mymake="MPD_NO_IPV6=noipv6"
fi
local myconf
myconf="--enable-proc-uptime"
if useq X; then
myconf="${myconf} --enable-x11 --enable-double-buffer --enable-xdamage --enable-own-window"
myconf="${myconf} $(use_enable truetype xft)"
else
myconf="${myconf} --disable-x11 --disable-double-buffer --disable-xdamage --disable-own-window"
myconf="${myconf} --disable-xft"
fi
econf \
${myconf} \
$(use_enable audacious) \
$(use_enable bmpx) \
$(use_enable hddtemp ) \
$(use_enable rss) \
$(use_enable wlan) \
$(use_enable mpd) \
$(use_enable !ipv6 portmon) || die "econf failed"
emake ${mymake} || die "compile failed"
}
src_install() {
emake DESTDIR="${D}" install || die "make install failed"
dodoc ChangeLog AUTHORS README doc/conkyrc.sample
dohtml doc/docs.html doc/config_settings.html doc/variables.html
if use vim-syntax; then
insinto /usr/share/vim/vimfiles/ftdetect
doins "${S}"/extras/vim/ftdetect/conkyrc.vim
insinto /usr/share/vim/vimfiles/syntax
doins "${S}"/extras/vim/syntax/conkyrc.vim
fi
}
pkg_postinst() {
elog 'Default configuration file is "~/.conkyrc"'
elog "You can find a sample configuration file in"
elog "/usr/share/doc/${PF}/conkyrc.sample.bz2"
elog
elog "For more info on Conky's new features,"
elog "please look at the README and ChangeLog:"
elog "/usr/share/doc/${PF}/README.gz"
elog "/usr/share/doc/${PF}/ChangeLog.gz"
elog "There are also pretty html docs available"
elog "on Conky's site or in /usr/share/doc/${PF}"
elog
elog "Also see http://www.gentoo.org/doc/en/conky-howto.xml"
elog
elog "Vim syntax highlighting for conkyrc now enabled with"
elog "USE=vim-syntax"
elog
}

View File

@ -1,113 +0,0 @@
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
inherit eutils
# used for epause
DESCRIPTION="Conky is an advanced, highly configurable system monitor for X"
HOMEPAGE="http://conky.sf.net"
SRC_URI="mirror://sourceforge/conky/${P}.tar.bz2"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~alpha amd64 ppc ppc64 sparc x86"
IUSE="audacious bmpx hddtemp ipv6 mpd rss truetype vim-syntax wifi X"
DEPEND_COMMON="
virtual/libc
X? (
x11-libs/libICE
x11-libs/libXext
x11-libs/libX11
x11-libs/libSM
x11-libs/libXrender
x11-libs/libXdamage
x11-libs/libXft
truetype? ( >=media-libs/freetype-2 )
audacious? ( <media-sound/audacious-1.4.0 )
bmpx? ( media-sound/bmpx
>=sys-apps/dbus-0.35
)
)
rss? ( dev-libs/libxml2
net-misc/curl
)
wifi? ( net-wireless/wireless-tools )
!ipv6? ( >=dev-libs/glib-2.0 )"
RDEPEND="${DEPEND_COMMON}
hddtemp? ( app-admin/hddtemp )
vim-syntax? ( || ( app-editors/vim
app-editors/gvim ) )"
DEPEND="
${DEPEND_COMMON}
X? (
x11-libs/libXt
x11-proto/xextproto
x11-proto/xproto
)"
src_compile() {
local mymake
if useq ipv6 ; then
ewarn
ewarn "You have the ipv6 USE flag enabled. Please note that using"
ewarn "the ipv6 USE flag with Conky disables the port monitor."
epause
else
mymake="MPD_NO_IPV6=noipv6"
fi
local myconf
myconf="--enable-proc-uptime"
if useq X; then
myconf="${myconf} --enable-x11 --enable-double-buffer --enable-xdamage --enable-own-window"
myconf="${myconf} $(use_enable truetype xft)"
else
myconf="${myconf} --disable-x11 --disable-double-buffer --disable-xdamage --disable-own-window"
myconf="${myconf} --disable-xft"
fi
econf \
${myconf} \
$(use_enable audacious) \
$(use_enable bmpx) \
$(use_enable hddtemp ) \
$(use_enable mpd) \
$(use_enable rss) \
$(use_enable wifi wlan) \
$(use_enable !ipv6 portmon) || die "econf failed"
emake ${mymake} || die "compile failed"
}
src_install() {
emake DESTDIR="${D}" install || die "make install failed"
dodoc ChangeLog AUTHORS README doc/conkyrc.sample
dohtml doc/docs.html doc/config_settings.html doc/variables.html
if use vim-syntax; then
insinto /usr/share/vim/vimfiles/ftdetect
doins "${S}"/extras/vim/ftdetect/conkyrc.vim
insinto /usr/share/vim/vimfiles/syntax
doins "${S}"/extras/vim/syntax/conkyrc.vim
fi
}
pkg_postinst() {
elog 'Default configuration file is "~/.conkyrc"'
elog "You can find a sample configuration file in"
elog "/usr/share/doc/${PF}/conkyrc.sample.bz2"
elog
elog "For more info on Conky's new features,"
elog "please look at the README and ChangeLog:"
elog "/usr/share/doc/${PF}/README.bz2"
elog "/usr/share/doc/${PF}/ChangeLog.bz2"
elog "There are also pretty html docs available"
elog "on Conky's site or in /usr/share/doc/${PF}"
elog
elog "Also see http://www.gentoo.org/doc/en/conky-howto.xml"
elog
elog "Vim syntax highlighting for conkyrc now enabled with"
elog "USE=vim-syntax"
elog
}

View File

@ -1,117 +0,0 @@
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
inherit eutils
# used for epause
DESCRIPTION="Conky is an advanced, highly configurable system monitor for X"
HOMEPAGE="http://conky.sf.net"
SRC_URI="mirror://sourceforge/conky/${P}.tar.bz2"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86"
IUSE="audacious audacious-legacy bmpx hddtemp ipv6 mpd rss truetype vim-syntax wifi X"
DEPEND_COMMON="
virtual/libc
X? (
x11-libs/libICE
x11-libs/libXext
x11-libs/libX11
x11-libs/libSM
x11-libs/libXrender
x11-libs/libXdamage
x11-libs/libXft
truetype? ( >=media-libs/freetype-2 )
audacious? ( >=media-sound/audacious-1.4.0 )
audacious-legacy? ( <media-sound/audacious-1.4.0 )
bmpx? ( media-sound/bmpx
>=sys-apps/dbus-0.35
)
)
rss? ( dev-libs/libxml2
net-misc/curl
)
wifi? ( net-wireless/wireless-tools )
!ipv6? ( >=dev-libs/glib-2.0 )"
RDEPEND="${DEPEND_COMMON}
hddtemp? ( app-admin/hddtemp )
vim-syntax? ( || ( app-editors/vim
app-editors/gvim ) )"
DEPEND="
${DEPEND_COMMON}
X? (
x11-libs/libXt
x11-proto/xextproto
x11-proto/xproto
)"
src_compile() {
local mymake
if useq ipv6 ; then
elog "You have the ipv6 USE flag enabled. Please note that using"
elog "the ipv6 USE flag with Conky disables the port monitor."
epause
else
mymake="MPD_NO_IPV6=noipv6"
fi
local myconf
myconf="--enable-proc-uptime"
if useq X; then
myconf="${myconf} --enable-x11 --enable-double-buffer --enable-xdamage --enable-own-window"
myconf="${myconf} $(use_enable truetype xft)"
else
myconf="${myconf} --disable-x11 --disable-double-buffer --disable-xdamage --disable-own-window"
myconf="${myconf} --disable-xft"
fi
if useq audacious-legacy; then
myconf="${myconf} --enable-audacious=legacy"
elif useq audacious; then
myconf="${myconf} --enable-audacious"
fi
econf \
${myconf} \
$(use_enable bmpx) \
$(use_enable hddtemp ) \
$(use_enable mpd) \
$(use_enable rss) \
$(use_enable wifi wlan) \
$(use_enable !ipv6 portmon) || die "econf failed"
emake ${mymake} || die "compile failed"
}
src_install() {
emake DESTDIR="${D}" install || die "make install failed"
dodoc ChangeLog AUTHORS README doc/conkyrc.sample
dohtml doc/docs.html doc/config_settings.html doc/variables.html
if use vim-syntax; then
insinto /usr/share/vim/vimfiles/ftdetect
doins "${S}"/extras/vim/ftdetect/conkyrc.vim
insinto /usr/share/vim/vimfiles/syntax
doins "${S}"/extras/vim/syntax/conkyrc.vim
fi
}
pkg_postinst() {
elog 'Default configuration file is "~/.conkyrc"'
elog "You can find a sample configuration file in"
elog "/usr/share/doc/${PF}/conkyrc.sample.bz2"
elog
elog "For more info on Conky's new features,"
elog "please look at the README and ChangeLog:"
elog "/usr/share/doc/${PF}/README.bz2"
elog "/usr/share/doc/${PF}/ChangeLog.bz2"
elog "There are also pretty html docs available"
elog "on Conky's site or in /usr/share/doc/${PF}"
elog
elog "Also see http://www.gentoo.org/doc/en/conky-howto.xml"
elog
elog "Vim syntax highlighting for conkyrc now enabled with"
elog "USE=vim-syntax"
elog
}

View File

@ -1,143 +0,0 @@
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
inherit eutils
# used for epause
DESCRIPTION="An advanced, highly configurable system monitor for X"
HOMEPAGE="http://conky.sourceforge.net/"
SRC_URI="mirror://sourceforge/conky/${P}.tar.bz2"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86"
IUSE="audacious audacious-legacy bmpx debug hddtemp ipv6 mpd nano-syntax rss truetype vim-syntax
smapi wifi X"
DEPEND_COMMON="
virtual/libc
X? (
x11-libs/libICE
x11-libs/libXext
x11-libs/libX11
x11-libs/libSM
x11-libs/libXrender
x11-libs/libXdamage
x11-libs/libXft
truetype? ( >=media-libs/freetype-2 )
audacious? ( >=media-sound/audacious-1.4.0 )
audacious-legacy? ( <media-sound/audacious-1.4.0 )
bmpx? ( media-sound/bmpx
>=sys-apps/dbus-0.35
)
)
rss? ( dev-libs/libxml2
net-misc/curl
)
wifi? ( net-wireless/wireless-tools )
!ipv6? ( >=dev-libs/glib-2.0 )"
RDEPEND="${DEPEND_COMMON}
hddtemp? ( app-admin/hddtemp )
vim-syntax? ( || ( app-editors/vim
app-editors/gvim ) )
nano-syntax? ( app-editors/nano )"
DEPEND="
${DEPEND_COMMON}
X? (
x11-libs/libXt
x11-proto/xextproto
x11-proto/xproto
)"
pkg_setup() {
if use audacious; then
if has_version <media-sound/audacious-1.5.0 && ! built_with_use media-sound/audacious dbus; then
eerror "media-sound/audacious is not built with dbus USE flag."
eerror "Please add 'dbus' to your USE flags, and re-emerge media-sound/audacious."
die "media-sound/audacious needs USE=dbus"
fi
fi
}
src_unpack() {
unpack ${A}
cd ${S}
epatch ${FILESDIR}/conky-1.5.0-disable-x11.patch
}
src_compile() {
local mymake
if useq ipv6 ; then
ewarn "You have the ipv6 USE flag enabled. Please note that using"
ewarn "the ipv6 USE flag with Conky disables the port monitor."
epause
else
mymake="MPD_NO_IPV6=noipv6"
fi
local myconf
myconf="--enable-proc-uptime"
if useq X; then
myconf="${myconf} --enable-x11 --enable-double-buffer --enable-xdamage --enable-own-window"
myconf="${myconf} $(use_enable truetype xft)"
else
myconf="${myconf} --disable-x11 --disable-double-buffer --disable-xdamage --disable-own-window"
myconf="${myconf} --disable-xft"
fi
if useq audacious-legacy; then
myconf="${myconf} --enable-audacious=legacy"
elif useq audacious; then
myconf="${myconf} --enable-audacious"
fi
econf \
${myconf} \
$(use_enable bmpx) \
$(use_enable debug) \
$(use_enable hddtemp ) \
$(use_enable mpd) \
$(use_enable rss) \
$(use_enable smapi) \
$(use_enable wifi wlan) \
$(use_enable !ipv6 portmon) || die "econf failed"
emake ${mymake} || die "compile failed"
}
src_install() {
emake DESTDIR="${D}" install || die "make install failed"
dodoc ChangeLog AUTHORS README
dohtml doc/docs.html doc/config_settings.html doc/variables.html
if use vim-syntax; then
insinto /usr/share/vim/vimfiles/ftdetect
doins "${S}"/extras/vim/ftdetect/conkyrc.vim
insinto /usr/share/vim/vimfiles/syntax
doins "${S}"/extras/vim/syntax/conkyrc.vim
fi
if use nano-syntax; then
insinto /usr/share/nano/
doins "${S}"/extras/nano/conky.nanorc
fi
}
pkg_postinst() {
elog "You can find the sample configuration file at"
elog "/etc/conky/conky.conf. To customize it, copy"
elog "/etc/conky/conky.conf to ~/.conkyrc and edit"
elog "it to your liking."
elog
elog "For more info on Conky's new features,"
elog "please look at the README and ChangeLog:"
elog "/usr/share/doc/${PF}/README.bz2"
elog "/usr/share/doc/${PF}/ChangeLog.bz2"
elog "There are also pretty html docs available"
elog "on Conky's site or in /usr/share/doc/${PF}"
elog
elog "Also see http://www.gentoo.org/doc/en/conky-howto.xml"
elog
elog "Vim syntax highlighting for conkyrc now enabled with"
elog "USE=vim-syntax, for Nano with USE=nano-syntax"
elog
}

View File

@ -1,144 +0,0 @@
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
inherit eutils
# used for epause
DESCRIPTION="An advanced, highly configurable system monitor for X"
HOMEPAGE="http://conky.sourceforge.net/"
SRC_URI="mirror://sourceforge/conky/${P}.tar.bz2"
LICENSE="GPL-3 BSD LGPL-2.1 MIT"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86"
IUSE="audacious audacious-legacy bmpx debug hddtemp ipv6 mpd nano-syntax rss truetype vim-syntax
smapi wifi X"
DEPEND_COMMON="
virtual/libc
dev-util/pkgconfig
X? (
x11-libs/libICE
x11-libs/libXext
x11-libs/libX11
x11-libs/libSM
x11-libs/libXrender
x11-libs/libXdamage
x11-libs/libXft
truetype? ( >=media-libs/freetype-2 )
audacious? ( >=media-sound/audacious-1.4.0 )
audacious-legacy? ( <media-sound/audacious-1.4.0 )
bmpx? ( media-sound/bmpx
>=sys-apps/dbus-0.35
)
)
rss? ( dev-libs/libxml2
net-misc/curl
)
wifi? ( net-wireless/wireless-tools )
!ipv6? ( >=dev-libs/glib-2.0 )"
RDEPEND="${DEPEND_COMMON}
hddtemp? ( app-admin/hddtemp )
vim-syntax? ( || ( app-editors/vim
app-editors/gvim ) )
nano-syntax? ( app-editors/nano )"
DEPEND="
${DEPEND_COMMON}
X? (
x11-libs/libXt
x11-proto/xextproto
x11-proto/xproto
)"
pkg_setup() {
if use audacious; then
if has_version <media-sound/audacious-1.5.0 && ! built_with_use media-sound/audacious dbus; then
eerror "media-sound/audacious is not built with dbus USE flag."
eerror "Please add 'dbus' to your USE flags, and re-emerge media-sound/audacious."
die "media-sound/audacious needs USE=dbus"
fi
fi
}
src_unpack() {
unpack ${A}
cd ${S}
epatch ${FILESDIR}/conky-1.5.0-disable-x11.patch
}
src_compile() {
local mymake
if useq ipv6 ; then
ewarn "You have the ipv6 USE flag enabled. Please note that using"
ewarn "the ipv6 USE flag with Conky disables the port monitor."
epause
else
mymake="MPD_NO_IPV6=noipv6"
fi
local myconf
myconf="--enable-proc-uptime"
if useq X; then
myconf="${myconf} --enable-x11 --enable-double-buffer --enable-xdamage --enable-own-window"
myconf="${myconf} $(use_enable truetype xft)"
else
myconf="${myconf} --disable-x11 --disable-double-buffer --disable-xdamage --disable-own-window"
myconf="${myconf} --disable-xft"
fi
if useq audacious-legacy; then
myconf="${myconf} --enable-audacious=legacy"
elif useq audacious; then
myconf="${myconf} --enable-audacious"
fi
econf \
${myconf} \
$(use_enable bmpx) \
$(use_enable debug) \
$(use_enable hddtemp ) \
$(use_enable mpd) \
$(use_enable rss) \
$(use_enable smapi) \
$(use_enable wifi wlan) \
$(use_enable !ipv6 portmon) || die "econf failed"
emake ${mymake} || die "compile failed"
}
src_install() {
emake DESTDIR="${D}" install || die "make install failed"
dodoc ChangeLog AUTHORS README
dohtml doc/docs.html doc/config_settings.html doc/variables.html
if use vim-syntax; then
insinto /usr/share/vim/vimfiles/ftdetect
doins "${S}"/extras/vim/ftdetect/conkyrc.vim
insinto /usr/share/vim/vimfiles/syntax
doins "${S}"/extras/vim/syntax/conkyrc.vim
fi
if use nano-syntax; then
insinto /usr/share/nano/
doins "${S}"/extras/nano/conky.nanorc
fi
}
pkg_postinst() {
elog "You can find the sample configuration file at"
elog "/etc/conky/conky.conf. To customize it, copy"
elog "/etc/conky/conky.conf to ~/.conkyrc and edit"
elog "it to your liking."
elog
elog "For more info on Conky's new features,"
elog "please look at the README and ChangeLog:"
elog "/usr/share/doc/${PF}/README.bz2"
elog "/usr/share/doc/${PF}/ChangeLog.bz2"
elog "There are also pretty html docs available"
elog "on Conky's site or in /usr/share/doc/${PF}"
elog
elog "Also see http://www.gentoo.org/doc/en/conky-howto.xml"
elog
elog "Vim syntax highlighting for conkyrc now enabled with"
elog "USE=vim-syntax, for Nano with USE=nano-syntax"
elog
}

View File

@ -1,131 +0,0 @@
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
inherit eutils
# used for epause
DESCRIPTION="An advanced, highly configurable system monitor for X"
HOMEPAGE="http://conky.sourceforge.net/"
SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
LICENSE="GPL-3 BSD LGPL-2.1 MIT"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86"
IUSE="audacious bmpx debug hddtemp ipv6 mpd nano-syntax rss truetype vim-syntax smapi wifi X"
DEPEND_COMMON="
virtual/libc
X? (
x11-libs/libICE
x11-libs/libXext
x11-libs/libX11
x11-libs/libSM
x11-libs/libXrender
x11-libs/libXdamage
x11-libs/libXft
truetype? ( >=media-libs/freetype-2 )
audacious? ( >=media-sound/audacious-1.4.0 )
bmpx? ( media-sound/bmpx
>=sys-apps/dbus-0.35
)
)
rss? ( dev-libs/libxml2
net-misc/curl
)
wifi? ( net-wireless/wireless-tools )
!ipv6? ( >=dev-libs/glib-2.0 )"
RDEPEND="${DEPEND_COMMON}
hddtemp? ( app-admin/hddtemp )
vim-syntax? ( || ( app-editors/vim
app-editors/gvim ) )
nano-syntax? ( app-editors/nano )"
DEPEND="
${DEPEND_COMMON}
dev-util/pkgconfig
X? (
x11-libs/libXt
x11-proto/xextproto
x11-proto/xproto
)"
pkg_setup() {
if use audacious; then
if has_version <media-sound/audacious-1.5.0 && ! built_with_use media-sound/audacious dbus; then
eerror "media-sound/audacious is not built with dbus USE flag."
eerror "Please add 'dbus' to your USE flags, and re-emerge media-sound/audacious."
die "media-sound/audacious needs USE=dbus"
fi
fi
}
src_compile() {
local mymake
if useq ipv6 ; then
ewarn "You have the ipv6 USE flag enabled. Please note that using"
ewarn "the ipv6 USE flag with Conky disables the port monitor."
epause
else
mymake="MPD_NO_IPV6=noipv6"
fi
local myconf
myconf="--enable-proc-uptime"
if useq X; then
myconf="${myconf} --enable-x11 --enable-double-buffer --enable-xdamage --enable-own-window"
myconf="${myconf} $(use_enable truetype xft)"
else
myconf="${myconf} --disable-x11 --disable-double-buffer --disable-xdamage --disable-own-window"
myconf="${myconf} --disable-xft"
fi
econf \
${myconf} \
$(use_enable audacious) \
$(use_enable bmpx) \
$(use_enable debug) \
$(use_enable hddtemp ) \
$(use_enable mpd) \
$(use_enable rss) \
$(use_enable smapi) \
$(use_enable wifi wlan) \
$(use_enable !ipv6 portmon) || die "econf failed"
emake ${mymake} || die "compile failed"
}
src_install() {
emake DESTDIR="${D}" install || die "make install failed"
dodoc ChangeLog AUTHORS README
dohtml doc/docs.html doc/config_settings.html doc/variables.html
if use vim-syntax; then
insinto /usr/share/vim/vimfiles/ftdetect
doins "${S}"/extras/vim/ftdetect/conkyrc.vim
insinto /usr/share/vim/vimfiles/syntax
doins "${S}"/extras/vim/syntax/conkyrc.vim
fi
if use nano-syntax; then
insinto /usr/share/nano/
doins "${S}"/extras/nano/conky.nanorc
fi
}
pkg_postinst() {
elog "You can find the sample configuration file at"
elog "/etc/conky/conky.conf. To customize it, copy"
elog "/etc/conky/conky.conf to ~/.conkyrc and edit"
elog "it to your liking."
elog
elog "For more info on Conky's new features,"
elog "please look at the README and ChangeLog:"
elog "/usr/share/doc/${PF}/README.bz2"
elog "/usr/share/doc/${PF}/ChangeLog.bz2"
elog "There are also pretty html docs available"
elog "on Conky's site or in /usr/share/doc/${PF}"
elog
elog "Also see http://www.gentoo.org/doc/en/conky-howto.xml"
elog
elog "Vim syntax highlighting for conkyrc now enabled with"
elog "USE=vim-syntax, for Nano with USE=nano-syntax"
elog
}

View File

@ -9,7 +9,7 @@
# Please see COPYING for details
#
# Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
# Copyright (c) 2005-2007 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS)
# Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS)
# All rights reserved.
#
# This program is free software: you can redistribute it and/or modify

View File

@ -10,7 +10,7 @@ f = sys.argv[1]
blah = 0
print '<html><body>'
print '<html><head><meta http-equiv="content-type" content="text/html;charset=utf-8" /></head><body>'
for i in open(f).read().splitlines():
# ignore empty lines

54
check_docs.py Executable file
View File

@ -0,0 +1,54 @@
#!/usr/bin/python
#
# TODO: finish this to update nano/vim syntax files, and also handle config
# settings.
#
import os.path
import re
file_names = dict()
file_names["text_objects"] = "src/text_object.h"
file_names["conky"] = "src/conky.c"
file_names["vim_syntax"] = "extras/vim/syntax/conkyrc.vim"
file_names["nano_syntax"] = "extras/nano/conky.nanorc"
file_names["variables"] = "doc/variables.xml"
file_names["config_settings"] = "doc/config_settings.xml"
for fn in file_names.values():
if not os.path.exists(fn) or not os.path.isfile(fn):
print "'%s' doesn't exist, or isn't a file" % (fn)
exit(0)
objects = []
file = open(file_names["text_objects"], "r")
exp = re.compile("\s*OBJ_(\w*).*")
while file:
line = file.readline()
if len(line) == 0:
break
res = exp.match(line)
if res:
obj = res.group(1)
if not re.match("color\d", obj) and obj != "text":
# ignore colourN stuff
objects.append(res.group(1))
doc_objects = []
exp = re.compile("\s*<command><option>(\w*)</option></command>.*")
file = open(file_names["variables"], "r")
while file:
line = file.readline()
if len(line) == 0:
break
res = exp.match(line)
if res:
doc_objects.append(res.group(1))
if doc_objects[len(doc_objects) - 1] not in objects:
print "'%s' is documented, but doesn't seem to be an object" % (doc_objects[len(doc_objects) - 1])
for obj in objects:
if obj not in doc_objects:
print "'%s' seems to be undocumented" % (obj)

View File

@ -55,7 +55,8 @@ case $uname in
FreeBSD*|GNU/kFreeBSD*)
WANT_KVM=yes
WANT_DEVSTAT=yes
;;
want_config_output=no
;;
# NetBSD*)
# WANT_KVM=yes
# WANT_OSSLIB=yes
@ -95,13 +96,14 @@ dnl BUILD_CONFIG_OUTPUT option
dnl
AC_ARG_ENABLE([config_output],
AC_HELP_STRING([--disable-config-output], [disable if you do not want conky to output a default config (with -C) @<:@default=yes@:>@]),
AC_HELP_STRING([--disable-config-output], [disable if you do not want conky to output a default config (with -C) Note: not available on FreeBSD @<:@default=yes@:>@]),
[want_config_output="$enableval"], [want_config_output=yes])
AM_CONDITIONAL(BUILD_CONFIG_OUTPUT, test x$want_config_output = xyes)
AM_CONDITIONAL(BUILD_FOR_FOPENCOOKIE, test x$want_config_output = xyes)
if test x$want_config_output = xyes; then
AC_DEFINE(CONFIG_OUTPUT, 1, [Define if you want conky to output a default config (with -C)])
AC_CHECK_FUNCS(fopencookie, AM_CONDITIONAL(BUILD_FOR_FOPENCOOKIE, true))
AC_CHECK_FUNCS(fopencookie)
fi
dnl
@ -183,7 +185,7 @@ if test x$want_ibm = xyes; then
AC_MSG_NOTICE([support for IBM/Lenovo notebooks not supported on $uname... disabling])
want_ibm=no
else
AC_DEFINE(IBM, 1, [Define if you want support for IBM/Lenovo notebooks])
AC_DEFINE(IBM, 1, [Define if you want support for IBM/Lenovo notebooks (SMAPI)])
fi
fi
@ -544,11 +546,28 @@ if test x$WANT_OSSLIB = xyes; then
)
fi
dnl
dnl ALSA for Linux
dnl
AC_ARG_ENABLE([alsa],
AC_HELP_STRING([--disable-alsa], [disable if you do not
want ALSA support @<:@default=yes@:>@]),
[want_alsa="$enableval"], [want_alsa=yes])
if test x$want_alsa = xyes; then
AC_CHECK_HEADER(alsa/asoundlib.h,, want_alsa=no)
fi
if test x$want_alsa = xyes; then
AC_CHECK_LIB(asound, snd_pcm_open,LIBS="$LIBS -lasound", want_alsa=no)
fi
if test x$want_alsa = xyes; then
AC_DEFINE(MIXER_IS_ALSA, 1, [Define if the mixers use ALSA])
fi
dnl
dnl Some headers
dnl
AC_CHECK_HEADERS([signal.h unistd.h sys/utsname.h sys/stat.h linux/soundcard.h dirent.h mcheck.h \
AC_CHECK_HEADERS([signal.h unistd.h sys/utsname.h sys/stat.h linux/soundcard.h alsa/asoundlib.h dirent.h mcheck.h \
sys/statfs.h sys/param.h pthread.h assert.h errno.h time.h])
AC_CHECK_HEADERS([sys/mount.h], [], [],
[#ifdef HAVE_SYS_PARAM_H
@ -732,4 +751,5 @@ $PACKAGE $VERSION configured successfully:
eve-online: $want_eve
config-output: $want_config_output
IMLIB2: $want_imlib2
ALSA mixer: $want_alsa
EOF

View File

@ -7,7 +7,7 @@
# Please see COPYING for details
#
# Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
# Copyright (c) 2005-2007 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS)
# Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS)
# All rights reserved.
#
# This program is free software: you can redistribute it and/or modify

View File

@ -7,7 +7,7 @@
# Please see COPYING for details
#
# Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
# Copyright (c) 2005-2007 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS)
# Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS)
# All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
@ -23,7 +23,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
alignment bottom_left
alignment top_left
background no
border_width 1
cpu_avg_samples 2
@ -34,7 +34,8 @@ draw_borders no
draw_graph_borders yes
draw_outline no
draw_shades no
font 6x10
use_xft yes
xftfont DejaVu Sans Mono:size=12
gap_x 5
gap_y 60
minimum_size 5 5
@ -44,9 +45,9 @@ out_to_console no
out_to_stderr no
own_window yes
own_window_class Conky
own_window_type normal
own_window_type desktop
stippled_borders 0
update_interval 3.0
update_interval 1.0
uppercase no
use_spacer none
show_graph_scale no
@ -64,13 +65,12 @@ ${color grey}CPU Usage:$color $cpu% ${cpubar 4}
${color grey}Processes:$color $processes ${color grey}Running:$color $running_processes
$hr
${color grey}File systems:
/ $color${fs_free /}/${fs_size /} ${fs_bar 6 /}
/ $color${fs_used /}/${fs_size /} ${fs_bar 6 /}
${color grey}Networking:
Up:$color ${upspeed eth0} k/s${color grey} - Down:$color ${downspeed eth0} k/s
Up:$color ${upspeed eth0} ${color grey} - Down:$color ${downspeed eth0}
$hr
${color grey}Name PID CPU% MEM%
${color grey}Name PID CPU% MEM%
${color lightgrey} ${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 lightgrey} ${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4}

34
debian/changelog vendored
View File

@ -1,34 +0,0 @@
conky (1.4.0-1) unstable; urgency=low
* New upstream release
-- Brenden Matthews <brenden@rty.ca> Wed Feb 15 04:34:46 UTC 2006
conky (1.3.4-1) unstable; urgency=low
* New upstream release
-- Brenden Matthews <brenden@rty.ca> Wed, 16 Nov 2005 17:13:53 -0700
conky (1.3.3-1) unstable; urgency=low
* New upstream release
* Removed ml_* variables from documentation (closes: #335543)
* Removed i2c line from sample config (closes: #329396)
-- Jason Tan <jtan325@gmail.com> Tue, 25 Oct 2005 07:34:54 -0700
conky (1.3.1-1) unstable; urgency=low
* New upstream release
* Added libxt-dev to build-depends in debian/control (closes: #327306)
* Fixed the double BSD-license in debian/copyright (closes: #327135)
-- Jason Tan <jtan325@gmail.com> Sat, 10 Sep 2005 22:45:51 -0700
conky (1.3.0-1) unstable; urgency=low
* Initial Release. (closes: #320978)
-- Jason Tan <jtan325@gmail.com> Wed, 24 Aug 2005 00:10:49 -0700

1
debian/compat vendored
View File

@ -1 +0,0 @@
4

18
debian/control vendored
View File

@ -1,18 +0,0 @@
Source: conky
Section: utils
Priority: optional
Maintainer: Brenden Matthews <brenden@rty.ca>
Build-Depends: cdbs, debhelper (>= 4.1.0), xlibs-dev, libxt-dev
Standards-Version: 3.6.2
Package: conky
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: highly configurable system monitor for X based on torsmo
Conky is a system monitor for X originally based on the torsmo code.
Since its original conception, Conky has changed a fair bit from its
predecessor. Conky can display just about anything, either on your
root desktop or in its own window. Conky has many built-in objects,
as well as the ability to execute programs and scripts, then display
the output from stdout. See http://conky.sf.net for more info.

12
debian/copyright vendored
View File

@ -1,12 +0,0 @@
This package was debianized by Jason Tan <jtan325@gmail.com> on
Wed, 24 Aug 2005 00:10:49 -0700.
It was downloaded from http://www.sourceforge.net/projects/conky
Copyright: This software is copyright (c) 2004-2005 by Brenden Matthews.
Upstream Author: Brenden Matthews <brenden@rty.ca>
You are free to distribute this software under the terms of the BSD License.
On Debian systems, the complete text of the BSD License can be found in the
file `/usr/share/common-licenses/BSD'.

6
debian/docs vendored
View File

@ -1,6 +0,0 @@
README
TODO
doc/docs.html
doc/variables.html
doc/config_settings.html
doc/conkyrc.sample

2
debian/menu vendored
View File

@ -1,2 +0,0 @@
?package(conky):needs="text" section="Apps/Tools"\
title="Conky" command="/usr/bin/conky"

5
debian/rules vendored
View File

@ -1,5 +0,0 @@
#!/usr/bin/make -f
include /usr/share/cdbs/1/class/autotools.mk
include /usr/share/cdbs/1/rules/debhelper.mk
DEB_CONFIGURE_EXTRA_FLAGS := --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --enable-double-buffer --enable-own-window --enable-proc-uptime --enable-mpd --enable-xft --enable-seti --enable-portmon --enable-mldonkey

View File

@ -12,7 +12,7 @@ conky.1: command_options.xml config_settings.xml docs.xml variables.xml
${db2x_xsltproc_cmd} -s man ${srcdir}/docs.xml -o docs.mxml
${db2x_manxml_cmd} docs.mxml
${xsltproc_cmd} http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl ${srcdir}/docs.xml > docs.html
man ./conky.1 | col -b > README
man ./conky.1 > README
mv README ${top_srcdir}
xsltproc ${srcdir}/variables.xsl ${srcdir}/variables.xml > variables.html
xsltproc ${srcdir}/config_settings.xsl ${srcdir}/config_settings.xml > config_settings.html
@ -24,8 +24,6 @@ endif
man_MANS = conky.1
sysconf_SYSCONFS = conky.conf
EXTRA_DIST = $(DOCS) conky.conf command_options.xml config_settings.xml docgen.sh docs.xml variables.xml variables.xsl config_settings.xsl
EXTRA_DIST = $(DOCS) command_options.xml config_settings.xml docgen.sh docs.xml variables.xml variables.xsl config_settings.xsl
# vi:set ts=8 sw=8 noet ai nocindent syntax=automake:

View File

@ -16,21 +16,21 @@
<varlistentry>
<term><command><option>background</option></command></term>
<listitem>
Boolean value, if true, Conky will be forked to background when started
Boolean value, if true, Conky will be forked to background when started.
<para></para></listitem>
</varlistentry>
<varlistentry>
<term><command><option>border_margin</option></command></term>
<listitem>
Border margin in pixels
Border margin in pixels.
<para></para></listitem>
</varlistentry>
<varlistentry>
<term><command><option>border_width</option></command></term>
<listitem>
Border width in pixels
Border width in pixels.
<para></para></listitem>
</varlistentry>
@ -44,7 +44,14 @@
<varlistentry>
<term><command><option>cpu_avg_samples</option></command></term>
<listitem>
The number of samples to average for CPU monitoring
The number of samples to average for CPU monitoring.
<para></para></listitem>
</varlistentry>
<varlistentry>
<term><command><option>diskio_avg_samples</option></command></term>
<listitem>
The number of samples to average for disk I/O monitoring.
<para></para></listitem>
</varlistentry>
@ -55,6 +62,27 @@
<para></para></listitem>
</varlistentry>
<varlistentry>
<term><command><option>default_bar_size</option></command></term>
<listitem>
Specify a default width and height for bars. Example: 'default_bar_size 0 6'. This is particularly useful for execbar and execibar as they do not take size arguments.
<para></para></listitem>
</varlistentry>
<varlistentry>
<term><command><option>default_graph_size</option></command></term>
<listitem>
Specify a default width and height for graphs. Example: 'default_graph_size 0 25'. This is particularly useful for execgraph and execigraph as they do not take size arguments
<para></para></listitem>
</varlistentry>
<varlistentry>
<term><command><option>default_gauge_size</option></command></term>
<listitem>
Specify a default width and height for gauges. Example: 'default_gauge_size 25 25'. This is particularly useful for execgauge and execigauge as they do not take size arguments
<para></para></listitem>
</varlistentry>
<varlistentry>
<term><command><option>default_color</option></command></term>
<listitem>

View File

@ -5,7 +5,7 @@
\\$2 \(la\\$1\(ra\\$3
..
.if \n(.g .mso www.tmac
.TH conky 1 2009-03-15 "" ""
.TH conky 1 2009-05-01 "" ""
.SH NAME
conky \- A system monitor for X originally based on the torsmo code, but more kickass. It just keeps on given'er. Yeah.
.SH SYNOPSIS
@ -155,15 +155,15 @@ Aligned position on screen, may be top_left, top_right, top_middle, bottom_left,
.TP
\fB\*(T<\fBbackground\fR\*(T>\fR
Boolean value, if true, Conky will be forked to background when started
Boolean value, if true, Conky will be forked to background when started.
.TP
\fB\*(T<\fBborder_margin\fR\*(T>\fR
Border margin in pixels
Border margin in pixels.
.TP
\fB\*(T<\fBborder_width\fR\*(T>\fR
Border width in pixels
Border width in pixels.
.TP
\fB\*(T<\fBcolorN\fR\*(T>\fR
@ -171,12 +171,28 @@ Predefine a color for use inside TEXT segments. Substitute N by a digit between
.TP
\fB\*(T<\fBcpu_avg_samples\fR\*(T>\fR
The number of samples to average for CPU monitoring
The number of samples to average for CPU monitoring.
.TP
\fB\*(T<\fBdiskio_avg_samples\fR\*(T>\fR
The number of samples to average for disk I/O monitoring.
.TP
\fB\*(T<\fBtop_cpu_separate\fR\*(T>\fR
If true, cpu in top will show usage of one processor's power. If false, cpu in top will show the usage of all processors' power combined.
.TP
\fB\*(T<\fBdefault_bar_size\fR\*(T>\fR
Specify a default width and height for bars. Example: 'default_bar_size 0 6'. This is particularly useful for execbar and execibar as they do not take size arguments.
.TP
\fB\*(T<\fBdefault_graph_size\fR\*(T>\fR
Specify a default width and height for graphs. Example: 'default_graph_size 0 25'. This is particularly useful for execgraph and execigraph as they do not take size arguments
.TP
\fB\*(T<\fBdefault_gauge_size\fR\*(T>\fR
Specify a default width and height for gauges. Example: 'default_gauge_size 25 25'. This is particularly useful for execgauge and execigauge as they do not take size arguments
.TP
\fB\*(T<\fBdefault_color\fR\*(T>\fR
Default color and border color
@ -590,6 +606,10 @@ Change drawing color to color
\fB\*(T<\fBcolorN\fR\*(T>\fR
Change drawing color to colorN configuration option, where N is a digit between 0 and 9, inclusively.
.TP
\fB\*(T<\fBcombine\fR\*(T>\fR \*(T<\fBvar1 var2\fR\*(T>
Places the lines of var2 to the right of the lines of var1 seperated by the chars that are put between var1 and var2. For example: ${combine ${head /proc/cpuinfo 2} - ${head /proc/meminfo 1}} gives as output "cpuinfo_line1 - meminfo_line1" on line 1 and "cpuinfo_line2 -" on line 2. $combine vars can also be nested to place more vars next to each other.
.TP
\fB\*(T<\fBconky_version\fR\*(T>\fR
Conky version
@ -607,15 +627,15 @@ CPU architecture Conky was built for
CPU usage in percents. For SMP machines, the CPU number can be provided as an argument. ${cpu cpu0} is the total usage, and ${cpu cpuX} (X >= 1) are individual CPUs.
.TP
\fB\*(T<\fBcpubar\fR\*(T>\fR \*(T<\fB(cpu number) (height),(width)\fR\*(T>
\fB\*(T<\fBcpubar\fR\*(T>\fR \*(T<\fB(cpuN) (height),(width)\fR\*(T>
Bar that shows CPU usage, height is bar's height in pixels. See $cpu for more info on SMP.
.TP
\fB\*(T<\fBcpugauge\fR\*(T>\fR \*(T<\fB(cpu number) (height),(width)\fR\*(T>
\fB\*(T<\fBcpugauge\fR\*(T>\fR \*(T<\fB(cpuN) (height),(width)\fR\*(T>
Elliptical gauge that shows CPU usage, height and width are gauge's vertical and horizontal axis respectively. See $cpu for more info on SMP.
.TP
\fB\*(T<\fBcpugraph\fR\*(T>\fR \*(T<\fB("normal"|"log") (height),(width) (gradient colour 1) (gradient colour 2) (scale) (cpu number)\fR\*(T>
\fB\*(T<\fBcpugraph\fR\*(T>\fR \*(T<\fB(cpuN) ("normal"|"log") (height),(width) (gradient colour 1) (gradient colour 2) (scale)\fR\*(T>
CPU usage graph, with optional colours in hex, minus the #. See $cpu for more info on SMP. Uses a logarithmic scale (to see small numbers) when you use "log" instead of "normal".
.TP
@ -674,21 +694,25 @@ Normalized bar of available entropy for crypto freaks
\fB\*(T<\fBentropy_poolsize\fR\*(T>\fR
Total size of system entropy pool for crypto freaks
.TP
\fB\*(T<\fBeval\fR\*(T>\fR \*(T<\fBstring\fR\*(T>
Evalutates given string according to the rules of TEXT interpretation, i.e. parsing any contained text object specifications into their output, any occuring '$$' into a single '$' and so on. The output is then being parsed again.
.TP
\fB\*(T<\fBexec\fR\*(T>\fR \*(T<\fBcommand\fR\*(T>
Executes a shell command and displays the output in conky. warning: this takes a lot more resources than other variables. I'd recommend coding wanted behaviour in C and posting a patch.
.TP
\fB\*(T<\fBexecbar\fR\*(T>\fR \*(T<\fBcommand\fR\*(T>
Same as exec, except if the first value return is a value between 0-100, it will use that number for a bar. The size for the bar is currently fixed, but that may change in the future.
Same as exec, except if the first value return is a value between 0-100, it will use that number for a bar. The size for bars can be controlled via the default_bar_size config setting.
.TP
\fB\*(T<\fBexecgauge\fR\*(T>\fR \*(T<\fBcommand\fR\*(T>
Same as exec, except if the first value return is a value between 0-100, it will use that number for a gauge. The size for the gauge is currently fixed, but you may change that for the future conky release.
Same as exec, except if the first value returned is a value between 0-100, it will use that number for a gauge. The size for gauges can be controlled via the default_gauge_size config setting.
.TP
\fB\*(T<\fBexecgraph\fR\*(T>\fR \*(T<\fB("normal"|"log") (height),(width) (gradient colour 1) (gradient colour 2) (scale) command\fR\*(T>
Same as execbar, but graphs values. Uses a logaritmic scale when the log option is given (to see small numbers). Values still have to be between 0 and 100.
Same as execbar, but graphs values. Uses a logaritmic scale when the log option is given (to see small numbers). Values still have to be between 0 and 100. The size for graphs can be controlled via the default_graph_size config setting.
.TP
\fB\*(T<\fBexeci\fR\*(T>\fR \*(T<\fBinterval command\fR\*(T>
@ -700,7 +724,11 @@ Same as execbar, except with an interval
.TP
\fB\*(T<\fBexecigraph\fR\*(T>\fR \*(T<\fBinterval command\fR\*(T>
Same as execgraph, but takes an interval arg graphs values
Same as execgraph, but takes an interval arg and graphs values.
.TP
\fB\*(T<\fBexecigauge\fR\*(T>\fR \*(T<\fBinterval command\fR\*(T>
Same as execgauge, but takes an interval arg and gauges values.
.TP
\fB\*(T<\fBexecp\fR\*(T>\fR \*(T<\fBcommand\fR\*(T>
@ -723,18 +751,14 @@ Returns CPU #n's frequency in MHz. CPUs are counted from 1. If omitted, the para
\fB\*(T<\fBfreq_g\fR\*(T>\fR \*(T<\fB(n)\fR\*(T>
Returns CPU #n's frequency in GHz. CPUs are counted from 1. If omitted, the parameter defaults to 1.
.TP
\fB\*(T<\fBfreq_dyn\fR\*(T>\fR \*(T<\fB(n)\fR\*(T>
Returns CPU #n's frequency in MHz (defaults to 1), but is calculated by counting to clock cycles to complete an instruction. Only available for x86/amd64.
.TP
\fB\*(T<\fBfreq_dyn_g\fR\*(T>\fR \*(T<\fB(n)\fR\*(T>
Returns CPU #n's frequency in GHz (defaults to 1), but is calculated by counting to clock cycles to complete an instruction. Only available for x86/amd64.
.TP
\fB\*(T<\fBfs_bar\fR\*(T>\fR \*(T<\fB(height),(width) fs\fR\*(T>
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.
.TP
\fB\*(T<\fBfs_bar_free\fR\*(T>\fR \*(T<\fB(height),(width) fs\fR\*(T>
Bar that shows how much space is free on a file system. height is the height in pixels. fs is any file on that file system.
.TP
\fB\*(T<\fBfs_free\fR\*(T>\fR \*(T<\fB(fs)\fR\*(T>
Free space on a file system available for users.
@ -745,15 +769,19 @@ Free percentage of space on a file system available for users.
.TP
\fB\*(T<\fBfs_size\fR\*(T>\fR \*(T<\fB(fs)\fR\*(T>
File system size
File system size.
.TP
\fB\*(T<\fBfs_type\fR\*(T>\fR \*(T<\fB(fs)\fR\*(T>
File system type
File system type.
.TP
\fB\*(T<\fBfs_used\fR\*(T>\fR \*(T<\fB(fs)\fR\*(T>
File system used space
File system used space.
.TP
\fB\*(T<\fBfs_used_perc\fR\*(T>\fR \*(T<\fB(fs)\fR\*(T>
Percent of file system used space.
.TP
\fB\*(T<\fBgoto\fR\*(T>\fR \*(T<\fBx\fR\*(T>
@ -899,6 +927,11 @@ before.
Valid operands are:
\&'>', '<', '>=', '<=', '==', '!='.
.TP
\fB\*(T<\fBif_mixer_mute\fR\*(T>\fR \*(T<\fB(mixer)\fR\*(T>
If mixer exists, display everything between $if_mixer_mute and the
matching $endif. If no mixer is specified, "Master" is used.
.TP
\fB\*(T<\fBif_running\fR\*(T>\fR \*(T<\fB(process)\fR\*(T>
if PROCESS is running, display everything $if_running
@ -1396,12 +1429,12 @@ Runs a command at an interval inside a thread and displays the output. Same as $
Move text over by N pixels. See also $voffset.
.TP
\fB\*(T<\fBrss\fR\*(T>\fR \*(T<\fBurl delay_in_minutes action item_num\fR\*(T>
Download and parse RSS feeds. Action may be one of the following: feed_title, item_title (with num par), item_desc (with num par) and item_titles.
\fB\*(T<\fBrss\fR\*(T>\fR \*(T<\fBurl delay_in_minutes action (num_par (spaces_in_front))\fR\*(T>
Download and parse RSS feeds. Action may be one of the following: feed_title, item_title (with num par), item_desc (with num par) and item_titles (when using this action and spaces_in_front is given conky places that many spaces in front of each item).
.TP
\fB\*(T<\fBtab\fR\*(T>\fR \*(T<\fB(width, (start))\fR\*(T>
Puts a tab of the specified width, starting from column 'start'.
Puts a tab of the specified width, starting from column 'start'. The unit is pixels for both arguments.
.TP
\fB\*(T<\fBtail\fR\*(T>\fR \*(T<\fBlogfile lines (interval)\fR\*(T>
@ -1602,14 +1635,6 @@ Genre in current XMMS2 song
\fB\*(T<\fBxmms2_comment\fR\*(T>\fR
Comment in current XMMS2 song
.TP
\fB\*(T<\fBxmms2_decoder\fR\*(T>\fR
Decoder plugin used
.TP
\fB\*(T<\fBxmms2_transport\fR\*(T>\fR
Transport plugin used
.TP
\fB\*(T<\fBxmms2_url\fR\*(T>\fR
Full path to current song
@ -1642,6 +1667,18 @@ Size of current song
\fB\*(T<\fBxmms2_percent\fR\*(T>\fR
Percent of song's progress
.TP
\fB\*(T<\fBxmms2_date\fR\*(T>\fR
Returns song's date.
.TP
\fB\*(T<\fBxmms2_playlist\fR\*(T>\fR
Returns the XMMS2 playlist.
.TP
\fB\*(T<\fBxmms2_timesplayed\fR\*(T>\fR
Number of times a song was played (presumably).
.TP
\fB\*(T<\fBxmms2_status\fR\*(T>\fR
XMMS2 status (Playing, Paused, Stopped, or Disconnected)
@ -1662,6 +1699,10 @@ Display everything between $if_xmms2_connected and the matching $endif if xmms2
\fB\*(T<\fBeve\fR\*(T>\fR \*(T<\fBapi_userid api_key character_id\fR\*(T>
Fetches your currently training skill from the Eve Online API servers (http://www.eve-online.com/) and displays the skill along with the remaining training time.
.TP
\fB\*(T<\fBendif\fR\*(T>\fR
Ends an $if block.
.SH EXAMPLES
.TP
\*(T<conky \*(T>\*(T<\fB\-t '${time %D %H:%M}' \-o \-u 30\fR\*(T>
@ -1688,7 +1729,7 @@ window, be sure to read up on the own_window_type settings and experiment.
.PP
#conky on irc.freenode.net
.SH COPYING
Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
Any original torsmo code is licensed under the BSD license (see LICENSE.BSD for a copy).
All code written since the fork of torsmo is licensed under the GPL (see LICENSE.GPL for a copy), except where noted differently (such as in portmon code, timed thread code, and audacious code which are LGPL, and prss which is an MIT-style license).
.SH AUTHORS

View File

@ -1,224 +0,0 @@
# Conky sample configuration
#
# the list of variables has been removed from this file in favour
# of keeping the documentation more maintainable.
# Check http://conky.sf.net for an up-to-date-list.
#set to no if you don't want to see anything in X
out_to_x yes
# set to yes if you want Conky to be forked in the background
background no
# 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 -*-*-*-*-*-*-34-*-*-*-*-*-*-*
# Use Xft? - enabling XFreeType allows truetype fonts to be used
use_xft yes
# Xft font when Xft is enabled
xftfont Bitstream Vera Sans Mono:size=8
# Text alpha when using Xft
xftalpha 0.8
# Print everything to stdout?
# out_to_console no
# ... or maybe to stderr ?
# out_to_stderr no
# ... or a file ?
#overwrite_file /this/file/will/contain/the/last/entry
# ... or append to a file so you won't lose the last entry ?
#append_file /this/file/will/contain/all/entries
# MPD host/port - for integration with Music Player Daemon
# mpd_host localhost
# mpd_port 6600
# mpd_password tinker_bell
# Print everything to console?
# out_to_console no
# mail spool
mail_spool $MAIL
# Update interval in seconds
update_interval 5.0
# 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
# If own_window is yes, you may use type normal, desktop, dock or override
own_window_type normal
# Use pseudo transparency with own_window?
own_window_transparent yes
# If own_window_transparent is set to no, you can set the background colour here
own_window_colour hotpink
# If own_window is yes, these window manager hints may be used
#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 280 5
# Draw shades?
draw_shades yes
# Draw outlines?
draw_outline no
# Draw borders around text
draw_borders yes
# Draw borders around graphs
draw_graph_borders yes
# Stippled borders?
stippled_borders 8
# border margins
border_margin 4
# border width
border_width 1
# Default colors and also border colors
default_color white
default_shade_color black
default_outline_color black
# Text alignment, other possible values are commented
#alignment top_left
#alignment top_right
alignment bottom_left
#alignment bottom_right
#alignment none
# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 12
gap_y 12
# Subtract file system buffers from used memory?
no_buffers yes
# 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 requires XFT
override_utf8_locale no
# Add spaces to keep things from moving about? This only affects certain objects. Possible values are "none" (default), "left" or "right"
use_spacer none
# Shows the maximum value in scaled graphs.
show_graph_scale no
# Shows the time range covered by a graph.
show_graph_range no
# Allow each port monitor to track at most this many connections (if 0 or not set, default is 256)
#max_port_monitor_connections 256
# Maximum number of special things, e.g. fonts, offsets, aligns, etc.
#max_specials 512
# Maximum size of buffer for user text, i.e. below TEXT line.
#max_user_text 16384
# Timing interval for music player thread, e.g. mpd, audacious
#music_player_interval (update_interval is default)
# Strictness of if_up. One of: up, link or address. The later ones imply the further ones.
# Defaults to up.
#if_up_strictness address
# Output unit for all temperature related variables. Use either one of
# fahrenheit or celsius, defaults to celsius.
#temperature_unit celsius
# Templates to simplify stuff below 'TEXT'. The following example aids in
# displaying filesystem usage for a given partition and can be used below
# 'TEXT' like so:
# | ${template0 boot /dev/sda1}
# | ${template0 root /dev/sda3}
#template0 \1: ${fs_free_perc \2} ${fs_bar 4,100 \2} ${fs_free \2} / ${fs_used \2}
# Note on general syntax:
# variable is given either in format $variable or in ${variable}. Later
# allows characters right after the variable and must be used to pass
# parameters to the variable.
# stuff after 'TEXT' will be formatted on screen.
# Comment lines in the TEXT block will be interpreted as display text!
TEXT
$nodename - $sysname $kernel on $machine
$stippled_hr
${color lightgrey}Uptime:$color $uptime ${color lightgrey}- Load:$color $loadavg
${color lightgrey}CPU Usage:${color #cc2222} $cpu% ${cpubar}
${color red}${cpugraph 0000ff 00ff00}
${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 80}Up:${color #22ccff} ${upspeed eth0} k/s
${color #0000ff}${downspeedgraph eth0 32,150 ff0000 0000ff} ${color #22ccff}${upspeedgraph eth0 32,150 0000ff ff0000}
${color lightgrey}File systems:
/ $color${fs_used /}/${fs_size /} ${fs_bar /}
${color #88aadd}MPD: ${alignc}$mpd_artist - $mpd_title
${color #88aadd}$mpd_bar
${color #88aadd}${alignc}$mpd_status
${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 lightgrey} ${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4}
${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}
$stippled_hr
${color #ddaa00}Port(s)${alignr}#Connections
$color Inbound: ${tcp_portmon 1 32767 count} Outbound: ${tcp_portmon 32768 61000 count}${alignr}ALL: ${tcp_portmon 1 65535 count}
${color #ddaa00}Inbound Connection ${alignr} Local Service/Port$color
${tcp_portmon 1 32767 rhost 0} ${alignr} ${tcp_portmon 1 32767 lservice 0}
${tcp_portmon 1 32767 rhost 1} ${alignr} ${tcp_portmon 1 32767 lservice 1}
${tcp_portmon 1 32767 rhost 2} ${alignr} ${tcp_portmon 1 32767 lservice 2}
${tcp_portmon 1 32767 rhost 3} ${alignr} ${tcp_portmon 1 32767 lservice 3}
${tcp_portmon 1 32767 rhost 4} ${alignr} ${tcp_portmon 1 32767 lservice 4}
${tcp_portmon 1 32767 rhost 5} ${alignr} ${tcp_portmon 1 32767 lservice 5}
${color #ddaa00}Outbound Connection ${alignr} Remote Service/Port$color
${tcp_portmon 32768 61000 rhost 0} ${alignr} ${tcp_portmon 32768 61000 rservice 0}
${tcp_portmon 32768 61000 rhost 1} ${alignr} ${tcp_portmon 32768 61000 rservice 1}
${tcp_portmon 32768 61000 rhost 2} ${alignr} ${tcp_portmon 32768 61000 rservice 2}
${tcp_portmon 32768 61000 rhost 3} ${alignr} ${tcp_portmon 32768 61000 rservice 3}
${tcp_portmon 32768 61000 rhost 4} ${alignr} ${tcp_portmon 32768 61000 rservice 4}
${tcp_portmon 32768 61000 rhost 5} ${alignr} ${tcp_portmon 32768 61000 rservice 5}

View File

@ -16,7 +16,7 @@
<firstname>Brenden</firstname>
<surname>Matthews</surname>
</author>
<date>2009-03-15</date>
<date>2009-05-01</date>
</refentryinfo>
<refmeta>
@ -227,7 +227,7 @@
<refsect1>
<title>Copying</title>
<para>
Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
Any original torsmo code is licensed under the BSD license (see LICENSE.BSD for a copy).
All code written since the fork of torsmo is licensed under the GPL (see LICENSE.GPL for a copy), except where noted differently (such as in portmon code, timed thread code, and audacious code which are LGPL, and prss which is an MIT-style license).
</para>

View File

@ -381,6 +381,16 @@
<para></para></listitem>
</varlistentry>
<varlistentry>
<term>
<command><option>combine</option></command>
<option>var1 var2</option>
</term>
<listitem>
Places the lines of var2 to the right of the lines of var1 seperated by the chars that are put between var1 and var2. For example: ${combine ${head /proc/cpuinfo 2} - ${head /proc/meminfo 1}} gives as output "cpuinfo_line1 - meminfo_line1" on line 1 and "cpuinfo_line2 -" on line 2. $combine vars can also be nested to place more vars next to each other.
<para></para></listitem>
</varlistentry>
<varlistentry>
<term>
<command><option>conky_version</option></command>
@ -421,7 +431,7 @@
<varlistentry>
<term>
<command><option>cpubar</option></command>
<option>(cpu number) (height),(width)</option>
<option>(cpuN) (height),(width)</option>
</term>
<listitem>
Bar that shows CPU usage, height is bar's height in pixels. See $cpu for more info on SMP.
@ -431,7 +441,7 @@
<varlistentry>
<term>
<command><option>cpugauge</option></command>
<option>(cpu number) (height),(width)</option>
<option>(cpuN) (height),(width)</option>
</term>
<listitem>
Elliptical gauge that shows CPU usage, height and width are gauge's vertical and horizontal axis respectively. See $cpu for more info on SMP.
@ -441,7 +451,7 @@
<varlistentry>
<term>
<command><option>cpugraph</option></command>
<option>("normal"|"log") (height),(width) (gradient colour 1) (gradient colour 2) (scale) (cpu number)</option>
<option>(cpuN) ("normal"|"log") (height),(width) (gradient colour 1) (gradient colour 2) (scale)</option>
</term>
<listitem>
CPU usage graph, with optional colours in hex, minus the #. See $cpu for more info on SMP. Uses a logarithmic scale (to see small numbers) when you use "log" instead of "normal".
@ -585,6 +595,16 @@
<para></para></listitem>
</varlistentry>
<varlistentry>
<term>
<command><option>eval</option></command>
<option>string</option>
</term>
<listitem>
Evalutates given string according to the rules of TEXT interpretation, i.e. parsing any contained text object specifications into their output, any occuring '$$' into a single '$' and so on. The output is then being parsed again.
<para></para></listitem>
</varlistentry>
<varlistentry>
<term>
<command><option>exec</option></command>
@ -601,7 +621,7 @@
<option>command</option>
</term>
<listitem>
Same as exec, except if the first value return is a value between 0-100, it will use that number for a bar. The size for the bar is currently fixed, but that may change in the future.
Same as exec, except if the first value return is a value between 0-100, it will use that number for a bar. The size for bars can be controlled via the default_bar_size config setting.
<para></para></listitem>
</varlistentry>
@ -611,7 +631,7 @@
<option>command</option>
</term>
<listitem>
Same as exec, except if the first value return is a value between 0-100, it will use that number for a gauge. The size for the gauge is currently fixed, but you may change that for the future conky release.
Same as exec, except if the first value returned is a value between 0-100, it will use that number for a gauge. The size for gauges can be controlled via the default_gauge_size config setting.
<para></para></listitem>
</varlistentry>
@ -621,7 +641,7 @@
<option>("normal"|"log") (height),(width) (gradient colour 1) (gradient colour 2) (scale) command</option>
</term>
<listitem>
Same as execbar, but graphs values. Uses a logaritmic scale when the log option is given (to see small numbers). Values still have to be between 0 and 100.
Same as execbar, but graphs values. Uses a logaritmic scale when the log option is given (to see small numbers). Values still have to be between 0 and 100. The size for graphs can be controlled via the default_graph_size config setting.
<para></para></listitem>
</varlistentry>
@ -651,7 +671,17 @@
<option>interval command</option>
</term>
<listitem>
Same as execgraph, but takes an interval arg graphs values
Same as execgraph, but takes an interval arg and graphs values.
<para></para></listitem>
</varlistentry>
<varlistentry>
<term>
<command><option>execigauge</option></command>
<option>interval command</option>
</term>
<listitem>
Same as execgauge, but takes an interval arg and gauges values.
<para></para></listitem>
</varlistentry>
@ -705,26 +735,6 @@
<para></para></listitem>
</varlistentry>
<varlistentry>
<term>
<command><option>freq_dyn</option></command>
<option>(n)</option>
</term>
<listitem>
Returns CPU #n's frequency in MHz (defaults to 1), but is calculated by counting to clock cycles to complete an instruction. Only available for x86/amd64.
<para></para></listitem>
</varlistentry>
<varlistentry>
<term>
<command><option>freq_dyn_g</option></command>
<option>(n)</option>
</term>
<listitem>
Returns CPU #n's frequency in GHz (defaults to 1), but is calculated by counting to clock cycles to complete an instruction. Only available for x86/amd64.
<para></para></listitem>
</varlistentry>
<varlistentry>
<term>
<command><option>fs_bar</option></command>
@ -735,6 +745,16 @@
<para></para></listitem>
</varlistentry>
<varlistentry>
<term>
<command><option>fs_bar_free</option></command>
<option>(height),(width) fs</option>
</term>
<listitem>
Bar that shows how much space is free on a file system. height is the height in pixels. fs is any file on that file system.
<para></para></listitem>
</varlistentry>
<varlistentry>
<term>
<command><option>fs_free</option></command>
@ -761,7 +781,7 @@
<option>(fs)</option>
</term>
<listitem>
File system size
File system size.
<para></para></listitem>
</varlistentry>
@ -771,7 +791,7 @@
<option>(fs)</option>
</term>
<listitem>
File system type
File system type.
<para></para></listitem>
</varlistentry>
@ -781,7 +801,17 @@
<option>(fs)</option>
</term>
<listitem>
File system used space
File system used space.
<para></para></listitem>
</varlistentry>
<varlistentry>
<term>
<command><option>fs_used_perc</option></command>
<option>(fs)</option>
</term>
<listitem>
Percent of file system used space.
<para></para></listitem>
</varlistentry>
@ -1092,6 +1122,17 @@
<para></para></listitem>
</varlistentry>
<varlistentry>
<term>
<command><option>if_mixer_mute</option></command>
<option>(mixer)</option>
</term>
<listitem>
If mixer exists, display everything between $if_mixer_mute and the
matching $endif. If no mixer is specified, "Master" is used.
<para></para></listitem>
</varlistentry>
<varlistentry>
<term>
<command><option>if_running</option></command>
@ -2155,10 +2196,10 @@
<varlistentry>
<term>
<command><option>rss</option></command>
<option>url delay_in_minutes action item_num</option>
<option>url delay_in_minutes action (num_par (spaces_in_front))</option>
</term>
<listitem>
Download and parse RSS feeds. Action may be one of the following: feed_title, item_title (with num par), item_desc (with num par) and item_titles.
Download and parse RSS feeds. Action may be one of the following: feed_title, item_title (with num par), item_desc (with num par) and item_titles (when using this action and spaces_in_front is given conky places that many spaces in front of each item).
<para></para></listitem>
</varlistentry>
@ -2168,7 +2209,7 @@
<option>(width, (start))</option>
</term>
<listitem>
Puts a tab of the specified width, starting from column 'start'.
Puts a tab of the specified width, starting from column 'start'. The unit is pixels for both arguments.
<para></para></listitem>
</varlistentry>
@ -2566,24 +2607,6 @@
<para></para></listitem>
</varlistentry>
<varlistentry>
<term>
<command><option>xmms2_decoder</option></command>
</term>
<listitem>
Decoder plugin used
<para></para></listitem>
</varlistentry>
<varlistentry>
<term>
<command><option>xmms2_transport</option></command>
</term>
<listitem>
Transport plugin used
<para></para></listitem>
</varlistentry>
<varlistentry>
<term>
<command><option>xmms2_url</option></command>
@ -2656,6 +2679,33 @@
<para></para></listitem>
</varlistentry>
<varlistentry>
<term>
<command><option>xmms2_date</option></command>
</term>
<listitem>
Returns song's date.
<para></para></listitem>
</varlistentry>
<varlistentry>
<term>
<command><option>xmms2_playlist</option></command>
</term>
<listitem>
Returns the XMMS2 playlist.
<para></para></listitem>
</varlistentry>
<varlistentry>
<term>
<command><option>xmms2_timesplayed</option></command>
</term>
<listitem>
Number of times a song was played (presumably).
<para></para></listitem>
</varlistentry>
<varlistentry>
<term>
<command><option>xmms2_status</option></command>
@ -2702,4 +2752,14 @@
<para></para></listitem>
</varlistentry>
<varlistentry>
<term>
<command><option>endif</option></command>
<option></option>
</term>
<listitem>
Ends an $if block.
<para></para></listitem>
</varlistentry>
</variablelist>

View File

@ -5,13 +5,13 @@
syntax "conky" "(\.*conkyrc.*$|conky.conf)"
## Configuration items
color green "\<(alias|alignment|background|show_graph_range|show_graph_scale|border_margin|border_width|color0|color1|color2|color3|color4|color5|color6|color7|color8|color9|default_color|default_shade_color|default_shadecolor|default_outline_color|default_outlinecolor|imap|pop3|mpd_host|mpd_port|mpd_password|music_player_interval|sensor_device|cpu_avg_samples|net_avg_samples|double_buffer|override_utf8_locale|draw_borders|draw_graph_borders|draw_shades|draw_outline|out_to_console|out_to_stderr|out_to_x|extra_newline|overwrite_file|append_file|use_spacer|use_xft|font|xftalpha|xftfont|use_xft|gap_x|gap_y|mail_spool|minimum_size|maximum_width|no_buffers|template0|template1|template2|template3|template4|template5|template6|template7|template8|template9|top_cpu_separate|short_units|pad_percents|own_window|own_window_class|own_window_title|own_window_transparent|own_window_colour|own_window_hints|own_window_type|stippled_borders|temp1|temp2|update_interval|total_run_times|uppercase|max_specials|max_user_text|text_buffer_size|max_port_monitor_connections)\>"
color green "\<(alias|alignment|background|show_graph_range|show_graph_scale|border_margin|border_width|color0|color1|color2|color3|color4|color5|color6|color7|color8|color9|default_bar_size|default_gauge_size|default_graph_size|default_color|default_shade_color|default_shadecolor|default_outline_color|default_outlinecolor|imap|pop3|mpd_host|mpd_port|mpd_password|music_player_interval|sensor_device|cpu_avg_samples|net_avg_samples|double_buffer|override_utf8_locale|draw_borders|draw_graph_borders|draw_shades|draw_outline|out_to_console|out_to_stderr|out_to_x|extra_newline|overwrite_file|append_file|use_spacer|use_xft|font|xftalpha|xftfont|use_xft|gap_x|gap_y|mail_spool|minimum_size|maximum_width|no_buffers|template0|template1|template2|template3|template4|template5|template6|template7|template8|template9|top_cpu_separate|short_units|pad_percents|own_window|own_window_class|own_window_title|own_window_transparent|own_window_colour|own_window_hints|own_window_type|stippled_borders|temp1|temp2|update_interval|total_run_times|uppercase|max_specials|max_user_text|text_buffer_size|max_port_monitor_connections)\>"
## Configuration item constants
color yellow "\<(above|below|bottom_left|bottom_right|bottom_middle|desktop|dock|no|none|normal|override|skip_pager|skip_taskbar|sticky|top_left|top_right|top_middle|middle_left|middle_right|undecorated|yes)\>"
## Variables
color brightblue "\<(acpitemp|acpitempf|freq|freq_g|voltage_mv|voltage_v|wireless_essid|wireless_mode|wireless_bitrate|wireless_ap|wireless_link_qual|wireless_link_qual_max|wireless_link_qual_perc|wireless_link_bar|freq_dyn|freq_dyn_g|adt746xcpu|adt746xfan|acpifan|acpiacadapter|battery|battery_time|battery_percent|battery_bar|buffers|cached|cpu|cpubar|cpugraph|loadgraph|lines|color|color0|color1|color2|color3|color4|color5|color6|color7|color8|color9|conky_version|conky_build_date|conky_build_arch|disk_protect|i8k_version|i8k_bios|i8k_serial|i8k_cpu_temp|i8k_cpu_tempf|i8k_left_fan_status|i8k_right_fan_status|i8k_left_fan_rpm|i8k_right_fan_rpm|i8k_ac_status|i8k_buttons_status|ibm_fan|ibm_temps|ibm_volume|ibm_brightness|if_up|if_updatenr|if_gw|gw_iface|gw_ip|laptop_mode|pb_battery|obsd_sensors_temp|obsd_sensors_fan|obsd_sensors_volt|obsd_vendor|obsd_product|font|diskio|diskio_write|diskio_read|diskiograph|diskiograph_read|diskiograph_write|downspeed|downspeedf|downspeedgraph|else|endif|addr|addrs|image|exec|execp|execbar|execgraph|execibar|execigraph|execi|execpi|texeci|imap_unseen|imap_messages|pop3_unseen|pop3_used|fs_bar|fs_free|fs_free_perc|fs_size|fs_type|fs_used|fs_bar_free|fs_used_perc|loadavg|goto|tab|hr|nameserver|rss|hddtemp|offset|voffset|i2c|platform|hwmon|alignr|alignc|if_empty|if_existing|if_mounted|if_running|ioscheduler|kernel|machine|mem|memeasyfree|memfree|memmax|memperc|membar|memgraph|mixer|mixerl|mixerr|mixerbar|mixerlbar|mixerrbar|mails|mboxscan|new_mails|nodename|outlinecolor|processes|running_processes|scroll|shadecolor|stippled_hr|swap|swapmax|swapperc|swapbar|sysname|time|utime|tztime|totaldown|totalup|updates|upspeed|upspeedf|upspeedgraph|uptime_short|uptime|user_names|user_terms|user_times|user_number|apm_adapter|apm_battery_life|apm_battery_time|monitor|monitor_number|mpd_title|mpd_artist|mpd_album|mpd_random|mpd_repeat|mpd_track|mpd_name|mpd_file|mpd_vol|mpd_bitrate|mpd_status|mpd_elapsed|mpd_length|mpd_percent|mpd_bar|mpd_smart|words|xmms2_artist|xmms2_album|xmms2_title|xmms2_genre|xmms2_comment|xmms2_url|xmms2_status|xmms2_date|xmms2_tracknr|xmms2_bitrate|xmms2_id|xmms2_size|xmms2_elapsed|xmms2_duration|xmms2_percent|xmms2_bar|xmms2_playlist|xmms2_timesplayed|xmms2_smart|audacious_status|audacious_title|audacious_length|audacious_length_seconds|audacious_position|audacious_position_seconds|audacious_bitrate|audacious_frequency|audacious_channels|audacious_filename|audacious_playlist_length|audacious_playlist_position|audacious_bar|bmpx_title|bmpx_artist|bmpx_album|bmpx_uri|bmpx_track|bmpx_bitrate|top|top_mem|tail|head|tcp_portmon|iconv_start|iconv_stop|entropy_avail|entropy_poolsize|entropy_bar|smapi|if_smapi_bat_installed|smapi_bat_perc|smapi_bat_bar)\>"
color brightblue "\<(acpitemp|acpitempf|freq|freq_g|voltage_mv|voltage_v|wireless_essid|wireless_mode|wireless_bitrate|wireless_ap|wireless_link_qual|wireless_link_qual_max|wireless_link_qual_perc|wireless_link_bar|freq_dyn|freq_dyn_g|adt746xcpu|adt746xfan|acpifan|acpiacadapter|battery|battery_time|battery_percent|battery_bar|buffers|cached|cpu|cpubar|cpugraph|loadgraph|lines|color|color0|color1|color2|color3|color4|color5|color6|color7|color8|color9|combine|conky_version|conky_build_date|conky_build_arch|disk_protect|i8k_version|i8k_bios|i8k_serial|i8k_cpu_temp|i8k_cpu_tempf|i8k_left_fan_status|i8k_right_fan_status|i8k_left_fan_rpm|i8k_right_fan_rpm|i8k_ac_status|i8k_buttons_status|ibm_fan|ibm_temps|ibm_volume|ibm_brightness|if_up|if_updatenr|if_gw|gw_iface|gw_ip|laptop_mode|pb_battery|obsd_sensors_temp|obsd_sensors_fan|obsd_sensors_volt|obsd_vendor|obsd_product|font|diskio|diskio_write|diskio_read|diskiograph|diskiograph_read|diskiograph_write|downspeed|downspeedf|downspeedgraph|else|endif|addr|addrs|image|exec|execp|execbar|execgraph|execibar|execigraph|execi|execpi|texeci|imap_unseen|imap_messages|pop3_unseen|pop3_used|fs_bar|fs_free|fs_free_perc|fs_size|fs_type|fs_used|fs_bar_free|fs_used_perc|loadavg|goto|tab|hr|nameserver|rss|hddtemp|offset|voffset|i2c|platform|hwmon|alignr|alignc|if_empty|if_existing|if_mounted|if_running|ioscheduler|kernel|machine|mem|memeasyfree|memfree|memmax|memperc|membar|memgraph|mixer|mixerl|mixerr|mixerbar|mixerlbar|mixerrbar|mails|mboxscan|new_mails|nodename|outlinecolor|processes|running_processes|scroll|shadecolor|stippled_hr|swap|swapmax|swapperc|swapbar|sysname|time|utime|tztime|totaldown|totalup|updates|upspeed|upspeedf|upspeedgraph|uptime_short|uptime|user_names|user_terms|user_times|user_number|apm_adapter|apm_battery_life|apm_battery_time|monitor|monitor_number|mpd_title|mpd_artist|mpd_album|mpd_random|mpd_repeat|mpd_track|mpd_name|mpd_file|mpd_vol|mpd_bitrate|mpd_status|mpd_elapsed|mpd_length|mpd_percent|mpd_bar|mpd_smart|words|xmms2_artist|xmms2_album|xmms2_title|xmms2_genre|xmms2_comment|xmms2_url|xmms2_status|xmms2_date|xmms2_tracknr|xmms2_bitrate|xmms2_id|xmms2_size|xmms2_elapsed|xmms2_duration|xmms2_percent|xmms2_bar|xmms2_playlist|xmms2_timesplayed|xmms2_smart|audacious_status|audacious_title|audacious_length|audacious_length_seconds|audacious_position|audacious_position_seconds|audacious_bitrate|audacious_frequency|audacious_channels|audacious_filename|audacious_playlist_length|audacious_playlist_position|audacious_bar|bmpx_title|bmpx_artist|bmpx_album|bmpx_uri|bmpx_track|bmpx_bitrate|top|top_mem|tail|head|tcp_portmon|iconv_start|iconv_stop|entropy_avail|entropy_poolsize|entropy_bar|smapi|if_smapi_bat_installed|smapi_bat_perc|smapi_bat_bar)\>"
color brightblue "\$\{?[0-9A-Z_!@#$*?-]+\}?"

View File

@ -30,6 +30,9 @@ syn keyword ConkyrcSetting
\ color7
\ color8
\ color9
\ default_bar_size
\ default_gauge_size
\ default_graph_size
\ default_color
\ default_shade_color
\ default_shadecolor
@ -176,6 +179,7 @@ syn keyword ConkyrcVarName contained nextgroup=ConkyrcNumber,ConkyrcColour skipw
\ color7
\ color8
\ color9
\ combine
\ conky_version
\ conky_build_date
\ conky_build_arch

View File

@ -7,7 +7,7 @@
# Please see COPYING for details
#
# Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
# Copyright (c) 2005-2007 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS)
# Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS)
# All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
@ -35,7 +35,7 @@ endif
conky_DEPENDENCIES = $(config_output)
BUILT_SOURCES = $(config_output)
CLEANFILES = $(config_output)
$(config_output): ../doc/conky.conf
$(config_output): ../data/conky.conf
sh ../text2c.sh $< $@ defconfig
endif

View File

@ -7,7 +7,7 @@
* Please see COPYING for details
*
* Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*

View File

@ -7,7 +7,7 @@
* Please see COPYING for details
*
* Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*

View File

@ -6,7 +6,7 @@
*
* Please see COPYING for details
*
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*

View File

@ -7,7 +7,7 @@
* Please see COPYING for details
*
* Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*

View File

@ -7,7 +7,7 @@
* Please see COPYING for details
*
* Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*

View File

@ -7,7 +7,7 @@
* Please see COPYING for details
*
* Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*
@ -32,7 +32,11 @@
#include <ctype.h>
#include <errno.h>
#include <sys/time.h>
#include <sys/ioctl.h>
#include <net/if.h>
#include <netinet/in.h>
#include <pthread.h>
#include <unistd.h>
#include "diskio.h"
/* check for OS and include appropriate headers */
@ -186,6 +190,49 @@ void clear_net_stats(void)
memset(netstats, 0, sizeof(netstats));
}
/* We should check if this is ok with OpenBSD and NetBSD as well. */
int interface_up(const char *dev)
{
int fd;
struct ifreq ifr;
if ((fd = socket(PF_INET, SOCK_DGRAM, 0)) < 0) {
CRIT_ERR("could not create sockfd");
return 0;
}
strncpy(ifr.ifr_name, dev, IFNAMSIZ);
if (ioctl(fd, SIOCGIFFLAGS, &ifr)) {
/* if device does not exist, treat like not up */
if (errno != ENODEV && errno != ENXIO)
perror("SIOCGIFFLAGS");
goto END_FALSE;
}
if (!(ifr.ifr_flags & IFF_UP)) /* iface is not up */
goto END_FALSE;
if (ifup_strictness == IFUP_UP)
goto END_TRUE;
if (!(ifr.ifr_flags & IFF_RUNNING))
goto END_FALSE;
if (ifup_strictness == IFUP_LINK)
goto END_TRUE;
if (ioctl(fd, SIOCGIFADDR, &ifr)) {
perror("SIOCGIFADDR");
goto END_FALSE;
}
if (((struct sockaddr_in *)&(ifr.ifr_ifru.ifru_addr))->sin_addr.s_addr)
goto END_TRUE;
END_FALSE:
close(fd);
return 0;
END_TRUE:
close(fd);
return 1;
}
void free_dns_data(void)
{
int i;

View File

@ -69,18 +69,7 @@ struct net_stat {
};
void clear_net_stats(void);
struct net_stat *get_net_stat(const char *);
int open_sysfs_sensor(const char *dir, const char *dev, const char *type, int n,
int *divisor, char *devtype);
#define open_i2c_sensor(dev, type, n, divisor, devtype) \
open_sysfs_sensor("/sys/bus/i2c/devices/", dev, type, n, divisor, devtype)
#define open_platform_sensor(dev, type, n, divisor, devtype) \
open_sysfs_sensor("/sys/bus/platform/devices/", dev, type, n, divisor, devtype)
#define open_hwmon_sensor(dev, type, n, divisor, devtype) \
open_sysfs_sensor("/sys/class/hwmon/", dev, type, n, divisor, devtype)
double get_sysfs_info(int *fd, int arg, char *devtype, char *type);
int interface_up(const char *dev);
void get_adt746x_cpu(char *, size_t);
void get_adt746x_fan(char *, size_t);

File diff suppressed because it is too large Load Diff

View File

@ -7,7 +7,7 @@
* Please see COPYING for details
*
* Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*
@ -229,14 +229,14 @@ struct information {
unsigned int net_avg_samples;
unsigned int diskio_avg_samples;
float loadavg[3];
struct mail_s *mail;
int mail_running;
#ifdef XMMS2
struct xmms2_s xmms2;
int xmms2_conn_state;
xmmsc_connection_t *xmms2_conn;
#endif
#ifdef AUDACIOUS
AUDACIOUS_S audacious;

View File

@ -8,7 +8,7 @@
* Please see COPYING for details
*
* Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*
@ -52,6 +52,9 @@
* also containing the totals. */
static struct diskio_stat stats = {
.next = NULL,
.sample = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
.sample_read = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
.sample_write = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
.current = 0,
.current_read = 0,
.current_write = 0,
@ -98,19 +101,40 @@ struct diskio_stat *prepare_diskio_stat(const char *s)
static void update_diskio_values(struct diskio_stat *ds,
unsigned int reads, unsigned int writes)
{
int i;
double sum=0, sum_r=0, sum_w=0;
if (reads < ds->last_read || writes < ds->last_write) {
/* counter overflow or reset - rebase to sane values */
ds->last = 0;
ds->last_read = 0;
ds->last_write = 0;
ds->last = reads+writes;
ds->last_read = reads;
ds->last_write = writes;
}
/* since the values in /proc/diskstats are absolute, we have to substract
* our last reading. The numbers stand for "sectors read", and we therefore
* have to divide by two to get KB */
ds->current_read = (reads - ds->last_read) / 2;
ds->current_write = (writes - ds->last_write) / 2;
ds->current = ds->current_read + ds->current_write;
ds->sample_read[0] = (reads - ds->last_read) / 2;
ds->sample_write[0] = (writes - ds->last_write) / 2;
ds->sample[0] = ds->sample_read[0] + ds->sample_write[0];
/* compute averages */
for (i = 0; i < (signed) info.diskio_avg_samples; i++) {
sum += ds->sample[i];
sum_r += ds->sample_read[i];
sum_w += ds->sample_write[i];
}
ds->current = sum / (double) info.diskio_avg_samples;
ds->current_read = sum_r / (double) info.diskio_avg_samples;
ds->current_write = sum_w / (double) info.diskio_avg_samples;
/* shift sample history */
for (i = info.diskio_avg_samples-1; i > 0; i--) {
ds->sample[i] = ds->sample[i-1];
ds->sample_read[i] = ds->sample_read[i-1];
ds->sample_write[i] = ds->sample_write[i-1];
}
/* save last */
ds->last_read = reads;
ds->last_write = writes;
ds->last = ds->last_read + ds->last_write;
@ -125,7 +149,7 @@ void update_diskio(void)
char buf[512], devbuf[64];
unsigned int major, minor;
unsigned int reads, writes;
unsigned int total_reads, total_writes;
unsigned int total_reads=0, total_writes=0;
int col_count = 0;
stats.current = 0;
@ -146,7 +170,7 @@ void update_diskio(void)
*
* XXX: ignore devices which are part of a SW RAID (MD_MAJOR) */
if (col_count == 5 && major != LVM_BLK_MAJOR && major != NBD_MAJOR
&& major != RAMDISK_MAJOR && major != LOOP_MAJOR) {
&& major != RAMDISK_MAJOR && major != LOOP_MAJOR && minor==0) {
total_reads += reads;
total_writes += writes;
} else {

View File

@ -8,7 +8,7 @@
* Please see COPYING for details
*
* Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*
@ -32,12 +32,15 @@
struct diskio_stat {
struct diskio_stat *next;
char *dev;
unsigned int current;
unsigned int current_read;
unsigned int current_write;
unsigned int last;
unsigned int last_read;
unsigned int last_write;
double sample[15];
double sample_read[15];
double sample_write[15];
double current;
double current_read;
double current_write;
double last;
double last_read;
double last_write;
};
struct diskio_stat *prepare_diskio_stat(const char *s);

View File

@ -1,7 +1,7 @@
/* Conky, a system monitor, based on torsmo
*
* Copyright (c) 2008 Asbjørn Zweidorff Kjær
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*

View File

@ -1,7 +1,7 @@
/* Conky, a system monitor, based on torsmo
*
* Copyright (c) 2008 Asbjørn Zweidorff Kjær
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*

View File

@ -7,7 +7,7 @@
* Please see COPYING for details
*
* Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*

View File

@ -7,7 +7,7 @@
* Please see COPYING for details
*
* Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*

View File

@ -6,7 +6,7 @@
*
* Please see COPYING for details
*
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*
@ -28,28 +28,31 @@
#include <sys/param.h>
#include <sys/resource.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/sysctl.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/vmmeter.h>
#include <sys/user.h>
#include <sys/ioctl.h>
#include <net/if.h>
#include <net/if_mib.h>
#include <net/if_media.h>
#include <net/if_var.h>
#include <netinet/in.h>
#include <devstat.h>
#include <fcntl.h>
#include <ifaddrs.h>
#include <limits.h>
#include <unistd.h>
#include <dev/wi/if_wavelan_ieee.h>
#include <dev/acpica/acpiio.h>
#include "conky.h"
#include "freebsd.h"
#include "logging.h"
#include "top.h"
#include "diskio.h"
#define GETSYSCTL(name, var) getsysctl(name, &(var), sizeof(var))
#define KELVTOC(x) ((x - 2732) / 10.0)
@ -61,11 +64,16 @@
inline void proc_find_top(struct process **cpu, struct process **mem);
u_int64_t diskio_prev = 0;
static short cpu_setup = 0;
static short diskio_setup = 0;
static struct diskio_stat diskio_stats_[MAX_DISKIO_STATS];
struct diskio_stat *diskio_stats = diskio_stats_;
static struct diskio_stat stats = {
.next = NULL,
.current = 0,
.current_read = 0,
.current_write = 0,
.last = UINT_MAX,
.last_read = UINT_MAX,
.last_write = UINT_MAX,
};
static int getsysctl(char *name, void *ptr, size_t len)
{
@ -75,7 +83,7 @@ static int getsysctl(char *name, void *ptr, size_t len)
return -1;
}
if (nlen != len) {
if (nlen != len && errno == ENOMEM) {
return -1;
}
@ -345,11 +353,6 @@ void update_cpu_usage()
oldtotal = total;
}
double get_sysfs_info(int *fd, int arg, char *devtype, char *type)
{
return 0.0;
}
void update_load_average()
{
double v[3];
@ -374,90 +377,107 @@ double get_acpi_temperature(int fd)
return KELVTOC(temp);
}
static void get_battery_stats(int *battime, int *batcapacity, int *batstate, int *ac) {
if (battime && GETSYSCTL("hw.acpi.battery.time", *battime)) {
fprintf(stderr, "Cannot read sysctl \"hw.acpi.battery.time\"\n");
}
if (batcapacity && GETSYSCTL("hw.acpi.battery.life", *batcapacity)) {
fprintf(stderr, "Cannot read sysctl \"hw.acpi.battery.life\"\n");
}
if (batstate && GETSYSCTL("hw.acpi.battery.state", *batstate)) {
fprintf(stderr, "Cannot read sysctl \"hw.acpi.battery.state\"\n");
}
if (ac && GETSYSCTL("hw.acpi.acline", *ac)) {
fprintf(stderr, "Cannot read sysctl \"hw.acpi.acline\"\n");
}
}
void get_battery_stuff(char *buf, unsigned int n, const char *bat, int item)
{
int battime, batcapacity, batstate, ac;
char battery_status[64];
char battery_time[64];
if (GETSYSCTL("hw.acpi.battery.time", battime)) {
fprintf(stderr, "Cannot read sysctl \"hw.acpi.battery.time\"\n");
}
if (GETSYSCTL("hw.acpi.battery.life", batcapacity)) {
fprintf(stderr, "Cannot read sysctl \"hw.acpi.battery.life\"\n");
}
get_battery_stats(&battime, &batcapacity, &batstate, &ac);
if (GETSYSCTL("hw.acpi.battery.state", batstate)) {
fprintf(stderr, "Cannot read sysctl \"hw.acpi.battery.state\"\n");
}
if (GETSYSCTL("hw.acpi.acline", ac)) {
fprintf(stderr, "Cannot read sysctl \"hw.acpi.acline\"\n");
}
if (batstate == 1) {
if (battime != -1) {
snprintf(battery_status, sizeof(battery_status) - 1,
"remaining %d%%", batcapacity);
snprintf(battery_time, sizeof(battery_time) - 1, "%d:%2.2d",
battime / 60, battime % 60);
/* snprintf(buf, n, "remaining %d%% (%d:%2.2d)", batcapacity,
battime / 60, battime % 60); */
} else {
/* no time estimate available yet */
snprintf(battery_status, sizeof(battery_status) - 1,
"remaining %d%%", batcapacity);
}
/* snprintf(buf, n, "remaining %d%%", batcapacity); */
if (ac == 1) {
fprintf(stderr, "Discharging while on AC!\n");
}
} else {
snprintf(battery_status, sizeof(battery_status) - 1,
batstate == 2 ? "charging (%d%%)" : "charged (%d%%)", batcapacity);
/* snprintf(buf, n,
batstate == 2 ? "charging (%d%%)" : "charged (%d%%)",
batcapacity); */
if (batstate != 2 && batstate != 0) {
fprintf(stderr, "Unknown battery state %d!\n", batstate);
}
if (ac == 0) {
fprintf(stderr, "Charging while not on AC!\n");
}
}
if (batstate != 1 && batstate != 2 && batstate != 0 && batstate != 7)
fprintf(stderr, "Unknown battery state %d!\n", batstate);
else if (batstate != 1 && ac == 0)
fprintf(stderr, "Battery charging while not on AC!\n");
else if (batstate == 1 && ac == 1)
fprintf(stderr, "Battery discharing while on AC!\n");
switch (item) {
case BATTERY_STATUS:
snprintf(buf, n, "%s", battery_status);
break;
case BATTERY_TIME:
snprintf(buf, n, "%s", battery_time);
if (batstate == 1 && battime != -1)
snprintf(buf, n, "%d:%2.2d", battime / 60, battime % 60);
break;
case BATTERY_STATUS:
if (batstate == 1) // Discharging
snprintf(buf, n, "remaining %d%%", batcapacity);
else
snprintf(buf, n, batstate == 2 ? "charging (%d%%)" :
(batstate == 7 ? "absent/on AC" : "charged (%d%%)"),
batcapacity);
break;
default:
break;
fprintf(stderr, "Unknown requested battery stat %d\n", item);
}
}
static int check_bat(const char *bat)
{
int batnum, numbatts;
char *endptr;
if (GETSYSCTL("hw.acpi.battery.units", numbatts)) {
fprintf(stderr, "Cannot read sysctl \"hw.acpi.battery.units\"\n");
return -1;
}
if (numbatts <= 0) {
fprintf(stderr, "No battery unit detected\n");
return -1;
}
if (!bat || (batnum = strtol(bat, &endptr, 10)) < 0 ||
bat == endptr || batnum > numbatts) {
fprintf(stderr, "Wrong battery unit requested\n", bat);
return -1;
}
return batnum;
}
int get_battery_perct(const char *bat)
{
/* not implemented */
return 0;
union acpi_battery_ioctl_arg battio;
int batnum, numbatts, acpifd;
int designcap, lastfulcap, batperct;
if ((battio.unit = batnum = check_bat(bat)) < 0)
return 0;
if ((acpifd = open("/dev/acpi", O_RDONLY)) < 0) {
fprintf(stderr, "Can't open ACPI device\n");
return 0;
}
if (ioctl(acpifd, ACPIIO_BATT_GET_BIF, &battio) == -1) {
fprintf(stderr, "Unable to get info for battery unit %d\n", batnum);
return 0;
}
close(acpifd);
designcap = battio.bif.dcap;
lastfulcap = battio.bif.lfcap;
batperct = (designcap > 0 && lastfulcap > 0) ?
(int) (((float) lastfulcap / designcap) * 100) : 0;
return batperct > 100 ? 100 : batperct;
}
int get_battery_perct_bar(const char *bar)
{
/* not implemented */
return 0;
}
int open_sysfs_sensor(const char *dir, const char *dev, const char *type,
int n, int *div, char *devtype)
{
return 0;
int batperct = get_battery_perct(bar);
return (int)(batperct * 2.56 - 1);
}
int open_acpi_temperature(const char *name)
{
/* Not applicable for FreeBSD. */
return 0;
}
@ -640,21 +660,19 @@ cleanup:
void update_diskio()
{
int devs_count, num_selected, num_selections, i;
int devs_count, num_selected, num_selections;
struct device_selection *dev_select = NULL;
long select_generation;
int dn;
static struct statinfo statinfo_cur;
u_int64_t diskio_current = 0;
u_int64_t writes = 0;
struct diskio_stat *cur;
bzero(&statinfo_cur, sizeof(statinfo_cur));
statinfo_cur.dinfo = (struct devinfo *) malloc(sizeof(struct devinfo));
bzero(statinfo_cur.dinfo, sizeof(struct devinfo));
statinfo_cur.dinfo = (struct devinfo *)calloc(1, sizeof(struct devinfo));
stats.current = stats.current_read = stats.current_write = 0;
if (devstat_getdevs(NULL, &statinfo_cur) < 0) {
if (devstat_getdevs(NULL, &statinfo_cur) < 0)
return;
}
devs_count = statinfo_cur.dinfo->numdevs;
if (devstat_selectdevs(&dev_select, &num_selected, &num_selections,
@ -668,33 +686,30 @@ void update_diskio()
di = dev_select[dn].position;
dev = &statinfo_cur.dinfo->devices[di];
diskio_current += dev->bytes[DEVSTAT_READ] + dev->bytes[DEVSTAT_WRITE];
for (i = 0; i < MAX_DISKIO_STATS; i++) {
if (diskio_stats[i].dev && strcmp(dev_select[dn].device_name,
diskio_stats[i].dev) == 0) {
diskio_stats[i].current = (dev->bytes[DEVSTAT_READ] +
dev->bytes[DEVSTAT_WRITE] - diskio_stats[i].last) / 1024;
diskio_stats[i].current_read = (dev->bytes[DEVSTAT_READ] -
diskio_stats[i].last_read) / 1024;
diskio_stats[i].current_write = (dev->bytes[DEVSTAT_WRITE] -
diskio_stats[i].last_write) / 1024;
if (dev->bytes[DEVSTAT_READ] + dev->bytes[DEVSTAT_WRITE]
< diskio_stats[i].last) {
diskio_stats[i].current = 0;
for (cur = stats.next; cur; cur = cur->next) {
if (cur->dev && !strcmp(dev_select[dn].device_name, cur->dev)) {
cur->current = (dev->bytes[DEVSTAT_READ] +
dev->bytes[DEVSTAT_WRITE] - cur->last) / 1024;
cur->current_read = (dev->bytes[DEVSTAT_READ] -
cur->last_read) / 1024;
cur->current_write = (dev->bytes[DEVSTAT_WRITE] -
cur->last_write) / 1024;
if (dev->bytes[DEVSTAT_READ] + dev->bytes[DEVSTAT_WRITE] <
cur->last) {
cur->current = 0;
}
if (dev->bytes[DEVSTAT_READ] < diskio_stats[i].last_read) {
diskio_stats[i].current_read = 0;
diskio_stats[i].current = diskio_stats[i].current_write;
if (dev->bytes[DEVSTAT_READ] < cur->last_read) {
cur->current_read = 0;
cur->current = cur->current_write;
}
if (dev->bytes[DEVSTAT_WRITE] < diskio_stats[i].last_write) {
diskio_stats[i].current_write = 0;
diskio_stats[i].current = diskio_stats[i].current_read;
if (dev->bytes[DEVSTAT_WRITE] < cur->last_write) {
cur->current_write = 0;
cur->current = cur->current_read;
}
diskio_stats[i].last = dev->bytes[DEVSTAT_READ] +
cur->last = dev->bytes[DEVSTAT_READ] +
dev->bytes[DEVSTAT_WRITE];
diskio_stats[i].last_read = dev->bytes[DEVSTAT_READ];
diskio_stats[i].last_write = dev->bytes[DEVSTAT_WRITE];
cur->last_read = dev->bytes[DEVSTAT_READ];
cur->last_write = dev->bytes[DEVSTAT_WRITE];
}
}
}
@ -702,29 +717,16 @@ void update_diskio()
free(dev_select);
}
/* Since we return (diskio_total_current - diskio_total_old),
* the first frame will be way too high
* (it will be equal to diskio_total_current, i.e. all disk I/O since boot).
* That's why it is better to return 0 first time; */
if (diskio_setup == 0) {
diskio_setup = 1;
info.diskio_value = 0;
} else {
info.diskio_value = (unsigned int) ((diskio_current - diskio_prev) / 1024);
}
diskio_prev = diskio_current;
free(statinfo_cur.dinfo);
}
void clear_diskio_stats()
{
unsigned i;
for(i = 0; i < MAX_DISKIO_STATS; i++) {
if (diskio_stats[i].dev) {
free(diskio_stats[i].dev);
diskio_stats[i].dev = 0;
}
struct diskio_stat *cur;
while (stats.next) {
cur = stats.next;
stats.next = stats.next->next;
free(cur);
}
}
@ -732,36 +734,33 @@ struct diskio_stat *prepare_diskio_stat(const char *s)
{
struct diskio_stat *new = 0;
struct stat sb;
unsigned i;
FILE *fp;
int found = 0;
char device[text_buffer_size], fbuf[text_buffer_size];
static int rep = 0;
/* lookup existing or get new */
for (i = 0; i < MAX_DISKIO_STATS; i++) {
if (diskio_stats[i].dev) {
if (strcmp(diskio_stats[i].dev, s) == 0) {
return &diskio_stats[i];
}
} else {
new = &diskio_stats[i];
break;
}
struct diskio_stat *cur = &stats;
if (!s)
return cur;
while (cur->next) {
cur = cur->next;
if (!strcmp(cur->dev, s))
return cur;
}
/* new dev */
if (!new) {
ERR("too many diskio stats");
return 0;
}
if (new->dev) {
free(new->dev);
new->dev = 0;
if (!(cur->next = calloc(1, sizeof(struct diskio_stat)))) {
ERR("out of memory allocating new disk stats struct");
return NULL;
}
cur = cur->next;
cur->last = cur->last_read = cur->last_write = UINT_MAX;
if (strncmp(s, "/dev/", 5) == 0) {
// supplied a /dev/device arg, so cut off the /dev part
new->dev = strndup(s + 5, text_buffer_size);
cur->dev = strndup(s + 5, text_buffer_size);
} else {
new->dev = strndup(s, text_buffer_size);
cur->dev = strndup(s, text_buffer_size);
}
/*
* check that device actually exists
@ -772,13 +771,7 @@ struct diskio_stat *prepare_diskio_stat(const char *s)
ERR("diskio device '%s' does not exist", s);
return 0;
}
new->current = 0;
new->current_read = 0;
new ->current_write = 0;
new->last = UINT_MAX;
new->last_read = UINT_MAX;
new->last_write = UINT_MAX;
return new;
return cur;
}
/* While topless is obviously better, top is also not bad. */
@ -1020,9 +1013,24 @@ char *get_apm_battery_time()
#endif
void get_battery_short_status(char *buffer, unsigned int n, const char *bat)
{
get_battery_stuff(buffer, n, bat, BATTERY_STATUS);
if (0 == strncmp("charging", buffer, 8)) {
buffer[0] = 'C';
memmove(buffer + 1, buffer + 8, n - 8);
} else if (0 == strncmp("discharging", buffer, 11)) {
buffer[0] = 'D';
memmove(buffer + 1, buffer + 11, n - 11);
} else if (0 == strncmp("absent/on AC", buffer, 12)) {
buffer[0] = 'A';
memmove(buffer + 1, buffer + 12, n - 12);
}
}
void update_entropy(void)
{
/* mirrorbox: can you do anything equivalent in freebsd? -drphibes. */
/* Not applicable for FreeBSD as it uses the yarrow prng. */
}
/* empty stub so conky links */

View File

@ -7,7 +7,7 @@
* Please see COPYING for details
*
* Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*

View File

@ -7,7 +7,7 @@
* Please see COPYING for details
*
* Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*

View File

@ -8,7 +8,7 @@
*
* Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
* Copyright (c) 2007 Toni Spets
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*

View File

@ -8,7 +8,7 @@
*
* Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
* Copyright (c) 2007 Toni Spets
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*
@ -211,48 +211,6 @@ char *get_ioscheduler(char *disk)
return strndup("n/a", text_buffer_size);
}
int interface_up(const char *dev)
{
int fd;
struct ifreq ifr;
if ((fd = socket(PF_INET, SOCK_DGRAM, 0)) < 0) {
CRIT_ERR("could not create sockfd");
return 0;
}
strncpy(ifr.ifr_name, dev, IFNAMSIZ);
if (ioctl(fd, SIOCGIFFLAGS, &ifr)) {
/* if device does not exist, treat like not up */
if (errno != ENODEV)
perror("SIOCGIFFLAGS");
goto END_FALSE;
}
if (!(ifr.ifr_flags & IFF_UP)) /* iface is not up */
goto END_FALSE;
if (ifup_strictness == IFUP_UP)
goto END_TRUE;
if (!(ifr.ifr_flags & IFF_RUNNING))
goto END_FALSE;
if (ifup_strictness == IFUP_LINK)
goto END_TRUE;
if (ioctl(fd, SIOCGIFADDR, &ifr)) {
perror("SIOCGIFADDR");
goto END_FALSE;
}
if (((struct sockaddr_in *)&(ifr.ifr_ifru.ifru_addr))->sin_addr.s_addr)
goto END_TRUE;
END_FALSE:
close(fd);
return 0;
END_TRUE:
close(fd);
return 1;
}
#define COND_FREE(x) if(x) free(x); x = 0
#define SAVE_SET_STRING(x, y) \
if (x && strcmp((char *)x, (char *)y)) { \

View File

@ -20,7 +20,6 @@ struct i8k_struct {
struct i8k_struct i8k;
int interface_up(const char *dev);
char *get_ioscheduler(char *);
int get_laptop_mode(void);
void update_gateway_info(void);
@ -28,4 +27,16 @@ void update_gateway_info(void);
enum { PB_BATT_STATUS, PB_BATT_PERCENT, PB_BATT_TIME };
void get_powerbook_batt_info(char *, size_t, int);
int open_sysfs_sensor(const char *dir, const char *dev, const char *type, int n,
int *divisor, char *devtype);
#define open_i2c_sensor(dev, type, n, divisor, devtype) \
open_sysfs_sensor("/sys/bus/i2c/devices/", dev, type, n, divisor, devtype)
#define open_platform_sensor(dev, type, n, divisor, devtype) \
open_sysfs_sensor("/sys/bus/platform/devices/", dev, type, n, divisor, devtype)
#define open_hwmon_sensor(dev, type, n, divisor, devtype) \
open_sysfs_sensor("/sys/class/hwmon/", dev, type, n, divisor, devtype)
double get_sysfs_info(int *fd, int arg, char *devtype, char *type);
#endif /* _LINUX_H */

View File

@ -7,7 +7,7 @@
* Please see COPYING for details
*
* Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*

View File

@ -7,7 +7,7 @@
* Please see COPYING for details
*
* Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*
@ -36,6 +36,7 @@
#include <string.h>
#include <unistd.h>
#include <limits.h>
#include <netinet/in.h>
#include <netdb.h>
#include <sys/socket.h>
#include <sys/stat.h>
@ -280,6 +281,7 @@ struct mail_s *parse_mail_args(char type, const char *arg)
} else if (type == IMAP_TYPE) {
ERR("Scanning POP3 args failed");
}
return 0;
}
// see if password needs prompting
if (mail->pass[0] == '*' && mail->pass[1] == '\0') {

View File

@ -2,6 +2,7 @@
#define _MAIL_H
#include "timed_thread.h"
#include <time.h>
extern char *current_mail_spool;

View File

@ -7,7 +7,7 @@
* Please see COPYING for details
*
* Copyright (c) 2006 Marco Candrian <mac@calmar.ws>
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*

View File

@ -7,7 +7,7 @@
* Please see COPYING for details
*
* Copyright (c) 2006 Marco Candrian <mac@calmar.ws>
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*

View File

@ -7,7 +7,7 @@
* Please see COPYING for details
*
* Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*
@ -30,8 +30,12 @@
#include <sys/ioctl.h>
#include <errno.h>
#include <fcntl.h>
#include <ctype.h>
#ifdef MIXER_IS_ALSA
#include <alsa/asoundlib.h>
#else
#ifdef HAVE_LINUX_SOUNDCARD_H
#include <linux/soundcard.h>
#else
@ -41,12 +45,168 @@
#include <sys/soundcard.h>
#endif /* __OpenBSD__ */
#endif /* HAVE_LINUX_SOUNDCARD_H */
#endif /* MIXER_IS_ALSA */
#define MIXER_DEV "/dev/mixer"
#ifdef MIXER_IS_ALSA
#define MAX_MIXERS 8
struct mixer_control {
char name[64];
snd_mixer_t *mixer;
snd_mixer_selem_id_t *sid;
snd_mixer_elem_t *elem;
long vol_min, vol_max;
};
static struct mixer_control mixer_data[MAX_MIXERS];
int num_mixers = 0;
static char soundcard[64] = "default";
#else
static int mixer_fd;
static const char *devs[] = SOUND_DEVICE_NAMES;
#endif
#ifdef MIXER_IS_ALSA
static int parse_simple_id(const char *str, snd_mixer_selem_id_t *sid)
{
int c, size;
char buf[128];
char *ptr = buf;
while (*str == ' ' || *str == '\t')
str++;
if (!(*str))
return -EINVAL;
size = 1; /* for '\0' */
if (*str != '"' && *str != '\'') {
while (*str && *str != ',') {
if (size < (int)sizeof(buf)) {
*ptr++ = *str;
size++;
}
str++;
}
} else {
c = *str++;
while (*str && *str != c) {
if (size < (int)sizeof(buf)) {
*ptr++ = *str;
size++;
}
str++;
}
if (*str == c)
str++;
}
if (*str == '\0') {
snd_mixer_selem_id_set_index(sid, 0);
*ptr = 0;
goto _set;
}
if (*str != ',')
return -EINVAL;
*ptr = 0; /* terminate the string */
str++;
if (!isdigit(*str))
return -EINVAL;
snd_mixer_selem_id_set_index(sid, atoi(str));
_set:
snd_mixer_selem_id_set_name(sid, buf);
return 0;
}
int mixer_init (const char *name)
{
/* from amixer.c, replaced -EINVAL with -1 */
int i, err;
if (!name)
name = "Master";
for (i = 0; i < num_mixers; i++) {
if (!strcasecmp (mixer_data[i].name, name)) {
return i;
}
}
if (i == MAX_MIXERS) {
fprintf (stderr, "max mixers (%d) reached\n", MAX_MIXERS);
return -1;
};
num_mixers++;
#define data mixer_data[i]
strncpy (mixer_data[i].name, name, 63);
mixer_data[i].name[63] = '\0';
snd_mixer_selem_id_alloca (&data.sid);
data.mixer = NULL;
if (parse_simple_id (name, data.sid) < 0) {
fprintf (stderr, "Wrong mixer identifier: %s\n", name);
return -1;
}
if ((err = snd_mixer_open (&data.mixer, 0)) < 0) {
fprintf (stderr, "snd_mixer_open: %s\n", snd_strerror (err));
return -1;
}
if ((err = snd_mixer_attach (data.mixer, soundcard)) < 0) {
fprintf (stderr, "snd_mixer_attach: %s\n", snd_strerror (err));
return -1;
}
if ((err = snd_mixer_selem_register (data.mixer, NULL, NULL)) < 0) {
fprintf (stderr, "snd_mixer_selem_register: %s\n",
snd_strerror (err));
return -1;
}
if ((err = snd_mixer_load (data.mixer)) < 0) {
fprintf (stderr, "snd_mixer_load: %s\n", snd_strerror (err));
return -1;
}
if (!(data.elem = snd_mixer_find_selem (data.mixer, data.sid))) {
fprintf (stderr, "snd_mixer_find_selem (\"%s\", %i)\n",
snd_mixer_selem_id_get_name (data.sid),
snd_mixer_selem_id_get_index (data.sid));
return -1;
}
snd_mixer_selem_get_playback_volume_range(data.elem, &data.vol_min, &data.vol_max);
return i;
}
int mixer_get_avg (int i)
{
long val;
snd_mixer_handle_events (data.mixer);
snd_mixer_selem_get_playback_volume (data.elem, 0, &val);
return (int) val;
}
int mixer_get_left (int i)
{
/* stub */
return mixer_get_avg (i);
}
int mixer_get_right (int i)
{
/* stub */
return mixer_get_avg (i);
}
int mixer_to_255(int i, int x)
{
return (x-data.vol_min)*255/(data.vol_max-data.vol_min);
}
int mixer_is_mute(int i)
{
snd_mixer_handle_events (data.mixer);
if (snd_mixer_selem_has_playback_switch (data.elem)) {
int val, err;
if ((err = snd_mixer_selem_get_playback_switch(data.elem, 0, &val)) < 0)
fprintf (stderr, "playback_switch: %s\n", snd_strerror (err));
return !val;
} else {
return !mixer_get_avg(i);
}
}
#undef data
#else
int mixer_init(const char *name)
{
unsigned int i;
@ -106,3 +266,8 @@ int mixer_get_right(int i)
{
return mixer_get(i) & 0xFF;
}
int mixer_is_mute(int i)
{
return !mixer_get(i);
}
#endif

View File

@ -1,9 +1,17 @@
#ifndef MIXER_H_
#define MIXER_H_
#ifdef MIXER_IS_ALSA
int mixer_to_255(int, int);
#else
#define mixer_to_255(l,x) x
#endif
int mixer_init(const char *);
int mixer_get_avg(int);
int mixer_get_left(int);
int mixer_get_right(int);
int mixer_is_mute(int);
#endif /*MIXER_H_*/

View File

@ -6,7 +6,7 @@
*
* Please see COPYING for details
*
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*
@ -132,8 +132,6 @@ static void *update_mpd_thread(void *arg)
const char *emptystr = "";
while (1) {
clear_mpd();
if (!conn)
conn = mpd_newConnection(mpd_host, mpd_port, 10);
@ -248,7 +246,13 @@ static void *update_mpd_thread(void *arg)
mpd_freeInfoEntity(entity);
continue;
}
#define SONGSET(x) if(song->x) mpd_info.x = strmdup(song->x); else mpd_info.x = strmdup(emptystr)
#define SONGSET(x) { \
free(mpd_info.x); \
if(song->x) \
mpd_info.x = strmdup(song->x); \
else \
mpd_info.x = strmdup(emptystr); \
}
SONGSET(artist);
SONGSET(album);
SONGSET(title);

View File

@ -7,7 +7,7 @@
* Please see COPYING for details
*
* Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*
@ -302,11 +302,6 @@ void update_cpu_usage()
oldtotal = total;
}
double get_sysfs_info(int *fd, int div, char *devtype)
{
return -1;
}
void update_load_average()
{
double v[3];
@ -327,12 +322,6 @@ void get_battery_stuff(char *buf, unsigned int n, const char *bat, int item)
{
}
int open_sysfs_sensor(const char *dir, const char *dev, const char *type, int n,
int *div, char *devtype)
{
return -1;
}
int open_acpi_temperature(const char *name)
{
return -1;

View File

@ -7,7 +7,7 @@
* Please see COPYING for details
*
* Copyright (c) 2008 Markus Meissner
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*

View File

@ -7,7 +7,7 @@
* Please see COPYING for details
*
* Copyright (c) 2008 Markus Meissner
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*

View File

@ -7,7 +7,7 @@
* Please see COPYING for details
*
* Copyright (c) 2007 Toni Spets
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*

View File

@ -7,7 +7,7 @@
* Please see COPYING for details
*
* Copyright (c) 2007 Toni Spets
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*

View File

@ -6,7 +6,7 @@
*
* Please see COPYING for details
*
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*

View File

@ -7,7 +7,7 @@
* Please see COPYING for details
*
* Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*
@ -42,6 +42,10 @@ struct special_t *specials = NULL;
unsigned int special_count;
int default_bar_width = 0, default_bar_height = 6;
int default_graph_width = 0, default_graph_height = 25;
int default_gauge_width = 50, default_gauge_height = 25;
/*
* Scanning arguments to various special text objects
*/
@ -49,8 +53,8 @@ unsigned int special_count;
const char *scan_gauge(const char *args, int *w, int *h)
{
/*width and height*/
*w = 25;
*h = 25;
*w = default_gauge_width;
*h = default_gauge_height;
/* gauge's argument is either height or height,width */
if (args) {
@ -69,8 +73,8 @@ const char *scan_gauge(const char *args, int *w, int *h)
const char *scan_bar(const char *args, int *w, int *h)
{
/* zero width means all space that is available */
*w = 0;
*h = 6;
*w = default_bar_width;
*h = default_bar_height;
/* bar's argument is either height or height,width */
if (args) {
int n = 0;
@ -102,8 +106,8 @@ char *scan_graph(const char *args, int *w, int *h,
buf[0] = 0;
/* zero width means all space that is available */
*w = 0;
*h = 25;
*w = default_graph_width;
*h = default_graph_height;
*first_colour = 0;
*last_colour = 0;
*scale = 0;

View File

@ -7,7 +7,7 @@
* Please see COPYING for details
*
* Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*
@ -76,6 +76,13 @@ struct special_t {
extern struct special_t *specials;
extern unsigned int special_count;
extern int default_bar_width;
extern int default_bar_height;
extern int default_graph_width;
extern int default_graph_height;
extern int default_gauge_width;
extern int default_gauge_height;
/* max number of specials allowed (TODO: use linked list instead) */
extern unsigned int max_specials;

View File

@ -7,7 +7,7 @@
* Please see COPYING for details
*
* Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*

View File

@ -7,7 +7,7 @@
* Please see COPYING for details
*
* Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*

View File

@ -6,8 +6,7 @@
*
* Please see COPYING for details
*
* Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*

View File

@ -7,7 +7,7 @@
* Please see COPYING for details
*
* Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*
@ -91,6 +91,7 @@ enum text_object_type {
OBJ_downspeedgraph,
OBJ_else,
OBJ_endif,
OBJ_eval,
OBJ_image,
OBJ_exec,
OBJ_execi,
@ -100,6 +101,7 @@ enum text_object_type {
OBJ_execgraph,
OBJ_execibar,
OBJ_execigraph,
OBJ_execigauge,
OBJ_execp,
OBJ_execpi,
OBJ_freq,
@ -146,7 +148,6 @@ enum text_object_type {
OBJ_smapi_bat_power,
OBJ_if_smapi_bat_installed,
#endif /* IBM */
OBJ_if_up,
OBJ_if_gw,
OBJ_ioscheduler,
OBJ_gw_iface,
@ -164,6 +165,9 @@ enum text_object_type {
OBJ_wireless_link_qual_perc,
OBJ_wireless_link_bar,
#endif /* __linux__ */
#if defined(__FreeBSD__) || defined(__linux__)
OBJ_if_up,
#endif
OBJ_if_empty,
OBJ_if_match,
OBJ_if_existing,
@ -201,14 +205,13 @@ enum text_object_type {
OBJ_memgraph,
OBJ_memmax,
OBJ_memperc,
OBJ_mem_res,
OBJ_mem_vsize,
OBJ_mixer,
OBJ_mixerl,
OBJ_mixerr,
OBJ_mixerbar,
OBJ_mixerlbar,
OBJ_mixerrbar,
OBJ_if_mixer_mute,
#ifdef X11
OBJ_monitor,
OBJ_monitor_number,
@ -227,8 +230,6 @@ enum text_object_type {
OBJ_swapmax,
OBJ_swapperc,
OBJ_sysname,
OBJ_temp1, /* i2c is used instead in these */
OBJ_temp2,
OBJ_text,
OBJ_time,
OBJ_utime,
@ -245,10 +246,8 @@ enum text_object_type {
OBJ_user_terms,
OBJ_user_times,
OBJ_user_number,
OBJ_imap,
OBJ_imap_messages,
OBJ_imap_unseen,
OBJ_pop3,
OBJ_pop3_unseen,
OBJ_pop3_used,
#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) \
@ -273,9 +272,6 @@ enum text_object_type {
OBJ_mpd_vol,
OBJ_mpd_bitrate,
OBJ_mpd_status,
OBJ_mpd_host,
OBJ_mpd_port,
OBJ_mpd_password,
OBJ_mpd_bar,
OBJ_mpd_elapsed,
OBJ_mpd_length,
@ -299,7 +295,6 @@ enum text_object_type {
OBJ_moc_bitrate,
OBJ_moc_rate,
#endif
OBJ_music_player_interval,
#ifdef XMMS2
OBJ_xmms2_artist,
OBJ_xmms2_album,
@ -363,6 +358,7 @@ enum text_object_type {
OBJ_hddtemp,
#endif
OBJ_scroll,
OBJ_combine,
OBJ_entropy_avail,
OBJ_entropy_poolsize,
OBJ_entropy_bar
@ -478,6 +474,7 @@ struct text_object {
char *action;
int act_par;
int delay;
unsigned int nrspaces;
} rss;
#endif
struct {
@ -487,6 +484,12 @@ struct text_object {
unsigned int start;
} scroll;
struct {
char *left;
char *seperation;
char *right;
} combine;
struct local_mail_s local_mail;
#ifdef NVIDIA
struct nvidia_s nvidia;

View File

@ -8,7 +8,7 @@
*
* Copyright (c) 2005 Adi Zaimi, Dan Piponi <dan@tanelorn.demon.co.uk>,
* Dave Clark <clarkd@skynet.ca>
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*

View File

@ -8,7 +8,7 @@
*
* Copyright (c) 2005 Adi Zaimi, Dan Piponi <dan@tanelorn.demon.co.uk>,
* Dave Clark <clarkd@skynet.ca>
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*

View File

@ -7,7 +7,7 @@
* Please see COPYING for details
*
* Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*

View File

@ -7,7 +7,7 @@
* Please see COPYING for details
*
* Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*
@ -73,9 +73,9 @@ static Window find_desktop_window(Window *p_root, Window *p_desktop);
static Window find_subwindow(Window win, int w, int h);
/* X11 initializer */
void init_X11(void)
void init_X11(const char *disp)
{
if ((display = XOpenDisplay(0)) == NULL) {
if ((display = XOpenDisplay(disp)) == NULL) {
CRIT_ERR("can't open display: %s", XDisplayName(0));
}

View File

@ -76,7 +76,7 @@ extern int workarea[4];
extern struct conky_window window;
void init_X11(void);
void init_X11(const char*);
void init_window(int use_own_window, int width, int height, int set_trans,
int back_colour, char **argv, int argc);
void create_gc(void);

View File

@ -6,7 +6,7 @@
*
* Please see COPYING for details
*
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*
@ -25,60 +25,46 @@
*/
#include "conky.h"
#include <xmmsclient/xmmsclient.h>
xmms_socket_t xmms2_fd;
fd_set xmms2_fdset;
xmmsc_connection_t *xmms2_conn;
#define CONN_INIT 0
#define CONN_OK 1
#define CONN_NO 2
/* callbacks */
static void xmms_alloc(struct information *ptr)
{
if (ptr->xmms2.status == NULL) {
ptr->xmms2.status = malloc(text_buffer_size);
ptr->xmms2.status[0] = '\0';
}
if (ptr->xmms2.artist == NULL) {
ptr->xmms2.artist = malloc(text_buffer_size);
ptr->xmms2.artist[0] = '\0';
}
if (ptr->xmms2.album == NULL) {
ptr->xmms2.album = malloc(text_buffer_size);
ptr->xmms2.album[0] = '\0';
}
if (ptr->xmms2.title == NULL) {
ptr->xmms2.title = malloc(text_buffer_size);
ptr->xmms2.title[0] = '\0';
}
if (ptr->xmms2.genre == NULL) {
ptr->xmms2.genre = malloc(text_buffer_size);
ptr->xmms2.genre[0] = '\0';
}
if (ptr->xmms2.comment == NULL) {
ptr->xmms2.comment = malloc(text_buffer_size);
ptr->xmms2.comment[0] = '\0';
}
if (ptr->xmms2.url == NULL) {
ptr->xmms2.url = malloc(text_buffer_size);
ptr->xmms2.url[0] = '\0';
}
if (ptr->xmms2.date == NULL) {
ptr->xmms2.date = malloc(text_buffer_size);
ptr->xmms2.date[0] = '\0';
}
}
static void xmms_clear(struct information *ptr)
{
xmms_alloc(ptr);
ptr->xmms2.artist[0] = '\0';
ptr->xmms2.album[0] = '\0';
ptr->xmms2.title[0] = '\0';
@ -100,138 +86,133 @@ static void xmms_clear(struct information *ptr)
void connection_lost(void *p)
{
struct information *ptr = p;
ptr->xmms2_conn_state = CONN_NO;
ptr->xmms2.conn_state = CONN_NO;
fprintf(stderr,PACKAGE_NAME": xmms2 connection failed. %s\n",
xmmsc_get_last_error ( ptr->xmms2_conn ));
fflush(stderr);
fprintf(stderr,"XMMS2 connection failed. %s\n", xmmsc_get_last_error(xmms2_conn));
xmms_clear(ptr);
xmms_alloc(ptr);
strncpy(ptr->xmms2.status, "Disocnnected", text_buffer_size - 1);
ptr->xmms2.playlist[0] = '\0';
ptr->xmms2.id = 0;
}
void handle_curent_id(xmmsc_result_t *res, void *p)
int handle_curent_id(xmmsv_t *value, void *p)
{
uint current_id;
struct information *ptr = p;
xmmsv_t *val, *infos, *dict_entry;
xmmsc_result_t *res;
const char *errbuf;
int current_id;
if (xmmsc_result_get_uint(res, &current_id)) {
const char *charval;
int intval;
xmmsc_result_t *res2;
res2 = xmmsc_medialib_get_info(ptr->xmms2_conn, current_id);
xmmsc_result_wait(res2);
if (xmmsv_get_error(value, &errbuf)) {
fprintf(stderr,"XMMS2 server error. %s\n", errbuf);
return TRUE;
}
if (xmmsv_get_int(value, &current_id) && current_id > 0) {
res = xmmsc_medialib_get_info(xmms2_conn, current_id);
xmmsc_result_wait(res);
val = xmmsc_result_get_value(res);
if (xmmsv_get_error(val, &errbuf)) {
fprintf(stderr,"XMMS2 server error. %s\n", errbuf);
return TRUE;
}
xmms_alloc(ptr);
xmms_clear(ptr);
ptr->xmms2.id = current_id;
char *temp;
infos = xmmsv_propdict_to_dict(val, NULL);
xmmsc_result_get_dict_entry_string(res2, "artist", &temp);
if (temp != NULL) {
strncpy(ptr->xmms2.artist, temp, text_buffer_size - 1);
} else {
strncpy(ptr->xmms2.artist, "[Unknown]", text_buffer_size - 1);
}
if (xmmsv_dict_get(infos, "artist", &dict_entry) && xmmsv_get_string(dict_entry, &charval))
strncpy(ptr->xmms2.artist, charval, text_buffer_size - 1);
xmmsc_result_get_dict_entry_string(res2, "title", &temp);
if (temp != NULL) {
strncpy(ptr->xmms2.title, temp, text_buffer_size - 1);
} else {
strncpy(ptr->xmms2.title, "[Unknown]", text_buffer_size - 1);
}
if (xmmsv_dict_get(infos, "title", &dict_entry) && xmmsv_get_string(dict_entry, &charval))
strncpy(ptr->xmms2.title, charval, text_buffer_size - 1);
if (xmmsv_dict_get(infos, "album", &dict_entry) && xmmsv_get_string(dict_entry, &charval))
strncpy(ptr->xmms2.album, charval, text_buffer_size - 1);
if (xmmsv_dict_get(infos, "genre", &dict_entry) && xmmsv_get_string(dict_entry, &charval))
strncpy(ptr->xmms2.genre, charval, text_buffer_size - 1);
xmmsc_result_get_dict_entry_string(res2, "album", &temp);
if (temp != NULL) {
strncpy(ptr->xmms2.album, temp, text_buffer_size - 1);
} else {
strncpy(ptr->xmms2.album, "[Unknown]", text_buffer_size - 1);
}
if (xmmsv_dict_get(infos, "comment", &dict_entry) && xmmsv_get_string(dict_entry, &charval))
strncpy(ptr->xmms2.comment, charval, text_buffer_size - 1);
xmmsc_result_get_dict_entry_string(res2, "genre", &temp);
if (temp != NULL) {
if (xmmsv_dict_get(infos, "url", &dict_entry) && xmmsv_get_string(dict_entry, &charval))
strncpy(ptr->xmms2.url, charval, text_buffer_size - 1);
strncpy(ptr->xmms2.genre, temp, text_buffer_size - 1);
} else {
strncpy(ptr->xmms2.genre, "[Unknown]", text_buffer_size - 1);
}
if (xmmsv_dict_get(infos, "date", &dict_entry) && xmmsv_get_string(dict_entry, &charval))
strncpy(ptr->xmms2.date, charval, text_buffer_size - 1);
xmmsc_result_get_dict_entry_string(res2, "comment", &temp);
if (temp != NULL) {
strncpy(ptr->xmms2.comment, temp, text_buffer_size - 1);
} else {
strncpy(ptr->xmms2.comment, "", text_buffer_size - 1);
}
xmmsc_result_get_dict_entry_string(res2, "url", &temp);
if (temp != NULL) {
strncpy(ptr->xmms2.url, temp, text_buffer_size - 1);
} else {
strncpy(ptr->xmms2.url, "[Unknown]", text_buffer_size - 1);
}
if (xmmsv_dict_get(infos, "tracknr", &dict_entry) && xmmsv_get_int(dict_entry, &intval))
ptr->xmms2.tracknr = intval;
xmmsc_result_get_dict_entry_string(res2, "date", &temp);
if (temp != NULL) {
strncpy(ptr->xmms2.date, temp, text_buffer_size - 1);
} else {
strncpy(ptr->xmms2.date, "????", text_buffer_size - 1);
}
if (xmmsv_dict_get(infos, "duration", &dict_entry) && xmmsv_get_int(dict_entry, &intval))
ptr->xmms2.duration = intval;
int itemp;
if (xmmsv_dict_get(infos, "bitrate", &dict_entry) && xmmsv_get_int(dict_entry, &intval))
ptr->xmms2.bitrate = intval / 1000;
xmmsc_result_get_dict_entry_int(res2, "tracknr", &itemp);
ptr->xmms2.tracknr = itemp;
if (xmmsv_dict_get(infos, "size", &dict_entry) && xmmsv_get_int(dict_entry, &intval))
ptr->xmms2.size = (float) intval / 1048576;
xmmsc_result_get_dict_entry_int(res2, "duration", &itemp);
ptr->xmms2.duration = itemp;
if (xmmsv_dict_get(infos, "timesplayed", &dict_entry) && xmmsv_get_int(dict_entry, &intval))
ptr->xmms2.timesplayed = intval;
xmmsc_result_get_dict_entry_int(res2, "bitrate", &itemp);
ptr->xmms2.bitrate = itemp / 1000;
xmmsc_result_get_dict_entry_int(res2, "size", &itemp);
ptr->xmms2.size = (float) itemp / 1048576;
xmmsc_result_get_dict_entry_int( res2, "timesplayed", &itemp );
ptr->xmms2.timesplayed = itemp;
xmmsc_result_unref(res2);
xmmsv_unref(infos);
xmmsc_result_unref(res);
}
return TRUE;
}
void handle_playtime(xmmsc_result_t *res, void *p)
int handle_playtime(xmmsv_t *value, void *p)
{
struct information *ptr = p;
xmmsc_result_t *res2;
uint play_time;
int play_time;
const char *errbuf;
if (xmmsc_result_iserror(res)) {
return;
if (xmmsv_get_error(value, &errbuf)) {
fprintf(stderr,"XMMS2 server error. %s\n", errbuf);
return TRUE;
}
if (!xmmsc_result_get_uint(res, &play_time)) {
return;
if (xmmsv_get_int(value, &play_time)) {
ptr->xmms2.elapsed = play_time;
ptr->xmms2.progress = (float) play_time / ptr->xmms2.duration;
}
res2 = xmmsc_result_restart(res);
xmmsc_result_unref(res2);
ptr->xmms2.elapsed = play_time;
ptr->xmms2.progress = (float) play_time / ptr->xmms2.duration;
return TRUE;
}
void handle_playback_state_change(xmmsc_result_t *res, void *p)
int handle_playback_state_change(xmmsv_t *value, void *p)
{
struct information *ptr = p;
uint pb_state = 0;
int pb_state = 0;
const char *errbuf;
if (xmmsc_result_iserror(res)) {
return;
if (xmmsv_get_error(value, &errbuf)) {
fprintf(stderr,"XMMS2 server error. %s\n", errbuf);
return TRUE;
}
if (!xmmsc_result_get_uint(res, &pb_state)) {
return;
if (ptr->xmms2.status == NULL) {
ptr->xmms2.status = malloc(text_buffer_size);
ptr->xmms2.status[0] = '\0';
}
if (xmmsv_get_int(value, &pb_state)) {
switch (pb_state) {
case XMMS_PLAYBACK_STATUS_PLAY:
strncpy(ptr->xmms2.status, "Playing", text_buffer_size - 1);
@ -245,20 +226,29 @@ void handle_playback_state_change(xmmsc_result_t *res, void *p)
default:
strncpy(ptr->xmms2.status, "Unknown", text_buffer_size - 1);
}
}
return TRUE;
}
void handle_playlist_loaded(xmmsc_result_t *res, void *p) {
int handle_playlist_loaded(xmmsv_t *value, void *p)
{
struct information *ptr = p;
const char *c, *errbuf;
if (xmmsv_get_error(value, &errbuf)) {
fprintf(stderr,"XMMS2 server error. %s\n", errbuf);
return TRUE;
}
if (ptr->xmms2.playlist == NULL) {
ptr->xmms2.playlist = malloc(text_buffer_size);
ptr->xmms2.playlist[0] = '\0';
}
if (!xmmsc_result_get_string(res, &ptr->xmms2.playlist)) {
ptr->xmms2.playlist[0] = '\0';
if (xmmsv_get_string(value, &c)) {
strncpy(ptr->xmms2.playlist, c, text_buffer_size - 1);
}
return TRUE;
}
void update_xmms2()
@ -266,82 +256,91 @@ void update_xmms2()
struct information *current_info = &info;
/* initialize connection */
if (current_info->xmms2_conn_state == CONN_INIT) {
if (current_info->xmms2.conn_state == CONN_INIT) {
if (current_info->xmms2_conn == NULL) {
current_info->xmms2_conn = xmmsc_init(PACKAGE);
if (xmms2_conn == NULL) {
xmms2_conn = xmmsc_init(PACKAGE);
}
/* did init fail? */
if (current_info->xmms2_conn == NULL) {
fprintf(stderr, PACKAGE_NAME": xmms2 init failed. %s\n",
xmmsc_get_last_error(current_info->xmms2_conn));
fflush(stderr);
if (xmms2_conn == NULL) {
fprintf(stderr,"XMMS2 init failed. %s\n", xmmsc_get_last_error(xmms2_conn));
return;
}
/* init ok but not connected yet.. */
current_info->xmms2_conn_state = CONN_NO;
current_info->xmms2.conn_state = CONN_NO;
/* clear all values */
xmms_clear(current_info);
/* fprintf(stderr, PACKAGE_NAME": xmms2 init ok.\n");
fflush(stderr); */
xmms_alloc(current_info);
}
/* connect */
if (current_info->xmms2_conn_state == CONN_NO) {
if (current_info->xmms2.conn_state == CONN_NO) {
char *path = getenv("XMMS_PATH");
if (!xmmsc_connect(current_info->xmms2_conn, path)) {
fprintf(stderr, PACKAGE_NAME": xmms2 connection failed. %s\n",
xmmsc_get_last_error(current_info->xmms2_conn));
fflush(stderr);
current_info->xmms2_conn_state = CONN_NO;
if (!xmmsc_connect(xmms2_conn, path)) {
fprintf(stderr,"XMMS2 connection failed. %s\n", xmmsc_get_last_error(xmms2_conn));
current_info->xmms2.conn_state = CONN_NO;
return;
}
/* set callbacks */
xmmsc_disconnect_callback_set(current_info->xmms2_conn, connection_lost,
current_info);
XMMS_CALLBACK_SET(current_info->xmms2_conn,
xmmsc_broadcast_playback_current_id, handle_curent_id,
current_info);
XMMS_CALLBACK_SET(current_info->xmms2_conn,
xmmsc_signal_playback_playtime, handle_playtime, current_info);
XMMS_CALLBACK_SET(current_info->xmms2_conn,
xmmsc_broadcast_playback_status, handle_playback_state_change,
current_info);
XMMS_CALLBACK_SET(current_info->xmms2_conn,
xmmsc_broadcast_playlist_loaded, handle_playlist_loaded,
current_info);
XMMS_CALLBACK_SET(current_info->xmms2_conn,
xmmsc_broadcast_medialib_entry_changed, handle_curent_id,
current_info);
xmmsc_disconnect_callback_set(xmms2_conn, connection_lost, current_info);
XMMS_CALLBACK_SET(xmms2_conn, xmmsc_broadcast_playback_current_id,
handle_curent_id, current_info);
XMMS_CALLBACK_SET(xmms2_conn, xmmsc_signal_playback_playtime,
handle_playtime, current_info);
XMMS_CALLBACK_SET(xmms2_conn, xmmsc_broadcast_playback_status,
handle_playback_state_change, current_info);
XMMS_CALLBACK_SET(xmms2_conn, xmmsc_broadcast_playlist_loaded,
handle_playlist_loaded, current_info);
/* get playback status, current id and active playlist */
XMMS_CALLBACK_SET(current_info->xmms2_conn,
xmmsc_playback_current_id, handle_curent_id, current_info);
XMMS_CALLBACK_SET(current_info->xmms2_conn,
xmmsc_playback_status, handle_playback_state_change, current_info);
XMMS_CALLBACK_SET(current_info->xmms2_conn,
xmmsc_playlist_current_active, handle_playlist_loaded, current_info);
XMMS_CALLBACK_SET(xmms2_conn, xmmsc_playback_current_id,
handle_curent_id, current_info);
XMMS_CALLBACK_SET(xmms2_conn, xmmsc_playback_status,
handle_playback_state_change, current_info);
XMMS_CALLBACK_SET(xmms2_conn, xmmsc_playlist_current_active,
handle_playlist_loaded, current_info);
/* everything seems to be ok */
current_info->xmms2_conn_state = CONN_OK;
/* fprintf(stderr, PACKAGE_NAME": xmms2 connected.\n");
fflush(stderr); */
current_info->xmms2.conn_state = CONN_OK;
}
/* handle callbacks */
if (current_info->xmms2_conn_state == CONN_OK) {
if (current_info->xmms2.conn_state == CONN_OK) {
struct timeval tmout;
tmout.tv_sec = 0;
tmout.tv_usec = 100;
xmmsc_io_in_handle(current_info->xmms2_conn);
if (xmmsc_io_want_out(current_info->xmms2_conn)) {
xmmsc_io_out_handle(current_info->xmms2_conn);
select(xmms2_fd + 1, &xmms2_fdset, NULL, NULL, &tmout);
xmmsc_io_in_handle(xmms2_conn);
if (xmmsc_io_want_out(xmms2_conn)) {
xmmsc_io_out_handle(xmms2_conn);
}
}
}
void free_xmms2()
{
struct information *current_info = &info;
current_info->xmms2.conn_state = -1;
free(current_info->xmms2.artist);
free(current_info->xmms2.album);
free(current_info->xmms2.title);
free(current_info->xmms2.genre);
free(current_info->xmms2.comment);
free(current_info->xmms2.url);
free(current_info->xmms2.date);
free(current_info->xmms2.playlist);
free(current_info->xmms2.status);
}

View File

@ -1,6 +1,34 @@
/* Conky, a system monitor, based on torsmo
*
* Any original torsmo code is licensed under the BSD license
*
* All code written since the fork of torsmo is licensed under the GPL
*
* Please see COPYING for details
*
* Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef XMMS2_H_
#define XMMS2_H_
#include <xmmsclient/xmmsclient.h>
struct xmms2_s {
char *artist;
char *album;
@ -9,7 +37,7 @@ struct xmms2_s {
char *comment;
char *url;
char *date;
char* playlist;
char *playlist;
int tracknr;
int bitrate;
unsigned int id;
@ -20,8 +48,10 @@ struct xmms2_s {
float progress;
char *status;
int conn_state;
};
void update_xmms2(void);
void free_xmms2(void);
#endif /*XMMS2_H_*/