Compare commits
48 Commits
Author | SHA1 | Date | |
---|---|---|---|
fe77fcb2fd | |||
d226629b45 | |||
413dbb2134 | |||
b11b4d2462 | |||
62dd94a294 | |||
12d506a16d | |||
363c4327ee | |||
a716269e79 | |||
c66b255e8b | |||
decf714e74 | |||
405dda5144 | |||
0f8b9dc627 | |||
6cf7792f9a | |||
1df3cf0def | |||
59ffe456de | |||
9b981cb3f0 | |||
f640eb58d7 | |||
e5648babfc | |||
c34e569603 | |||
f42fc1e97d | |||
b8fd9cd51f | |||
05b65679d9 | |||
284243f810 | |||
c0e1f9c094 | |||
3545b9c1f1 | |||
d66bafa816 | |||
e6bbea9c07 | |||
2ddf9082f2 | |||
65a60de9a5 | |||
1b5e2c7fea | |||
a3a5ebf2af | |||
0d3aacdec7 | |||
5bcf76a136 | |||
29da9b43f3 | |||
e2e511f083 | |||
ccaca2a725 | |||
916c32589f | |||
24325e2d3a | |||
9569400757 | |||
4d4317150a | |||
946c0ea874 | |||
ebb828dd4c | |||
f5fa6af1bc | |||
ddf1de6f8e | |||
4689a9054d | |||
4a841766e8 | |||
7d5803fec8 | |||
60f1cd8c58 |
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
sources/build
|
||||
sources/usr
|
||||
*-src.tar.xz
|
3
AUTHORS
Normal file
@ -0,0 +1,3 @@
|
||||
Current developers:
|
||||
|
||||
Evgeniy Alekseev aka arcanis <esalexeev (at) gmail (dot) com>
|
94
CHANGELOG
Normal file
@ -0,0 +1,94 @@
|
||||
Ver.1.7.0:
|
||||
+ added support of several tags in temperature label
|
||||
+ added tags $cpuN, $cpuclN, $hddN, $tempN, $hddtempN, $up, $down
|
||||
+ added label with custom command
|
||||
+ added tooltips for CPU, CPU clock, memory, swap and network labels
|
||||
- removed tags @@...@@, $temp, $ccpu, $ccpucl, $net
|
||||
* changes in settings
|
||||
* ptm now does not require net-tools
|
||||
* refactoring
|
||||
|
||||
Ver.1.6.1:
|
||||
+ added support of several devices in hddtemp label
|
||||
- fixed #6
|
||||
|
||||
Ver.1.6.0:
|
||||
+ added $custom tag to time and uptime labels (#8)
|
||||
+ russian translation
|
||||
- fixed #6, #10
|
||||
* changed license to GPLv3
|
||||
* changed project build
|
||||
|
||||
Ver.1.5.3:
|
||||
+ added $album, $progress and $time tags to player label (#7)
|
||||
- fixed zero swap
|
||||
|
||||
Ver.1.5.2:
|
||||
+ added $isotime, $shorttime and $longtime tags to time label
|
||||
|
||||
Ver.1.5.1:
|
||||
+ added time label
|
||||
|
||||
Ver.1.5.0:
|
||||
+ added player label
|
||||
|
||||
Ver.1.4.0:
|
||||
+ added notifications
|
||||
|
||||
Ver.1.3.6:
|
||||
- fixed #1, #2
|
||||
|
||||
Ver.1.3.5:
|
||||
- fix bug with definition network device
|
||||
|
||||
Ver.1.3.4:
|
||||
+ added double click event
|
||||
+ added auto selection of network device
|
||||
- fixed yet another plasma crash
|
||||
|
||||
Ver.1.3.3:
|
||||
* edited reading temperature device
|
||||
|
||||
Ver.1.3.2b:
|
||||
- fixed plasma crash
|
||||
|
||||
Ver.1.3.2:
|
||||
+ added GPU, GPU temperature, HDD and HDD temperature labels
|
||||
+ added $ccpu and $ccpucl tags
|
||||
* bug fixes
|
||||
* optimization and refactoring
|
||||
|
||||
Ver.1.2.2:
|
||||
+ added tooltip to lineEdit
|
||||
|
||||
Ver.1.2.1:
|
||||
* if battery doesn't exist return 'off'
|
||||
* if AC doesn't exist return '(?)'
|
||||
|
||||
Ver.1.2.0:
|
||||
+ added $ac tag to battery label
|
||||
+ added battery and ac device configurations
|
||||
+ added error cheking
|
||||
* $bat tag now reading from /sys/*
|
||||
|
||||
Ver.1.1.4:
|
||||
* changed parsing acpi output (battery label)
|
||||
|
||||
Ver.1.1.3:
|
||||
+ added font weight
|
||||
* edited font setup line. Now setup for font family works normaly
|
||||
* small bug fix
|
||||
|
||||
Ver.1.1.2:
|
||||
+ added CPU clock lable
|
||||
+ added function to update network device (100*time_interval)
|
||||
+ changed update sliders
|
||||
|
||||
Ver.1.1.1:
|
||||
+ added $swapmb, $memmb, $netdev, @@netdev=...@@ tags
|
||||
* widget consists of several labels
|
||||
* edited configuration interface
|
||||
- some bug fixes
|
||||
|
||||
Ver.1.0:
|
||||
First release
|
674
COPYING
Normal file
@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
pytextmonitor
|
||||
Copyright (C) 2013-2014 Evgeniy Alekseev
|
||||
|
||||
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/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
pytextmonitor Copyright (C) 2013 Evgeniy Alekseev
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
56
PKGBUILD
@ -2,55 +2,39 @@
|
||||
# Maintainer: Evgeniy "arcanis" Alexeev <esalexeev@gmail.com>
|
||||
|
||||
pkgname=kdeplasma-applets-pytextmonitor
|
||||
_pkgname=py-text-monitor
|
||||
pkgver=1.4.0
|
||||
_pkgname=pytextmonitor
|
||||
pkgver=1.7.0
|
||||
pkgrel=1
|
||||
_dtengine=ext-sysmon
|
||||
_dtver=1.2
|
||||
pkgdesc="Minimalistic Plasmoid script written on Python2. It looks like widgets in awesome-wm"
|
||||
arch=('i686' 'x86_64')
|
||||
url="https://github.com/arcan1s/pytextmonitor"
|
||||
license=('GPL')
|
||||
depends=('kdebase-workspace' 'kdebindings-python2' 'lm_sensors' 'net-tools')
|
||||
url="http://arcanis.name/projects/pytextmonitor"
|
||||
license=('GPLv3')
|
||||
depends=('kdebase-workspace' 'kdebindings-python2' 'lm_sensors' 'sysstat')
|
||||
optdepends=("hddtemp: for HDD temperature monitor"
|
||||
"catalyst: for GPU monitor"
|
||||
"nvidia-utils: for GPU monitor")
|
||||
"nvidia-utils: for GPU monitor"
|
||||
"amarok: for music player monitor"
|
||||
"mpd: for music player monitor"
|
||||
"qmmp: for music player monitor")
|
||||
makedepends=('automoc4' 'cmake')
|
||||
source=(https://github.com/arcan1s/pytextmonitor/releases/download/V.${pkgver}/${_pkgname}-${pkgver}.plasmoid
|
||||
https://github.com/arcan1s/pytextmonitor/releases/download/V.${pkgver}/${_dtengine}-${_dtver}.zip)
|
||||
source=(https://github.com/arcan1s/pytextmonitor/releases/download/V.${pkgver}/${_pkgname}-${pkgver}-src.tar.xz)
|
||||
install=${pkgname}.install
|
||||
md5sums=('988704016573b215bb36b62762075fee'
|
||||
'3182acdadb3b498be929b3cadad92206')
|
||||
md5sums=('bedeb6f30641b718c5020b1c16673ba2')
|
||||
backup=('usr/share/config/extsysmon.conf')
|
||||
|
||||
build ()
|
||||
{
|
||||
# build dataengine
|
||||
if [[ -d ${srcdir}/${_dtengine}/build ]]; then
|
||||
rm -rf "${srcdir}/${_dtengine}/build"
|
||||
build () {
|
||||
if [[ -d ${srcdir}/build ]]; then
|
||||
rm -rf "${srcdir}/build"
|
||||
fi
|
||||
mkdir "${srcdir}/${_dtengine}/build"; cd "${srcdir}/${_dtengine}/build"
|
||||
mkdir "${srcdir}/build"
|
||||
cd "${srcdir}/build"
|
||||
cmake -DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` \
|
||||
../
|
||||
"../${_pkgname}"
|
||||
make
|
||||
}
|
||||
|
||||
package()
|
||||
{
|
||||
# install dataengine
|
||||
cd "${srcdir}/${_dtengine}/build"
|
||||
package() {
|
||||
cd "${srcdir}/build"
|
||||
make DESTDIR="${pkgdir}" install
|
||||
|
||||
# install plasmoid
|
||||
install -D -m644 "${srcdir}/contents/code/plasma_applet_pytextmonitor.notifyrc" \
|
||||
"${pkgdir}/`kde4-config --prefix`/share/apps/plasma_applet_pytextmonitor/plasma_applet_pytextmonitor.notifyrc"
|
||||
install -D -m644 "${srcdir}/metadata.desktop" \
|
||||
"${pkgdir}/`kde4-config --prefix`/share/kde4/services/${_pkgname}.desktop"
|
||||
install -D -m644 "${srcdir}/metadata.desktop" \
|
||||
"${pkgdir}/`kde4-config --prefix`/share/apps/plasma/plasmoids/${_pkgname}/metadata.desktop"
|
||||
mkdir -p "${pkgdir}/`kde4-config --prefix`/share/apps/plasma/plasmoids/${_pkgname}/contents/"{code,ui}
|
||||
install -m644 "${srcdir}/contents/code/"* \
|
||||
-t "${pkgdir}/`kde4-config --prefix`/share/apps/plasma/plasmoids/${_pkgname}/contents/code"
|
||||
install -m644 "${srcdir}/contents/ui/"* \
|
||||
-t "${pkgdir}/`kde4-config --prefix`/share/apps/plasma/plasmoids/${_pkgname}/contents/ui"
|
||||
}
|
||||
|
36
README
@ -1,36 +0,0 @@
|
||||
py-text-monitor
|
||||
=============
|
||||
|
||||
PyTextMonitor is a minimalistic Plasmoid script written on Python2. It looks like widgets in awesome-wm.
|
||||
|
||||
HOWTO
|
||||
For edited output you must open Settings window and setup output format in lines:
|
||||
label "$uptime" means uptime, ---d--h--m
|
||||
label "$cpu" means total load cpu, %
|
||||
label "$ccpu" means load CPU for each core, %
|
||||
label "$cpucl" - average cpu clock, MHz
|
||||
label "$ccpucl" - cpu clock for each core, MHz
|
||||
label "$temp" - average temperature in system
|
||||
label "$gpu" - GPU usage, %. `aticonfig` or `nvidia-smi` must be installed
|
||||
label "$gputemp" - GPU temperature. `aticonfig` or `nvidia-smi` must be installed
|
||||
label "$mem" - usage memory, %
|
||||
label "$memmb" - usage memory, MB
|
||||
label "$swap" - swap, %
|
||||
label "$swapmb" - swap, MB
|
||||
label "@@/@@" (in hdd label) - mount point ('/' in example) usage, %. Separator for mount points list is ';', for example "@@/;/home;/mnt/global@@". `hddtemp` must be installed
|
||||
label "@@/dev/sda@@" (in hddtemp label) - HDD ('/dev/sda' in example) temperature
|
||||
label "$net" - download and upload speed, KB/s. You may specify network device: something like @@eth0@@
|
||||
label "$netdev" - current network device
|
||||
label "$bat" - battery charge, %. Battery device may be set below. File ("/sys/class/power_supply/BAT0/capacity" by default) must contain only battery charge in percent
|
||||
label "$ac" - status AC device. Return (*) if AC device is online or ( ) if offline. AC device may be set below. FIle ("/sys/class/power_supply/AC/online" by default) must contain '1' if AC is online
|
||||
|
||||
Label order will changed if you change slider position. HTML tags in label work normally.
|
||||
Attention: you don't may set to show $cpu in swap label for example. $cpu will work only in cpu label.
|
||||
|
||||
|
||||
Dependencies:
|
||||
kdebindings-python2
|
||||
|
||||
ext-sysmon (for GPU, GPU temp and HDD temp labels)
|
||||
lm_sensors (for definition temperature device)
|
||||
net-tools (for definition network device)
|
167
README.md
Normal file
@ -0,0 +1,167 @@
|
||||
pytextmonitor
|
||||
=============
|
||||
|
||||
Information
|
||||
-----------
|
||||
PyTextMonitor is a minimalistic Plasmoid script written on Python2. It looks like widgets in awesome-wm.
|
||||
|
||||
**NOTE** LOOKING FOR TRANSLATORS!
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
For edited output you must open Settings window and setup output format in lines:
|
||||
* label `$time` - time in default format. For example, `fri Nov 6 04:48:01 2013`
|
||||
* label `$isotime` - time in iso format
|
||||
* label `$shorttime` - time in short locale format
|
||||
* label `$longtime` - time in long locale format
|
||||
* label `$custom` - custom time format
|
||||
* label `$uptime` - uptime, <i>---d--h--m</i>
|
||||
* label `$custom` - custom uptime format
|
||||
* label `$cpu` - total load cpu, <i>%</i>
|
||||
* label `$cpuN` - load CPU for core N, <i>%</i>. N should be in range 0 to 8
|
||||
* label `$cpucl` - average cpu clock, <i>MHz</i>
|
||||
* label `$cpuclN` - cpu clock for core N, <i>MHz</i>. N should be in range 0 to 8
|
||||
* label `$tempN` - temperature for device N. For example, `$temp0`
|
||||
* label `$gpu` - GPU usage, <i>%</i>. `aticonfig` or `nvidia-smi` must be installed
|
||||
* label `$gputemp` - GPU temperature. `aticonfig` or `nvidia-smi` must be installed
|
||||
* label `$mem` - usage memory, <i>%</i>
|
||||
* label `$memmb` - usage memory, <i>MB</i>
|
||||
* label `$swap` - swap, <i>%</i>
|
||||
* label `$swapmb` - swap, <i>MB</i>
|
||||
* label `$hddN` - usage for mount point N, <i>%</i>. For example, `$hdd0`
|
||||
* label `$hddtempN` - temperature for HDD N. For example, `$hddtemp0`
|
||||
* label `$down` - download speed, <i>KB/s</i>
|
||||
* label `$up` - upload speed, <i>KB/s</i>
|
||||
* label `$netdev` - current network device
|
||||
* label `$bat` - battery charge, <i>%</i>
|
||||
* label `$ac` - status AC device. Return <i>(*)</i> if AC device is online or <i>( )</i> if offline
|
||||
* label `$album` - current song album. One of supported music players must be installed
|
||||
* label `$artist` - current song artist. One of supported music players must be installed
|
||||
* label `$progress` - current song progress. One of supported music players must be installed (mpd does not support yet)
|
||||
* label `$time` - current song duration. One of supported music players must be installed
|
||||
* label `$title` - current song title. One of supported music players must be installed
|
||||
* label `$custom` - returns output for custom command
|
||||
|
||||
Label order will changed if you change slider position. HTML tags in label work normally.
|
||||
|
||||
**NOTE** you don't may set to show $cpu in swap label for example. <b>$cpu will work only in cpu label</b>.
|
||||
|
||||
Advanced settings
|
||||
-----------------
|
||||
**Custom time**
|
||||
|
||||
* label `$dddd` - weekday in long format
|
||||
* label `$ddd` - weekday in short format
|
||||
* label `$dd` - day
|
||||
* label `$d` - day without zero
|
||||
* label `$MMMM` - month in long format
|
||||
* label `$MMM` - month in short format
|
||||
* label `$MM` - month
|
||||
* label `$M` - month without zero
|
||||
* label `$yyyy` - year
|
||||
* label `$yy` - year in short format
|
||||
* label `$hh` - hours
|
||||
* label `$h` - hours without zero
|
||||
* label `$mm` - minutes
|
||||
* label `$m` - minutes without zero
|
||||
* label `$ss` - seconds
|
||||
* label `$s` - seconds without zero
|
||||
|
||||
**Custom uptime**
|
||||
|
||||
* label `$ds` - uptime days
|
||||
* label `$hs` - uptime hours
|
||||
* label `$ms` - uptime minutes
|
||||
|
||||
**Temperature devices**
|
||||
|
||||
List of devices, which will be observed in temp label (combo box items come from `sensors`). List widget is editable, delete key will remove current item.
|
||||
|
||||
**Mount points**
|
||||
|
||||
List of mount points, which will be observed in hdd label (combo box items come from `mount`). List widget is editable, delete key will remove current item.
|
||||
|
||||
**HDD**
|
||||
|
||||
List of hard disk devices, which will be observed in hddtem label (combo box items come from `find`). List widget is editable, delete key will remove current item.
|
||||
|
||||
**Network directory**
|
||||
|
||||
Path to directory, which contains network devices information. Default is `/sys/class/net`. Required for auto select network device.
|
||||
|
||||
**Network device**
|
||||
|
||||
Use specified device as active. Combo box items come from **network directory**. Will disable auto select network device.
|
||||
|
||||
**Battery device**
|
||||
|
||||
File with battery information. File (`/sys/class/power_supply/BAT0/capacity` by default) should contain only battery charge in percent.
|
||||
|
||||
**AC device**
|
||||
|
||||
File with AC information. File (`/sys/class/power_supply/AC/online` by default) must contain `1` if AC is online.
|
||||
|
||||
**Music player**
|
||||
|
||||
Select one of supported music playes for player label.
|
||||
|
||||
**Custom command**
|
||||
|
||||
*NOTE* This can cause the computer freeze.
|
||||
|
||||
A command, which will be run for custom label.
|
||||
|
||||
Tooltip settings
|
||||
----------------
|
||||
Since version 1.7.0 CPU, CPU clock, memory, swap and network labels support graphical tooltip. To enable them just make the needed checkboxes a fully checked. The number of stored values can be set in the tab. Colors of graphs are configurable too.
|
||||
|
||||
DataEngine configuration
|
||||
------------------------
|
||||
You may edit DataEngine configuration. It is `/usr/share/config/extsysmon.conf` or `$HOME/share/config/extsysmon.conf` depending on the type of installation. Uncomment needed line and edit it.
|
||||
|
||||
Instruction
|
||||
===========
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
* kdebase-workspace
|
||||
* kdebindings-python2
|
||||
* lm_sensors (for definition temperature device)
|
||||
* sysstat (for notification)
|
||||
|
||||
Optional dependencies
|
||||
---------------------
|
||||
ext-sysmon (for GPU, GPU temp, HDD temp and player labels):
|
||||
* proprietary video driver
|
||||
* hddtemp
|
||||
* music player (amarok, mpd or qmmp)
|
||||
|
||||
Make dependencies
|
||||
-----------------
|
||||
* automoc4
|
||||
* cmake
|
||||
|
||||
Installation
|
||||
------------
|
||||
* download sources
|
||||
* install
|
||||
|
||||
mkdir build && cd build
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=`kde4-config --localprefix` ../
|
||||
make && make install
|
||||
|
||||
Also you may install it to "/":
|
||||
|
||||
mkdir build && cd build
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` ../
|
||||
make && sudo make install
|
||||
|
||||
Additional information
|
||||
======================
|
||||
|
||||
Links
|
||||
-----
|
||||
* [Homepage](http://arcanis.name/projects/pytextmonitor/)
|
||||
* Plasmoid on [kde-look](http://kde-look.org/content/show.php/Py+Text+Monitor?content=157124)
|
||||
* DataEngine on [kde-look](http://kde-look.org/content/show.php/Extended+Systemmonitor+DataEngine?content=158773)
|
||||
* Archlinux [AUR](https://aur.archlinux.org/packages/kdeplasma-applets-pytextmonitor/) package
|
6
TODO
@ -1,6 +0,0 @@
|
||||
1. Tooltip (graphical information):
|
||||
a) cpu, %
|
||||
b) cpuclock, mhz
|
||||
c) memory, %
|
||||
d) swap, %
|
||||
e) network, %
|
@ -1,30 +1,33 @@
|
||||
#!/bin/bash
|
||||
|
||||
SRCDIR="sources"
|
||||
VERSION=$(grep -m1 PROJECT_VERSION_MAJOR sources/CMakeLists.txt | awk '{print $3}' | cut -c 1).\
|
||||
$(grep -m1 PROJECT_VERSION_MINOR sources/CMakeLists.txt | awk '{print $3}' | cut -c 1).\
|
||||
$(grep -m1 PROJECT_VERSION_PATCH sources/CMakeLists.txt | awk '{print $3}' | cut -c 1)
|
||||
|
||||
# build dataengine
|
||||
ARCHIVE="ext-sysmon"
|
||||
VERSION=`grep Version ext-sysmon/plasma-engine-extsysmon.desktop | awk -F "=" '{print $2}'`
|
||||
# create archive
|
||||
if [ -e ${ARCHIVE}-${VERSION}.zip ]; then
|
||||
rm -f ${ARCHIVE}-${VERSION}.zip
|
||||
fi
|
||||
zip -9 -y -r -q ${ARCHIVE}-${VERSION}.zip ${ARCHIVE}
|
||||
# update md5sum
|
||||
MD5SUMS=`md5sum ${ARCHIVE}-${VERSION}.zip | awk '{print $1}'`
|
||||
sed -i "/ '[0-9A-Fa-f]*/s/[^'][^)]*/ '${MD5SUMS}'/" PKGBUILD
|
||||
sed -i "s/_dtver=[0-9.]*/_dtver=${VERSION}/" PKGBUILD
|
||||
[[ -e ${ARCHIVE}-${VERSION}-src.tar.xz ]] && rm -f ${ARCHIVE}-${VERSION}-src.tar.xz
|
||||
[[ -d ${ARCHIVE} ]] && rm -rf "${ARCHIVE}"
|
||||
cp -r "${SRCDIR}/${ARCHIVE}" "${ARCHIVE}"
|
||||
tar cJf "${ARCHIVE}-${VERSION}-src.tar.xz" "${ARCHIVE}"
|
||||
rm -rf "${ARCHIVE}"
|
||||
|
||||
# build widget
|
||||
cd sources
|
||||
FILES="contents metadata.desktop plasma_applet_pytextmonitor"
|
||||
ARCHIVE="py-text-monitor"
|
||||
VERSION=`grep Version metadata.desktop | awk -F "=" '{print $2}'`
|
||||
ARCHIVE="pytextmonitor"
|
||||
FILES="AUTHORS CHANGELOG COPYING README.md"
|
||||
IGNORELIST="build usr"
|
||||
# create archive
|
||||
if [ -e ${ARCHIVE}-${VERSION}.plasmoid ]; then
|
||||
rm -f ${ARCHIVE}-${VERSION}.plasmoid
|
||||
fi
|
||||
zip -9 -y -r -q ../${ARCHIVE}-${VERSION}.plasmoid ${FILES}
|
||||
cd ..
|
||||
[[ -e ${ARCHIVE}-${VERSION}-src.tar.xz ]] && rm -f "${ARCHIVE}-${VERSION}-src.tar.xz"
|
||||
[[ -d ${ARCHIVE} ]] && rm -rf "${ARCHIVE}"
|
||||
cp -r "${SRCDIR}" "${ARCHIVE}"
|
||||
for FILE in ${FILES[*]}; do cp "$FILE" "${ARCHIVE}"; done
|
||||
for FILE in ${IGNORELIST[*]}; do rm -rf "${ARCHIVE}/${FILE}"; done
|
||||
tar cJf "${ARCHIVE}-${VERSION}-src.tar.xz" "${ARCHIVE}"
|
||||
rm -rf "${ARCHIVE}"
|
||||
|
||||
# update md5sum
|
||||
MD5SUMS=`md5sum ${ARCHIVE}-${VERSION}.plasmoid | awk '{print $1}'`
|
||||
MD5SUMS=$(md5sum ${ARCHIVE}-${VERSION}-src.tar.xz | awk '{print $1}')
|
||||
sed -i "/md5sums=('[0-9A-Fa-f]*/s/[^'][^)]*/md5sums=('${MD5SUMS}'/" PKGBUILD
|
||||
sed -i "s/pkgver=[0-9.]*/pkgver=${VERSION}/" PKGBUILD
|
||||
|
@ -1,24 +0,0 @@
|
||||
# set project name
|
||||
project (plasma_engine_extsysmon)
|
||||
|
||||
# find required libaries
|
||||
find_package (KDE4 REQUIRED)
|
||||
include (KDE4Defaults)
|
||||
|
||||
add_definitions (${QT_DEFINITIONS}
|
||||
${KDE4_DEFINITIONS})
|
||||
include_directories (${CMAKE_SOURCE_DIR}
|
||||
${CMAKE_BINARY_DIR}
|
||||
${KDE4_INCLUDES})
|
||||
|
||||
set (PLUGIN_NAME ${PROJECT_NAME})
|
||||
file (GLOB PROJECT_DESKTOP *.desktop)
|
||||
file (GLOB PROJECT_SRCS *.cpp)
|
||||
|
||||
# make
|
||||
kde4_add_plugin (${PLUGIN_NAME} ${PROJECT_SRCS})
|
||||
target_link_libraries (${PLUGIN_NAME} ${KDE4_KDECORE_LIBS} ${KDE4_PLASMA_LIBS})
|
||||
|
||||
# install
|
||||
install(TARGETS ${PLUGIN_NAME} DESTINATION ${PLUGIN_INSTALL_DIR})
|
||||
install(FILES ${PROJECT_DESKTOP} DESTINATION ${SERVICES_INSTALL_DIR})
|
@ -1,175 +0,0 @@
|
||||
#include "extsysmon.h"
|
||||
|
||||
#include <Plasma/DataContainer>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
ExtendedSysMon::ExtendedSysMon(QObject* parent, const QVariantList& args)
|
||||
: Plasma::DataEngine(parent, args)
|
||||
{
|
||||
Q_UNUSED(args)
|
||||
|
||||
setMinimumPollingInterval(333);
|
||||
|
||||
FILE *f_out;
|
||||
f_out = popen("lspci 2>&1", "r");
|
||||
char device[256];
|
||||
QString dev;
|
||||
while (fgets(device, 256, f_out) != NULL)
|
||||
{
|
||||
dev = QString(device);
|
||||
if (dev.toLower().contains("nvidia"))
|
||||
gpudev = QString("nvidia");
|
||||
else if (dev.toLower().contains("radeon"))
|
||||
gpudev = QString("ati");
|
||||
}
|
||||
pclose(f_out);
|
||||
|
||||
f_out = popen("ls -1 /dev/sd[a-z] && ls -1 /dev/hd[a-z] 2>&1", "r");
|
||||
while (fgets(device, 256, f_out) != NULL)
|
||||
{
|
||||
dev = QString(device);
|
||||
if (dev[0] == '/')
|
||||
hdddev.append(dev);
|
||||
}
|
||||
pclose(f_out);
|
||||
}
|
||||
|
||||
QStringList ExtendedSysMon::sources() const
|
||||
{
|
||||
QStringList source;
|
||||
source.append(QString("gpu"));
|
||||
source.append(QString("gputemp"));
|
||||
source.append(QString("hddtemp"));
|
||||
return source;
|
||||
}
|
||||
|
||||
bool ExtendedSysMon::sourceRequestEvent(const QString &name)
|
||||
{
|
||||
return updateSourceEvent(name);
|
||||
}
|
||||
|
||||
bool ExtendedSysMon::updateSourceEvent(const QString &source)
|
||||
{
|
||||
FILE *f_out;
|
||||
QString key, out, tmp_out, value;
|
||||
bool ok = false;
|
||||
char output[256], val[5];
|
||||
if (source == QString("gpu"))
|
||||
{
|
||||
key = QString("GPU");
|
||||
if (gpudev == QString("nvidia"))
|
||||
{
|
||||
f_out = popen("nvidia-smi -q -d UTILIZATION | grep Gpu | tail -n1 2>&1", "r");
|
||||
fgets (output, 256, f_out);
|
||||
if ((output[0] == '\0') ||
|
||||
(QString(output).split(QString(" "), QString::SkipEmptyParts).count() < 2))
|
||||
value = QString(" N\\A");
|
||||
else
|
||||
{
|
||||
out = QString(output).split(QString(" "), QString::SkipEmptyParts)[2];
|
||||
sprintf (val, "%5.1f", out.left(out.count()-2).toFloat(&ok));
|
||||
value = QString(val);
|
||||
}
|
||||
pclose(f_out);
|
||||
}
|
||||
else if (gpudev == QString("ati"))
|
||||
{
|
||||
f_out = popen("aticonfig --od-getclocks | grep load | tail -n1 2>&1", "r");
|
||||
fgets (output, 256, f_out);
|
||||
if ((output[0] == '\0') ||
|
||||
(QString(output).split(QString(" "), QString::SkipEmptyParts).count() < 3))
|
||||
value = QString(" N\\A");
|
||||
else
|
||||
{
|
||||
out = QString(output).split(QString(" "), QString::SkipEmptyParts)[3];
|
||||
sprintf (val, "%5.1f", out.left(out.count()-2).toFloat(&ok));
|
||||
value = QString(val);
|
||||
}
|
||||
pclose(f_out);
|
||||
}
|
||||
else
|
||||
{
|
||||
value = QString(" N\\A");
|
||||
}
|
||||
if (ok == false)
|
||||
value = QString(" N\\A");
|
||||
value = value.split(QString(","), QString::SkipEmptyParts).join(QString("."));
|
||||
setData(source, key, value);
|
||||
}
|
||||
else if (source == QString("gputemp"))
|
||||
{
|
||||
key = QString("GPUTemp");
|
||||
if (gpudev == QString("nvidia"))
|
||||
{
|
||||
f_out = popen("nvidia-smi -q -d TEMPERATURE | grep Gpu | tail -n1 2>&1", "r");
|
||||
fgets (output, 256, f_out);
|
||||
if ((output[0] == '\0') ||
|
||||
(QString(output).split(QString(" "), QString::SkipEmptyParts).count() < 2))
|
||||
value = QString(" N\\A");
|
||||
else
|
||||
{
|
||||
out = QString(output).split(QString(" "), QString::SkipEmptyParts)[2];
|
||||
sprintf (val, "%4.1f", out.toFloat(&ok));
|
||||
value = QString(val);
|
||||
}
|
||||
pclose(f_out);
|
||||
}
|
||||
else if (gpudev == QString("ati"))
|
||||
{
|
||||
f_out = popen("aticonfig --od-gettemperature | grep Temperature | tail -n1 2>&1", "r");
|
||||
fgets (output, 256, f_out);
|
||||
if ((output[0] == '\0') ||
|
||||
(QString(output).split(QString(" "), QString::SkipEmptyParts).count() < 4))
|
||||
value = QString(" N\\A");
|
||||
else
|
||||
{
|
||||
out = QString(output).split(QString(" "), QString::SkipEmptyParts)[4];
|
||||
sprintf (val, "%4.1f", out.toFloat(&ok));
|
||||
value = QString(val);
|
||||
}
|
||||
pclose(f_out);
|
||||
}
|
||||
else
|
||||
{
|
||||
value = QString(" N\\A");
|
||||
}
|
||||
if (ok == false)
|
||||
value = QString(" N\\A");
|
||||
value = value.split(QString(","), QString::SkipEmptyParts).join(QString("."));
|
||||
setData(source, key, value);
|
||||
}
|
||||
else if (source == QString("hddtemp"))
|
||||
{
|
||||
char command[256], *dev;
|
||||
QByteArray qb;
|
||||
for (int i=0; i<hdddev.count(); i++)
|
||||
{
|
||||
qb = hdddev[i].toUtf8();
|
||||
dev = qb.data();
|
||||
sprintf(command, "hddtemp %s", dev);
|
||||
f_out = popen(command, "r");
|
||||
fgets(output, 256, f_out);
|
||||
if ((output[0] == '\0') ||
|
||||
(QString(output).split(QString(":"), QString::SkipEmptyParts).count() < 3))
|
||||
value = QString(" N\\A");
|
||||
else
|
||||
{
|
||||
out = QString(output).split(QString(":"), QString::SkipEmptyParts)[2];
|
||||
sprintf (val, "%4.1f", out.left(out.count()-4).toFloat(&ok));
|
||||
value = QString(val);
|
||||
}
|
||||
pclose(f_out);
|
||||
if (ok == false)
|
||||
value = QString(" N\\A");
|
||||
value = value.split(QString(","), QString::SkipEmptyParts).join(QString("."));
|
||||
setData(source, hdddev[i], value);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
K_EXPORT_PLASMA_DATAENGINE(extsysmon, ExtendedSysMon)
|
||||
|
||||
#include "extsysmon.moc"
|
@ -1,21 +0,0 @@
|
||||
#ifndef EXTSYSMON_H
|
||||
#define EXTSYSMON_H
|
||||
|
||||
#include <Plasma/DataEngine>
|
||||
|
||||
class ExtendedSysMon : public Plasma::DataEngine
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ExtendedSysMon(QObject *parent, const QVariantList &args);
|
||||
|
||||
protected:
|
||||
bool sourceRequestEvent(const QString &name);
|
||||
bool updateSourceEvent(const QString &source);
|
||||
QStringList hdddev;
|
||||
QString gpudev;
|
||||
QStringList sources() const;
|
||||
};
|
||||
|
||||
#endif // EXTSYSMON_H
|
@ -1,25 +1,24 @@
|
||||
func_update()
|
||||
{
|
||||
func_update() {
|
||||
cat << EOF
|
||||
Update plasmoids...
|
||||
EOF
|
||||
kbuildsycoca4 > /dev/null 2>&1
|
||||
}
|
||||
|
||||
post_install()
|
||||
{
|
||||
post_install() {
|
||||
func_update
|
||||
cat << EOF
|
||||
Make sure that \`hddtemp\` can be run as non-root
|
||||
Make sure that \`hddtemp\` can be run with sudo without password
|
||||
EOF
|
||||
}
|
||||
|
||||
post_upgrade()
|
||||
{
|
||||
post_upgrade() {
|
||||
func_update
|
||||
cat << EOF
|
||||
Make sure that \`hddtemp\` can be run with sudo without password
|
||||
EOF
|
||||
}
|
||||
|
||||
post_remove()
|
||||
{
|
||||
post_remove() {
|
||||
func_update
|
||||
}
|
||||
|
@ -1,3 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
plasmapkg -t dataengine -i ext-sysmon-1.0.zip
|
Before Width: | Height: | Size: 205 KiB |
BIN
screenshots/dataengine.png
Normal file
After Width: | Height: | Size: 83 KiB |
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 45 KiB |
BIN
screenshots/panel_01.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
screenshots/panel_02.png
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
screenshots/panel_03.png
Normal file
After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 2.5 KiB |
BIN
screenshots/ptm_config_01.png
Normal file
After Width: | Height: | Size: 106 KiB |
BIN
screenshots/ptm_config_02.png
Normal file
After Width: | Height: | Size: 47 KiB |
BIN
screenshots/ptm_config_03.png
Normal file
After Width: | Height: | Size: 189 KiB |
27
sources/CMakeLists.txt
Normal file
@ -0,0 +1,27 @@
|
||||
cmake_minimum_required (VERSION 2.8)
|
||||
|
||||
cmake_policy (SET CMP0003 OLD)
|
||||
cmake_policy (SET CMP0002 OLD)
|
||||
cmake_policy (SET CMP0011 NEW)
|
||||
cmake_policy (SET CMP0015 NEW)
|
||||
|
||||
project (pytextmonitor)
|
||||
set (PROJECT_VERSION_MAJOR 1)
|
||||
set (PROJECT_VERSION_MINOR 7)
|
||||
set (PROJECT_VERSION_PATCH 0)
|
||||
set (PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
|
||||
|
||||
message (STATUS "Version: ${PROJECT_VERSION}")
|
||||
|
||||
# flags
|
||||
if (CMAKE_COMPILER_IS_GNUCXX)
|
||||
set (ADD_CXX_FLAGS "-Wall")
|
||||
set (CMAKE_CXX_FLAGS "-O0 ${ADD_CXX_FLAGS}")
|
||||
set (CMAKE_CXX_FLAGS_DEBUG "-g -O0")
|
||||
set (CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
|
||||
else ()
|
||||
message (STATUS "Unknown compiler")
|
||||
endif ()
|
||||
|
||||
add_subdirectory (ext-sysmon)
|
||||
add_subdirectory (ptm)
|
@ -1,16 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from util import *
|
||||
|
||||
|
||||
|
||||
class Config():
|
||||
def __init__(self, applet):
|
||||
self.applet = applet
|
||||
self.config = self.applet.config()
|
||||
|
||||
def get(self, key, default = ''):
|
||||
return self.config.readEntry(key, default).toString()
|
||||
|
||||
def set(self, key, value):
|
||||
self.config.writeEntry(key, value)
|
@ -1,194 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from PyQt4.QtGui import *
|
||||
from PyKDE4.kdecore import *
|
||||
from PyKDE4.kdeui import *
|
||||
import commands
|
||||
import config
|
||||
|
||||
|
||||
|
||||
class ConfigDefinition:
|
||||
def __init__(self, parent, configpage):
|
||||
"""class definition"""
|
||||
self.parent = parent
|
||||
self.configpage = configpage
|
||||
|
||||
|
||||
def configAccepted(self):
|
||||
"""function to accept settings"""
|
||||
settings = config.Config(self.parent)
|
||||
|
||||
# update local variables
|
||||
self.parent.interval = self.configpage.ui.spinBox_interval.value()
|
||||
settings.set('interval', self.parent.interval)
|
||||
self.parent.font_family = str(self.configpage.ui.fontComboBox.currentFont().family())
|
||||
settings.set('font_family', self.parent.font_family)
|
||||
self.parent.font_size = self.configpage.ui.spinBox_fontSize.value()
|
||||
settings.set('font_size', self.parent.font_size)
|
||||
self.parent.font_color = str(self.configpage.ui.kcolorcombo.color().name())
|
||||
settings.set('font_color', self.parent.font_color)
|
||||
if (self.configpage.ui.comboBox_style.currentIndex() == 0):
|
||||
self.parent.font_style = 'normal'
|
||||
else:
|
||||
self.parent.font_style = 'italic'
|
||||
settings.set('font_style', self.parent.font_style)
|
||||
self.parent.font_weight = self.configpage.ui.spinBox_weight.value()
|
||||
settings.set('font_weight', self.parent.font_weight)
|
||||
|
||||
# disconnecting from source and clear layout
|
||||
if (self.parent.uptimeBool > 0):
|
||||
self.parent.systemmonitor.disconnectSource("system/uptime", self.parent)
|
||||
self.parent.label_uptime.setText('')
|
||||
self.parent.layout.removeItem(self.parent.label_uptime)
|
||||
if (self.parent.cpuBool > 0):
|
||||
self.parent.systemmonitor.disconnectSource("cpu/system/TotalLoad", self.parent)
|
||||
if (self.parent.cpuFormat.split('$ccpu')[0] != self.parent.cpuFormat):
|
||||
self.parent.label_cpu.setText('')
|
||||
self.parent.layout.removeItem(self.parent.label_cpu)
|
||||
self.parent.label_cpu1.setText('')
|
||||
self.parent.layout.removeItem(self.parent.label_cpu1)
|
||||
for core in range(self.parent.numCores):
|
||||
self.parent.systemmonitor.disconnectSource("cpu/cpu"+str(core)+"/TotalLoad", self.parent)
|
||||
exec ("self.parent.label_coreCpu" + str(core) + ".setText('')")
|
||||
exec ("self.parent.layout.removeItem(self.parent.label_coreCpu" + str(core) + ")")
|
||||
else:
|
||||
self.parent.label_cpu.setText('')
|
||||
self.parent.layout.removeItem(self.parent.label_cpu)
|
||||
if (self.parent.cpuclockBool > 0):
|
||||
self.parent.systemmonitor.disconnectSource("cpu/system/AverageClock", self.parent)
|
||||
if (self.parent.cpuclockFormat.split('$ccpu')[0] != self.parent.cpuclockFormat):
|
||||
self.parent.label_cpuclock.setText('')
|
||||
self.parent.layout.removeItem(self.parent.label_cpuclock)
|
||||
self.parent.label_cpuclock1.setText('')
|
||||
self.parent.layout.removeItem(self.parent.label_cpuclock1)
|
||||
for core in range(self.parent.numCores):
|
||||
self.parent.systemmonitor.disconnectSource("cpu/cpu"+str(core)+"/clock", self.parent)
|
||||
exec ("self.parent.label_coreCpuclock" + str(core) + ".setText('')")
|
||||
exec ("self.parent.layout.removeItem(self.parent.label_coreCpuclock" + str(core) + ")")
|
||||
else:
|
||||
self.parent.label_cpuclock.setText('')
|
||||
self.parent.layout.removeItem(self.parent.label_cpuclock)
|
||||
if (self.parent.tempBool > 0):
|
||||
self.parent.systemmonitor.disconnectSource(self.parent.tempdev, self.parent)
|
||||
self.parent.label_temp.setText('')
|
||||
self.parent.layout.removeItem(self.parent.label_temp)
|
||||
if (self.parent.gpuBool > 0):
|
||||
self.parent.extsysmon.disconnectSource("gpu", self.parent)
|
||||
self.parent.label_gpu.setText('')
|
||||
self.parent.layout.removeItem(self.parent.label_gpu)
|
||||
if (self.parent.gputempBool > 0):
|
||||
self.parent.extsysmon.disconnectSource("gputemp", self.parent)
|
||||
self.parent.label_gputemp.setText('')
|
||||
self.parent.layout.removeItem(self.parent.label_gputemp)
|
||||
if (self.parent.memBool > 0):
|
||||
self.parent.systemmonitor.disconnectSource("mem/physical/application", self.parent)
|
||||
if (self.parent.memInMb == False):
|
||||
self.parent.systemmonitor.disconnectSource("mem/physical/free", self.parent)
|
||||
self.parent.systemmonitor.disconnectSource("mem/physical/used", self.parent)
|
||||
self.parent.label_mem.setText('')
|
||||
self.parent.layout.removeItem(self.parent.label_mem)
|
||||
if (self.parent.swapBool > 0):
|
||||
self.parent.systemmonitor.disconnectSource("mem/swap/used", self.parent)
|
||||
if (self.parent.swapInMb == False):
|
||||
self.parent.systemmonitor.disconnectSource("mem/swap/free", self.parent)
|
||||
self.parent.label_swap.setText('')
|
||||
self.parent.layout.removeItem(self.parent.label_swap)
|
||||
if (self.parent.hddBool > 0):
|
||||
for mount in self.parent.mountPoints:
|
||||
self.parent.systemmonitor.disconnectSource("partitions" + mount + "/filllevel", self.parent)
|
||||
exec ('self.parent.label_hdd_' + ''.join(mount.split('/')) + '.setText("")')
|
||||
exec ("self.parent.layout.removeItem(self.parent.label_hdd_" + ''.join(mount.split('/')) + ")")
|
||||
self.parent.label_hdd0.setText('')
|
||||
self.parent.label_hdd1.setText('')
|
||||
self.parent.layout.removeItem(self.parent.label_hdd0)
|
||||
self.parent.layout.removeItem(self.parent.label_hdd1)
|
||||
if (self.parent.hddtempBool > 0):
|
||||
self.parent.extsysmon.disconnectSource("hddtemp", self.parent)
|
||||
self.parent.label_hddtemp.setText('')
|
||||
self.parent.layout.removeItem(self.parent.label_hddtemp)
|
||||
if (self.parent.netBool > 0):
|
||||
self.parent.systemmonitor.disconnectSource("network/interfaces/"+self.parent.netdev+"/transmitter/data", self.parent)
|
||||
self.parent.systemmonitor.disconnectSource("network/interfaces/"+self.parent.netdev+"/receiver/data", self.parent)
|
||||
self.parent.label_netDown.setText('')
|
||||
self.parent.label_netUp.setText('')
|
||||
self.parent.layout.removeItem(self.parent.label_netUp)
|
||||
self.parent.layout.removeItem(self.parent.label_netDown)
|
||||
if (self.parent.batBool > 0):
|
||||
self.parent.label_bat.setText('')
|
||||
self.parent.layout.removeItem(self.parent.label_bat)
|
||||
|
||||
self.parent.label_order = "------------"
|
||||
|
||||
for label in self.parent.dict_orders.keys():
|
||||
exec ('self.parent.' + self.parent.dict_orders[label] + 'Bool = ' + str(self.configpage.checkboxes[self.parent.dict_orders[label]].checkState()))
|
||||
if (self.configpage.checkboxes[self.parent.dict_orders[label]].checkState() > 0):
|
||||
pos = self.configpage.sliders[self.parent.dict_orders[label]].value() - 1
|
||||
self.parent.label_order = self.parent.label_order[:pos] + label + self.parent.label_order[pos+1:]
|
||||
if (self.parent.dict_orders[label] == 'net'):
|
||||
exec ('self.parent.' + self.parent.dict_orders[label] + 'NonFormat = str(self.configpage.lineedits[self.parent.dict_orders[label]].text())')
|
||||
exec ('settings.set("' + self.parent.dict_orders[label] + 'NonFormat", self.parent.' + self.parent.dict_orders[label] + 'NonFormat)')
|
||||
else:
|
||||
exec ('self.parent.' + self.parent.dict_orders[label] + 'Format = str(self.configpage.lineedits[self.parent.dict_orders[label]].text())')
|
||||
exec ('settings.set("' + self.parent.dict_orders[label] + 'Format", self.parent.' + self.parent.dict_orders[label] + 'Format)')
|
||||
exec ('settings.set("' + self.parent.dict_orders[label] + 'Bool", self.parent.' + self.parent.dict_orders[label] + 'Bool)')
|
||||
if (self.parent.dict_orders[label] == 'bat'):
|
||||
self.parent.battery_device = str(self.configpage.ui.lineEdit_batdev.text())
|
||||
self.parent.ac_device = str(self.configpage.ui.lineEdit_acdev.text())
|
||||
settings.set('battery_device', self.parent.battery_device)
|
||||
settings.set('ac_device', self.parent.ac_device)
|
||||
elif (self.parent.dict_orders[label] == 'temp'):
|
||||
self.parent.tempdev = str(self.configpage.ui.comboBox_temp.currentText())
|
||||
settings.set('temp_device', self.parent.tempdev)
|
||||
|
||||
self.parent.label_order = ''.join(self.parent.label_order.split('-'))
|
||||
settings.set('label_order', self.parent.label_order)
|
||||
|
||||
# reinitializate
|
||||
self.parent.reinit.reinit(confAccept=True)
|
||||
|
||||
|
||||
def createConfigurationInterface(self, parent):
|
||||
"""function to setup configuration window"""
|
||||
settings = config.Config(self.parent)
|
||||
|
||||
font = QFont(str(settings.get('font_family', 'Terminus')), settings.get('font_size', 12).toInt()[0], 400, False)
|
||||
self.configpage.ui.spinBox_interval.setValue(settings.get('interval', 2000).toInt()[0])
|
||||
self.configpage.ui.fontComboBox.setCurrentFont(font)
|
||||
self.configpage.ui.spinBox_fontSize.setValue(settings.get('font_size', 12).toInt()[0])
|
||||
self.configpage.ui.kcolorcombo.setColor(QColor(str(settings.get('font_color', '#000000'))))
|
||||
font = str(settings.get('font_style', 'normal'))
|
||||
if (font == 'normal'):
|
||||
self.configpage.ui.comboBox_style.setCurrentIndex(0)
|
||||
else:
|
||||
self.configpage.ui.comboBox_style.setCurrentIndex(1)
|
||||
self.configpage.ui.spinBox_weight.setValue(settings.get('font_weight', 400).toInt()[0])
|
||||
for label in self.parent.dict_orders.keys():
|
||||
exec ('bool = self.parent.' + self.parent.dict_orders[label] + 'Bool')
|
||||
self.configpage.checkboxes[self.parent.dict_orders[label]].setCheckState(bool)
|
||||
if (bool > 0):
|
||||
self.configpage.sliders[self.parent.dict_orders[label]].setValue(self.parent.label_order.find(label)+1)
|
||||
if (self.parent.dict_orders[label] == 'net'):
|
||||
self.configpage.lineedits[self.parent.dict_orders[label]].setText(str(settings.get(self.parent.dict_orders[label] + 'NonFormat', self.parent.dict_defFormat[self.parent.dict_orders[label]])))
|
||||
else:
|
||||
self.configpage.lineedits[self.parent.dict_orders[label]].setText(str(settings.get(self.parent.dict_orders[label] + 'Format', self.parent.dict_defFormat[self.parent.dict_orders[label]])))
|
||||
if (self.parent.dict_orders[label] == 'bat'):
|
||||
self.configpage.ui.lineEdit_batdev.setText(str(settings.get('battery_device', '/sys/class/power_supply/BAT0/capacity')))
|
||||
self.configpage.ui.lineEdit_acdev.setText(str(settings.get('ac_device', '/sys/class/power_supply/AC/online')))
|
||||
elif (self.parent.dict_orders[label] == 'temp'):
|
||||
self.configpage.ui.comboBox_temp.addItem(str(settings.get('temp_device', '<select device>')))
|
||||
commandOut = commands.getoutput("sensors")
|
||||
for adapter in commandOut.split("\n\n"):
|
||||
for device in adapter.split("\n"):
|
||||
if (device.find('\xc2\xb0C') > -1):
|
||||
try:
|
||||
tempdev = 'lmsensors/' + adapter.split('\n')[0] + '/' + '_'.join(device.split(":")[0].split())
|
||||
self.configpage.ui.comboBox_temp.addItem(tempdev)
|
||||
except:
|
||||
pass
|
||||
|
||||
# add config page
|
||||
page = parent.addPage(self.configpage, i18n(self.parent.name()))
|
||||
page.setIcon(KIcon(self.parent.icon()))
|
||||
|
||||
parent.okClicked.connect(self.configAccepted)
|
@ -1,237 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from PyQt4.QtCore import *
|
||||
from PyQt4.QtGui import *
|
||||
from PyKDE4.plasma import Plasma
|
||||
from PyKDE4 import plasmascript
|
||||
|
||||
|
||||
|
||||
class DataEngine:
|
||||
def __init__(self, parent):
|
||||
"""class definition"""
|
||||
self.parent = parent
|
||||
|
||||
|
||||
def connectToEngine(self):
|
||||
"""function to initializate engine"""
|
||||
self.parent.systemmonitor = self.parent.dataEngine("systemmonitor")
|
||||
if ((self.parent.gputempBool > 0) or (self.parent.gpuBool > 0) or (self.parent.hddtempBool > 0)):
|
||||
self.parent.extsysmon = self.parent.dataEngine("ext-sysmon")
|
||||
|
||||
if (self.parent.uptimeBool > 0):
|
||||
self.parent.systemmonitor.connectSource("system/uptime", self.parent, self.parent.interval)
|
||||
if (self.parent.cpuBool > 0):
|
||||
self.parent.systemmonitor.connectSource("cpu/system/TotalLoad", self.parent, self.parent.interval)
|
||||
if (self.parent.cpuFormat.split('$ccpu')[0] != self.parent.cpuFormat):
|
||||
for core in range(self.parent.numCores):
|
||||
self.parent.systemmonitor.connectSource("cpu/cpu"+str(core)+"/TotalLoad", self.parent, self.parent.interval)
|
||||
if (self.parent.cpuclockBool > 0):
|
||||
self.parent.systemmonitor.connectSource("cpu/system/AverageClock", self.parent, self.parent.interval)
|
||||
if (self.parent.cpuclockFormat.split('$ccpucl')[0] != self.parent.cpuclockFormat):
|
||||
for core in range(self.parent.numCores):
|
||||
self.parent.systemmonitor.connectSource("cpu/cpu"+str(core)+"/clock", self.parent, self.parent.interval)
|
||||
if (self.parent.tempBool > 0):
|
||||
self.parent.systemmonitor.connectSource(self.parent.tempdev, self.parent, self.parent.interval)
|
||||
if (self.parent.gpuBool > 0):
|
||||
self.parent.extsysmon.connectSource("gpu", self.parent, self.parent.interval)
|
||||
if (self.parent.gputempBool > 0):
|
||||
self.parent.extsysmon.connectSource("gputemp", self.parent, self.parent.interval)
|
||||
if (self.parent.memBool > 0):
|
||||
if (self.parent.memInMb):
|
||||
self.parent.systemmonitor.connectSource("mem/physical/application", self.parent, self.parent.interval)
|
||||
else:
|
||||
self.parent.systemmonitor.connectSource("mem/physical/free", self.parent, int(self.parent.interval*0.5))
|
||||
self.parent.systemmonitor.connectSource("mem/physical/used", self.parent, int(self.parent.interval*0.5))
|
||||
self.parent.systemmonitor.connectSource("mem/physical/application", self.parent, int(self.parent.interval*0.5))
|
||||
if (self.parent.swapBool > 0):
|
||||
if (self.parent.swapInMb):
|
||||
self.parent.systemmonitor.connectSource("mem/swap/used", self.parent, self.parent.interval)
|
||||
else:
|
||||
self.parent.systemmonitor.connectSource("mem/swap/free", self.parent, int(self.parent.interval*0.5))
|
||||
self.parent.systemmonitor.connectSource("mem/swap/used", self.parent, int(self.parent.interval*0.5))
|
||||
if (self.parent.hddBool > 0):
|
||||
for mount in self.parent.mountPoints:
|
||||
self.parent.systemmonitor.connectSource("partitions" + mount + "/filllevel", self.parent, self.parent.interval)
|
||||
if (self.parent.hddtempBool > 0):
|
||||
self.parent.extsysmon.connectSource("hddtemp", self.parent, self.parent.interval)
|
||||
if (self.parent.netBool > 0):
|
||||
self.parent.updateNetdev = 0
|
||||
self.parent.systemmonitor.connectSource("network/interfaces/"+self.parent.netdev+"/transmitter/data", self.parent, self.parent.interval)
|
||||
self.parent.systemmonitor.connectSource("network/interfaces/"+self.parent.netdev+"/receiver/data", self.parent, self.parent.interval)
|
||||
|
||||
def dataUpdated(self, sourceName, data):
|
||||
"""function to update data"""
|
||||
try:
|
||||
if (sourceName == "system/uptime"):
|
||||
value = int(round(float(data[QString(u'value')]), 1))
|
||||
uptimeText = '%3sd%2sh%2sm' % (str(int(value/(24*60*60))), int(value/60/60)-int(value/24/60/60)*24, (value-value%60)/60%60)
|
||||
if (self.parent.uptimeFormat.split('$uptime')[0] != self.parent.uptimeFormat):
|
||||
line = self.parent.uptimeFormat.split('$uptime')[0] + uptimeText + self.parent.uptimeFormat.split('$uptime')[1]
|
||||
else:
|
||||
line = self.parent.uptimeFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_uptime.setText(text)
|
||||
elif (sourceName == "cpu/system/TotalLoad"):
|
||||
value = str(round(float(data[QString(u'value')]), 1))
|
||||
cpuText = "%5s" % (value)
|
||||
if (self.parent.cpuFormat.split('$ccpu')[0] != self.parent.cpuFormat):
|
||||
if (self.parent.cpuFormat.split('$ccpu')[0].split('$cpu')[0] != self.parent.cpuFormat.split('$ccpu')[0]):
|
||||
line = self.parent.cpuFormat.split('$ccpu')[0].split('$cpu')[0] + cpuText + self.parent.cpuFormat.split('$ccpu')[0].split('$cpu')[1]
|
||||
else:
|
||||
line = self.parent.cpuFormat.split('$ccpu')[0]
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_cpu.setText(text)
|
||||
if (self.parent.cpuFormat.split('$ccpu')[1].split('$cpu')[0] != self.parent.cpuFormat.split('$ccpu')[1]):
|
||||
line = self.parent.cpuFormat.split('$ccpu')[1].split('$cpu')[0] + cpuText + self.parent.cpuFormat.split('$ccpu')[1].split('$cpu')[1]
|
||||
else:
|
||||
line = self.parent.cpuFormat.split('$ccpu')[1]
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_cpu1.setText(text)
|
||||
else:
|
||||
if (self.parent.cpuFormat.split('$cpu')[0] != self.parent.cpuFormat):
|
||||
line = self.parent.cpuFormat.split('$cpu')[0] + cpuText + self.parent.cpuFormat.split('$cpu')[1]
|
||||
else:
|
||||
line = self.parent.cpuFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_cpu.setText(text)
|
||||
elif ((str(sourceName)[:7] == "cpu/cpu") and (str(sourceName).split('/')[2] == "TotalLoad")):
|
||||
value = str(round(float(data[QString(u'value')]), 1))
|
||||
cpuText = "%5s" % (value)
|
||||
text = self.parent.formatLine.split('$LINE')[0] + cpuText + self.parent.formatLine.split('$LINE')[1]
|
||||
exec ('self.parent.label_coreCpu' + str(sourceName)[7] + '.setText(text)')
|
||||
elif (sourceName == "cpu/system/AverageClock"):
|
||||
value = str(data[QString(u'value')]).split('.')[0]
|
||||
cpuclockText = "%4s" % (value)
|
||||
if (self.parent.cpuclockFormat.split('$ccpucl')[0] != self.parent.cpuclockFormat):
|
||||
if (self.parent.cpuclockFormat.split('$ccpucl')[0].split('$cpucl')[0] != self.parent.cpuclockFormat.split('$ccpucl')[0]):
|
||||
line = self.parent.cpuclockFormat.split('$ccpucl')[0].split('$cpucl')[0] + cpuclockText + self.parent.cpuclockFormat.split('$ccpucl')[0].split('$cpucl')[1]
|
||||
else:
|
||||
line = self.parent.cpuclockFormat.split('$ccpucl')[0]
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_cpuclock.setText(text)
|
||||
if (self.parent.cpuclockFormat.split('$ccpucl')[1].split('$cpucl')[0] != self.parent.cpuclockFormat.split('$ccpucl')[1]):
|
||||
line = self.parent.cpuclockFormat.split('$ccpucl')[1].split('$cpucl')[0] + cpuclockText + self.parent.cpuclockFormat.split('$ccpucl')[1].split('$cpucl')[1]
|
||||
else:
|
||||
line = self.parent.cpuclockFormat.split('$ccpucl')[1]
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_cpuclock1.setText(text)
|
||||
else:
|
||||
if (self.parent.cpuclockFormat.split('$cpucl')[0] != self.parent.cpuclockFormat):
|
||||
line = self.parent.cpuclockFormat.split('$cpucl')[0] + cpuclockText + self.parent.cpuclockFormat.split('$cpucl')[1]
|
||||
else:
|
||||
line = self.parent.cpuclockFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_cpuclock.setText(text)
|
||||
elif ((str(sourceName)[:7] == "cpu/cpu") and (str(sourceName).split('/')[2] == "clock")):
|
||||
value = str(data[QString(u'value')]).split('.')[0]
|
||||
cpuclockText = "%4s" % (value)
|
||||
text = self.parent.formatLine.split('$LINE')[0] + cpuclockText + self.parent.formatLine.split('$LINE')[1]
|
||||
exec ('self.parent.label_coreCpuclock' + str(sourceName)[7] + '.setText(text)')
|
||||
elif (sourceName == "network/interfaces/"+self.parent.netdev+"/transmitter/data"):
|
||||
value = str(data[QString(u'value')]).split('.')[0]
|
||||
up_speed = "%4s" % (value)
|
||||
if (self.parent.netFormat.split('$net')[0] != self.parent.netFormat):
|
||||
line = '/' + up_speed + self.parent.netFormat.split('$net')[1]
|
||||
else:
|
||||
line = ''
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_netUp.setText(text)
|
||||
elif (sourceName == "network/interfaces/"+self.parent.netdev+"/receiver/data"):
|
||||
value = str(data[QString(u'value')]).split('.')[0]
|
||||
down_speed = "%4s" % (value)
|
||||
if (self.parent.netFormat.split('$net')[0] != self.parent.netFormat):
|
||||
line = self.parent.netFormat.split('$net')[0] + down_speed
|
||||
else:
|
||||
line = self.parent.netFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_netDown.setText(text)
|
||||
# update network device
|
||||
self.parent.updateNetdev = self.parent.updateNetdev + 1
|
||||
if (self.parent.updateNetdev == 100):
|
||||
self.parent.updateNetdev = 0
|
||||
if (self.parent.netNonFormat.split('@@')[0] == self.parent.netNonFormat):
|
||||
self.parent.systemmonitor.disconnectSource("network/interfaces/"+self.parent.netdev+"/transmitter/data", self.parent)
|
||||
self.parent.systemmonitor.disconnectSource("network/interfaces/"+self.parent.netdev+"/receiver/data", self.parent)
|
||||
self.parent.netdev = self.parent.setupNetdev()
|
||||
self.parent.systemmonitor.connectSource("network/interfaces/"+self.parent.netdev+"/transmitter/data", self.parent, self.parent.interval)
|
||||
self.parent.systemmonitor.connectSource("network/interfaces/"+self.parent.netdev+"/receiver/data", self.parent, self.parent.interval)
|
||||
if (self.parent.netNonFormat.split('$netdev')[0] != self.parent.netNonFormat):
|
||||
self.parent.netFormat = self.parent.netNonFormat.split('$netdev')[0] + self.parent.netdev + self.parent.netNonFormat.split('$netdev')[1]
|
||||
else:
|
||||
self.parent.netFormat = self.parent.netNonFormat
|
||||
elif (sourceName == self.parent.tempdev):
|
||||
value = str(round(float(data[QString(u'value')]), 1))
|
||||
tempText = "%4s" % (value)
|
||||
if (self.parent.tempFormat.split('$temp')[0] != self.parent.tempFormat):
|
||||
line = self.parent.tempFormat.split('$temp')[0] + tempText + self.parent.tempFormat.split('$temp')[1]
|
||||
else:
|
||||
line = self.parent.tempFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_temp.setText(text)
|
||||
elif (str(sourceName).split('/')[0] == "partitions"):
|
||||
value = str(round(float(data[QString(u'value')]), 1))
|
||||
hddText = "%5s" % (value)
|
||||
text = self.parent.formatLine.split('$LINE')[0] + hddText + self.parent.formatLine.split('$LINE')[1]
|
||||
exec ('self.parent.label_hdd_' + ''.join(str(sourceName).split('/')[1:-1]) + '.setText(text)')
|
||||
elif (sourceName == "mem/physical/free"):
|
||||
self.parent.mem_free = float(data[QString(u'value')])
|
||||
elif (sourceName == "mem/physical/used"):
|
||||
self.parent.mem_uf = float(data[QString(u'value')])
|
||||
elif (sourceName == "mem/physical/application"):
|
||||
if (self.parent.memInMb):
|
||||
mem = str(round(float(data[QString(u'value')]) / 1024, 0)).split('.')[0]
|
||||
mem = "%5s" % (mem)
|
||||
if (self.parent.memFormat.split('$memmb')[0] != self.parent.memFormat):
|
||||
line = self.parent.memFormat.split('$memmb')[0] + mem + self.parent.memFormat.split('$memmb')[1]
|
||||
else:
|
||||
line = self.parent.memFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_mem.setText(text)
|
||||
else:
|
||||
self.parent.mem_used = float(data[QString(u'value')])
|
||||
elif (sourceName == "mem/swap/free"):
|
||||
self.parent.swap_free = float(data[QString(u'value')])
|
||||
elif (sourceName == "mem/swap/used"):
|
||||
if (self.parent.swapInMb):
|
||||
mem = str(round(float(data[QString(u'value')]) / 1024, 0)).split('.')[0]
|
||||
mem = "%5s" % (mem)
|
||||
if (self.parent.swapFormat.split('$swapmb')[0] != self.parent.swapFormat):
|
||||
line = self.parent.swapFormat.split('$swapmb')[0] + mem + self.parent.swapFormat.split('$swapmb')[1]
|
||||
else:
|
||||
line = self.parent.swapFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_swap.setText(text)
|
||||
else:
|
||||
self.parent.swap_used = float(data[QString(u'value')])
|
||||
elif (sourceName == "gpu"):
|
||||
value = str(data[QString(u'GPU')])
|
||||
gpuText = "%4s" % (value)
|
||||
if (self.parent.gpuFormat.split('$gpu')[0] != self.parent.gpuFormat):
|
||||
line = self.parent.gpuFormat.split('$gpu')[0] + gpuText + self.parent.gpuFormat.split('$gpu')[1]
|
||||
else:
|
||||
line = self.parent.gpuFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_gpu.setText(text)
|
||||
elif (sourceName == "gputemp"):
|
||||
value = str(data[QString(u'GPUTemp')])
|
||||
gputempText = "%4s" % (value)
|
||||
if (self.parent.gputempFormat.split('$gputemp')[0] != self.parent.gputempFormat):
|
||||
line = self.parent.gputempFormat.split('$gputemp')[0] + gputempText + self.parent.gputempFormat.split('$gputemp')[1]
|
||||
else:
|
||||
line = self.parent.gputempFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_gputemp.setText(text)
|
||||
elif (sourceName == "hddtemp"):
|
||||
value = str(data[QString(self.parent.hddtempFormat.split('@@')[1])])
|
||||
hddtempText = "%4s" % (value)
|
||||
if (self.parent.hddtempFormat.split('@@')[0] != self.parent.hddtempFormat):
|
||||
line = self.parent.hddtempFormat.split('@@')[0] + hddtempText + self.parent.hddtempFormat.split('@@')[2]
|
||||
else:
|
||||
line = self.parent.hddtempFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_hddtemp.setText(text)
|
||||
|
||||
self.parent.update()
|
||||
except:
|
||||
pass
|
@ -1,202 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from PyQt4.QtCore import *
|
||||
from PyQt4.QtGui import *
|
||||
from PyKDE4.kdecore import *
|
||||
from PyKDE4.kdeui import *
|
||||
from PyKDE4.kio import *
|
||||
from PyKDE4 import plasmascript
|
||||
from PyKDE4.plasma import Plasma
|
||||
import commands, os, shutil, time
|
||||
|
||||
import configdef
|
||||
import configwindow
|
||||
import dataengine
|
||||
import reinit
|
||||
from util import *
|
||||
|
||||
|
||||
|
||||
class pyTextWidget(plasmascript.Applet):
|
||||
def __init__(self, parent, args=None):
|
||||
"""widget definition"""
|
||||
plasmascript.Applet.__init__(self, parent)
|
||||
|
||||
|
||||
def init(self):
|
||||
"""function to initializate widget"""
|
||||
self._name = str(self.package().metadata().pluginName())
|
||||
self.initTooltip()
|
||||
self.layout = QGraphicsLinearLayout(Qt.Horizontal, self.applet)
|
||||
|
||||
self.dataengine = dataengine.DataEngine(self)
|
||||
self.reinit = reinit.Reinit(self)
|
||||
|
||||
self.timer = QTimer()
|
||||
QObject.connect(self.timer, SIGNAL("timeout()"), self.updateLabel)
|
||||
|
||||
self.setupVar()
|
||||
self.reinit.reinit(confAccept=False)
|
||||
|
||||
self.setHasConfigurationInterface(True)
|
||||
# Create notifyrc file if required
|
||||
kdehome = unicode(KGlobal.dirs().localkdedir())
|
||||
if ((not os.path.exists(kdehome + "/share/apps/plasma_applet_pytextmonitor/plasma_applet_pytextmonitor.notifyrc")) or
|
||||
(not os.path.exists("/usr" + "/share/apps/plasma_applet_pytextmonitor/plasma_applet_pytextmonitor.notifyrc"))):
|
||||
self.createNotifyrc(kdehome)
|
||||
|
||||
|
||||
def createConfigurationInterface(self, parent):
|
||||
"""function to setup configuration window"""
|
||||
self.configpage = configwindow.ConfigWindow(self)
|
||||
self.configdef = configdef.ConfigDefinition(self, self.configpage)
|
||||
self.configdef.createConfigurationInterface(parent)
|
||||
|
||||
|
||||
def createNotifyrc(self, kdehome):
|
||||
"""function to create *.notifyrc"""
|
||||
if (not os.path.isdir(kdehome + "/share/apps/plasma_applet_pytextmonitor")):
|
||||
os.mkdir(kdehome + "/share/apps/plasma_applet_pytextmonitor")
|
||||
shutil.copy(kdehome + "/share/apps/plasma/plasmoids/py-text-monitor/contents/code/plasma_applet_pytextmonitor.notifyrc",
|
||||
kdehome + "/share/apps/plasma_applet_pytextmonitor/")
|
||||
|
||||
|
||||
def initTooltip(self):
|
||||
"""function to create tooltip"""
|
||||
self.tooltip = Plasma.ToolTipContent()
|
||||
self.tooltip.setMainText("PyTextMonitor")
|
||||
self.tooltip.setSubText('')
|
||||
Plasma.ToolTipManager.self().registerWidget(self.applet)
|
||||
# show tooltip
|
||||
#Plasma.ToolTipManager.self().setContent(self.applet, self.tooltip)
|
||||
|
||||
|
||||
def mouseDoubleClickEvent(self, event):
|
||||
"""function to doubleclick event"""
|
||||
os.system("ksysguard &")
|
||||
|
||||
|
||||
def setupNetdev(self):
|
||||
"""function to setup network device"""
|
||||
netdev = "lo"
|
||||
try:
|
||||
interfaces = []
|
||||
for line in commands.getoutput("ifconfig -a -s").split("\n"):
|
||||
if ((line.split()[0] != 'Iface') and (line.split()[0] != 'lo')):
|
||||
interfaces.append(line.split()[0])
|
||||
|
||||
for device in interfaces:
|
||||
if (commands.getoutput("ifconfig " + device + " | grep 'inet '") != ''):
|
||||
netdev = device
|
||||
break
|
||||
except:
|
||||
pass
|
||||
return netdev
|
||||
|
||||
|
||||
def setupVar(self):
|
||||
"""function to setup variables"""
|
||||
self.netdev = ''
|
||||
# setup number of cores
|
||||
commandOut = commands.getoutput("grep -c '^processor' /proc/cpuinfo")
|
||||
self.numCores = int(commandOut)
|
||||
|
||||
# create dictionaries
|
||||
self.dict_orders = {'6':'bat', '1':'cpu', '7':'cpuclock', '9':'gpu', 'a':'gputemp',
|
||||
'b':'hdd', 'c':'hddtemp', '3':'mem', '5':'net', '4':'swap', '2':'temp', '8':'uptime'}
|
||||
self.dict_defFormat = {'bat':'[bat: $bat%$ac]', 'cpu':'[cpu: $cpu%]',
|
||||
'cpuclock':'[mhz: $cpucl]', 'gpu':'[gpu: $gpu%]',
|
||||
'gputemp':'[gpu temp: $gputemp°C]', 'hdd':'[hdd: @@/@@%]',
|
||||
'hddtemp':'[hdd temp: @@/dev/sda@@°C]', 'mem':'[mem: $mem%]',
|
||||
'net':'[$netdev: $netKB/s]', 'swap':'[swap: $swap%]',
|
||||
'temp':'[temp: $temp°C]', 'uptime':'[uptime: $uptime]'}
|
||||
|
||||
def showConfigurationInterface(self):
|
||||
"""function to show configuration window"""
|
||||
plasmascript.Applet.showConfigurationInterface(self)
|
||||
|
||||
|
||||
def startPolling(self):
|
||||
try:
|
||||
self.timer.start()
|
||||
self.updateLabel()
|
||||
self.tooltip.setSubText('')
|
||||
except Exception as strerror:
|
||||
self.tooltip.setSubText(str(strerror))
|
||||
self.label_error = Plasma.Label(self.applet)
|
||||
self.label_error.setText('<font color="red">ERROR</font>')
|
||||
self.layout.addItem(self.label_error)
|
||||
return
|
||||
|
||||
def updateLabel(self):
|
||||
"""function to update label"""
|
||||
if ((self.memBool > 0) and (self.memInMb == False)):
|
||||
self.memText()
|
||||
if ((self.swapBool > 0) and (self.swapInMb == False)):
|
||||
self.swapText()
|
||||
if (self.batBool > 0):
|
||||
self.batText()
|
||||
|
||||
|
||||
def batText(self):
|
||||
"""function to set battery text"""
|
||||
line = self.batFormat
|
||||
if (line.split('$bat')[0] != line):
|
||||
try:
|
||||
with open (self.battery_device, 'r') as bat_file:
|
||||
bat = bat_file.readline().split('\n')[0]
|
||||
except:
|
||||
bat = 'off'
|
||||
bat = "%3s" % (bat)
|
||||
line = line.split('$bat')[0] + bat + line.split('$bat')[1]
|
||||
|
||||
if (line.split('$ac')[0] != line):
|
||||
try:
|
||||
with open (self.ac_device, 'r') as bat_file:
|
||||
bat = bat_file.readline().split('\n')[0]
|
||||
if (bat == '1'):
|
||||
bat = '(*)'
|
||||
else:
|
||||
bat = '( )'
|
||||
except:
|
||||
bat = '(?)'
|
||||
line = line.split('$ac')[0] + bat + line.split('$ac')[1]
|
||||
text = self.formatLine.split('$LINE')[0] + line + self.formatLine.split('$LINE')[1]
|
||||
self.label_bat.setText(text)
|
||||
|
||||
|
||||
def memText(self):
|
||||
"""function to set mem text"""
|
||||
full = self.mem_uf + self.mem_free
|
||||
mem = 100 * self.mem_used / full
|
||||
mem = "%5s" % (str(round(mem, 1)))
|
||||
if (self.memFormat.split('$mem')[0] != self.memFormat):
|
||||
line = self.memFormat.split('$mem')[0] + mem + self.memFormat.split('$mem')[1]
|
||||
else:
|
||||
line = self.memFormat
|
||||
text = self.formatLine.split('$LINE')[0] + line + self.formatLine.split('$LINE')[1]
|
||||
self.label_mem.setText(text)
|
||||
|
||||
|
||||
def swapText(self):
|
||||
"""function to set swap text"""
|
||||
full = self.swap_used + self.swap_free
|
||||
mem = 100 * self.swap_used / full
|
||||
mem = "%5s" % (str(round(mem, 1)))
|
||||
if (self.swapFormat.split('$swap')[0] != self.swapFormat):
|
||||
line = self.swapFormat.split('$swap')[0] + mem + self.swapFormat.split('$swap')[1]
|
||||
else:
|
||||
line = self.swapFormat
|
||||
text = self.formatLine.split('$LINE')[0] + line + self.formatLine.split('$LINE')[1]
|
||||
self.label_swap.setText(text)
|
||||
|
||||
|
||||
@pyqtSignature("dataUpdated(const QString &, const Plasma::DataEngine::Data &)")
|
||||
def dataUpdated(self, sourceName, data):
|
||||
"""function to update label"""
|
||||
self.dataengine.dataUpdated(sourceName, data)
|
||||
|
||||
|
||||
|
||||
def CreateApplet(parent):
|
||||
return pyTextWidget(parent)
|
@ -1,292 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from PyQt4.QtCore import *
|
||||
from PyQt4.QtGui import *
|
||||
from PyKDE4.plasma import Plasma
|
||||
import config
|
||||
import ptmnotify
|
||||
|
||||
|
||||
|
||||
class NewPlasmaLabel(Plasma.Label):
|
||||
"""new Label with defined clicked() event"""
|
||||
def __init__(self, applet, parent):
|
||||
"""class definition"""
|
||||
Plasma.Label.__init__(self, applet)
|
||||
self.parent = parent
|
||||
self.notify = ptmnotify.PTMNotify(self)
|
||||
|
||||
|
||||
def mousePressEvent(self, event):
|
||||
"""mouse click event"""
|
||||
if (event.button() == Qt.LeftButton):
|
||||
self.notify.init()
|
||||
|
||||
|
||||
|
||||
class Reinit():
|
||||
def __init__(self, parent):
|
||||
"""class definition"""
|
||||
self.parent = parent
|
||||
|
||||
|
||||
def reinit(self, confAccept=False):
|
||||
"""function to reinitializate widget"""
|
||||
settings = config.Config(self.parent)
|
||||
self.parent.interval = settings.get('interval', 2000).toInt()[0]
|
||||
self.parent.font_family = str(settings.get('font_family', 'Terminus'))
|
||||
self.parent.font_size = settings.get('font_size', 12).toInt()[0]
|
||||
self.parent.font_color = str(settings.get('font_color', '#000000'))
|
||||
self.parent.font_style = str(settings.get('font_style', 'normal'))
|
||||
self.parent.font_weight = settings.get('font_weight', 400).toInt()[0]
|
||||
self.parent.formatLine = "<pre><p align=\"center\"><span style=\" font-family:'" + self.parent.font_family + "'; font-style:" + self.parent.font_style
|
||||
self.parent.formatLine = self.parent.formatLine + "; font-size:" + str(self.parent.font_size) + "pt; font-weight:" + str(self.parent.font_weight)
|
||||
self.parent.formatLine = self.parent.formatLine + "; color:" + self.parent.font_color + ";\">$LINE</span></p></pre>"
|
||||
self.parent.label_order = str(settings.get('label_order', '1345'))
|
||||
for label in self.parent.dict_orders.values():
|
||||
if ((label == 'cpu') or (label == 'mem') or (label == 'swap') or (label == 'net')):
|
||||
exec ('self.parent.' + label + 'Bool = int(settings.get("' + label + 'Bool", 2))')
|
||||
else:
|
||||
exec ('self.parent.' + label + 'Bool = int(settings.get("' + label + 'Bool", 0))')
|
||||
|
||||
# labels
|
||||
for order in self.parent.label_order:
|
||||
if (order == "1"):
|
||||
if (self.parent.cpuBool > 0):
|
||||
self.parent.cpuFormat = str(settings.get('cpuFormat', '[cpu: $cpu%]'))
|
||||
if (self.parent.cpuFormat.split('$ccpu')[0] != self.parent.cpuFormat):
|
||||
self.parent.label_cpu = NewPlasmaLabel(self.parent.applet, self.parent)
|
||||
self.parent.label_cpu1 = Plasma.Label(self.parent.applet)
|
||||
if (self.parent.cpuFormat.split('$ccpu')[0].split('$cpu')[0] != self.parent.cpuFormat.split('$ccpu')[0]):
|
||||
line = self.parent.cpuFormat.split('$ccpu')[0].split('$cpu')[0] + '-----' + self.parent.cpuFormat.split('$ccpu')[0].split('$cpu')[1]
|
||||
else:
|
||||
line = self.parent.cpuFormat.split('$ccpu')[0]
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_cpu.setText(text)
|
||||
self.parent.layout.addItem(self.parent.label_cpu)
|
||||
text = self.parent.formatLine.split('$LINE')[0] + "-----" + self.parent.formatLine.split('$LINE')[1]
|
||||
for core in range(self.parent.numCores):
|
||||
exec ('self.parent.label_coreCpu' + str(core) + ' = Plasma.Label(self.parent.applet)')
|
||||
exec ('self.parent.label_coreCpu' + str(core) + '.setText(text)')
|
||||
exec ('self.parent.layout.addItem(self.parent.label_coreCpu' + str(core) + ')')
|
||||
if (self.parent.cpuFormat.split('$ccpu')[1].split('$cpu')[0] != self.parent.cpuFormat.split('$ccpu')[1]):
|
||||
line = self.parent.cpuFormat.split('$ccpu')[1].split('$cpu')[0] + '-----' + self.parent.cpuFormat.split('$ccpu')[1].split('$cpu')[1]
|
||||
else:
|
||||
line = self.parent.cpuFormat.split('$ccpu')[1]
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_cpu1.setText(text)
|
||||
self.parent.layout.addItem(self.parent.label_cpu1)
|
||||
else:
|
||||
self.parent.label_cpu = NewPlasmaLabel(self.parent.applet, self.parent)
|
||||
if (self.parent.cpuFormat.split('$cpu')[0] != self.parent.cpuFormat):
|
||||
line = self.parent.cpuFormat.split('$cpu')[0] + '-----' + self.parent.cpuFormat.split('$cpu')[1]
|
||||
else:
|
||||
line = self.parent.cpuFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_cpu.setText(text)
|
||||
self.parent.layout.addItem(self.parent.label_cpu)
|
||||
elif (order == "2"):
|
||||
if (self.parent.tempBool > 0):
|
||||
self.parent.tempdev = str(settings.get('temp_device', '<select device>'))
|
||||
self.parent.tempFormat = str(settings.get('tempFormat', '[temp: $temp°C]'))
|
||||
self.parent.label_temp = NewPlasmaLabel(self.parent.applet, self.parent)
|
||||
if (self.parent.tempFormat.split('$temp')[0] != self.parent.tempFormat):
|
||||
line = self.parent.tempFormat.split('$temp')[0] + '----' + self.parent.tempFormat.split('$temp')[1]
|
||||
else:
|
||||
line = self.parent.tempFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_temp.setText(text)
|
||||
self.parent.layout.addItem(self.parent.label_temp)
|
||||
elif (order == "3"):
|
||||
if (self.parent.memBool > 0):
|
||||
self.parent.memFormat = str(settings.get('memFormat', '[mem: $mem%]'))
|
||||
if (self.parent.memFormat.split('$memmb')[0] != self.parent.memFormat):
|
||||
self.parent.memInMb = True
|
||||
line = self.parent.memFormat.split('$memmb')[0] + '-----' + self.parent.memFormat.split('$memmb')[1]
|
||||
elif (self.parent.memFormat.split('$mem')[0] != self.parent.memFormat):
|
||||
self.parent.memInMb = False
|
||||
self.parent.mem_used = 0.0
|
||||
self.parent.mem_free = 1.0
|
||||
self.parent.mem_uf = 0.0
|
||||
line = self.parent.memFormat.split('$mem')[0] + '-----' + self.parent.memFormat.split('$mem')[1]
|
||||
else:
|
||||
line = self.parent.memFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_mem = NewPlasmaLabel(self.parent.applet, self.parent)
|
||||
self.parent.label_mem.setText(text)
|
||||
self.parent.layout.addItem(self.parent.label_mem)
|
||||
elif (order == "4"):
|
||||
if (self.parent.swapBool > 0):
|
||||
self.parent.swapFormat = str(settings.get('swapFormat', '[swap: $swap%]'))
|
||||
if (self.parent.swapFormat.split('$swapmb')[0] != self.parent.swapFormat):
|
||||
self.parent.swapInMb = True
|
||||
line = self.parent.swapFormat.split('$swapmb')[0] + '-----' + self.parent.swapFormat.split('$swapmb')[1]
|
||||
elif (self.parent.swapFormat.split('$swap')[0] != self.parent.swapFormat):
|
||||
self.parent.swapInMb = False
|
||||
self.parent.swap_free = 1.0
|
||||
self.parent.swap_used = 0.0
|
||||
line = self.parent.swapFormat.split('$swap')[0] + '-----' + self.parent.swapFormat.split('$swap')[1]
|
||||
else:
|
||||
line = self.parent.swapFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_swap = NewPlasmaLabel(self.parent.applet, self.parent)
|
||||
self.parent.label_swap.setText(text)
|
||||
self.parent.layout.addItem(self.parent.label_swap)
|
||||
elif (order == "5"):
|
||||
if (self.parent.netBool > 0):
|
||||
self.parent.netNonFormat = str(settings.get('netNonFormat', '[net: $netKB/s]'))
|
||||
if (self.parent.netNonFormat.split('@@')[0] != self.parent.netNonFormat):
|
||||
self.parent.netdev = self.parent.netNonFormat.split('@@')[1]
|
||||
self.parent.netNonFormat = self.parent.netNonFormat.split('@@')[0] + self.parent.netNonFormat.split('@@')[2]
|
||||
else:
|
||||
self.parent.netdev = self.parent.setupNetdev()
|
||||
if (self.parent.netNonFormat.split('$netdev')[0] != self.parent.netNonFormat):
|
||||
self.parent.netFormat = self.parent.netNonFormat.split('$netdev')[0] + self.parent.netdev + self.parent.netNonFormat.split('$netdev')[1]
|
||||
else:
|
||||
self.parent.netFormat = self.parent.netNonFormat
|
||||
self.parent.label_netDown = NewPlasmaLabel(self.parent.applet, self.parent)
|
||||
if (self.parent.netFormat.split('$net')[0] != self.parent.netFormat):
|
||||
line = self.parent.netFormat.split('$net')[0] + '----'
|
||||
else:
|
||||
line = self.parent.netFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_netDown.setText(text)
|
||||
self.parent.layout.addItem(self.parent.label_netDown)
|
||||
self.parent.label_netUp = Plasma.Label(self.parent.applet)
|
||||
if (self.parent.netFormat.split('$net')[0] != self.parent.netFormat):
|
||||
line = '/----' + self.parent.netFormat.split('$net')[1]
|
||||
else:
|
||||
line = ''
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_netUp.setText(text)
|
||||
self.parent.layout.addItem(self.parent.label_netUp)
|
||||
elif (order == "6"):
|
||||
if (self.parent.batBool > 0):
|
||||
self.parent.batFormat = str(settings.get('batFormat', '[bat: $bat%$ac]'))
|
||||
self.parent.battery_device= str(settings.get('battery_device', '/sys/class/power_supply/BAT0/capacity'))
|
||||
self.parent.ac_device = str(settings.get('ac_device', '/sys/class/power_supply/AC/online'))
|
||||
self.parent.label_bat = NewPlasmaLabel(self.parent.applet, self.parent)
|
||||
line = self.parent.batFormat
|
||||
if (line.split('$ac')[0] != line):
|
||||
line = line.split('$ac')[0] + '(-)' + line.split('$ac')[1]
|
||||
if (line.split('$bat')[0] != line):
|
||||
line = line.split('$bat')[0] + '---' + line.split('$bat')[1]
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_bat.setText(text)
|
||||
self.parent.layout.addItem(self.parent.label_bat)
|
||||
elif (order == "7"):
|
||||
if (self.parent.cpuclockBool > 0):
|
||||
self.parent.cpuclockFormat = str(settings.get('cpuclockFormat', '[mhz: $cpucl]'))
|
||||
if (self.parent.cpuclockFormat.split('$ccpucl')[0] != self.parent.cpuclockFormat):
|
||||
self.parent.label_cpuclock = NewPlasmaLabel(self.parent.applet, self.parent)
|
||||
self.parent.label_cpuclock1 = Plasma.Label(self.parent.applet)
|
||||
if (self.parent.cpuclockFormat.split('$ccpucl')[0].split('$cpucl')[0] != self.parent.cpuclockFormat.split('$ccpucl')[0]):
|
||||
line = self.parent.cpuclockFormat.split('$ccpucl')[0].split('$cpucl')[0] + '----' + self.parent.cpuclockFormat.split('$ccpucl')[0].split('$cpucl')[1]
|
||||
else:
|
||||
line = self.parent.cpuclockFormat.split('$ccpucl')[0]
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_cpuclock.setText(text)
|
||||
self.parent.layout.addItem(self.parent.label_cpuclock)
|
||||
text = self.parent.formatLine.split('$LINE')[0] + "----" + self.parent.formatLine.split('$LINE')[1]
|
||||
for core in range(self.parent.numCores):
|
||||
exec ('self.parent.label_coreCpuclock' + str(core) + ' = Plasma.Label(self.parent.applet)')
|
||||
exec ('self.parent.label_coreCpuclock' + str(core) + '.setText(text)')
|
||||
exec ('self.parent.layout.addItem(self.parent.label_coreCpuclock' + str(core) + ')')
|
||||
if (self.parent.cpuclockFormat.split('$ccpucl')[1].split('$cpucl')[0] != self.parent.cpuclockFormat.split('$ccpucl')[1]):
|
||||
line = self.parent.cpuclockFormat.split('$ccpucl')[1].split('$cpucl')[0] + '----' + self.parent.cpuclockFormat.split('$ccpucl')[1].split('$cpucl')[1]
|
||||
else:
|
||||
line = self.parent.cpuclockFormat.split('$ccpucl')[1]
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_cpuclock1.setText(text)
|
||||
self.parent.layout.addItem(self.parent.label_cpuclock1)
|
||||
else:
|
||||
self.parent.label_cpuclock = NewPlasmaLabel(self.parent.applet, self.parent)
|
||||
if (self.parent.cpuclockFormat.split('$cpucl')[0] != self.parent.cpuclockFormat):
|
||||
line = self.parent.cpuclockFormat.split('$cpucl')[0] + '----' + self.parent.cpuclockFormat.split('$cpucl')[1]
|
||||
else:
|
||||
line = self.parent.cpuclockFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_cpuclock.setText(text)
|
||||
self.parent.layout.addItem(self.parent.label_cpuclock)
|
||||
elif (order == "8"):
|
||||
if (self.parent.uptimeBool > 0):
|
||||
self.parent.uptimeFormat = str(settings.get('uptimeFormat', '[uptime: $uptime]'))
|
||||
self.parent.label_uptime = NewPlasmaLabel(self.parent.applet, self.parent)
|
||||
if (self.parent.uptimeFormat.split('$uptime')[0] != self.parent.uptimeFormat):
|
||||
line = self.parent.uptimeFormat.split('$uptime')[0] + '---d--h--m' + self.parent.uptimeFormat.split('$uptime')[1]
|
||||
else:
|
||||
line = self.parent.uptimeFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_uptime.setText(text)
|
||||
self.parent.layout.addItem(self.parent.label_uptime)
|
||||
elif (order == "9"):
|
||||
if (self.parent.gpuBool > 0):
|
||||
self.parent.gpuFormat = str(settings.get('gpuFormat', '[gpu: $gpu%]'))
|
||||
self.parent.label_gpu = NewPlasmaLabel(self.parent.applet, self.parent)
|
||||
if (self.parent.gpuFormat.split('$gpu')[0] != self.parent.gpuFormat):
|
||||
line = self.parent.gpuFormat.split('$gpu')[0] + '-----' + self.parent.gpuFormat.split('$gpu')[1]
|
||||
else:
|
||||
line = self.parent.gpuFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_gpu.setText(text)
|
||||
self.parent.layout.addItem(self.parent.label_gpu)
|
||||
elif (order == "a"):
|
||||
if (self.parent.gputempBool > 0):
|
||||
self.parent.gputempFormat = str(settings.get('gputempFormat', '[gpu temp: $gputemp°C]'))
|
||||
self.parent.label_gputemp = NewPlasmaLabel(self.parent.applet, self.parent)
|
||||
if (self.parent.gputempFormat.split('$gputemp')[0] != self.parent.gputempFormat):
|
||||
line = self.parent.gputempFormat.split('$gputemp')[0] + '----' + self.parent.gputempFormat.split('$gputemp')[1]
|
||||
else:
|
||||
line = self.parent.gputempFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_gputemp.setText(text)
|
||||
self.parent.layout.addItem(self.parent.label_gputemp)
|
||||
elif (order == "b"):
|
||||
if (self.parent.hddBool > 0):
|
||||
self.parent.hddFormat = str(settings.get('hddFormat', '[hdd: @@/@@%]'))
|
||||
if (self.parent.hddFormat.split('@@')[0] != self.parent.hddFormat):
|
||||
self.parent.mountPoints = self.parent.hddFormat.split('@@')[1].split(';')
|
||||
line = self.parent.hddFormat.split('@@')[0]
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_hdd0 = NewPlasmaLabel(self.parent.applet, self.parent)
|
||||
self.parent.label_hdd0.setText(text)
|
||||
self.parent.layout.addItem(self.parent.label_hdd0)
|
||||
text = self.parent.formatLine.split('$LINE')[0] + "-----" + self.parent.formatLine.split('$LINE')[1]
|
||||
for mount in self.parent.mountPoints:
|
||||
exec ('self.parent.label_hdd_' + ''.join(mount.split('/')) + ' = Plasma.Label(self.parent.applet)')
|
||||
exec ('self.parent.label_hdd_' + ''.join(mount.split('/')) + '.setText(text)')
|
||||
exec ('self.parent.layout.addItem(self.parent.label_hdd_' + ''.join(mount.split('/')) + ')')
|
||||
line = self.parent.hddFormat.split('@@')[2]
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_hdd1 = Plasma.Label(self.parent.applet)
|
||||
self.parent.label_hdd1.setText(text)
|
||||
self.parent.layout.addItem(self.parent.label_hdd1)
|
||||
else:
|
||||
line = self.parent.hddFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_hdd0.setText(text)
|
||||
self.parent.layout.addItem(self.parent.label_hdd0)
|
||||
elif (order == "c"):
|
||||
if (self.parent.hddtempBool > 0):
|
||||
self.parent.hddtempFormat = str(settings.get('hddtempFormat', '[hdd temp: @@/dev/sda@@°C]'))
|
||||
self.parent.label_hddtemp = NewPlasmaLabel(self.parent.applet, self.parent)
|
||||
if (self.parent.hddtempFormat.split('@@')[0] != self.parent.hddtempFormat):
|
||||
line = self.parent.hddtempFormat.split('@@')[0] + '----' + self.parent.hddtempFormat.split('@@')[2]
|
||||
else:
|
||||
line = self.parent.hddtempFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_hddtemp.setText(text)
|
||||
self.parent.layout.addItem(self.parent.label_hddtemp)
|
||||
if not confAccept:
|
||||
self.parent.applet.setLayout(self.parent.layout)
|
||||
self.parent.theme = Plasma.Svg(self.parent)
|
||||
self.parent.theme.setImagePath("widgets/background")
|
||||
self.parent.setBackgroundHints(Plasma.Applet.DefaultBackground)
|
||||
self.parent.resize(10, 10)
|
||||
|
||||
# create dataengines
|
||||
self.parent.thread().wait(60000)
|
||||
self.parent.dataengine.connectToEngine()
|
||||
|
||||
self.parent.timer.setInterval(self.parent.interval)
|
||||
self.parent.startPolling()
|
@ -1,40 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from shutil import copyfile
|
||||
from PyKDE4.kdecore import *
|
||||
import os
|
||||
|
||||
|
||||
|
||||
class Util():
|
||||
def __init__(self, applet):
|
||||
self.applet = applet
|
||||
|
||||
|
||||
def createDirectory(self, name):
|
||||
if not os.path.isdir(name):
|
||||
try:
|
||||
os.mkdir(name)
|
||||
except:
|
||||
print 'Failed to create directory: ' + name
|
||||
|
||||
|
||||
def kdeHome(self):
|
||||
return unicode(KGlobal.dirs().localkdedir())
|
||||
|
||||
|
||||
def createNotifyrc(self):
|
||||
print '[%s] creating notifyrc' % (self.applet._name)
|
||||
self.createDirectory(self.kdeHome() + 'share/apps/%s' % self.applet._name)
|
||||
|
||||
source = self.applet.package().path() + 'contents/misc/%s.notifyrc' % self.applet._name
|
||||
destination = self.kdeHome() + 'share/apps/%s/%s.notifyrc' % (self.applet._name, self.applet._name)
|
||||
copyfile(source, destination)
|
||||
|
||||
|
||||
def createConfig(self):
|
||||
self.createDirectory(self.kdeHome() + 'share/apps/%s' % self.applet._name)
|
||||
|
||||
source = self.applet.package().path() + 'contents/misc/%s.ini' % self.applet._name
|
||||
destination = self.kdeHome() + 'share/apps/%s/%s.ini' % (self.applet._name, self.applet._name)
|
||||
copyfile(source, destination)
|
27
sources/ext-sysmon/CMakeLists.txt
Normal file
@ -0,0 +1,27 @@
|
||||
# set project name
|
||||
set (SUBPROJECT plasma_engine_extsysmon)
|
||||
|
||||
# find required libaries
|
||||
find_package (KDE4 REQUIRED)
|
||||
include (KDE4Defaults)
|
||||
|
||||
add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
|
||||
include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/../)
|
||||
|
||||
set (PLUGIN_NAME ${SUBPROJECT})
|
||||
file (GLOB SUBPROJECT_DESKTOP_IN *.desktop)
|
||||
file (RELATIVE_PATH SUBPROJECT_DESKTOP ${CMAKE_SOURCE_DIR} ${SUBPROJECT_DESKTOP_IN})
|
||||
file (GLOB SUBPROJECT_SOURCE *.cpp)
|
||||
file (GLOB SUBPROJECT_CONF *.conf)
|
||||
|
||||
# prepare
|
||||
configure_file (${SUBPROJECT_DESKTOP_IN} ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_DESKTOP})
|
||||
|
||||
# make
|
||||
kde4_add_plugin (${PLUGIN_NAME} ${SUBPROJECT_SOURCE})
|
||||
target_link_libraries (${PLUGIN_NAME} ${KDE4_KDECORE_LIBS} ${KDE4_PLASMA_LIBS})
|
||||
|
||||
# install
|
||||
install (TARGETS ${PLUGIN_NAME} DESTINATION ${PLUGIN_INSTALL_DIR})
|
||||
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_DESKTOP} DESTINATION ${SERVICES_INSTALL_DIR})
|
||||
install (FILES ${SUBPROJECT_CONF} DESTINATION ${CONFIG_INSTALL_DIR})
|
13
sources/ext-sysmon/extsysmon.conf
Normal file
@ -0,0 +1,13 @@
|
||||
# Configuration file for Extended Systemmonitor DataEngine
|
||||
# Uncomment needed lines
|
||||
|
||||
# Set GPU device
|
||||
# May be 'nvidia' (for nvidia), 'ati' (for ATI RADEON), 'ignore' or 'auto'
|
||||
#GPUDEV=auto
|
||||
|
||||
# Set block device for hddtemp comma separated or use 'all'
|
||||
#HDDDEV=all
|
||||
|
||||
# Set MPD settings
|
||||
#MPDADDRESS=localhost
|
||||
#MPDPORT=6600
|
359
sources/ext-sysmon/extsysmon.cpp
Normal file
@ -0,0 +1,359 @@
|
||||
/***************************************************************************
|
||||
* This file is part of pytextmonitor *
|
||||
* *
|
||||
* pytextmonitor 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. *
|
||||
* *
|
||||
* pytextmonitor 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 pytextmonitor. If not, see http://www.gnu.org/licenses/ *
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#include "extsysmon.h"
|
||||
|
||||
#include <Plasma/DataContainer>
|
||||
#include <QFile>
|
||||
#include <QProcess>
|
||||
#include <QTextCodec>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
ExtendedSysMon::ExtendedSysMon(QObject* parent, const QVariantList& args)
|
||||
: Plasma::DataEngine(parent, args)
|
||||
{
|
||||
Q_UNUSED(args)
|
||||
|
||||
setMinimumPollingInterval(333);
|
||||
readConfiguration();
|
||||
}
|
||||
|
||||
QStringList ExtendedSysMon::sources() const
|
||||
{
|
||||
QStringList source;
|
||||
source.append(QString("gpu"));
|
||||
source.append(QString("gputemp"));
|
||||
source.append(QString("hddtemp"));
|
||||
source.append(QString("player"));
|
||||
return source;
|
||||
}
|
||||
|
||||
bool ExtendedSysMon::readConfiguration()
|
||||
{
|
||||
// pre-setup
|
||||
FILE *f_out;
|
||||
f_out = popen("lspci 2> /dev/null", "r");
|
||||
char device[256];
|
||||
QString dev;
|
||||
while (fgets(device, 256, f_out) != NULL) {
|
||||
dev = QString(device);
|
||||
if (dev.toLower().contains("nvidia"))
|
||||
gpuDev = QString("nvidia");
|
||||
else if (dev.toLower().contains("radeon"))
|
||||
gpuDev = QString("ati");
|
||||
}
|
||||
pclose(f_out);
|
||||
|
||||
f_out = popen("ls -1 /dev/sd[a-z] 2> /dev/null ; ls -1 /dev/hd[a-z] 2> /dev/null", "r");
|
||||
while (fgets(device, 256, f_out) != NULL) {
|
||||
dev = QString(device).split("\n")[0];
|
||||
if (dev[0] == '/')
|
||||
hddDev.append(dev);
|
||||
}
|
||||
pclose(f_out);
|
||||
|
||||
mpdAddress = QString("localhost");
|
||||
mpdPort = QString("6600");
|
||||
|
||||
QString fileStr;
|
||||
// FIXME: define configuration file
|
||||
QString confFileName = QString(getenv("HOME")) + QString("/.kde4/share/config/extsysmon.conf");
|
||||
QFile confFile(confFileName);
|
||||
bool exists = confFile.open(QIODevice::ReadOnly);
|
||||
if (!exists) {
|
||||
confFileName = QString("/usr/share/config/extsysmon.conf");
|
||||
confFile.setFileName(confFileName);
|
||||
exists = confFile.open(QIODevice::ReadOnly);
|
||||
if (!exists)
|
||||
return false;
|
||||
}
|
||||
|
||||
while (true) {
|
||||
fileStr = QString(confFile.readLine());
|
||||
if (fileStr[0] != '#') {
|
||||
if (fileStr.split(QString("="), QString::SkipEmptyParts).count() == 2) {
|
||||
if (fileStr.split(QString("="), QString::SkipEmptyParts)[0] == QString("GPUDEV")) {
|
||||
if (fileStr.split(QString("="), QString::SkipEmptyParts)[1].trimmed() == QString("ati"))
|
||||
gpuDev = fileStr.split(QString("="), QString::SkipEmptyParts)[1].trimmed();
|
||||
else if (fileStr.split(QString("="), QString::SkipEmptyParts)[1].trimmed() == QString("nvidia"))
|
||||
gpuDev = fileStr.split(QString("="), QString::SkipEmptyParts)[1].trimmed();
|
||||
else if (fileStr.split(QString("="), QString::SkipEmptyParts)[1].trimmed() != QString("auto"))
|
||||
gpuDev = QString("ignore");
|
||||
}
|
||||
else if (fileStr.split(QString("="), QString::SkipEmptyParts)[0] == QString("HDDDEV")) {
|
||||
if (fileStr.split(QString("="), QString::SkipEmptyParts)[1].trimmed() != QString("all")) {
|
||||
hddDev.clear();
|
||||
for (int i=0; i<fileStr.split(QString("="), QString::SkipEmptyParts)[1].split(QString("\n"), \
|
||||
QString::SkipEmptyParts)[0].split(QString(","), QString::SkipEmptyParts).count(); i++)
|
||||
hddDev.append(fileStr.split(QString("="), QString::SkipEmptyParts)[1].split(QString("\n"), \
|
||||
QString::SkipEmptyParts)[0].split(QString(","), QString::SkipEmptyParts)[i]);
|
||||
}
|
||||
}
|
||||
else if (fileStr.split(QString("="), QString::SkipEmptyParts)[0] == QString("MPDADDRESS"))
|
||||
mpdAddress = fileStr.split(QString("="), QString::SkipEmptyParts)[1].trimmed();
|
||||
else if (fileStr.split(QString("="), QString::SkipEmptyParts)[0] == QString("MPDPORT"))
|
||||
mpdPort = fileStr.split(QString("="), QString::SkipEmptyParts)[1].trimmed();
|
||||
}
|
||||
}
|
||||
if (confFile.atEnd())
|
||||
break;
|
||||
}
|
||||
|
||||
confFile.close();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ExtendedSysMon::sourceRequestEvent(const QString &name)
|
||||
{
|
||||
return updateSourceEvent(name);
|
||||
}
|
||||
|
||||
bool ExtendedSysMon::updateSourceEvent(const QString &source)
|
||||
{
|
||||
FILE *f_out;
|
||||
QString key, out, tmp_out, value;
|
||||
bool ok = false;
|
||||
char output[256], val[5];
|
||||
if (source == QString("gpu")) {
|
||||
key = QString("GPU");
|
||||
if (gpuDev == QString("nvidia")) {
|
||||
f_out = popen("nvidia-smi -q -d UTILIZATION 2> /dev/null | grep Gpu | tail -n1", "r");
|
||||
fgets (output, 256, f_out);
|
||||
if ((output[0] == '\0') ||
|
||||
(QString(output).split(QString(" "), QString::SkipEmptyParts).count() < 2))
|
||||
value = QString(" N\\A");
|
||||
else {
|
||||
out = QString(output).split(QString(" "), QString::SkipEmptyParts)[2];
|
||||
sprintf (val, "%5.1f", out.left(out.count()-2).toFloat(&ok));
|
||||
value = QString(val);
|
||||
}
|
||||
pclose(f_out);
|
||||
}
|
||||
else if (gpuDev == QString("ati")) {
|
||||
f_out = popen("aticonfig --od-getclocks 2> /dev/null | grep load | tail -n1", "r");
|
||||
fgets (output, 256, f_out);
|
||||
if ((output[0] == '\0') ||
|
||||
(QString(output).split(QString(" "), QString::SkipEmptyParts).count() < 3))
|
||||
value = QString(" N\\A");
|
||||
else {
|
||||
out = QString(output).split(QString(" "), QString::SkipEmptyParts)[3];
|
||||
sprintf (val, "%5.1f", out.left(out.count()-2).toFloat(&ok));
|
||||
value = QString(val);
|
||||
}
|
||||
pclose(f_out);
|
||||
}
|
||||
else {
|
||||
value = QString(" N\\A");
|
||||
}
|
||||
if (ok == false)
|
||||
value = QString(" N\\A");
|
||||
value = value.split(QString(","), QString::SkipEmptyParts).join(QString("."));
|
||||
setData(source, key, value);
|
||||
}
|
||||
else if (source == QString("gputemp")) {
|
||||
key = QString("GPUTemp");
|
||||
if (gpuDev == QString("nvidia")) {
|
||||
f_out = popen("nvidia-smi -q -d TEMPERATURE 2> /dev/null | grep Gpu | tail -n1", "r");
|
||||
fgets (output, 256, f_out);
|
||||
if ((output[0] == '\0') ||
|
||||
(QString(output).split(QString(" "), QString::SkipEmptyParts).count() < 2))
|
||||
value = QString(" N\\A");
|
||||
else {
|
||||
out = QString(output).split(QString(" "), QString::SkipEmptyParts)[2];
|
||||
sprintf (val, "%4.1f", out.toFloat(&ok));
|
||||
value = QString(val);
|
||||
}
|
||||
pclose(f_out);
|
||||
}
|
||||
else if (gpuDev == QString("ati")) {
|
||||
f_out = popen("aticonfig --od-gettemperature 2> /dev/null | grep Temperature | tail -n1", "r");
|
||||
fgets (output, 256, f_out);
|
||||
if ((output[0] == '\0') ||
|
||||
(QString(output).split(QString(" "), QString::SkipEmptyParts).count() < 4))
|
||||
value = QString(" N\\A");
|
||||
else {
|
||||
out = QString(output).split(QString(" "), QString::SkipEmptyParts)[4];
|
||||
sprintf (val, "%4.1f", out.toFloat(&ok));
|
||||
value = QString(val);
|
||||
}
|
||||
pclose(f_out);
|
||||
}
|
||||
else {
|
||||
value = QString(" N\\A");
|
||||
}
|
||||
if (ok == false)
|
||||
value = QString(" N\\A");
|
||||
value = value.split(QString(","), QString::SkipEmptyParts).join(QString("."));
|
||||
setData(source, key, value);
|
||||
}
|
||||
else if (source == QString("hddtemp")) {
|
||||
char command[256], *dev;
|
||||
QByteArray qb;
|
||||
for (int i=0; i<hddDev.count(); i++) {
|
||||
qb = hddDev[i].toUtf8();
|
||||
dev = qb.data();
|
||||
sprintf(command, "sudo hddtemp %s 2> /dev/null", dev);
|
||||
f_out = popen(command, "r");
|
||||
fgets(output, 256, f_out);
|
||||
if ((output[0] == '\0') ||
|
||||
(QString(output).split(QString(":"), QString::SkipEmptyParts).count() < 3))
|
||||
value = QString(" N\\A");
|
||||
else {
|
||||
out = QString(output).split(QString(":"), QString::SkipEmptyParts)[2];
|
||||
sprintf (val, "%4.1f", out.left(out.count()-4).toFloat(&ok));
|
||||
value = QString(val);
|
||||
}
|
||||
pclose(f_out);
|
||||
if (ok == false)
|
||||
value = QString(" N\\A");
|
||||
value = value.split(QString(","), QString::SkipEmptyParts).join(QString("."));
|
||||
setData(source, hddDev[i], value);
|
||||
}
|
||||
}
|
||||
else if (source == QString("player")) {
|
||||
QProcess player;
|
||||
QString qoutput;
|
||||
QString value_album, value_artist, value_progress, value_duration, qstr;
|
||||
// qmmp
|
||||
qoutput = QString("");
|
||||
value = QString("N\\A");
|
||||
value_album = QString("N\\A");
|
||||
value_artist = QString("N\\A");
|
||||
value_progress = QString("0");
|
||||
value_duration = QString("0");
|
||||
player.start("qmmp --status");
|
||||
player.waitForFinished(-1);
|
||||
qoutput = QTextCodec::codecForMib(106)->toUnicode(player.readAllStandardOutput());
|
||||
for (int i=0; i<qoutput.split(QString("\n"), QString::SkipEmptyParts).count(); i++) {
|
||||
qstr = qoutput.split(QString("\n"), QString::SkipEmptyParts)[i];
|
||||
if ((qstr.split(QString(" = "), QString::SkipEmptyParts).count() > 1) || (qstr.at(0) == QChar('['))) {
|
||||
if (qstr.split(QString(" = "), QString::SkipEmptyParts)[0] == QString("ALBUM"))
|
||||
value_album = qstr.split(QString(" = "), QString::SkipEmptyParts)[1].trimmed();
|
||||
else if (qstr.split(QString(" = "), QString::SkipEmptyParts)[0] == QString("ARTIST"))
|
||||
value_artist = qstr.split(QString(" = "), QString::SkipEmptyParts)[1].trimmed();
|
||||
else if ((qstr.at(0) == QChar('[')) && (!qstr.contains("[stopped]"))) {
|
||||
QString time = qstr.split(QString(" "), QString::SkipEmptyParts)[2].trimmed();
|
||||
value_progress = QString::number(time.split(QString("/"), QString::SkipEmptyParts)[0].split(QString(":"), QString::SkipEmptyParts)[0].toInt() * 60 +
|
||||
time.split(QString("/"), QString::SkipEmptyParts)[0].split(QString(":"), QString::SkipEmptyParts)[1].toInt());
|
||||
value_duration = QString::number(time.split(QString("/"), QString::SkipEmptyParts)[1].split(QString(":"), QString::SkipEmptyParts)[0].toInt() * 60 +
|
||||
time.split(QString("/"), QString::SkipEmptyParts)[1].split(QString(":"), QString::SkipEmptyParts)[1].toInt());
|
||||
}
|
||||
else if (qstr.split(QString(" = "), QString::SkipEmptyParts)[0] == QString("TITLE"))
|
||||
value = qstr.split(QString(" = "), QString::SkipEmptyParts)[1].trimmed();
|
||||
}
|
||||
}
|
||||
key = QString("qmmp_album");
|
||||
setData(source, key, value_album);
|
||||
key = QString("qmmp_artist");
|
||||
setData(source, key, value_artist);
|
||||
key = QString("qmmp_progress");
|
||||
setData(source, key, value_progress);
|
||||
key = QString("qmmp_duration");
|
||||
setData(source, key, value_duration);
|
||||
key = QString("qmmp_title");
|
||||
setData(source, key, value);
|
||||
// amarok
|
||||
qoutput = QString("");
|
||||
value = QString("N\\A");
|
||||
value_album = QString("N\\A");
|
||||
value_artist = QString("N\\A");
|
||||
value_progress = QString("0");
|
||||
value_duration = QString("0");
|
||||
player.start("qdbus org.kde.amarok /Player GetMetadata");
|
||||
player.waitForFinished(-1);
|
||||
qoutput = QTextCodec::codecForMib(106)->toUnicode(player.readAllStandardOutput());
|
||||
for (int i=0; i<qoutput.split(QString("\n"), QString::SkipEmptyParts).count(); i++) {
|
||||
qstr = qoutput.split(QString("\n"), QString::SkipEmptyParts)[i];
|
||||
if (qstr.split(QString(": "), QString::SkipEmptyParts).count() > 1) {
|
||||
if (qstr.split(QString(": "), QString::SkipEmptyParts)[0] == QString("album"))
|
||||
value_album = qstr.split(QString(": "), QString::SkipEmptyParts)[1].trimmed();
|
||||
else if (qstr.split(QString(": "), QString::SkipEmptyParts)[0] == QString("artist"))
|
||||
value_artist = qstr.split(QString(": "), QString::SkipEmptyParts)[1].trimmed();
|
||||
else if (qstr.split(QString(": "), QString::SkipEmptyParts)[0] == QString("time"))
|
||||
value_duration = qstr.split(QString(": "), QString::SkipEmptyParts)[1].trimmed();
|
||||
else if (qstr.split(QString(": "), QString::SkipEmptyParts)[0] == QString("title"))
|
||||
value = qstr.split(QString(": "), QString::SkipEmptyParts)[1].trimmed();
|
||||
}
|
||||
}
|
||||
player.start("qdbus org.kde.amarok /Player PositionGet");
|
||||
player.waitForFinished(-1);
|
||||
qoutput = player.readAllStandardOutput();
|
||||
for (int i=0; i<qoutput.split(QString("\n"), QString::SkipEmptyParts).count(); i++) {
|
||||
qstr = qoutput.split(QString("\n"), QString::SkipEmptyParts)[i];
|
||||
int time = qstr.toInt() / 1000;
|
||||
value_progress = QString::number(time);
|
||||
}
|
||||
key = QString("amarok_album");
|
||||
setData(source, key, value_album);
|
||||
key = QString("amarok_artist");
|
||||
setData(source, key, value_artist);
|
||||
key = QString("amarok_progress");
|
||||
setData(source, key, value_progress);
|
||||
key = QString("amarok_duration");
|
||||
setData(source, key, value_duration);
|
||||
key = QString("amarok_title");
|
||||
setData(source, key, value);
|
||||
// mpd
|
||||
value = QString("N\\A");
|
||||
value_album = QString("N\\A");
|
||||
value_artist = QString("N\\A");
|
||||
value_progress = QString("0");
|
||||
value_duration = QString("0");
|
||||
char commandStr[512];
|
||||
sprintf(commandStr, "bash -c \"echo 'currentsong\nstatus\nclose' | curl --connect-timeout 1 -fsm 3 telnet://%s:%s 2> /dev/null\"", \
|
||||
mpdAddress.toUtf8().data(), mpdPort.toUtf8().data());
|
||||
qoutput = QString("");
|
||||
player.start(QString(commandStr));
|
||||
player.waitForFinished(-1);
|
||||
qoutput = QTextCodec::codecForMib(106)->toUnicode(player.readAllStandardOutput());
|
||||
for (int i=0; i<qoutput.split(QString("\n"), QString::SkipEmptyParts).count(); i++) {
|
||||
qstr = qoutput.split(QString("\n"), QString::SkipEmptyParts)[i];
|
||||
if (qstr.split(QString(": "), QString::SkipEmptyParts).count() > 1) {
|
||||
if (qstr.split(QString(": "), QString::SkipEmptyParts)[0] == QString("Album"))
|
||||
value_album = qstr.split(QString(": "), QString::SkipEmptyParts)[1].trimmed();
|
||||
else if (qstr.split(QString(": "), QString::SkipEmptyParts)[0] == QString("Artist"))
|
||||
value_artist = qstr.split(QString(": "), QString::SkipEmptyParts)[1].trimmed();
|
||||
else if (qstr.split(QString(": "), QString::SkipEmptyParts)[0] == QString("time")) {
|
||||
value_duration = qstr.split(QString(": "), QString::SkipEmptyParts)[1].trimmed().split(QString(":"))[0];
|
||||
value_progress = qstr.split(QString(": "), QString::SkipEmptyParts)[1].trimmed().split(QString(":"))[1];
|
||||
}
|
||||
else if (qstr.split(QString(": "), QString::SkipEmptyParts)[0] == QString("Title"))
|
||||
value = qstr.split(QString(": "), QString::SkipEmptyParts)[1].trimmed();
|
||||
}
|
||||
}
|
||||
key = QString("mpd_album");
|
||||
setData(source, key, value_album);
|
||||
key = QString("mpd_artist");
|
||||
setData(source, key, value_artist);
|
||||
key = QString("mpd_progress");
|
||||
setData(source, key, value_progress);
|
||||
key = QString("mpd_duration");
|
||||
setData(source, key, value_duration);
|
||||
key = QString("mpd_title");
|
||||
setData(source, key, value);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
K_EXPORT_PLASMA_DATAENGINE(extsysmon, ExtendedSysMon)
|
||||
|
||||
#include "extsysmon.moc"
|
43
sources/ext-sysmon/extsysmon.h
Normal file
@ -0,0 +1,43 @@
|
||||
/***************************************************************************
|
||||
* This file is part of pytextmonitor *
|
||||
* *
|
||||
* pytextmonitor 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. *
|
||||
* *
|
||||
* pytextmonitor 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 pytextmonitor. If not, see http://www.gnu.org/licenses/ *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef EXTSYSMON_H
|
||||
#define EXTSYSMON_H
|
||||
|
||||
#include <Plasma/DataEngine>
|
||||
|
||||
class ExtendedSysMon : public Plasma::DataEngine
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ExtendedSysMon(QObject *parent, const QVariantList &args);
|
||||
|
||||
protected:
|
||||
bool sourceRequestEvent(const QString &name);
|
||||
bool updateSourceEvent(const QString &source);
|
||||
bool readConfiguration();
|
||||
QStringList sources() const;
|
||||
// main configuration
|
||||
QStringList hddDev;
|
||||
QString gpuDev;
|
||||
// configuration
|
||||
QString mpdAddress;
|
||||
QString mpdPort;
|
||||
};
|
||||
|
||||
#endif /* EXTSYSMON_H */
|
@ -13,8 +13,8 @@ X-Plasma-EngineName=ext-sysmon
|
||||
X-KDE-PluginInfo-Author=Evgeniy Alekseev aka arcanis
|
||||
X-KDE-PluginInfo-Email=esalexeev@gmail.com
|
||||
X-KDE-PluginInfo-Name=ext-sysmon
|
||||
X-KDE-PluginInfo-Version=1.2
|
||||
X-KDE-PluginInfo-Version=@PROJECT_VERSION@
|
||||
X-KDE-PluginInfo-Category=System Information
|
||||
X-KDE-PluginInfo-Depends=
|
||||
X-KDE-PluginInfo-License=GPL
|
||||
X-KDE-PluginInfo-License=GPLv3
|
||||
X-KDE-PluginInfo-EnabledByDefault=true
|
33
sources/ptm/CMakeLists.txt
Normal file
@ -0,0 +1,33 @@
|
||||
# set project name
|
||||
set (SUBPROJECT pytextmonitor)
|
||||
# for notifications
|
||||
set (PLUGIN_NAME plasma_applet_pytextmonitor)
|
||||
message (STATUS "Subproject ${SUBPROJECT}")
|
||||
|
||||
# find required libaries
|
||||
find_package (KDE4 REQUIRED)
|
||||
include (KDE4Defaults)
|
||||
|
||||
add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
|
||||
include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/../)
|
||||
|
||||
add_subdirectory (po)
|
||||
|
||||
# set sources
|
||||
set (SUBPROJECT_CODE_DIR "contents/code")
|
||||
set (SUBPROJECT_UI_DIR "contents/ui")
|
||||
file (GLOB SUBPROJECT_DESKTOP_IN *.desktop)
|
||||
file (RELATIVE_PATH SUBPROJECT_DESKTOP ${CMAKE_SOURCE_DIR} ${SUBPROJECT_DESKTOP_IN})
|
||||
file (GLOB SUBPROJECT_NOTIFY *.notifyrc)
|
||||
file (GLOB SUBPROJECT_SOURCE ${SUBPROJECT_CODE_DIR}/*.py)
|
||||
file (GLOB SUBPROJECT_UI ${SUBPROJECT_UI_DIR}/*.ui)
|
||||
|
||||
# prepare
|
||||
configure_file (${SUBPROJECT_DESKTOP_IN} ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_DESKTOP})
|
||||
|
||||
# install
|
||||
install (FILES ${SUBPROJECT_SOURCE} DESTINATION "share/apps/plasma/plasmoids/${SUBPROJECT}/${SUBPROJECT_CODE_DIR}")
|
||||
install (FILES ${SUBPROJECT_UI} DESTINATION "share/apps/plasma/plasmoids/${SUBPROJECT}/${SUBPROJECT_UI_DIR}")
|
||||
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_DESKTOP} DESTINATION ${SERVICES_INSTALL_DIR} RENAME "plasma-applet-${SUBPROJECT}.desktop")
|
||||
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_DESKTOP} DESTINATION "share/apps/plasma/plasmoids/${SUBPROJECT}")
|
||||
install (FILES ${SUBPROJECT_NOTIFY} DESTINATION ${DATA_INSTALL_DIR}/${PLUGIN_NAME})
|
34
sources/ptm/contents/code/config.py
Normal file
@ -0,0 +1,34 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
############################################################################
|
||||
# Copyright 2012 Alex Oleshkevich <alex.oleshkevich@gmail.com> #
|
||||
# #
|
||||
# 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 2 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, write to the Free Software Foundation, Inc., #
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #
|
||||
############################################################################
|
||||
|
||||
from util import *
|
||||
|
||||
|
||||
|
||||
class Config():
|
||||
def __init__(self, applet):
|
||||
self.applet = applet
|
||||
self.config = self.applet.config()
|
||||
|
||||
def get(self, key, default = ''):
|
||||
return self.config.readEntry(key, default).toString()
|
||||
|
||||
def set(self, key, value):
|
||||
self.config.writeEntry(key, value)
|
280
sources/ptm/contents/code/configdef.py
Normal file
@ -0,0 +1,280 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
############################################################################
|
||||
# This file is part of pytextmonitor #
|
||||
# #
|
||||
# pytextmonitor 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. #
|
||||
# #
|
||||
# pytextmonitor 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 pytextmonitor. If not, see http://www.gnu.org/licenses/ #
|
||||
############################################################################
|
||||
|
||||
from PyQt4.QtCore import *
|
||||
from PyQt4.QtGui import *
|
||||
from PyKDE4.kdecore import *
|
||||
from PyKDE4.kdeui import *
|
||||
import commands
|
||||
import config
|
||||
|
||||
|
||||
|
||||
class ConfigDefinition:
|
||||
def __init__(self, parent, configpage):
|
||||
"""class definition"""
|
||||
self.parent = parent
|
||||
self.configpage = configpage
|
||||
|
||||
|
||||
def configAccepted(self):
|
||||
"""function to accept settings"""
|
||||
settings = config.Config(self.parent)
|
||||
|
||||
# update local variables
|
||||
self.parent.interval = self.configpage.ui.spinBox_interval.value()
|
||||
settings.set('interval', self.parent.interval)
|
||||
self.parent.font_family = str(self.configpage.ui.fontComboBox.currentFont().family())
|
||||
settings.set('font_family', self.parent.font_family)
|
||||
self.parent.font_size = self.configpage.ui.spinBox_fontSize.value()
|
||||
settings.set('font_size', self.parent.font_size)
|
||||
self.parent.font_color = str(self.configpage.ui.kcolorcombo.color().name())
|
||||
settings.set('font_color', self.parent.font_color)
|
||||
if (self.configpage.ui.comboBox_style.currentIndex() == 0):
|
||||
self.parent.font_style = 'normal'
|
||||
else:
|
||||
self.parent.font_style = 'italic'
|
||||
settings.set('font_style', self.parent.font_style)
|
||||
self.parent.font_weight = self.configpage.ui.spinBox_weight.value()
|
||||
settings.set('font_weight', self.parent.font_weight)
|
||||
|
||||
self.parent.custom_time = str(self.configpage.ui.lineEdit_timeFormat.text())
|
||||
settings.set('custom_time', self.parent.custom_time)
|
||||
self.parent.custom_uptime = str(self.configpage.ui.lineEdit_uptimeFormat.text())
|
||||
settings.set('custom_uptime', self.parent.custom_uptime)
|
||||
# temp and mount below
|
||||
self.parent.hddNames = []
|
||||
self.parent.hdd = {}
|
||||
for i in range(self.configpage.ui.listWidget_hddDevice.count()):
|
||||
item = self.configpage.ui.listWidget_hddDevice.item(i).text()
|
||||
self.parent.hddNames.append(str(item))
|
||||
self.parent.hdd[str(item)] =" 0.0"
|
||||
settings.set('hdd', '@@'.join(self.parent.hddNames))
|
||||
self.parent.netdir = str(self.configpage.ui.lineEdit_netdir.text())
|
||||
settings.set('netdir', self.parent.netdir)
|
||||
self.parent.netdevBool = str(self.configpage.ui.checkBox_netdev.checkState())
|
||||
settings.set('netdevBool', self.parent.netdevBool)
|
||||
self.parent.custom_netdev = str(self.configpage.ui.comboBox_netdev.currentText())
|
||||
settings.set('custom_netdev', self.parent.custom_netdev)
|
||||
self.parent.battery_device = str(self.configpage.ui.lineEdit_batdev.text())
|
||||
settings.set('battery_device', self.parent.battery_device)
|
||||
self.parent.ac_device = str(self.configpage.ui.lineEdit_acdev.text())
|
||||
settings.set('ac_device', self.parent.ac_device)
|
||||
self.parent.player_name = self.configpage.ui.comboBox_playerSelect.currentIndex()
|
||||
settings.set('player_name', self.parent.player_name)
|
||||
self.parent.custom_command = str(self.configpage.ui.lineEdit_customCommand.text())
|
||||
settings.set('custom_command', self.parent.custom_command)
|
||||
|
||||
self.parent.tooltipNum = self.configpage.ui.spinBox_tooltipNum.value()
|
||||
settings.set('tooltip_num', self.parent.tooltipNum)
|
||||
for label in ['cpu', 'cpuclock', 'mem', 'swap', 'down', 'up']:
|
||||
exec ('self.parent.tooltipColors["' + label + '"] = str(self.configpage.kcolorcombo_' + label + '.color().name())')
|
||||
exec ('settings.set("' + label + '_color", self.parent.tooltipColors["' + label + '"])')
|
||||
|
||||
# disconnecting from source and clear layout
|
||||
if (self.parent.uptimeBool > 0):
|
||||
self.parent.systemmonitor.disconnectSource("system/uptime", self.parent)
|
||||
self.parent.label_uptime.setText('')
|
||||
self.parent.layout.removeItem(self.parent.label_uptime)
|
||||
if (self.parent.cpuBool > 0):
|
||||
self.parent.systemmonitor.disconnectSource("cpu/system/TotalLoad", self.parent)
|
||||
for core in self.parent.cpuCore.keys():
|
||||
self.parent.systemmonitor.disconnectSource("cpu/cpu"+str(core)+"/TotalLoad", self.parent)
|
||||
self.parent.label_cpu.setText('')
|
||||
self.parent.layout.removeItem(self.parent.label_cpu)
|
||||
if (self.parent.cpuclockBool > 0):
|
||||
self.parent.systemmonitor.disconnectSource("cpu/system/AverageClock", self.parent)
|
||||
for core in self.parent.cpuClockCore.keys():
|
||||
self.parent.systemmonitor.disconnectSource("cpu/cpu"+str(core)+"/clock", self.parent)
|
||||
self.parent.label_cpuclock.setText('')
|
||||
self.parent.layout.removeItem(self.parent.label_cpuclock)
|
||||
if (self.parent.tempBool > 0):
|
||||
for item in self.parent.temp:
|
||||
self.parent.systemmonitor.disconnectSource(item, self.parent)
|
||||
self.parent.label_temp.setText('')
|
||||
self.parent.layout.removeItem(self.parent.label_temp)
|
||||
self.parent.tempNames = []
|
||||
self.parent.temp = {}
|
||||
for i in range(self.configpage.ui.listWidget_tempDevice.count()):
|
||||
item = self.configpage.ui.listWidget_tempDevice.item(i).text()
|
||||
self.parent.tempNames.append(str(item))
|
||||
self.parent.temp[str(item)] =" 0.0"
|
||||
settings.set('temp_device', '@@'.join(self.parent.tempNames))
|
||||
if (self.parent.gpuBool > 0):
|
||||
self.parent.extsysmon.disconnectSource("gpu", self.parent)
|
||||
self.parent.label_gpu.setText('')
|
||||
self.parent.layout.removeItem(self.parent.label_gpu)
|
||||
if (self.parent.gputempBool > 0):
|
||||
self.parent.extsysmon.disconnectSource("gputemp", self.parent)
|
||||
self.parent.label_gputemp.setText('')
|
||||
self.parent.layout.removeItem(self.parent.label_gputemp)
|
||||
if (self.parent.memBool > 0):
|
||||
self.parent.systemmonitor.disconnectSource("mem/physical/application", self.parent)
|
||||
if (self.parent.memInMb == False):
|
||||
self.parent.systemmonitor.disconnectSource("mem/physical/free", self.parent)
|
||||
self.parent.systemmonitor.disconnectSource("mem/physical/used", self.parent)
|
||||
self.parent.label_mem.setText('')
|
||||
self.parent.layout.removeItem(self.parent.label_mem)
|
||||
if (self.parent.swapBool > 0):
|
||||
self.parent.systemmonitor.disconnectSource("mem/swap/used", self.parent)
|
||||
if (self.parent.swapInMb == False):
|
||||
self.parent.systemmonitor.disconnectSource("mem/swap/free", self.parent)
|
||||
self.parent.label_swap.setText('')
|
||||
self.parent.layout.removeItem(self.parent.label_swap)
|
||||
if (self.parent.hddBool > 0):
|
||||
for item in self.parent.mount:
|
||||
self.parent.systemmonitor.disconnectSource("partitions" + item + "/filllevel", self.parent)
|
||||
self.parent.label_hdd.setText('')
|
||||
self.parent.layout.removeItem(self.parent.label_hdd)
|
||||
self.parent.mountNames = []
|
||||
self.parent.mount = {}
|
||||
for i in range(self.configpage.ui.listWidget_mount.count()):
|
||||
item = self.configpage.ui.listWidget_mount.item(i).text()
|
||||
self.parent.mountNames.append(str(item))
|
||||
self.parent.mount[str(item)] =" 0.0"
|
||||
settings.set('mount', '@@'.join(self.parent.mountNames))
|
||||
if (self.parent.hddtempBool > 0):
|
||||
self.parent.extsysmon.disconnectSource("hddtemp", self.parent)
|
||||
self.parent.label_hddtemp.setText('')
|
||||
self.parent.layout.removeItem(self.parent.label_hddtemp)
|
||||
if (self.parent.netBool > 0):
|
||||
self.parent.systemmonitor.disconnectSource("network/interfaces/"+self.parent.netdev+"/transmitter/data", self.parent)
|
||||
self.parent.systemmonitor.disconnectSource("network/interfaces/"+self.parent.netdev+"/receiver/data", self.parent)
|
||||
self.parent.label_net.setText('')
|
||||
self.parent.layout.removeItem(self.parent.label_net)
|
||||
if (self.parent.batBool > 0):
|
||||
self.parent.label_bat.setText('')
|
||||
self.parent.layout.removeItem(self.parent.label_bat)
|
||||
if (self.parent.playerBool > 0):
|
||||
self.parent.extsysmon.disconnectSource("player", self.parent)
|
||||
self.parent.label_player.setText('')
|
||||
self.parent.layout.removeItem(self.parent.label_player)
|
||||
if (self.parent.timeBool > 0):
|
||||
self.parent.timemon.disconnectSource("Local", self.parent)
|
||||
self.parent.label_time.setText('')
|
||||
self.parent.layout.removeItem(self.parent.label_time)
|
||||
if (self.parent.customBool > 0):
|
||||
self.parent.label_custom.setText('')
|
||||
self.parent.layout.removeItem(self.parent.label_custom)
|
||||
|
||||
self.parent.label_order = "---------------"
|
||||
|
||||
for label in self.parent.dict_orders.keys():
|
||||
exec ('self.parent.' + self.parent.dict_orders[label] + 'Bool = ' + str(self.configpage.checkboxes[self.parent.dict_orders[label]].checkState()))
|
||||
if (self.configpage.checkboxes[self.parent.dict_orders[label]].checkState() > 0):
|
||||
pos = self.configpage.sliders[self.parent.dict_orders[label]].value() - 1
|
||||
self.parent.label_order = self.parent.label_order[:pos] + label + self.parent.label_order[pos+1:]
|
||||
if (self.parent.dict_orders[label] == 'net'):
|
||||
exec ('self.parent.' + self.parent.dict_orders[label] + 'NonFormat = str(self.configpage.lineedits[self.parent.dict_orders[label]].text())')
|
||||
exec ('settings.set("' + self.parent.dict_orders[label] + 'NonFormat", self.parent.' + self.parent.dict_orders[label] + 'NonFormat)')
|
||||
else:
|
||||
exec ('self.parent.' + self.parent.dict_orders[label] + 'Format = str(self.configpage.lineedits[self.parent.dict_orders[label]].text())')
|
||||
exec ('settings.set("' + self.parent.dict_orders[label] + 'Format", self.parent.' + self.parent.dict_orders[label] + 'Format)')
|
||||
exec ('settings.set("' + self.parent.dict_orders[label] + 'Bool", self.parent.' + self.parent.dict_orders[label] + 'Bool)')
|
||||
self.parent.label_order = ''.join(self.parent.label_order.split('-'))
|
||||
settings.set('label_order', self.parent.label_order)
|
||||
|
||||
# reinitializate
|
||||
self.parent.reinit.reinit(confAccept=True)
|
||||
|
||||
|
||||
def createConfigurationInterface(self, parent):
|
||||
"""function to setup configuration window"""
|
||||
settings = config.Config(self.parent)
|
||||
|
||||
font = QFont(str(settings.get('font_family', 'Terminus')), settings.get('font_size', 12).toInt()[0], 400, False)
|
||||
self.configpage.ui.spinBox_interval.setValue(settings.get('interval', 2000).toInt()[0])
|
||||
self.configpage.ui.fontComboBox.setCurrentFont(font)
|
||||
self.configpage.ui.spinBox_fontSize.setValue(settings.get('font_size', 12).toInt()[0])
|
||||
self.configpage.ui.kcolorcombo.setColor(QColor(str(settings.get('font_color', '#000000'))))
|
||||
font = str(settings.get('font_style', 'normal'))
|
||||
if (font == 'normal'):
|
||||
self.configpage.ui.comboBox_style.setCurrentIndex(0)
|
||||
else:
|
||||
self.configpage.ui.comboBox_style.setCurrentIndex(1)
|
||||
self.configpage.ui.spinBox_weight.setValue(settings.get('font_weight', 400).toInt()[0])
|
||||
|
||||
self.configpage.ui.lineEdit_timeFormat.setText(str(settings.get('custom_time', '$hh:$mm')))
|
||||
self.configpage.ui.lineEdit_uptimeFormat.setText(str(settings.get('custom_uptime', '$ds,$hs,$ms')))
|
||||
commandOut = commands.getoutput("sensors")
|
||||
for item in commandOut.split("\n\n"):
|
||||
for device in item.split("\n"):
|
||||
if (device.find('\xc2\xb0C') > -1):
|
||||
try:
|
||||
tempdev = 'lmsensors/' + item.split("\n")[0] + '/' + '_'.join(device.split(":")[0].split())
|
||||
self.configpage.ui.comboBox_tempDevice.addItem(tempdev)
|
||||
except:
|
||||
pass
|
||||
self.configpage.ui.listWidget_tempDevice.clear()
|
||||
for item in str(settings.get('temp_device', '')).split('@@'):
|
||||
if (len(item) > 0):
|
||||
self.configpage.ui.listWidget_tempDevice.addItem(item)
|
||||
commandOut = commands.getoutput("mount")
|
||||
for item in commandOut.split("\n"):
|
||||
try:
|
||||
mount = item.split(' on ')[1].split(' type ')[0]
|
||||
self.configpage.ui.comboBox_mount.addItem(mount)
|
||||
except:
|
||||
pass
|
||||
self.configpage.ui.listWidget_mount.clear()
|
||||
for item in str(settings.get('mount', '/')).split('@@'):
|
||||
self.configpage.ui.listWidget_mount.addItem(item)
|
||||
commandOut = commands.getoutput("find /dev -name '[hs]d[a-z]'")
|
||||
for item in commandOut.split("\n"):
|
||||
try:
|
||||
self.configpage.ui.comboBox_hddDevice.addItem(item)
|
||||
except:
|
||||
pass
|
||||
self.configpage.ui.listWidget_hddDevice.clear()
|
||||
for item in str(settings.get('hdd', '/dev/sda')).split('@@'):
|
||||
self.configpage.ui.listWidget_hddDevice.addItem(item)
|
||||
self.configpage.ui.lineEdit_netdir.setText(str(settings.get('netdir', '/sys/class/net')))
|
||||
self.configpage.ui.checkBox_netdev.setCheckState(settings.get('netdevBool', 0).toInt()[0])
|
||||
for item in QDir.entryList(QDir(str(settings.get('netdir', '/sys/class/net'))), QDir.Dirs | QDir.NoDotAndDotDot):
|
||||
self.configpage.ui.comboBox_netdev.addItem(item)
|
||||
index = self.configpage.ui.comboBox_netdev.findText(str(settings.get('custom_netdev', 'lo')))
|
||||
self.configpage.ui.comboBox_netdev.setCurrentIndex(index)
|
||||
self.configpage.ui.lineEdit_batdev.setText(str(settings.get('battery_device', '/sys/class/power_supply/BAT0/capacity')))
|
||||
self.configpage.ui.lineEdit_acdev.setText(str(settings.get('ac_device', '/sys/class/power_supply/AC/online')))
|
||||
self.configpage.ui.comboBox_playerSelect.setCurrentIndex(settings.get('player_name', 0).toInt()[0])
|
||||
self.configpage.ui.lineEdit_customCommand.setText(str(settings.get('custom_command', 'wget -qO- http://ifconfig.me/ip')))
|
||||
|
||||
self.configpage.ui.spinBox_tooltipNum.setValue(settings.get('tooltip_num', 100).toInt()[0])
|
||||
self.configpage.ui.kcolorcombo_cpu.setColor(QColor(str(settings.get('cpu_color', '#ff0000'))))
|
||||
self.configpage.ui.kcolorcombo_cpuclock.setColor(QColor(str(settings.get('cpuclock_color', '#00ff00'))))
|
||||
self.configpage.ui.kcolorcombo_mem.setColor(QColor(str(settings.get('mem_color', '#0000ff'))))
|
||||
self.configpage.ui.kcolorcombo_swap.setColor(QColor(str(settings.get('swap_color', '#ffff00'))))
|
||||
self.configpage.ui.kcolorcombo_down.setColor(QColor(str(settings.get('down_color', '#00ffff'))))
|
||||
self.configpage.ui.kcolorcombo_up.setColor(QColor(str(settings.get('up_color', '#ff00ff'))))
|
||||
|
||||
for label in self.parent.dict_orders.keys():
|
||||
exec ('bool = self.parent.' + self.parent.dict_orders[label] + 'Bool')
|
||||
self.configpage.checkboxes[self.parent.dict_orders[label]].setCheckState(bool)
|
||||
if (bool > 0):
|
||||
self.configpage.sliders[self.parent.dict_orders[label]].setValue(self.parent.label_order.find(label)+1)
|
||||
if (self.parent.dict_orders[label] == 'net'):
|
||||
self.configpage.lineedits[self.parent.dict_orders[label]].setText(str(settings.get(self.parent.dict_orders[label] + 'NonFormat', self.parent.dict_defFormat[self.parent.dict_orders[label]])))
|
||||
else:
|
||||
self.configpage.lineedits[self.parent.dict_orders[label]].setText(str(settings.get(self.parent.dict_orders[label] + 'Format', self.parent.dict_defFormat[self.parent.dict_orders[label]])))
|
||||
|
||||
# add config page
|
||||
page = parent.addPage(self.configpage, i18n(self.parent.name()))
|
||||
page.setIcon(KIcon(self.parent.icon()))
|
||||
|
||||
parent.okClicked.connect(self.configAccepted)
|
@ -1,5 +1,22 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
############################################################################
|
||||
# This file is part of pytextmonitor #
|
||||
# #
|
||||
# pytextmonitor 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. #
|
||||
# #
|
||||
# pytextmonitor 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 pytextmonitor. If not, see http://www.gnu.org/licenses/ #
|
||||
############################################################################
|
||||
|
||||
from PyQt4.QtCore import *
|
||||
from PyQt4.QtGui import *
|
||||
from PyKDE4.plasma import *
|
||||
@ -19,38 +36,109 @@ class ConfigWindow(QWidget):
|
||||
'gputemp':self.ui.checkBox_gpuTemp, 'hdd':self.ui.checkBox_hdd,
|
||||
'hddtemp':self.ui.checkBox_hddTemp, 'mem':self.ui.checkBox_mem,
|
||||
'net':self.ui.checkBox_net, 'swap':self.ui.checkBox_swap,
|
||||
'temp':self.ui.checkBox_temp, 'uptime':self.ui.checkBox_uptime}
|
||||
self.sliders = {'bat':self.ui.slider_bat, 'cpu':self.ui.slider_cpu,
|
||||
'cpuclock':self.ui.slider_cpuclock, 'gpu':self.ui.slider_gpu,
|
||||
'gputemp':self.ui.slider_gpuTemp, 'hdd':self.ui.slider_hdd,
|
||||
'hddtemp':self.ui.slider_hddTemp, 'mem':self.ui.slider_mem,
|
||||
'net':self.ui.slider_net, 'swap':self.ui.slider_swap,
|
||||
'temp':self.ui.slider_temp, 'uptime':self.ui.slider_uptime}
|
||||
'temp':self.ui.checkBox_temp, 'uptime':self.ui.checkBox_uptime,
|
||||
'player':self.ui.checkBox_player, 'time':self.ui.checkBox_time,
|
||||
'custom':self.ui.checkBox_custom}
|
||||
self.lineedits = {'bat':self.ui.lineEdit_bat, 'cpu':self.ui.lineEdit_cpu,
|
||||
'cpuclock':self.ui.lineEdit_cpuclock, 'gpu':self.ui.lineEdit_gpu,
|
||||
'gputemp':self.ui.lineEdit_gpuTemp, 'hdd':self.ui.lineEdit_hdd,
|
||||
'hddtemp':self.ui.lineEdit_hddTemp, 'mem':self.ui.lineEdit_mem,
|
||||
'net':self.ui.lineEdit_net, 'swap':self.ui.lineEdit_swap,
|
||||
'temp':self.ui.lineEdit_temp, 'uptime':self.ui.lineEdit_uptime}
|
||||
'temp':self.ui.lineEdit_temp, 'uptime':self.ui.lineEdit_uptime,
|
||||
'player':self.ui.lineEdit_player, 'time':self.ui.lineEdit_time,
|
||||
'custom':self.ui.lineEdit_custom}
|
||||
self.sliders = {'bat':self.ui.slider_bat, 'cpu':self.ui.slider_cpu,
|
||||
'cpuclock':self.ui.slider_cpuclock, 'gpu':self.ui.slider_gpu,
|
||||
'gputemp':self.ui.slider_gpuTemp, 'hdd':self.ui.slider_hdd,
|
||||
'hddtemp':self.ui.slider_hddTemp, 'mem':self.ui.slider_mem,
|
||||
'net':self.ui.slider_net, 'swap':self.ui.slider_swap,
|
||||
'temp':self.ui.slider_temp, 'uptime':self.ui.slider_uptime,
|
||||
'player':self.ui.slider_player, 'time':self.ui.slider_time,
|
||||
'custom':self.ui.slider_custom}
|
||||
|
||||
for item in self.checkboxes.values():
|
||||
QObject.connect(item, SIGNAL("stateChanged(int)"), self.setStatus)
|
||||
QObject.connect(self.ui.checkBox_netdev, SIGNAL("stateChanged(int)"), self.setNetdevEnabled)
|
||||
QObject.connect(self.ui.pushButton_hddDevice, SIGNAL("clicked()"), self.addHddDevice)
|
||||
QObject.connect(self.ui.pushButton_mount, SIGNAL("clicked()"), self.addMount)
|
||||
QObject.connect(self.ui.pushButton_tempDevice, SIGNAL("clicked()"), self.addTempDevice)
|
||||
QObject.connect(self.ui.listWidget_hddDevice, SIGNAL("itemActivated(QListWidgetItem*)"), self.ui.listWidget_hddDevice.openPersistentEditor)
|
||||
QObject.connect(self.ui.listWidget_mount, SIGNAL("itemActivated(QListWidgetItem*)"), self.ui.listWidget_mount.openPersistentEditor)
|
||||
QObject.connect(self.ui.listWidget_tempDevice, SIGNAL("itemActivated(QListWidgetItem*)"), self.ui.listWidget_tempDevice.openPersistentEditor)
|
||||
for item in self.sliders.values():
|
||||
QObject.connect(item, SIGNAL("valueChanged(int)"), self.setSlider)
|
||||
for item in self.checkboxes.values():
|
||||
QObject.connect(item, SIGNAL("stateChanged(int)"), self.setStatus)
|
||||
|
||||
|
||||
def keyPressEvent(self, event):
|
||||
"""delete events"""
|
||||
if (event.key() == Qt.Key_Delete):
|
||||
if (self.ui.listWidget_hddDevice.hasFocus() and
|
||||
(self.ui.listWidget_hddDevice.currentRow() > -1)):
|
||||
self.ui.listWidget_hddDevice.takeItem(self.ui.listWidget_hddDevice.currentRow())
|
||||
elif (self.ui.listWidget_mount.hasFocus() and
|
||||
(self.ui.listWidget_mount.currentRow() > -1)):
|
||||
self.ui.listWidget_mount.takeItem(self.ui.listWidget_mount.currentRow())
|
||||
elif (self.ui.listWidget_tempDevice.hasFocus() and
|
||||
(self.ui.listWidget_tempDevice.currentRow() > -1)):
|
||||
self.ui.listWidget_tempDevice.takeItem(self.ui.listWidget_tempDevice.currentRow())
|
||||
|
||||
|
||||
def addHddDevice(self):
|
||||
"""function to add mount points"""
|
||||
self.ui.listWidget_hddDevice.clearSelection()
|
||||
if (self.ui.listWidget_hddDevice.count() > 9):
|
||||
self.ui.listWidget_hddDevice.takeItem(0)
|
||||
self.ui.listWidget_hddDevice.addItem(self.ui.comboBox_hddDevice.currentText())
|
||||
|
||||
|
||||
def addMount(self):
|
||||
"""function to add mount points"""
|
||||
self.ui.listWidget_mount.clearSelection()
|
||||
if (self.ui.listWidget_mount.count() > 9):
|
||||
self.ui.listWidget_mount.takeItem(0)
|
||||
self.ui.listWidget_mount.addItem(self.ui.comboBox_mount.currentText())
|
||||
|
||||
|
||||
def addTempDevice(self):
|
||||
"""function to add temperature device"""
|
||||
self.ui.listWidget_tempDevice.clearSelection()
|
||||
if (self.ui.listWidget_tempDevice.count() > 9):
|
||||
self.ui.listWidget_tempDevice.takeItem(0)
|
||||
self.ui.listWidget_tempDevice.addItem(self.ui.comboBox_tempDevice.currentText())
|
||||
|
||||
|
||||
def setNetdevEnabled(self):
|
||||
"""function to set enabled netdev"""
|
||||
if (self.ui.checkBox_netdev.checkState() == 0):
|
||||
self.ui.comboBox_netdev.setDisabled(True)
|
||||
else:
|
||||
self.ui.comboBox_netdev.setEnabled(True)
|
||||
|
||||
|
||||
def setSlider(self):
|
||||
"""function to set sliders"""
|
||||
if (self.sender().isEnabled() == True):
|
||||
second_slider = self.sender()
|
||||
order = []
|
||||
for slider in self.sliders.values():
|
||||
if (slider.isEnabled() == True):
|
||||
order.append(slider.value())
|
||||
if ((slider.value() == self.sender().value()) and (slider != self.sender())):
|
||||
second_slider = slider
|
||||
if (second_slider == self.sender()):
|
||||
return
|
||||
for value in range(len(order)):
|
||||
if (order.count(value+1) == 0):
|
||||
new_value = value + 1
|
||||
second_slider.setValue(new_value)
|
||||
|
||||
|
||||
def setStatus(self):
|
||||
"""function to enable label"""
|
||||
count = self.sliders['bat'].maximum()
|
||||
for label in self.checkboxes.keys():
|
||||
if ((self.checkboxes[label].checkState() > 0) and (self.sliders[label].isEnabled() == False)):
|
||||
self.lineedits[label].setEnabled(True)
|
||||
self.sliders[label].setEnabled(True)
|
||||
if (label == 'bat'):
|
||||
self.ui.lineEdit_acdev.setEnabled(True)
|
||||
self.ui.lineEdit_batdev.setEnabled(True)
|
||||
elif (label == 'temp'):
|
||||
self.ui.comboBox_temp.setEnabled(True)
|
||||
slider_label = 0
|
||||
for slider in self.sliders.values():
|
||||
if (slider.isEnabled() == True):
|
||||
@ -64,11 +152,6 @@ class ConfigWindow(QWidget):
|
||||
elif ((self.checkboxes[label].checkState() == 0) and (self.sliders[label].isEnabled() == True)):
|
||||
self.lineedits[label].setDisabled(True)
|
||||
self.sliders[label].setDisabled(True)
|
||||
if (label == 'bat'):
|
||||
self.ui.lineEdit_acdev.setDisabled(True)
|
||||
self.ui.lineEdit_batdev.setDisabled(True)
|
||||
elif (label == 'temp'):
|
||||
self.ui.comboBox_temp.setDisabled(True)
|
||||
for slider in self.sliders.values():
|
||||
if ((slider.value() == slider.maximum()) and (slider != self.sliders[label])):
|
||||
slider.setValue(self.sliders[label].value())
|
||||
@ -82,23 +165,3 @@ class ConfigWindow(QWidget):
|
||||
else:
|
||||
slider.setMaximum(1)
|
||||
self.sliders[label].setValue(1)
|
||||
|
||||
def setSlider(self):
|
||||
"""function to set sliders"""
|
||||
if (self.sender().isEnabled() == True):
|
||||
second_slider = self.sender()
|
||||
order = []
|
||||
for slider in self.sliders.values():
|
||||
if (slider.isEnabled() == True):
|
||||
order.append(slider.value())
|
||||
if ((slider.value() == self.sender().value()) and (slider != self.sender())):
|
||||
second_slider = slider
|
||||
|
||||
if (second_slider == self.sender()):
|
||||
return
|
||||
|
||||
for value in range(len(order)):
|
||||
if (order.count(value+1) == 0):
|
||||
new_value = value + 1
|
||||
|
||||
second_slider.setValue(new_value)
|
286
sources/ptm/contents/code/dataengine.py
Normal file
@ -0,0 +1,286 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
############################################################################
|
||||
# This file is part of pytextmonitor #
|
||||
# #
|
||||
# pytextmonitor 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. #
|
||||
# #
|
||||
# pytextmonitor 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 pytextmonitor. If not, see http://www.gnu.org/licenses/ #
|
||||
############################################################################
|
||||
|
||||
from PyQt4.QtCore import *
|
||||
from PyQt4.QtGui import *
|
||||
from PyKDE4.plasma import Plasma
|
||||
from PyKDE4 import plasmascript
|
||||
|
||||
import datetime
|
||||
|
||||
timeLetters = ['dddd', 'ddd', 'dd', 'd', \
|
||||
'MMMM', 'MMM', 'MM', 'M', 'yyyy', 'yy', \
|
||||
'hh', 'h', 'mm', 'm', 'ss', 's']
|
||||
|
||||
|
||||
|
||||
class DataEngine:
|
||||
def __init__(self, parent):
|
||||
"""class definition"""
|
||||
self.parent = parent
|
||||
|
||||
|
||||
def connectToEngine(self):
|
||||
"""function to initializate engine"""
|
||||
self.parent.systemmonitor = self.parent.dataEngine("systemmonitor")
|
||||
self.parent.extsysmon = self.parent.dataEngine("ext-sysmon")
|
||||
|
||||
if (self.parent.timeBool > 0):
|
||||
self.parent.timemon = self.parent.dataEngine("time")
|
||||
self.parent.timemon.connectSource("Local", self.parent, 1000)
|
||||
|
||||
if (self.parent.uptimeBool > 0):
|
||||
self.parent.systemmonitor.connectSource("system/uptime", self.parent, self.parent.interval)
|
||||
if (self.parent.cpuBool > 0):
|
||||
self.parent.systemmonitor.connectSource("cpu/system/TotalLoad", self.parent, self.parent.interval)
|
||||
for core in self.parent.cpuCore.keys():
|
||||
if (core > -1):
|
||||
self.parent.systemmonitor.connectSource("cpu/cpu"+str(core)+"/TotalLoad", self.parent, self.parent.interval)
|
||||
if (self.parent.cpuclockBool > 0):
|
||||
self.parent.systemmonitor.connectSource("cpu/system/AverageClock", self.parent, self.parent.interval)
|
||||
for core in self.parent.cpuClockCore.keys():
|
||||
if (core > -1):
|
||||
self.parent.systemmonitor.connectSource("cpu/cpu"+str(core)+"/clock", self.parent, self.parent.interval)
|
||||
if (self.parent.tempBool > 0):
|
||||
for item in self.parent.tempNames:
|
||||
self.parent.systemmonitor.connectSource(item, self.parent, self.parent.interval)
|
||||
if (self.parent.gpuBool > 0):
|
||||
self.parent.extsysmon.connectSource("gpu", self.parent, self.parent.interval)
|
||||
if (self.parent.gputempBool > 0):
|
||||
self.parent.extsysmon.connectSource("gputemp", self.parent, self.parent.interval)
|
||||
if (self.parent.memBool > 0):
|
||||
if (self.parent.memInMb):
|
||||
self.parent.systemmonitor.connectSource("mem/physical/application", self.parent, self.parent.interval)
|
||||
else:
|
||||
self.parent.systemmonitor.connectSource("mem/physical/free", self.parent, int(self.parent.interval*0.5))
|
||||
self.parent.systemmonitor.connectSource("mem/physical/used", self.parent, int(self.parent.interval*0.5))
|
||||
self.parent.systemmonitor.connectSource("mem/physical/application", self.parent, int(self.parent.interval*0.5))
|
||||
if (self.parent.swapBool > 0):
|
||||
if (self.parent.swapInMb):
|
||||
self.parent.systemmonitor.connectSource("mem/swap/used", self.parent, self.parent.interval)
|
||||
else:
|
||||
self.parent.systemmonitor.connectSource("mem/swap/free", self.parent, int(self.parent.interval*0.5))
|
||||
self.parent.systemmonitor.connectSource("mem/swap/used", self.parent, int(self.parent.interval*0.5))
|
||||
if (self.parent.hddBool > 0):
|
||||
for item in self.parent.mountNames:
|
||||
self.parent.systemmonitor.connectSource("partitions" + item + "/filllevel", self.parent, self.parent.interval)
|
||||
if (self.parent.hddtempBool > 0):
|
||||
self.parent.extsysmon.connectSource("hddtemp", self.parent, self.parent.interval)
|
||||
if (self.parent.netBool > 0):
|
||||
self.parent.updateNetdev = 0
|
||||
self.parent.systemmonitor.connectSource("network/interfaces/"+self.parent.netdev+"/transmitter/data", self.parent, self.parent.interval)
|
||||
self.parent.systemmonitor.connectSource("network/interfaces/"+self.parent.netdev+"/receiver/data", self.parent, self.parent.interval)
|
||||
if (self.parent.playerBool > 0):
|
||||
self.parent.extsysmon.connectSource("player", self.parent, self.parent.interval)
|
||||
|
||||
def dataUpdated(self, sourceName, data):
|
||||
"""function to update data"""
|
||||
try:
|
||||
if (sourceName == "system/uptime"):
|
||||
value = datetime.timedelta(0, int(round(float(data[QString(u'value')]), 1)))
|
||||
days = value.days
|
||||
hours = int(value.seconds / 60 / 60)
|
||||
minutes = int(value.seconds / 60 % 60)
|
||||
line = self.parent.uptimeFormat
|
||||
if (line.split('$uptime')[0] != line):
|
||||
uptimeText = "%3id%2ih%2im" % (days, hours, minutes)
|
||||
line = line.split('$uptime')[0] + uptimeText + line.split('$uptime')[1]
|
||||
elif (line.split('$custom')[0] != line):
|
||||
uptimeText = self.parent.custom_uptime
|
||||
if (uptimeText.split('$ds')[0] != uptimeText):
|
||||
uptimeText = "%s%3i%s" % (uptimeText.split('$ds')[0], days, uptimeText.split('$ds')[1])
|
||||
if (uptimeText.split('$hs')[0] != uptimeText):
|
||||
uptimeText = "%s%2i%s" % (uptimeText.split('$hs')[0], hours, uptimeText.split('$hs')[1])
|
||||
if (uptimeText.split('$ms')[0] != uptimeText):
|
||||
uptimeText = "%s%2i%s" % (uptimeText.split('$ms')[0], minutes, uptimeText.split('$ms')[1])
|
||||
line = line.split('$custom')[0] + uptimeText + line.split('$custom')[1]
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_uptime.setText(text)
|
||||
elif (sourceName == "cpu/system/TotalLoad"):
|
||||
value = str(round(float(data[QString(u'value')]), 1))
|
||||
self.parent.cpuCore[-1] = "%5s" % (value)
|
||||
if (self.parent.cpuBool == 2):
|
||||
self.parent.tooltipAgent.addValue('cpu', float(value), self.parent.tooltipNum)
|
||||
elif ((str(sourceName)[:7] == "cpu/cpu") and (str(sourceName).split('/')[2] == "TotalLoad")):
|
||||
value = str(round(float(data[QString(u'value')]), 1))
|
||||
self.parent.cpuCore[int(str(sourceName)[7])] = "%5s" % (value)
|
||||
elif (sourceName == "cpu/system/AverageClock"):
|
||||
value = str(data[QString(u'value')]).split('.')[0]
|
||||
self.parent.cpuClockCore[-1] = "%4s" % (value)
|
||||
if (self.parent.cpuclockBool == 2):
|
||||
self.parent.tooltipAgent.addValue('cpuclock', float(value), self.parent.tooltipNum)
|
||||
elif ((str(sourceName)[:7] == "cpu/cpu") and (str(sourceName).split('/')[2] == "clock")):
|
||||
value = str(data[QString(u'value')]).split('.')[0]
|
||||
self.parent.cpuClockCore[int(str(sourceName)[7])] = "%4s" % (value)
|
||||
elif (sourceName == "network/interfaces/"+self.parent.netdev+"/transmitter/data"):
|
||||
value = str(data[QString(u'value')]).split('.')[0]
|
||||
self.parent.netSpeed["up"] = "%4s" % (value)
|
||||
if (self.parent.netBool == 2):
|
||||
self.parent.tooltipAgent.addValue('up', float(value), self.parent.tooltipNum)
|
||||
elif (sourceName == "network/interfaces/"+self.parent.netdev+"/receiver/data"):
|
||||
value = str(data[QString(u'value')]).split('.')[0]
|
||||
self.parent.netSpeed["down"] = "%4s" % (value)
|
||||
if (self.parent.netBool == 2):
|
||||
self.parent.tooltipAgent.addValue('down', float(value), self.parent.tooltipNum)
|
||||
# update network device
|
||||
self.parent.updateNetdev = self.parent.updateNetdev + 1
|
||||
if (self.parent.updateNetdev == 100):
|
||||
self.parent.updateNetdev = 0
|
||||
if (self.parent.netNonFormat.split('@@')[0] == self.parent.netNonFormat):
|
||||
self.parent.systemmonitor.disconnectSource("network/interfaces/"+self.parent.netdev+"/transmitter/data", self.parent)
|
||||
self.parent.systemmonitor.disconnectSource("network/interfaces/"+self.parent.netdev+"/receiver/data", self.parent)
|
||||
self.parent.netdev = self.parent.setupNetdev()
|
||||
self.parent.systemmonitor.connectSource("network/interfaces/"+self.parent.netdev+"/transmitter/data", self.parent, self.parent.interval)
|
||||
self.parent.systemmonitor.connectSource("network/interfaces/"+self.parent.netdev+"/receiver/data", self.parent, self.parent.interval)
|
||||
if (self.parent.netNonFormat.split('$netdev')[0] != self.parent.netNonFormat):
|
||||
self.parent.netFormat = self.parent.netNonFormat.split('$netdev')[0] + self.parent.netdev + self.parent.netNonFormat.split('$netdev')[1]
|
||||
else:
|
||||
self.parent.netFormat = self.parent.netNonFormat
|
||||
elif (str(sourceName).split('/')[0] == "lmsensors"):
|
||||
value = str(round(float(data[QString(u'value')]), 1))
|
||||
self.parent.temp[str(sourceName)] = "%4s" % (value)
|
||||
elif (str(sourceName).split('/')[0] == "partitions"):
|
||||
value = str(round(float(data[QString(u'value')]), 1))
|
||||
self.parent.mount['/'+'/'.join(str(sourceName).split('/')[1:-1])] = "%5s" % (value)
|
||||
elif (sourceName == "mem/physical/free"):
|
||||
self.parent.mem_free = float(data[QString(u'value')])
|
||||
elif (sourceName == "mem/physical/used"):
|
||||
self.parent.mem_uf = float(data[QString(u'value')])
|
||||
elif (sourceName == "mem/physical/application"):
|
||||
if (self.parent.memInMb):
|
||||
mem = str(round(float(data[QString(u'value')]) / 1024, 0)).split('.')[0]
|
||||
mem = "%5s" % (mem)
|
||||
if (self.parent.memFormat.split('$memmb')[0] != self.parent.memFormat):
|
||||
line = self.parent.memFormat.split('$memmb')[0] + mem + self.parent.memFormat.split('$memmb')[1]
|
||||
else:
|
||||
line = self.parent.memFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_mem.setText(text)
|
||||
else:
|
||||
self.parent.mem_used = float(data[QString(u'value')])
|
||||
if (self.parent.memBool == 2):
|
||||
self.parent.tooltipAgent.addValue('mem', float(data[QString(u'value')]), self.parent.tooltipNum)
|
||||
elif (sourceName == "mem/swap/free"):
|
||||
self.parent.swap_free = float(data[QString(u'value')])
|
||||
elif (sourceName == "mem/swap/used"):
|
||||
if (self.parent.swapInMb):
|
||||
mem = str(round(float(data[QString(u'value')]) / 1024, 0)).split('.')[0]
|
||||
mem = "%5s" % (mem)
|
||||
if (self.parent.swapFormat.split('$swapmb')[0] != self.parent.swapFormat):
|
||||
line = self.parent.swapFormat.split('$swapmb')[0] + mem + self.parent.swapFormat.split('$swapmb')[1]
|
||||
else:
|
||||
line = self.parent.swapFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_swap.setText(text)
|
||||
else:
|
||||
self.parent.swap_used = float(data[QString(u'value')])
|
||||
if (self.parent.swapBool == 2):
|
||||
self.parent.tooltipAgent.addValue('swap', float(data[QString(u'value')]), self.parent.tooltipNum)
|
||||
elif (sourceName == "gpu"):
|
||||
value = str(data[QString(u'GPU')])
|
||||
gpuText = "%4s" % (value)
|
||||
if (self.parent.gpuFormat.split('$gpu')[0] != self.parent.gpuFormat):
|
||||
line = self.parent.gpuFormat.split('$gpu')[0] + gpuText + self.parent.gpuFormat.split('$gpu')[1]
|
||||
else:
|
||||
line = self.parent.gpuFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_gpu.setText(text)
|
||||
elif (sourceName == "gputemp"):
|
||||
value = str(data[QString(u'GPUTemp')])
|
||||
gputempText = "%4s" % (value)
|
||||
if (self.parent.gputempFormat.split('$gputemp')[0] != self.parent.gputempFormat):
|
||||
line = self.parent.gputempFormat.split('$gputemp')[0] + gputempText + self.parent.gputempFormat.split('$gputemp')[1]
|
||||
else:
|
||||
line = self.parent.gputempFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_gputemp.setText(text)
|
||||
elif (sourceName == "hddtemp"):
|
||||
for item in self.parent.hddNames:
|
||||
value = str(data[QString(item)])
|
||||
self.parent.hdd[item] = "%4s" % (value)
|
||||
line = self.parent.hddtempFormat
|
||||
for i in range(len(self.parent.hddNames)):
|
||||
if (line.split('$hddtemp'+str(i))[0] != line):
|
||||
line = line.split('$hddtemp'+str(i))[0] + self.parent.hdd[self.parent.hddNames[i]] + line.split('$hddtemp'+str(i))[1]
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_hddtemp.setText(text)
|
||||
elif (sourceName == "player"):
|
||||
if (self.parent.player_name == 0):
|
||||
album = str(data[QString(u'amarok_album')].toUtf8()).decode("utf-8")
|
||||
artist = str(data[QString(u'amarok_artist')].toUtf8()).decode("utf-8")
|
||||
progress = str(data[QString(u'amarok_progress')].toUtf8()).decode("utf-8")
|
||||
time = str(data[QString(u'amarok_duration')].toUtf8()).decode("utf-8")
|
||||
title = str(data[QString(u'amarok_title')].toUtf8()).decode("utf-8")
|
||||
elif (self.parent.player_name == 1):
|
||||
album = str(data[QString(u'mpd_album')].toUtf8()).decode("utf-8")
|
||||
artist = str(data[QString(u'mpd_artist')].toUtf8()).decode("utf-8")
|
||||
progress = str(data[QString(u'mpd_progress')].toUtf8()).decode("utf-8")
|
||||
time = str(data[QString(u'mpd_duration')].toUtf8()).decode("utf-8")
|
||||
title = str(data[QString(u'mpd_title')].toUtf8()).decode("utf-8")
|
||||
elif (self.parent.player_name == 2):
|
||||
album = str(data[QString(u'qmmp_album')].toUtf8()).decode("utf-8")
|
||||
artist = str(data[QString(u'qmmp_artist')].toUtf8()).decode("utf-8")
|
||||
progress = str(data[QString(u'qmmp_progress')].toUtf8()).decode("utf-8")
|
||||
time = str(data[QString(u'qmmp_duration')].toUtf8()).decode("utf-8")
|
||||
title = str(data[QString(u'qmmp_title')].toUtf8()).decode("utf-8")
|
||||
line = self.parent.playerFormat
|
||||
if (line.split('$album')[0] != line):
|
||||
line = line.split('$album')[0] + album + line.split('$album')[1]
|
||||
if (line.split('$artist')[0] != line):
|
||||
line = line.split('$artist')[0] + artist + line.split('$artist')[1]
|
||||
if (line.split('$progress')[0] != line):
|
||||
timeText = '%02i:%02i' % (int(time)/60, int(time)%60)
|
||||
line = line.split('$progress')[0] + timeText + line.split('$progress')[1]
|
||||
if (line.split('$time')[0] != line):
|
||||
timeText = '%02i:%02i' % (int(time)/60, int(time)%60)
|
||||
line = line.split('$time')[0] + timeText + line.split('$time')[1]
|
||||
if (line.split('$title')[0] != line):
|
||||
line = line.split('$title')[0] + title + line.split('$title')[1]
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_player.setText(text)
|
||||
elif (sourceName == "Local"):
|
||||
if (self.parent.timeFormat.split('$time')[0] != self.parent.timeFormat):
|
||||
value = str(data[QString(u'DateTime')].toString(Qt.TextDate).toUtf8())
|
||||
line = self.parent.timeFormat.split('$time')[0] + value.decode("utf-8") + self.parent.timeFormat.split('$time')[1]
|
||||
elif (self.parent.timeFormat.split('$isotime')[0] != self.parent.timeFormat):
|
||||
value = str(data[QString(u'DateTime')].toString(Qt.ISODate).toUtf8())
|
||||
line = self.parent.timeFormat.split('$isotime')[0] + value.decode("utf-8") + self.parent.timeFormat.split('$isotime')[1]
|
||||
elif (self.parent.timeFormat.split('$shorttime')[0] != self.parent.timeFormat):
|
||||
value = str(data[QString(u'DateTime')].toString(Qt.SystemLocaleShortDate).toUtf8())
|
||||
line = self.parent.timeFormat.split('$shorttime')[0] + value.decode("utf-8") + self.parent.timeFormat.split('$shorttime')[1]
|
||||
elif (self.parent.timeFormat.split('$longtime')[0] != self.parent.timeFormat):
|
||||
value = str(data[QString(u'DateTime')].toString(Qt.SystemLocaleLongDate).toUtf8())
|
||||
line = self.parent.timeFormat.split('$longtime')[0] + value.decode("utf-8") + self.parent.timeFormat.split('$longtime')[1]
|
||||
elif (self.parent.timeFormat.split('$custom')[0] != self.parent.timeFormat):
|
||||
rawDate = data[QString(u'DateTime')]
|
||||
value = self.parent.custom_time
|
||||
for letters in timeLetters:
|
||||
if (value.split('$'+letters)[0] != value):
|
||||
value = value.split('$'+letters)[0] + \
|
||||
str(data[QString(u'DateTime')].toString(letters).toUtf8()).decode("utf-8") + \
|
||||
value.split('$'+letters)[1]
|
||||
line = self.parent.timeFormat.split('$custom')[0] + value + self.parent.timeFormat.split('$custom')[1]
|
||||
else:
|
||||
line = self.parent.timeFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_time.setText(text)
|
||||
|
||||
self.parent.update()
|
||||
except:
|
||||
pass
|
335
sources/ptm/contents/code/main.py
Normal file
@ -0,0 +1,335 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
############################################################################
|
||||
# This file is part of pytextmonitor #
|
||||
# #
|
||||
# pytextmonitor 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. #
|
||||
# #
|
||||
# pytextmonitor 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 pytextmonitor. If not, see http://www.gnu.org/licenses/ #
|
||||
############################################################################
|
||||
|
||||
from PyQt4.QtCore import *
|
||||
from PyQt4.QtGui import *
|
||||
from PyKDE4.kdecore import *
|
||||
from PyKDE4.kdeui import *
|
||||
from PyKDE4.kio import *
|
||||
from PyKDE4 import plasmascript
|
||||
from PyKDE4.plasma import Plasma
|
||||
import commands, os, shutil, time
|
||||
|
||||
import configdef
|
||||
import configwindow
|
||||
import dataengine
|
||||
import reinit
|
||||
import tooltip
|
||||
from util import *
|
||||
|
||||
|
||||
|
||||
class pyTextWidget(plasmascript.Applet):
|
||||
def __init__(self, parent, args=None):
|
||||
"""widget definition"""
|
||||
plasmascript.Applet.__init__(self, parent)
|
||||
|
||||
|
||||
def init(self):
|
||||
"""function to initializate widget"""
|
||||
self._name = str(self.package().metadata().pluginName())
|
||||
self.layout = QGraphicsLinearLayout(Qt.Horizontal, self.applet)
|
||||
|
||||
self.dataengine = dataengine.DataEngine(self)
|
||||
self.reinit = reinit.Reinit(self)
|
||||
self.tooltipAgent = tooltip.Tooltip(self)
|
||||
|
||||
self.timer = QTimer()
|
||||
QObject.connect(self.timer, SIGNAL("timeout()"), self.updateLabel)
|
||||
|
||||
self.setupVar()
|
||||
self.initTooltip()
|
||||
self.reinit.reinit(confAccept=False)
|
||||
|
||||
self.setHasConfigurationInterface(True)
|
||||
# Create notifyrc file if required
|
||||
kdehome = unicode(KGlobal.dirs().localkdedir())
|
||||
if ((not os.path.exists(kdehome + "/share/apps/plasma_applet_pytextmonitor/plasma_applet_pytextmonitor.notifyrc")) and
|
||||
(not os.path.exists("/usr" + "/share/apps/plasma_applet_pytextmonitor/plasma_applet_pytextmonitor.notifyrc"))):
|
||||
self.createNotifyrc(kdehome)
|
||||
|
||||
|
||||
def createConfigurationInterface(self, parent):
|
||||
"""function to setup configuration window"""
|
||||
self.configpage = configwindow.ConfigWindow(self)
|
||||
self.configdef = configdef.ConfigDefinition(self, self.configpage)
|
||||
self.configdef.createConfigurationInterface(parent)
|
||||
|
||||
|
||||
def createNotifyrc(self, kdehome):
|
||||
"""function to create *.notifyrc"""
|
||||
if (not os.path.isdir(kdehome + "/share/apps/plasma_applet_pytextmonitor")):
|
||||
os.mkdir(kdehome + "/share/apps/plasma_applet_pytextmonitor")
|
||||
shutil.copy(kdehome + "/share/apps/plasma/plasmoids/py-text-monitor/contents/code/plasma_applet_pytextmonitor.notifyrc",
|
||||
kdehome + "/share/apps/plasma_applet_pytextmonitor/")
|
||||
|
||||
|
||||
def initTooltip(self):
|
||||
"""function to create tooltip"""
|
||||
self.tooltip = Plasma.ToolTipContent()
|
||||
self.tooltip.setMainText("PyTextMonitor")
|
||||
self.tooltip.setSubText('')
|
||||
Plasma.ToolTipManager.self().registerWidget(self.applet)
|
||||
# graphical tooltip
|
||||
self.tooltip_pixmap = QPixmap()
|
||||
self.tooltip_scene = QGraphicsScene()
|
||||
self.tooltip_view = QGraphicsView(self.tooltip_scene)
|
||||
self.tooltip_view.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
|
||||
self.tooltip_view.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
|
||||
# show tooltip
|
||||
Plasma.ToolTipManager.self().setContent(self.applet, self.tooltip)
|
||||
|
||||
|
||||
def updateTooltip(self):
|
||||
"""function to update tooltip"""
|
||||
self.tooltip_view.resize(100.0*(len(self.tooltipReq)-self.tooltipReq.count('up')), 100.0)
|
||||
self.tooltipAgent.createGraphic(self.tooltipReq, self.tooltipColors, self.tooltipValues, self.tooltip_scene)
|
||||
self.tooltip.setImage(QPixmap.grabWidget(self.tooltip_view))
|
||||
Plasma.ToolTipManager.self().setContent(self.applet, self.tooltip)
|
||||
|
||||
|
||||
def mouseDoubleClickEvent(self, event):
|
||||
"""function to doubleclick event"""
|
||||
os.system("ksysguard &")
|
||||
|
||||
|
||||
def setupNetdev(self):
|
||||
"""function to setup network device"""
|
||||
netdev = "lo"
|
||||
interfaces = QDir.entryList(QDir(self.netdir), QDir.Dirs | QDir.NoDotAndDotDot)
|
||||
for device in interfaces:
|
||||
if (str(device) != "lo"):
|
||||
try:
|
||||
with open(self.netdir+"/"+str(device)+"/operstate", "r") as stateFile:
|
||||
if (stateFile.readline() == "up\n"):
|
||||
netdev = str(device)
|
||||
except:
|
||||
pass
|
||||
return netdev
|
||||
|
||||
|
||||
def setupVar(self):
|
||||
"""function to setup variables"""
|
||||
self.netdev = ''
|
||||
self.cpuCore = {-1:" 0.0"}
|
||||
self.cpuClockCore = {-1:" 0"}
|
||||
numCores = int(commands.getoutput("grep -c '^processor' /proc/cpuinfo"))
|
||||
for i in range(numCores):
|
||||
self.cpuCore[i] = str(" 0.0")
|
||||
self.cpuClockCore[i] = str(" 0")
|
||||
self.netSpeed = {"up":" 0", "down":" 0"}
|
||||
self.tempNames = []
|
||||
self.temp = {}
|
||||
self.mountNames = []
|
||||
self.mount = {}
|
||||
self.hddNames = []
|
||||
self.hdd = {}
|
||||
self.tooltipColors = {}
|
||||
self.tooltipNum = 100
|
||||
self.tooltipReq = []
|
||||
self.tooltipValues = {'cpu':[0.0, 0.01], 'cpuclock':[0.0, 0.01], 'mem':[0.0, 0.01],
|
||||
'swap':[0.0, 0.01], 'up':[0.0, 0.01], 'down':[0.0, 0.01]}
|
||||
|
||||
# create dictionaries
|
||||
self.dict_orders = {'6':'bat', '1':'cpu', '7':'cpuclock', 'f':'custom', '9':'gpu',
|
||||
'a':'gputemp', 'b':'hdd', 'c':'hddtemp', '3':'mem', '5':'net', '4':'swap', '2':'temp',
|
||||
'8':'uptime', 'd':'player', 'e':'time'}
|
||||
self.dict_defFormat = {'bat':'[bat: $bat%$ac]', 'cpu':'[cpu: $cpu%]',
|
||||
'cpuclock':'[mhz: $cpucl]', 'custom':'[$custom]', 'gpu':'[gpu: $gpu%]',
|
||||
'gputemp':'[gpu temp: $gputemp°C]', 'hdd':'[hdd: $hdd0%]',
|
||||
'hddtemp':'[hdd temp: $hddtemp0°C]', 'mem':'[mem: $mem%]',
|
||||
'net':'[$netdev: $down/$upKB/s]', 'swap':'[swap: $swap%]',
|
||||
'temp':'[temp: $temp0°C]', 'uptime':'[uptime: $uptime]',
|
||||
'player':'[$artist - $title]', 'time':'[$time]'}
|
||||
|
||||
|
||||
def showConfigurationInterface(self):
|
||||
"""function to show configuration window"""
|
||||
plasmascript.Applet.showConfigurationInterface(self)
|
||||
|
||||
|
||||
def startPolling(self):
|
||||
try:
|
||||
self.timer.start()
|
||||
self.updateLabel()
|
||||
self.tooltip.setSubText('')
|
||||
except Exception as strerror:
|
||||
self.tooltip.setSubText(str(strerror))
|
||||
self.label_error = Plasma.Label(self.applet)
|
||||
self.label_error.setText('<font color="red">ERROR</font>')
|
||||
self.layout.addItem(self.label_error)
|
||||
return
|
||||
|
||||
|
||||
def updateLabel(self):
|
||||
"""function to update label"""
|
||||
if (self.batBool > 0):
|
||||
self.batText()
|
||||
if (self.cpuBool > 0):
|
||||
self.cpuText()
|
||||
if (self.cpuclockBool > 0):
|
||||
self.cpuclockText()
|
||||
if (self.customBool > 0):
|
||||
self.getCustom()
|
||||
if (self.hddBool > 0):
|
||||
self.mountText()
|
||||
if ((self.memBool > 0) and (self.memInMb == False)):
|
||||
self.memText()
|
||||
if (self.netBool > 0):
|
||||
self.netText()
|
||||
if ((self.swapBool > 0) and (self.swapInMb == False)):
|
||||
self.swapText()
|
||||
if (self.tempBool > 0):
|
||||
self.tempText()
|
||||
self.updateTooltip()
|
||||
|
||||
|
||||
def batText(self):
|
||||
"""function to set battery text"""
|
||||
line = self.batFormat
|
||||
if (line.split('$bat')[0] != line):
|
||||
try:
|
||||
with open (self.battery_device, 'r') as bat_file:
|
||||
bat = bat_file.readline().split('\n')[0]
|
||||
except:
|
||||
bat = 'off'
|
||||
bat = "%3s" % (bat)
|
||||
line = line.split('$bat')[0] + bat + line.split('$bat')[1]
|
||||
if (line.split('$ac')[0] != line):
|
||||
try:
|
||||
with open (self.ac_device, 'r') as bat_file:
|
||||
bat = bat_file.readline().split('\n')[0]
|
||||
if (bat == '1'):
|
||||
bat = '(*)'
|
||||
else:
|
||||
bat = '( )'
|
||||
except:
|
||||
bat = '(?)'
|
||||
line = line.split('$ac')[0] + bat + line.split('$ac')[1]
|
||||
text = self.formatLine.split('$LINE')[0] + line + self.formatLine.split('$LINE')[1]
|
||||
self.label_bat.setText(text)
|
||||
|
||||
|
||||
def cpuText(self):
|
||||
"""function to set cpu text"""
|
||||
line = self.cpuFormat
|
||||
for core in self.cpuCore.keys():
|
||||
if (core > -1):
|
||||
if (line.split('$cpu'+str(core))[0] != line):
|
||||
line = line.split('$cpu'+str(core))[0] + self.cpuCore[core] + line.split('$cpu'+str(core))[1]
|
||||
if (line.split('$cpu')[0] != line):
|
||||
line = line.split('$cpu')[0] + self.cpuCore[-1] + line.split('$cpu')[1]
|
||||
text = self.formatLine.split('$LINE')[0] + line + self.formatLine.split('$LINE')[1]
|
||||
self.label_cpu.setText(text)
|
||||
|
||||
|
||||
def cpuclockText(self):
|
||||
"""function to set cpu clock text"""
|
||||
line = self.cpuclockFormat
|
||||
for core in self.cpuClockCore.keys():
|
||||
if (core > -1):
|
||||
if (line.split('$cpucl'+str(core))[0] != line):
|
||||
line = line.split('$cpucl'+str(core))[0] + self.cpuClockCore[core] + line.split('$cpucl'+str(core))[1]
|
||||
if (line.split('$cpucl')[0] != line):
|
||||
line = line.split('$cpucl')[0] + self.cpuClockCore[-1] + line.split('$cpucl')[1]
|
||||
text = self.formatLine.split('$LINE')[0] + line + self.formatLine.split('$LINE')[1]
|
||||
self.label_cpuclock.setText(text)
|
||||
|
||||
|
||||
def memText(self):
|
||||
"""function to set mem text"""
|
||||
full = self.mem_uf + self.mem_free
|
||||
try:
|
||||
mem = 100 * self.mem_used / full
|
||||
mem = "%5s" % (str(round(mem, 1)))
|
||||
except:
|
||||
mem = " N\\A"
|
||||
if (self.memFormat.split('$mem')[0] != self.memFormat):
|
||||
line = self.memFormat.split('$mem')[0] + mem + self.memFormat.split('$mem')[1]
|
||||
else:
|
||||
line = self.memFormat
|
||||
text = self.formatLine.split('$LINE')[0] + line + self.formatLine.split('$LINE')[1]
|
||||
self.label_mem.setText(text)
|
||||
|
||||
|
||||
def mountText(self):
|
||||
"""function to set mount text"""
|
||||
line = self.hddFormat
|
||||
for i in range(len(self.mountNames)):
|
||||
if (line.split('$hdd'+str(i))[0] != line):
|
||||
line = line.split('$hdd'+str(i))[0] + self.mount[self.mountNames[i]] + line.split('$hdd'+str(i))[1]
|
||||
text = self.formatLine.split('$LINE')[0] + line + self.formatLine.split('$LINE')[1]
|
||||
self.label_hdd.setText(text)
|
||||
|
||||
|
||||
def netText(self):
|
||||
"""function to set network text"""
|
||||
line = self.netFormat
|
||||
if (line.split('$up')[0] != line):
|
||||
line = line.split('$up')[0] + self.netSpeed['up'] + line.split('$up')[1]
|
||||
if (line.split('$down')[0] != line):
|
||||
line = line.split('$down')[0] + self.netSpeed['down'] + line.split('$down')[1]
|
||||
text = self.formatLine.split('$LINE')[0] + line + self.formatLine.split('$LINE')[1]
|
||||
self.label_net.setText(text)
|
||||
|
||||
|
||||
def swapText(self):
|
||||
"""function to set swap text"""
|
||||
full = self.swap_used + self.swap_free
|
||||
try:
|
||||
mem = 100 * self.swap_used / full
|
||||
mem = "%5s" % (str(round(mem, 1)))
|
||||
except:
|
||||
mem = " N\\A"
|
||||
if (self.swapFormat.split('$swap')[0] != self.swapFormat):
|
||||
line = self.swapFormat.split('$swap')[0] + mem + self.swapFormat.split('$swap')[1]
|
||||
else:
|
||||
line = self.swapFormat
|
||||
text = self.formatLine.split('$LINE')[0] + line + self.formatLine.split('$LINE')[1]
|
||||
self.label_swap.setText(text)
|
||||
|
||||
|
||||
def tempText(self):
|
||||
"""function to set temperature text"""
|
||||
line = self.tempFormat
|
||||
for i in range(len(self.tempNames)):
|
||||
if (line.split('$temp'+str(i))[0] != line):
|
||||
line = line.split('$temp'+str(i))[0] + self.temp[self.tempNames[i]] + line.split('$temp'+str(i))[1]
|
||||
text = self.formatLine.split('$LINE')[0] + line + self.formatLine.split('$LINE')[1]
|
||||
self.label_temp.setText(text)
|
||||
|
||||
|
||||
def getCustom(self):
|
||||
"""function to get output from custom command"""
|
||||
commandOut = commands.getoutput(self.custom_command)
|
||||
line = self.customFormat
|
||||
line = line.split('$custom')[0] + commandOut + line.split('$custom')[1]
|
||||
text = self.formatLine.split('$LINE')[0] + line + self.formatLine.split('$LINE')[1]
|
||||
self.label_custom.setText(text)
|
||||
|
||||
|
||||
@pyqtSignature("dataUpdated(const QString &, const Plasma::DataEngine::Data &)")
|
||||
def dataUpdated(self, sourceName, data):
|
||||
"""function to update label"""
|
||||
self.dataengine.dataUpdated(sourceName, data)
|
||||
|
||||
|
||||
|
||||
def CreateApplet(parent):
|
||||
return pyTextWidget(parent)
|
@ -1,5 +1,22 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
############################################################################
|
||||
# This file is part of pytextmonitor #
|
||||
# #
|
||||
# pytextmonitor 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. #
|
||||
# #
|
||||
# pytextmonitor 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 pytextmonitor. If not, see http://www.gnu.org/licenses/ #
|
||||
############################################################################
|
||||
|
||||
from PyKDE4.kdecore import KComponentData
|
||||
from PyKDE4.kdeui import KNotification
|
||||
import commands
|
||||
@ -43,7 +60,6 @@ class PTMNotify:
|
||||
output = commands.getoutput("grep 'model name' /proc/cpuinfo | head -1")
|
||||
text = text + "Model: %s\n" %(' '.join(output.split()[3:]))
|
||||
output = commands.getoutput("sar -u | tail -1")
|
||||
print "1"
|
||||
text = text + "CPU Usage: %s%%\n" %(str(100-float(output.split()[-1])))
|
||||
output = commands.getoutput("grep MHz /proc/cpuinfo | head -1")
|
||||
text = text + "CPU Freq: %s MHz\n" %(str(int(float(output.split()[-1]))))
|
||||
@ -133,6 +149,31 @@ class PTMNotify:
|
||||
text = text + "%s" %(commands.getoutput("acpi -abi"))
|
||||
except:
|
||||
text = "Something wrong"
|
||||
elif (type == "musicplayer"):
|
||||
try:
|
||||
artist = "N\\A"
|
||||
album = "N\\A"
|
||||
title = "N\\A"
|
||||
if (self.parent.parent.player_name == 0):
|
||||
artist = commands.getoutput("qdbus org.kde.amarok /Player GetMetadata 2> /dev/null | grep albumartist: | cut -c14-")
|
||||
album = commands.getoutput("qdbus org.kde.amarok /Player GetMetadata 2> /dev/null | grep album: | cut -c8-")
|
||||
title = commands.getoutput("qdbus org.kde.amarok /Player GetMetadata 2> /dev/null | grep title: | cut -c8-")
|
||||
elif (self.parent.parent.player_name == 1):
|
||||
output = commands.getoutput("echo 'currentsong\nclose' | curl --connect-timeout 1 -fsm 3 telnet://localhost:6600 2> /dev/null")
|
||||
for line in output.split("\n"):
|
||||
if (line.split(": ")[0] == "Artist"):
|
||||
artist = line.split(": ")[1]
|
||||
elif (line.split(": ")[0] == "Album"):
|
||||
album = line.split(": ")[1]
|
||||
elif (line.split(": ")[0] == "Title"):
|
||||
title = line.split(": ")[1]
|
||||
elif (self.parent.parent.player_name == 2):
|
||||
artist = commands.getoutput("qmmp --nowplaying '%if(%p,%p,Unknown)' 2> /dev/null")
|
||||
album = commands.getoutput("qmmp --nowplaying '%if(%a,%a,Unknown)' 2> /dev/null")
|
||||
title = commands.getoutput("qmmp --nowplaying '%if(%t,%t,Unknown)' 2> /dev/null")
|
||||
text = text + "Artist: %s\nAlbum: %s\nTitle: %s" %(artist, album, title)
|
||||
except:
|
||||
text = "Something wrong"
|
||||
|
||||
content = [type, text]
|
||||
return content
|
||||
@ -140,6 +181,12 @@ class PTMNotify:
|
||||
|
||||
def initText(self, sender):
|
||||
"""function to send text"""
|
||||
try:
|
||||
if (sender == self.parent.parent.label_time):
|
||||
content = self.createText("system")
|
||||
return content
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
if (sender == self.parent.parent.label_uptime):
|
||||
content = self.createText("system")
|
||||
@ -189,7 +236,7 @@ class PTMNotify:
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
if (sender == self.parent.parent.label_hdd0):
|
||||
if (sender == self.parent.parent.label_hdd):
|
||||
content = self.createText("disk")
|
||||
return content
|
||||
except:
|
||||
@ -201,7 +248,7 @@ class PTMNotify:
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
if (sender == self.parent.parent.label_netDown):
|
||||
if (sender == self.parent.parent.label_net):
|
||||
content = self.createText("network")
|
||||
return content
|
||||
except:
|
||||
@ -212,3 +259,15 @@ class PTMNotify:
|
||||
return content
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
if (sender == self.parent.parent.label_player):
|
||||
content = self.createText("musicplayer")
|
||||
return content
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
if (sender == self.parent.parent.label_custom):
|
||||
content = self.createText("system")
|
||||
return content
|
||||
except:
|
||||
pass
|
271
sources/ptm/contents/code/reinit.py
Normal file
@ -0,0 +1,271 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
############################################################################
|
||||
# This file is part of pytextmonitor #
|
||||
# #
|
||||
# pytextmonitor 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. #
|
||||
# #
|
||||
# pytextmonitor 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 pytextmonitor. If not, see http://www.gnu.org/licenses/ #
|
||||
############################################################################
|
||||
|
||||
from PyQt4.QtCore import *
|
||||
from PyQt4.QtGui import *
|
||||
from PyKDE4.plasma import Plasma
|
||||
import config
|
||||
import ptmnotify
|
||||
|
||||
|
||||
|
||||
class NewPlasmaLabel(Plasma.Label):
|
||||
"""new Label with defined clicked() event"""
|
||||
def __init__(self, applet, parent):
|
||||
"""class definition"""
|
||||
Plasma.Label.__init__(self, applet)
|
||||
self.parent = parent
|
||||
self.notify = ptmnotify.PTMNotify(self)
|
||||
|
||||
|
||||
def mousePressEvent(self, event):
|
||||
"""mouse click event"""
|
||||
if (event.button() == Qt.LeftButton):
|
||||
self.notify.init()
|
||||
|
||||
|
||||
|
||||
class Reinit():
|
||||
def __init__(self, parent):
|
||||
"""class definition"""
|
||||
self.parent = parent
|
||||
|
||||
|
||||
def reinit(self, confAccept=False):
|
||||
"""function to reinitializate widget"""
|
||||
settings = config.Config(self.parent)
|
||||
self.parent.interval = settings.get('interval', 2000).toInt()[0]
|
||||
self.parent.font_family = str(settings.get('font_family', 'Terminus'))
|
||||
self.parent.font_size = settings.get('font_size', 12).toInt()[0]
|
||||
self.parent.font_color = str(settings.get('font_color', '#000000'))
|
||||
self.parent.font_style = str(settings.get('font_style', 'normal'))
|
||||
self.parent.font_weight = settings.get('font_weight', 400).toInt()[0]
|
||||
self.parent.formatLine = "<pre><p align=\"center\"><span style=\" font-family:'" + self.parent.font_family + "'; font-style:" + self.parent.font_style
|
||||
self.parent.formatLine = self.parent.formatLine + "; font-size:" + str(self.parent.font_size) + "pt; font-weight:" + str(self.parent.font_weight)
|
||||
self.parent.formatLine = self.parent.formatLine + "; color:" + self.parent.font_color + ";\">$LINE</span></p></pre>"
|
||||
|
||||
self.parent.custom_time = str(settings.get('custom_time', '$hh:$mm'))
|
||||
self.parent.custom_uptime = str(settings.get('custom_uptime', '$ds,$hs,$ms'))
|
||||
self.parent.tempNames = []
|
||||
self.parent.temp = {}
|
||||
for item in str(settings.get('temp_device', '')).split('@@'):
|
||||
self.parent.tempNames.append(item)
|
||||
self.parent.temp[item] =" 0.0"
|
||||
self.parent.mountNames = []
|
||||
self.parent.mount = {}
|
||||
for item in str(settings.get('mount', '/')).split('@@'):
|
||||
self.parent.mountNames.append(item)
|
||||
self.parent.mount[item] =" 0.0"
|
||||
self.parent.hddNames = []
|
||||
self.parent.hdd = {}
|
||||
for item in str(settings.get('hdd', '/dev/sda')).split('@@'):
|
||||
self.parent.hddNames.append(item)
|
||||
self.parent.hdd[item] =" 0.0"
|
||||
self.parent.netdir = str(settings.get('netdir', '/sys/class/net'))
|
||||
self.parent.netdevBool = settings.get('netdevBool', 0).toInt()[0]
|
||||
self.parent.custom_netdev = str(settings.get('custom_netdev', 'lo'))
|
||||
self.parent.battery_device = str(settings.get('battery_device', '/sys/class/power_supply/BAT0/capacity'))
|
||||
self.parent.ac_device = str(settings.get('ac_device', '/sys/class/power_supply/AC/online'))
|
||||
self.parent.player_name = settings.get('player_name', 0).toInt()[0]
|
||||
self.parent.custom_command = str(settings.get('custom_command', 'wget -qO- http://ifconfig.me/ip'))
|
||||
|
||||
self.parent.tooltipNum = settings.get('tooltip_num', 100).toInt()[0]
|
||||
self.parent.tooltipColors['cpu'] = str(settings.get('cpu_color', '#ff0000'))
|
||||
self.parent.tooltipColors['cpuclock'] = str(settings.get('cpuclock_color', '#00ff00'))
|
||||
self.parent.tooltipColors['mem'] = str(settings.get('mem_color', '#0000ff'))
|
||||
self.parent.tooltipColors['swap'] = str(settings.get('swap_color', '#ffff00'))
|
||||
self.parent.tooltipColors['down'] = str(settings.get('down_color', '#00ffff'))
|
||||
self.parent.tooltipColors['up'] = str(settings.get('up_color', '#ff00ff'))
|
||||
|
||||
self.parent.tooltipReq = []
|
||||
self.parent.label_order = str(settings.get('label_order', '1345'))
|
||||
for label in self.parent.dict_orders.values():
|
||||
if ((label == 'cpu') or (label == 'mem') or (label == 'swap') or (label == 'net')):
|
||||
exec ('self.parent.' + label + 'Bool = settings.get("' + label + 'Bool", 2).toInt()[0]')
|
||||
else:
|
||||
exec ('self.parent.' + label + 'Bool = settings.get("' + label + 'Bool", 0).toInt()[0]')
|
||||
|
||||
# labels
|
||||
for order in self.parent.label_order:
|
||||
if (order == "1"):
|
||||
if (self.parent.cpuBool > 0):
|
||||
self.parent.cpuFormat = str(settings.get('cpuFormat', '[cpu: $cpu%]'))
|
||||
self.parent.label_cpu = NewPlasmaLabel(self.parent.applet, self.parent)
|
||||
line = self.parent.cpuFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_cpu.setText(text)
|
||||
self.parent.layout.addItem(self.parent.label_cpu)
|
||||
if (self.parent.cpuBool == 2):
|
||||
self.parent.tooltipReq.append('cpu')
|
||||
elif (order == "2"):
|
||||
if (self.parent.tempBool > 0):
|
||||
self.parent.tempFormat = str(settings.get('tempFormat', '[temp: $temp0°C]'))
|
||||
self.parent.label_temp = NewPlasmaLabel(self.parent.applet, self.parent)
|
||||
line = self.parent.tempFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_temp.setText(text)
|
||||
self.parent.layout.addItem(self.parent.label_temp)
|
||||
elif (order == "3"):
|
||||
if (self.parent.memBool > 0):
|
||||
self.parent.memFormat = str(settings.get('memFormat', '[mem: $mem%]'))
|
||||
self.parent.label_mem = NewPlasmaLabel(self.parent.applet, self.parent)
|
||||
if (self.parent.memFormat.split('$memmb')[0] != self.parent.memFormat):
|
||||
self.parent.memInMb = True
|
||||
elif (self.parent.memFormat.split('$mem')[0] != self.parent.memFormat):
|
||||
self.parent.memInMb = False
|
||||
self.parent.mem_used = 0.0
|
||||
self.parent.mem_free = 1.0
|
||||
self.parent.mem_uf = 0.0
|
||||
line = self.parent.memFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_mem.setText(text)
|
||||
self.parent.layout.addItem(self.parent.label_mem)
|
||||
if (self.parent.memBool == 2):
|
||||
self.parent.tooltipReq.append('mem')
|
||||
elif (order == "4"):
|
||||
if (self.parent.swapBool > 0):
|
||||
self.parent.swapFormat = str(settings.get('swapFormat', '[swap: $swap%]'))
|
||||
self.parent.label_swap = NewPlasmaLabel(self.parent.applet, self.parent)
|
||||
if (self.parent.swapFormat.split('$swapmb')[0] != self.parent.swapFormat):
|
||||
self.parent.swapInMb = True
|
||||
elif (self.parent.swapFormat.split('$swap')[0] != self.parent.swapFormat):
|
||||
self.parent.swapInMb = False
|
||||
self.parent.swap_free = 1.0
|
||||
self.parent.swap_used = 0.0
|
||||
line = self.parent.swapFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_swap.setText(text)
|
||||
self.parent.layout.addItem(self.parent.label_swap)
|
||||
if (self.parent.swapBool == 2):
|
||||
self.parent.tooltipReq.append('swap')
|
||||
elif (order == "5"):
|
||||
if (self.parent.netBool > 0):
|
||||
self.parent.netNonFormat = str(settings.get('netNonFormat', '[net: $down/$upKB/s]'))
|
||||
self.parent.label_net = NewPlasmaLabel(self.parent.applet, self.parent)
|
||||
if (self.parent.netdevBool > 0):
|
||||
self.parent.netdev = self.parent.custom_netdev
|
||||
else:
|
||||
self.parent.netdev = self.parent.setupNetdev()
|
||||
if (self.parent.netNonFormat.split('$netdev')[0] != self.parent.netNonFormat):
|
||||
self.parent.netFormat = self.parent.netNonFormat.split('$netdev')[0] + self.parent.netdev + self.parent.netNonFormat.split('$netdev')[1]
|
||||
else:
|
||||
self.parent.netFormat = self.parent.netNonFormat
|
||||
line = self.parent.netFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_net.setText(text)
|
||||
self.parent.layout.addItem(self.parent.label_net)
|
||||
if (self.parent.netBool == 2):
|
||||
self.parent.tooltipReq.append('down')
|
||||
self.parent.tooltipReq.append('up')
|
||||
elif (order == "6"):
|
||||
if (self.parent.batBool > 0):
|
||||
self.parent.batFormat = str(settings.get('batFormat', '[bat: $bat%$ac]'))
|
||||
self.parent.label_bat = NewPlasmaLabel(self.parent.applet, self.parent)
|
||||
line = self.parent.batFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_bat.setText(text)
|
||||
self.parent.layout.addItem(self.parent.label_bat)
|
||||
elif (order == "7"):
|
||||
if (self.parent.cpuclockBool > 0):
|
||||
self.parent.cpuclockFormat = str(settings.get('cpuclockFormat', '[mhz: $cpucl]'))
|
||||
self.parent.label_cpuclock = NewPlasmaLabel(self.parent.applet, self.parent)
|
||||
line = self.parent.cpuclockFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_cpuclock.setText(text)
|
||||
self.parent.layout.addItem(self.parent.label_cpuclock)
|
||||
if (self.parent.cpuclockBool == 2):
|
||||
self.parent.tooltipReq.append('cpuclock')
|
||||
elif (order == "8"):
|
||||
if (self.parent.uptimeBool > 0):
|
||||
self.parent.uptimeFormat = str(settings.get('uptimeFormat', '[uptime: $uptime]'))
|
||||
self.parent.label_uptime = NewPlasmaLabel(self.parent.applet, self.parent)
|
||||
line = self.parent.uptimeFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_uptime.setText(text)
|
||||
self.parent.layout.addItem(self.parent.label_uptime)
|
||||
elif (order == "9"):
|
||||
if (self.parent.gpuBool > 0):
|
||||
self.parent.gpuFormat = str(settings.get('gpuFormat', '[gpu: $gpu%]'))
|
||||
self.parent.label_gpu = NewPlasmaLabel(self.parent.applet, self.parent)
|
||||
line = self.parent.gpuFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_gpu.setText(text)
|
||||
self.parent.layout.addItem(self.parent.label_gpu)
|
||||
elif (order == "a"):
|
||||
if (self.parent.gputempBool > 0):
|
||||
self.parent.gputempFormat = str(settings.get('gputempFormat', '[gpu temp: $gputemp°C]'))
|
||||
self.parent.label_gputemp = NewPlasmaLabel(self.parent.applet, self.parent)
|
||||
line = self.parent.gputempFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_gputemp.setText(text)
|
||||
self.parent.layout.addItem(self.parent.label_gputemp)
|
||||
elif (order == "b"):
|
||||
if (self.parent.hddBool > 0):
|
||||
self.parent.hddFormat = str(settings.get('hddFormat', '[hdd: $hdd0%]'))
|
||||
self.parent.label_hdd = NewPlasmaLabel(self.parent.applet, self.parent)
|
||||
line = self.parent.hddFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_hdd.setText(text)
|
||||
self.parent.layout.addItem(self.parent.label_hdd)
|
||||
elif (order == "c"):
|
||||
if (self.parent.hddtempBool > 0):
|
||||
self.parent.hddtempFormat = str(settings.get('hddtempFormat', '[hdd temp: $hddtemp0°C]'))
|
||||
self.parent.label_hddtemp = NewPlasmaLabel(self.parent.applet, self.parent)
|
||||
line = self.parent.hddtempFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_hddtemp.setText(text)
|
||||
self.parent.layout.addItem(self.parent.label_hddtemp)
|
||||
elif (order == "d"):
|
||||
if (self.parent.playerBool > 0):
|
||||
self.parent.playerFormat = str(settings.get('playerFormat', '[$artist - $title]'))
|
||||
self.parent.label_player = NewPlasmaLabel(self.parent.applet, self.parent)
|
||||
line = self.parent.playerFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_player.setText(text)
|
||||
self.parent.layout.addItem(self.parent.label_player)
|
||||
elif (order == "e"):
|
||||
if (self.parent.timeBool > 0):
|
||||
self.parent.timeFormat = str(settings.get('timeFormat', '[$time]'))
|
||||
self.parent.label_time = NewPlasmaLabel(self.parent.applet, self.parent)
|
||||
line = self.parent.timeFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_time.setText(text)
|
||||
self.parent.layout.addItem(self.parent.label_time)
|
||||
elif (order == "f"):
|
||||
if (self.parent.customBool > 0):
|
||||
self.parent.customFormat = str(settings.get('customFormat', '[$custom]'))
|
||||
self.parent.label_custom = NewPlasmaLabel(self.parent.applet, self.parent)
|
||||
line = self.parent.customFormat
|
||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||
self.parent.label_custom.setText(text)
|
||||
self.parent.layout.addItem(self.parent.label_custom)
|
||||
if not confAccept:
|
||||
self.parent.layout.setContentsMargins(1, 1, 1, 1)
|
||||
self.parent.applet.setLayout(self.parent.layout)
|
||||
self.parent.theme = Plasma.Svg(self.parent)
|
||||
self.parent.theme.setImagePath("widgets/background")
|
||||
self.parent.setBackgroundHints(Plasma.Applet.DefaultBackground)
|
||||
self.parent.resize(10, 10)
|
||||
|
||||
# create dataengines
|
||||
self.parent.thread().wait(60000)
|
||||
self.parent.dataengine.connectToEngine()
|
||||
|
||||
self.parent.timer.setInterval(self.parent.interval)
|
||||
self.parent.startPolling()
|
65
sources/ptm/contents/code/tooltip.py
Normal file
@ -0,0 +1,65 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
############################################################################
|
||||
# This file is part of pytextmonitor #
|
||||
# #
|
||||
# pytextmonitor 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. #
|
||||
# #
|
||||
# pytextmonitor 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 pytextmonitor. If not, see http://www.gnu.org/licenses/ #
|
||||
############################################################################
|
||||
|
||||
from PyQt4.QtCore import *
|
||||
from PyQt4.QtGui import *
|
||||
|
||||
|
||||
|
||||
class Tooltip():
|
||||
def __init__(self, parent):
|
||||
"""class definition"""
|
||||
self.parent = parent
|
||||
|
||||
|
||||
def addValue(self, type, value=0.0, tooltipNum=100):
|
||||
"""function to add value to list"""
|
||||
if (len(self.parent.tooltipValues[type]) > tooltipNum):
|
||||
self.parent.tooltipValues[type] = self.parent.tooltipValues[type][1:]
|
||||
self.parent.tooltipValues[type].append(value)
|
||||
|
||||
|
||||
def createGraphic(self, types, colors, values, widget):
|
||||
"""function to create graph"""
|
||||
widget.clear()
|
||||
maxOne = [100.0, 100.0]
|
||||
pen = QPen()
|
||||
down = False
|
||||
for type in types:
|
||||
bound = [values[type][0], values[type][0]]
|
||||
for value in values[type]:
|
||||
if (value < bound[0]):
|
||||
bound[0] = value
|
||||
elif (value > bound[1]):
|
||||
bound[1] = value
|
||||
norm = [maxOne[0] / len(values[type]), maxOne[1] / (1.5*(bound[1] - bound[0]))]
|
||||
pen.setColor(QColor(colors[type]))
|
||||
if (down):
|
||||
shift = (types.index(type) - 1) * maxOne[0]
|
||||
else:
|
||||
shift = types.index(type) * maxOne[0]
|
||||
for i in range(len(values[type])-1):
|
||||
x1 = i * norm[0] + shift
|
||||
y1 = -(values[type][i] - bound[0]) * norm[1]
|
||||
x2 = (i + 1) * norm[0] + shift
|
||||
y2 = -(values[type][i+1] - bound[0]) * norm[1]
|
||||
widget.addLine(x1, y1, x2, y2, pen)
|
||||
if (type == 'down'):
|
||||
down = True
|
||||
|
58
sources/ptm/contents/code/util.py
Normal file
@ -0,0 +1,58 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
############################################################################
|
||||
# Copyright 2012 Alex Oleshkevich <alex.oleshkevich@gmail.com> #
|
||||
# #
|
||||
# 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 2 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, write to the Free Software Foundation, Inc., #
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #
|
||||
############################################################################
|
||||
|
||||
from shutil import copyfile
|
||||
from PyKDE4.kdecore import *
|
||||
import os
|
||||
|
||||
|
||||
|
||||
class Util():
|
||||
def __init__(self, applet):
|
||||
self.applet = applet
|
||||
|
||||
|
||||
def createDirectory(self, name):
|
||||
if not os.path.isdir(name):
|
||||
try:
|
||||
os.mkdir(name)
|
||||
except:
|
||||
print 'Failed to create directory: ' + name
|
||||
|
||||
|
||||
def kdeHome(self):
|
||||
return unicode(KGlobal.dirs().localkdedir())
|
||||
|
||||
|
||||
def createNotifyrc(self):
|
||||
print '[%s] creating notifyrc' % (self.applet._name)
|
||||
self.createDirectory(self.kdeHome() + 'share/apps/%s' % self.applet._name)
|
||||
|
||||
source = self.applet.package().path() + 'contents/misc/%s.notifyrc' % self.applet._name
|
||||
destination = self.kdeHome() + 'share/apps/%s/%s.notifyrc' % (self.applet._name, self.applet._name)
|
||||
copyfile(source, destination)
|
||||
|
||||
|
||||
def createConfig(self):
|
||||
self.createDirectory(self.kdeHome() + 'share/apps/%s' % self.applet._name)
|
||||
|
||||
source = self.applet.package().path() + 'contents/misc/%s.ini' % self.applet._name
|
||||
destination = self.kdeHome() + 'share/apps/%s/%s.ini' % (self.applet._name, self.applet._name)
|
||||
copyfile(source, destination)
|
@ -11,10 +11,10 @@ X-Plasma-RequiredExtensions=LaunchApp,LocalIO,FileDialog
|
||||
|
||||
X-KDE-PluginInfo-Author=Evgeniy Alekseev aka arcanis
|
||||
X-KDE-PluginInfo-Email=esalexeev@gmail.com
|
||||
X-KDE-PluginInfo-Name=py-text-monitor
|
||||
X-KDE-PluginInfo-Version=1.4.0
|
||||
X-KDE-PluginInfo-Name=pytextmonitor
|
||||
X-KDE-PluginInfo-Version=@PROJECT_VERSION@
|
||||
X-KDE-PluginInfo-Website=http://kde-look.org/
|
||||
X-KDE-PluginInfo-Category=System Information
|
||||
X-KDE-PluginInfo-Depends=
|
||||
X-KDE-PluginInfo-License=GPL
|
||||
X-KDE-PluginInfo-License=GPLv3
|
||||
X-KDE-PluginInfo-EnabledByDefault=true
|
@ -42,3 +42,8 @@ Action=Popup
|
||||
Name=Graphical Information
|
||||
Comment=Graphical Information
|
||||
Action=Popup
|
||||
|
||||
[Event/musicplayer]
|
||||
Name=Now playing
|
||||
Comment=Now playing
|
||||
Action=Popup
|
26
sources/ptm/po/CMakeLists.txt
Normal file
@ -0,0 +1,26 @@
|
||||
# set project name
|
||||
set (SUBPROJECT pytextmonitor)
|
||||
|
||||
# dependencies
|
||||
find_package(Gettext REQUIRED)
|
||||
|
||||
if (NOT GETTEXT_MSGFMT_EXECUTABLE)
|
||||
message(FATAL_ERROR "Please install the msgfmt binary")
|
||||
endif (NOT GETTEXT_MSGFMT_EXECUTABLE)
|
||||
|
||||
file (GLOB _po_files *.po)
|
||||
|
||||
set (_gmoFiles)
|
||||
|
||||
foreach (_current_PO_FILE ${_po_files})
|
||||
get_filename_component (_lang ${_current_PO_FILE} NAME_WE)
|
||||
set (_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo)
|
||||
add_custom_command (OUTPUT ${_gmoFile}
|
||||
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_current_PO_FILE}
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
DEPENDS ${_current_PO_FILE})
|
||||
|
||||
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo DESTINATION "share/apps/plasma/plasmoids/${SUBPROJECT}/contents/locale/${_lang}/LC_MESSAGES" RENAME ${SUBPROJECT}.mo)
|
||||
list (APPEND _gmoFiles ${_gmoFile})
|
||||
endforeach (_current_PO_FILE)
|
||||
add_custom_target (pofiles ALL DEPENDS ${_gmoFiles})
|
15
sources/ptm/po/create_list_files.sh
Executable file
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
WDIR=`pwd` # working dir
|
||||
SATELLITE_LIST=satellite.list
|
||||
BACKGROUND_LIST=background.list
|
||||
|
||||
# Background list
|
||||
cd "$WDIR"
|
||||
cd ../images
|
||||
ls -1 background_* | sed -e "s/background_//g" | sed -e "s/_/ /g" | sed -e "s/\.jpg//g" | sed -e "s/\.png//g" | sed -e "s/\.gif//g" | grep -v '^$' | sort --unique --ignore-leading-blanks > "$WDIR/background.list"
|
||||
|
||||
# Satellite list
|
||||
cd "$WDIR"
|
||||
cd ../data
|
||||
cat satellite_images.xml | grep image\ name | sed -e "s/.*<image name=\"\([^\"]*\).*/\1/" | sed -e "s/\&/\&/g" | sed -e "s/\'/'/g" | sed -e "s/\"/\"/g" | sed -e "s/\</</g" | sed -e "s/\>/>/g" | grep -v '^$' | sort --unique --ignore-leading-blanks > "$WDIR/satellite.list"
|
606
sources/ptm/po/en.po
Normal file
@ -0,0 +1,606 @@
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
#
|
||||
# Evgeniy Alekseev <esalexeev@gmail.com>, 2014.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: http://kde-look.org/content/show.php?content=157124\n"
|
||||
"POT-Creation-Date: 2014-04-02 20:48+0400\n"
|
||||
"PO-Revision-Date: 2014-04-02 20:49+0400\n"
|
||||
"Last-Translator: Evgeniy Alekseev <esalexeev@gmail.com>\n"
|
||||
"Language-Team: Russian <kde-russian@lists.kde.ru>\n"
|
||||
"Language: ru\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
|
||||
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
|
||||
"X-Generator: Lokalize 1.5\n"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:32
|
||||
#. i18n: ectx: property (windowTitle), widget (QWidget, ConfigWindow)
|
||||
#: rc.cpp:3
|
||||
msgid "Form"
|
||||
msgstr "Form"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:42
|
||||
#. i18n: ectx: attribute (title), widget (QWidget, settings)
|
||||
#: rc.cpp:6
|
||||
msgid "Widget settings"
|
||||
msgstr "Widget settings"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:48
|
||||
#. i18n: ectx: property (text), widget (QLabel, label)
|
||||
#: rc.cpp:9
|
||||
msgid ""
|
||||
"Detailed information may be found on <a href=\"http://arcanis.name/projects/"
|
||||
"pytextmonitor/\">project homepage</a>"
|
||||
msgstr ""
|
||||
"Detailed information may be found on <a href=\"http://arcanis.name/projects/"
|
||||
"pytextmonitor/\">project homepage</a>"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:69
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_time)
|
||||
#: rc.cpp:12
|
||||
msgid "Time"
|
||||
msgstr "Time"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:83
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_time)
|
||||
#: rc.cpp:15
|
||||
msgid ""
|
||||
"$time - time in default format\n"
|
||||
"$isotime - time in ISO format\n"
|
||||
"$shorttime - time in short format\n"
|
||||
"$longtime - time in log format\n"
|
||||
"$custom - custom time format"
|
||||
msgstr ""
|
||||
"$time - time in default format\n"
|
||||
"$isotime - time in ISO format\n"
|
||||
"$shorttime - time in short format\n"
|
||||
"$longtime - time in log format\n"
|
||||
"$custom - custom time format"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:128
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_uptime)
|
||||
#: rc.cpp:22
|
||||
msgid "Uptime"
|
||||
msgstr "Uptime"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:139
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_uptime)
|
||||
#: rc.cpp:25
|
||||
msgid ""
|
||||
"$uptime - system uptime\n"
|
||||
"$custom - custom format"
|
||||
msgstr ""
|
||||
"$uptime - system uptime\n"
|
||||
"$custom - custom format"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:187
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_cpu)
|
||||
#: rc.cpp:29
|
||||
msgid "CPU"
|
||||
msgstr "CPU"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:203
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_cpu)
|
||||
#: rc.cpp:33
|
||||
#, no-c-format
|
||||
msgid ""
|
||||
"$cpu - total load CPU, %\n"
|
||||
"$cpu0 - load CPU for core 0, %\n"
|
||||
"...\n"
|
||||
"$cpu7 - load CPU for core 7, %"
|
||||
msgstr ""
|
||||
"$cpu - total load CPU, %\n"
|
||||
"$cpu0 - load CPU for core 0, %\n"
|
||||
"...\n"
|
||||
"$cpu7 - load CPU for core 7, %"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:251
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_cpuclock)
|
||||
#: rc.cpp:39
|
||||
msgid "CPU Clock"
|
||||
msgstr "CPU Clock"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:267
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_cpuclock)
|
||||
#: rc.cpp:42
|
||||
msgid ""
|
||||
"$cpucl - average CPU clock, MHz\n"
|
||||
"$cpucl0 - CPU clock for core 0, MHz\n"
|
||||
"...\n"
|
||||
"$cpucl7 - CPU clock for core 7, MHz"
|
||||
msgstr ""
|
||||
"$cpucl - average CPU clock, MHz\n"
|
||||
"$cpucl0 - CPU clock for core 0, MHz\n"
|
||||
"...\n"
|
||||
"$cpucl7 - CPU clock for core 7, MHz"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:315
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_temp)
|
||||
#: rc.cpp:48
|
||||
msgid "Temperature"
|
||||
msgstr "Temperature"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:325
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_temp)
|
||||
#: rc.cpp:51
|
||||
msgid "$tempN - physical temperature on device N (from 0). Example: $temp0"
|
||||
msgstr "$tempN - physical temperature on device N (from 0). Example: $temp0"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:373
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_gpu)
|
||||
#: rc.cpp:54
|
||||
msgid "GPU"
|
||||
msgstr "GPU"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:383
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_gpu)
|
||||
#: rc.cpp:58
|
||||
#, no-c-format
|
||||
msgid "$gpu - gpu usage, %"
|
||||
msgstr "$gpu - gpu usage, %"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:431
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_gpuTemp)
|
||||
#: rc.cpp:61
|
||||
msgid "GPU Temp"
|
||||
msgstr "GPU Temp"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:441
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_gpuTemp)
|
||||
#: rc.cpp:64
|
||||
msgid "$gputemp - physical temperature on GPU"
|
||||
msgstr "$gputemp - physical temperature on GPU"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:489
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_mem)
|
||||
#: rc.cpp:67
|
||||
msgid "Memory"
|
||||
msgstr "Memory"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:503
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_mem)
|
||||
#: rc.cpp:71
|
||||
#, no-c-format
|
||||
msgid ""
|
||||
"$mem - RAM usage, %\n"
|
||||
"$memmb - RAM usage, MB"
|
||||
msgstr ""
|
||||
"$mem - RAM usage, %\n"
|
||||
"$memmb - RAM usage, MB"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:551
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_swap)
|
||||
#: rc.cpp:75
|
||||
msgid "Swap"
|
||||
msgstr "Swap"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:565
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_swap)
|
||||
#: rc.cpp:79
|
||||
#, no-c-format
|
||||
msgid ""
|
||||
"$swap - swap usage, %\n"
|
||||
"$swapmb - swap usage, MB"
|
||||
msgstr ""
|
||||
"$swap - swap usage, %\n"
|
||||
"$swapmb - swap usage, MB"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:613
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_hdd)
|
||||
#: rc.cpp:83
|
||||
msgid "HDD"
|
||||
msgstr "HDD"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:623
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_hdd)
|
||||
#: rc.cpp:87
|
||||
#, no-c-format
|
||||
msgid "$hddN - usage for mount point N (from 0), %. Example: $hdd0"
|
||||
msgstr "$hddN - usage for mount point N (from 0), %. Example: $hdd0"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:671
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_hddTemp)
|
||||
#: rc.cpp:90
|
||||
msgid "HDD Temp"
|
||||
msgstr "HDD Temp"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:681
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_hddTemp)
|
||||
#: rc.cpp:93
|
||||
msgid ""
|
||||
"$hddtempN - physical temperature on device N (from 0). Example: $hddtemp0"
|
||||
msgstr ""
|
||||
"$hddtempN - physical temperature on device N (from 0). Example: $hddtemp0"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:729
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_net)
|
||||
#: rc.cpp:96
|
||||
msgid "Network"
|
||||
msgstr "Network"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:744
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_net)
|
||||
#: rc.cpp:99
|
||||
msgid ""
|
||||
"$down - download speed, KB/s\n"
|
||||
"$up - upload speed, KB/s\n"
|
||||
"$netdev - current network device"
|
||||
msgstr ""
|
||||
"$down - download speed, KB/s\n"
|
||||
"$up - upload speed, KB/s\n"
|
||||
"$netdev - current network device"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:792
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_bat)
|
||||
#: rc.cpp:104
|
||||
msgid "Battery"
|
||||
msgstr "Battery"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:803
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_bat)
|
||||
#: rc.cpp:108
|
||||
#, no-c-format
|
||||
msgid ""
|
||||
"$bat - battery charge, %\n"
|
||||
"$ac - AC status"
|
||||
msgstr ""
|
||||
"$bat - battery charge, %\n"
|
||||
"$ac - AC status"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:851
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_player)
|
||||
#. i18n: file: ui/configwindow.ui:1338
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_playerSelect)
|
||||
#: rc.cpp:112 rc.cpp:214
|
||||
msgid "Music player"
|
||||
msgstr "Music player"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:865
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_player)
|
||||
#: rc.cpp:115
|
||||
msgid ""
|
||||
"$album - song album\n"
|
||||
"$artist - song artist\n"
|
||||
"$progress - song progress\n"
|
||||
"$time - song duration\n"
|
||||
"$title - song title"
|
||||
msgstr ""
|
||||
"$album - song album\n"
|
||||
"$artist - song artist\n"
|
||||
"$progress - song progress\n"
|
||||
"$time - song duration\n"
|
||||
"$title - song title"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:913
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_custom)
|
||||
#: rc.cpp:122
|
||||
msgid "Custom"
|
||||
msgstr "Custom"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:923
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_custom)
|
||||
#: rc.cpp:125
|
||||
msgid "$custom - get output from custom command"
|
||||
msgstr "$custom - get output from custom command"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:977
|
||||
#. i18n: ectx: attribute (title), widget (QWidget, advanced)
|
||||
#: rc.cpp:128
|
||||
msgid "Advanced"
|
||||
msgstr "Advanced"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:991
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_timeFormat)
|
||||
#: rc.cpp:131
|
||||
msgid "Custom time format"
|
||||
msgstr "Custom time format"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1013
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_timeFormat)
|
||||
#: rc.cpp:134
|
||||
msgid ""
|
||||
"$dddd - long weekday\n"
|
||||
"$ddd - short weekday\n"
|
||||
"$dd - day\n"
|
||||
"$d - day w\\o zero\n"
|
||||
"$MMMM - long month\n"
|
||||
"$MMM - short month\n"
|
||||
"$MM - month\n"
|
||||
"$M - month w\\o zero\n"
|
||||
"$yyyy - year\n"
|
||||
"$yy - short year\n"
|
||||
"$hh - hours (24 only)\n"
|
||||
"$h - hours w\\o zero (24 only)\n"
|
||||
"$mm - minutes\n"
|
||||
"$m - minutes w\\o zero\n"
|
||||
"$ss - seconds\n"
|
||||
"$s - seconds w\\o zero"
|
||||
msgstr ""
|
||||
"$dddd - long weekday\n"
|
||||
"$ddd - short weekday\n"
|
||||
"$dd - day\n"
|
||||
"$d - day w\\o zero\n"
|
||||
"$MMMM - long month\n"
|
||||
"$MMM - short month\n"
|
||||
"$MM - month\n"
|
||||
"$M - month w\\o zero\n"
|
||||
"$yyyy - year\n"
|
||||
"$yy - short year\n"
|
||||
"$hh - hours (24 only)\n"
|
||||
"$h - hours w\\o zero (24 only)\n"
|
||||
"$mm - minutes\n"
|
||||
"$m - minutes w\\o zero\n"
|
||||
"$ss - seconds\n"
|
||||
"$s - seconds w\\o zero"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1033
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_uptimeFormat)
|
||||
#: rc.cpp:152
|
||||
msgid "Custom uptime format"
|
||||
msgstr "Custom uptime format"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1042
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_uptimeFormat)
|
||||
#: rc.cpp:155
|
||||
msgid ""
|
||||
"$ds - uptime days\n"
|
||||
"$hs - uptime hours\n"
|
||||
"$ms - uptime minutes"
|
||||
msgstr ""
|
||||
"$ds - uptime days\n"
|
||||
"$hs - uptime hours\n"
|
||||
"$ms - uptime minutes"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1064
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_tempDevice)
|
||||
#: rc.cpp:160
|
||||
msgid "Temperature devices"
|
||||
msgstr "Temperature devices"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1090
|
||||
#. i18n: ectx: property (text), widget (QPushButton, pushButton_tempDevice)
|
||||
#. i18n: file: ui/configwindow.ui:1145
|
||||
#. i18n: ectx: property (text), widget (QPushButton, pushButton_mount)
|
||||
#. i18n: file: ui/configwindow.ui:1200
|
||||
#. i18n: ectx: property (text), widget (QPushButton, pushButton_hddDevice)
|
||||
#: rc.cpp:163 rc.cpp:173 rc.cpp:183
|
||||
msgid "Add"
|
||||
msgstr "Add"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1100
|
||||
#. i18n: ectx: property (toolTip), widget (QListWidget, listWidget_tempDevice)
|
||||
#. i18n: file: ui/configwindow.ui:1155
|
||||
#. i18n: ectx: property (toolTip), widget (QListWidget, listWidget_mount)
|
||||
#. i18n: file: ui/configwindow.ui:1210
|
||||
#. i18n: ectx: property (toolTip), widget (QListWidget, listWidget_hddDevice)
|
||||
#: rc.cpp:166 rc.cpp:176 rc.cpp:186
|
||||
msgid ""
|
||||
"Editable\n"
|
||||
"del - remove item"
|
||||
msgstr ""
|
||||
"Editable\n"
|
||||
"del - remove item"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1119
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_mount)
|
||||
#: rc.cpp:170
|
||||
msgid "Mount points"
|
||||
msgstr "Mount points"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1174
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_hddDevice)
|
||||
#: rc.cpp:180
|
||||
msgid "HDD devices"
|
||||
msgstr "HDD devices"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1227
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_netdir)
|
||||
#: rc.cpp:190
|
||||
msgid "Network directory"
|
||||
msgstr "Network directory"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1234
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_netdir)
|
||||
#: rc.cpp:193
|
||||
msgid "\"/sys/class/net\" by default"
|
||||
msgstr "\"/sys/class/net\" by default"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1254
|
||||
#. i18n: ectx: property (toolTip), widget (QCheckBox, checkBox_netdev)
|
||||
#: rc.cpp:196
|
||||
msgid "Disable auto select device and set specified device"
|
||||
msgstr "Disable auto select device and set specified device"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1257
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_netdev)
|
||||
#: rc.cpp:199
|
||||
msgid "Set network device"
|
||||
msgstr "Set network device"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1290
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_batdev)
|
||||
#: rc.cpp:202
|
||||
msgid "Battery device"
|
||||
msgstr "Battery device"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1297
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_batdev)
|
||||
#: rc.cpp:205
|
||||
msgid "\"/sys/class/power_supply/BAT0/capacity\" by default"
|
||||
msgstr "\"/sys/class/power_supply/BAT0/capacity\" by default"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1314
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_acdev)
|
||||
#: rc.cpp:208
|
||||
msgid "AC device"
|
||||
msgstr "AC device"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1321
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_acdev)
|
||||
#: rc.cpp:211
|
||||
msgid "\"/sys/class/power_supply/AC/online\" by default"
|
||||
msgstr "\"/sys/class/power_supply/AC/online\" by default"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1358
|
||||
#. i18n: ectx: property (text), item, widget (QComboBox, comboBox_playerSelect)
|
||||
#: rc.cpp:217
|
||||
msgid "amarok"
|
||||
msgstr "amarok"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1363
|
||||
#. i18n: ectx: property (text), item, widget (QComboBox, comboBox_playerSelect)
|
||||
#: rc.cpp:220
|
||||
msgid "mpd"
|
||||
msgstr "mpd"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1368
|
||||
#. i18n: ectx: property (text), item, widget (QComboBox, comboBox_playerSelect)
|
||||
#: rc.cpp:223
|
||||
msgid "qmmp"
|
||||
msgstr "qmmp"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1386
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_customCommand)
|
||||
#: rc.cpp:226
|
||||
msgid "Custom command"
|
||||
msgstr "Custom command"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1394
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_customCommand)
|
||||
#: rc.cpp:229
|
||||
msgid ""
|
||||
"Command to run, example:\n"
|
||||
"wget -qO- http://ifconfig.me/ip - get external IP"
|
||||
msgstr ""
|
||||
"Command to run, example:\n"
|
||||
"wget -qO- http://ifconfig.me/ip - get external IP"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1417
|
||||
#. i18n: ectx: attribute (title), widget (QWidget, tab)
|
||||
#: rc.cpp:233
|
||||
msgid "Tooltip"
|
||||
msgstr "Tooltip"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1423
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_tooltip)
|
||||
#: rc.cpp:236
|
||||
msgid ""
|
||||
"CPU, CPU clock, memory, swap and network labels support graphical tooltip. "
|
||||
"To enable them just make needed checkbox fully checked."
|
||||
msgstr ""
|
||||
"CPU, CPU clock, memory, swap and network labels support graphical tooltip. "
|
||||
"To enable them just make needed checkbox fully checked."
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1444
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_tooltipNum)
|
||||
#: rc.cpp:239
|
||||
msgid "Number of values for tooltips"
|
||||
msgstr "Number of values for tooltips"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1499
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_cpuColor)
|
||||
#: rc.cpp:242
|
||||
msgid "CPU color"
|
||||
msgstr "CPU color"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1539
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_cpuclockColor)
|
||||
#: rc.cpp:245
|
||||
msgid "CPU clock color"
|
||||
msgstr "CPU clock color"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1579
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_memColor)
|
||||
#: rc.cpp:248
|
||||
msgid "Memory color"
|
||||
msgstr "Memory color"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1619
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_swapColor)
|
||||
#: rc.cpp:251
|
||||
msgid "Swap color"
|
||||
msgstr "Swap color"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1659
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_downColor)
|
||||
#: rc.cpp:254
|
||||
msgid "Download speed color"
|
||||
msgstr "Download speed color"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1699
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_upColor)
|
||||
#: rc.cpp:257
|
||||
msgid "Upload speed color"
|
||||
msgstr "Upload speed color"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1745
|
||||
#. i18n: ectx: attribute (title), widget (QWidget, appearance)
|
||||
#: rc.cpp:260
|
||||
msgid "Appearance"
|
||||
msgstr "Appearance"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1759
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_interval)
|
||||
#: rc.cpp:263
|
||||
msgid "Time interval"
|
||||
msgstr "Time interval"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1814
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_font)
|
||||
#: rc.cpp:266
|
||||
msgid "Font"
|
||||
msgstr "Font"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1854
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_fontSize)
|
||||
#: rc.cpp:269
|
||||
msgid "Font size"
|
||||
msgstr "Font size"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1909
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_color)
|
||||
#: rc.cpp:272
|
||||
msgid "Font color"
|
||||
msgstr "Font color"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1949
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_style)
|
||||
#: rc.cpp:275
|
||||
msgid "Font style"
|
||||
msgstr "Font style"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1999
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_weight)
|
||||
#: rc.cpp:278
|
||||
msgid "Font weight"
|
||||
msgstr "Font weight"
|
||||
|
||||
#: rc.cpp:279
|
||||
msgctxt "NAME OF TRANSLATORS"
|
||||
msgid "Your names"
|
||||
msgstr "Evgeniy Alekseev"
|
||||
|
||||
#: rc.cpp:280
|
||||
msgctxt "EMAIL OF TRANSLATORS"
|
||||
msgid "Your emails"
|
||||
msgstr "esalexeev@gmail.com"
|
||||
|
||||
#~ msgid "@@/;@@ - mount point usage, %"
|
||||
#~ msgstr "@@/;@@ - mount point usage, %"
|
||||
|
||||
#~ msgid "@@/dev/sda@@ - physical temperature on /dev/sda"
|
||||
#~ msgstr "@@/dev/sda@@ - physical temperature on /dev/sda"
|
||||
|
||||
#~ msgid ""
|
||||
#~ "$net - network speed, down/up, KB/s\n"
|
||||
#~ "$netdev - current network device\n"
|
||||
#~ "@@eth0@@ - disable auto select device and set specified device"
|
||||
#~ msgstr ""
|
||||
#~ "$net - network speed, down/up, KB/s\n"
|
||||
#~ "$netdev - current network device\n"
|
||||
#~ "@@eth0@@ - disable auto select device and set specified device"
|
81
sources/ptm/po/extract_messages.sh
Executable file
@ -0,0 +1,81 @@
|
||||
#!/bin/sh
|
||||
BASEDIR="../contents" # root of translatable sources
|
||||
PROJECT="pytextmonitor" # project name
|
||||
BUGADDR="http://kde-look.org/content/show.php?content=157124" # MSGID-Bugs
|
||||
WDIR=`pwd` # working dir
|
||||
SATELLITE_LIST=satellite.list
|
||||
BACKGROUND_LIST=background.list
|
||||
|
||||
add_list()
|
||||
{
|
||||
LIST=$1
|
||||
|
||||
if [ -z "$LIST" ]
|
||||
then
|
||||
echo ">>ERR<< add_list() - missing parameter LIST - exiting"
|
||||
return
|
||||
fi
|
||||
|
||||
if [ -f "$LIST" ]
|
||||
then
|
||||
cat $LIST | while read ROW
|
||||
do
|
||||
echo "tr2i18n(\"${ROW}\")" >> ${WDIR}/rc.cpp
|
||||
done
|
||||
else
|
||||
echo ">>ERR<< add_list() - file $LIST does not exist."
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
echo "Preparing rc files"
|
||||
cd ${BASEDIR}
|
||||
# we use simple sorting to make sure the lines do not jump around too much from system to system
|
||||
find . -name '*.rc' -o -name '*.ui' -o -name '*.kcfg' | sort > ${WDIR}/rcfiles.list
|
||||
xargs --arg-file=${WDIR}/rcfiles.list extractrc > ${WDIR}/rc.cpp
|
||||
|
||||
# additional string for KAboutData
|
||||
echo 'i18nc("NAME OF TRANSLATORS","Your names");' >> ${WDIR}/rc.cpp
|
||||
echo 'i18nc("EMAIL OF TRANSLATORS","Your emails");' >> ${WDIR}/rc.cpp
|
||||
|
||||
cd ${WDIR}
|
||||
|
||||
# Add Satellite list
|
||||
add_list "$SATELLITE_LIST"
|
||||
|
||||
# Add Background list
|
||||
add_list "$BACKGROUND_LIST"
|
||||
|
||||
echo "Done preparing rc files"
|
||||
|
||||
|
||||
echo "Extracting messages"
|
||||
cd ${BASEDIR}
|
||||
# see above on sorting
|
||||
find . -name '*.cpp' -o -name '*.h' -o -name '*.c' | sort > ${WDIR}/infiles.list
|
||||
echo "rc.cpp" >> ${WDIR}/infiles.list
|
||||
cd ${WDIR}
|
||||
xgettext --from-code=UTF-8 -C -kde -ci18n -ki18n:1 -ki18nc:1c,2 -ki18np:1,2 -ki18ncp:1c,2,3 -ktr2i18n:1 \
|
||||
-kI18N_NOOP:1 -kI18N_NOOP2:1c,2 -kaliasLocale -kki18n:1 -kki18nc:1c,2 -kki18np:1,2 -kki18ncp:1c,2,3 \
|
||||
--msgid-bugs-address="${BUGADDR}" \
|
||||
--files-from=infiles.list -D ${BASEDIR} -D ${WDIR} -o ${PROJECT}.pot || { echo "error while calling xgettext. aborting."; exit 1; }
|
||||
echo "Done extracting messages"
|
||||
|
||||
|
||||
echo "Merging translations"
|
||||
catalogs=`find . -name '*.po'`
|
||||
for cat in $catalogs; do
|
||||
echo $cat
|
||||
msgmerge -o $cat.new $cat ${PROJECT}.pot
|
||||
mv $cat.new $cat
|
||||
done
|
||||
echo "Done merging translations"
|
||||
|
||||
|
||||
echo "Cleaning up"
|
||||
cd ${WDIR}
|
||||
rm rcfiles.list
|
||||
rm infiles.list
|
||||
rm rc.cpp
|
||||
echo "Done"
|
||||
|
533
sources/ptm/po/pytextmonitor.pot
Normal file
@ -0,0 +1,533 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: http://kde-look.org/content/show.php?content=157124\n"
|
||||
"POT-Creation-Date: 2014-04-02 20:48+0400\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"Language: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=CHARSET\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:32
|
||||
#. i18n: ectx: property (windowTitle), widget (QWidget, ConfigWindow)
|
||||
#: rc.cpp:3
|
||||
msgid "Form"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:42
|
||||
#. i18n: ectx: attribute (title), widget (QWidget, settings)
|
||||
#: rc.cpp:6
|
||||
msgid "Widget settings"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:48
|
||||
#. i18n: ectx: property (text), widget (QLabel, label)
|
||||
#: rc.cpp:9
|
||||
msgid ""
|
||||
"Detailed information may be found on <a href=\"http://arcanis.name/projects/"
|
||||
"pytextmonitor/\">project homepage</a>"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:69
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_time)
|
||||
#: rc.cpp:12
|
||||
msgid "Time"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:83
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_time)
|
||||
#: rc.cpp:15
|
||||
msgid ""
|
||||
"$time - time in default format\n"
|
||||
"$isotime - time in ISO format\n"
|
||||
"$shorttime - time in short format\n"
|
||||
"$longtime - time in log format\n"
|
||||
"$custom - custom time format"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:128
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_uptime)
|
||||
#: rc.cpp:22
|
||||
msgid "Uptime"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:139
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_uptime)
|
||||
#: rc.cpp:25
|
||||
msgid ""
|
||||
"$uptime - system uptime\n"
|
||||
"$custom - custom format"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:187
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_cpu)
|
||||
#: rc.cpp:29
|
||||
msgid "CPU"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:203
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_cpu)
|
||||
#: rc.cpp:33
|
||||
#, no-c-format
|
||||
msgid ""
|
||||
"$cpu - total load CPU, %\n"
|
||||
"$cpu0 - load CPU for core 0, %\n"
|
||||
"...\n"
|
||||
"$cpu7 - load CPU for core 7, %"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:251
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_cpuclock)
|
||||
#: rc.cpp:39
|
||||
msgid "CPU Clock"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:267
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_cpuclock)
|
||||
#: rc.cpp:42
|
||||
msgid ""
|
||||
"$cpucl - average CPU clock, MHz\n"
|
||||
"$cpucl0 - CPU clock for core 0, MHz\n"
|
||||
"...\n"
|
||||
"$cpucl7 - CPU clock for core 7, MHz"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:315
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_temp)
|
||||
#: rc.cpp:48
|
||||
msgid "Temperature"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:325
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_temp)
|
||||
#: rc.cpp:51
|
||||
msgid "$tempN - physical temperature on device N (from 0). Example: $temp0"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:373
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_gpu)
|
||||
#: rc.cpp:54
|
||||
msgid "GPU"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:383
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_gpu)
|
||||
#: rc.cpp:58
|
||||
#, no-c-format
|
||||
msgid "$gpu - gpu usage, %"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:431
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_gpuTemp)
|
||||
#: rc.cpp:61
|
||||
msgid "GPU Temp"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:441
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_gpuTemp)
|
||||
#: rc.cpp:64
|
||||
msgid "$gputemp - physical temperature on GPU"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:489
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_mem)
|
||||
#: rc.cpp:67
|
||||
msgid "Memory"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:503
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_mem)
|
||||
#: rc.cpp:71
|
||||
#, no-c-format
|
||||
msgid ""
|
||||
"$mem - RAM usage, %\n"
|
||||
"$memmb - RAM usage, MB"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:551
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_swap)
|
||||
#: rc.cpp:75
|
||||
msgid "Swap"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:565
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_swap)
|
||||
#: rc.cpp:79
|
||||
#, no-c-format
|
||||
msgid ""
|
||||
"$swap - swap usage, %\n"
|
||||
"$swapmb - swap usage, MB"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:613
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_hdd)
|
||||
#: rc.cpp:83
|
||||
msgid "HDD"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:623
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_hdd)
|
||||
#: rc.cpp:87
|
||||
#, no-c-format
|
||||
msgid "$hddN - usage for mount point N (from 0), %. Example: $hdd0"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:671
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_hddTemp)
|
||||
#: rc.cpp:90
|
||||
msgid "HDD Temp"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:681
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_hddTemp)
|
||||
#: rc.cpp:93
|
||||
msgid ""
|
||||
"$hddtempN - physical temperature on device N (from 0). Example: $hddtemp0"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:729
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_net)
|
||||
#: rc.cpp:96
|
||||
msgid "Network"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:744
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_net)
|
||||
#: rc.cpp:99
|
||||
msgid ""
|
||||
"$down - download speed, KB/s\n"
|
||||
"$up - upload speed, KB/s\n"
|
||||
"$netdev - current network device"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:792
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_bat)
|
||||
#: rc.cpp:104
|
||||
msgid "Battery"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:803
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_bat)
|
||||
#: rc.cpp:108
|
||||
#, no-c-format
|
||||
msgid ""
|
||||
"$bat - battery charge, %\n"
|
||||
"$ac - AC status"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:851
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_player)
|
||||
#. i18n: file: ui/configwindow.ui:1338
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_playerSelect)
|
||||
#: rc.cpp:112 rc.cpp:214
|
||||
msgid "Music player"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:865
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_player)
|
||||
#: rc.cpp:115
|
||||
msgid ""
|
||||
"$album - song album\n"
|
||||
"$artist - song artist\n"
|
||||
"$progress - song progress\n"
|
||||
"$time - song duration\n"
|
||||
"$title - song title"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:913
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_custom)
|
||||
#: rc.cpp:122
|
||||
msgid "Custom"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:923
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_custom)
|
||||
#: rc.cpp:125
|
||||
msgid "$custom - get output from custom command"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:977
|
||||
#. i18n: ectx: attribute (title), widget (QWidget, advanced)
|
||||
#: rc.cpp:128
|
||||
msgid "Advanced"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:991
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_timeFormat)
|
||||
#: rc.cpp:131
|
||||
msgid "Custom time format"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1013
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_timeFormat)
|
||||
#: rc.cpp:134
|
||||
msgid ""
|
||||
"$dddd - long weekday\n"
|
||||
"$ddd - short weekday\n"
|
||||
"$dd - day\n"
|
||||
"$d - day w\\o zero\n"
|
||||
"$MMMM - long month\n"
|
||||
"$MMM - short month\n"
|
||||
"$MM - month\n"
|
||||
"$M - month w\\o zero\n"
|
||||
"$yyyy - year\n"
|
||||
"$yy - short year\n"
|
||||
"$hh - hours (24 only)\n"
|
||||
"$h - hours w\\o zero (24 only)\n"
|
||||
"$mm - minutes\n"
|
||||
"$m - minutes w\\o zero\n"
|
||||
"$ss - seconds\n"
|
||||
"$s - seconds w\\o zero"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1033
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_uptimeFormat)
|
||||
#: rc.cpp:152
|
||||
msgid "Custom uptime format"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1042
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_uptimeFormat)
|
||||
#: rc.cpp:155
|
||||
msgid ""
|
||||
"$ds - uptime days\n"
|
||||
"$hs - uptime hours\n"
|
||||
"$ms - uptime minutes"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1064
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_tempDevice)
|
||||
#: rc.cpp:160
|
||||
msgid "Temperature devices"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1090
|
||||
#. i18n: ectx: property (text), widget (QPushButton, pushButton_tempDevice)
|
||||
#. i18n: file: ui/configwindow.ui:1145
|
||||
#. i18n: ectx: property (text), widget (QPushButton, pushButton_mount)
|
||||
#. i18n: file: ui/configwindow.ui:1200
|
||||
#. i18n: ectx: property (text), widget (QPushButton, pushButton_hddDevice)
|
||||
#: rc.cpp:163 rc.cpp:173 rc.cpp:183
|
||||
msgid "Add"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1100
|
||||
#. i18n: ectx: property (toolTip), widget (QListWidget, listWidget_tempDevice)
|
||||
#. i18n: file: ui/configwindow.ui:1155
|
||||
#. i18n: ectx: property (toolTip), widget (QListWidget, listWidget_mount)
|
||||
#. i18n: file: ui/configwindow.ui:1210
|
||||
#. i18n: ectx: property (toolTip), widget (QListWidget, listWidget_hddDevice)
|
||||
#: rc.cpp:166 rc.cpp:176 rc.cpp:186
|
||||
msgid ""
|
||||
"Editable\n"
|
||||
"del - remove item"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1119
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_mount)
|
||||
#: rc.cpp:170
|
||||
msgid "Mount points"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1174
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_hddDevice)
|
||||
#: rc.cpp:180
|
||||
msgid "HDD devices"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1227
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_netdir)
|
||||
#: rc.cpp:190
|
||||
msgid "Network directory"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1234
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_netdir)
|
||||
#: rc.cpp:193
|
||||
msgid "\"/sys/class/net\" by default"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1254
|
||||
#. i18n: ectx: property (toolTip), widget (QCheckBox, checkBox_netdev)
|
||||
#: rc.cpp:196
|
||||
msgid "Disable auto select device and set specified device"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1257
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_netdev)
|
||||
#: rc.cpp:199
|
||||
msgid "Set network device"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1290
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_batdev)
|
||||
#: rc.cpp:202
|
||||
msgid "Battery device"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1297
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_batdev)
|
||||
#: rc.cpp:205
|
||||
msgid "\"/sys/class/power_supply/BAT0/capacity\" by default"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1314
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_acdev)
|
||||
#: rc.cpp:208
|
||||
msgid "AC device"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1321
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_acdev)
|
||||
#: rc.cpp:211
|
||||
msgid "\"/sys/class/power_supply/AC/online\" by default"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1358
|
||||
#. i18n: ectx: property (text), item, widget (QComboBox, comboBox_playerSelect)
|
||||
#: rc.cpp:217
|
||||
msgid "amarok"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1363
|
||||
#. i18n: ectx: property (text), item, widget (QComboBox, comboBox_playerSelect)
|
||||
#: rc.cpp:220
|
||||
msgid "mpd"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1368
|
||||
#. i18n: ectx: property (text), item, widget (QComboBox, comboBox_playerSelect)
|
||||
#: rc.cpp:223
|
||||
msgid "qmmp"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1386
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_customCommand)
|
||||
#: rc.cpp:226
|
||||
msgid "Custom command"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1394
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_customCommand)
|
||||
#: rc.cpp:229
|
||||
msgid ""
|
||||
"Command to run, example:\n"
|
||||
"wget -qO- http://ifconfig.me/ip - get external IP"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1417
|
||||
#. i18n: ectx: attribute (title), widget (QWidget, tab)
|
||||
#: rc.cpp:233
|
||||
msgid "Tooltip"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1423
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_tooltip)
|
||||
#: rc.cpp:236
|
||||
msgid ""
|
||||
"CPU, CPU clock, memory, swap and network labels support graphical tooltip. "
|
||||
"To enable them just make needed checkbox fully checked."
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1444
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_tooltipNum)
|
||||
#: rc.cpp:239
|
||||
msgid "Number of values for tooltips"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1499
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_cpuColor)
|
||||
#: rc.cpp:242
|
||||
msgid "CPU color"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1539
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_cpuclockColor)
|
||||
#: rc.cpp:245
|
||||
msgid "CPU clock color"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1579
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_memColor)
|
||||
#: rc.cpp:248
|
||||
msgid "Memory color"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1619
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_swapColor)
|
||||
#: rc.cpp:251
|
||||
msgid "Swap color"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1659
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_downColor)
|
||||
#: rc.cpp:254
|
||||
msgid "Download speed color"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1699
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_upColor)
|
||||
#: rc.cpp:257
|
||||
msgid "Upload speed color"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1745
|
||||
#. i18n: ectx: attribute (title), widget (QWidget, appearance)
|
||||
#: rc.cpp:260
|
||||
msgid "Appearance"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1759
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_interval)
|
||||
#: rc.cpp:263
|
||||
msgid "Time interval"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1814
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_font)
|
||||
#: rc.cpp:266
|
||||
msgid "Font"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1854
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_fontSize)
|
||||
#: rc.cpp:269
|
||||
msgid "Font size"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1909
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_color)
|
||||
#: rc.cpp:272
|
||||
msgid "Font color"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1949
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_style)
|
||||
#: rc.cpp:275
|
||||
msgid "Font style"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1999
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_weight)
|
||||
#: rc.cpp:278
|
||||
msgid "Font weight"
|
||||
msgstr ""
|
||||
|
||||
#: rc.cpp:279
|
||||
msgctxt "NAME OF TRANSLATORS"
|
||||
msgid "Your names"
|
||||
msgstr ""
|
||||
|
||||
#: rc.cpp:280
|
||||
msgctxt "EMAIL OF TRANSLATORS"
|
||||
msgid "Your emails"
|
||||
msgstr ""
|
607
sources/ptm/po/ru.po
Normal file
@ -0,0 +1,607 @@
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
#
|
||||
# Evgeniy Alekseev <esalexeev@gmail.com>, 2014.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: http://kde-look.org/content/show.php?content=157124\n"
|
||||
"POT-Creation-Date: 2014-04-02 20:48+0400\n"
|
||||
"PO-Revision-Date: 2014-04-02 20:52+0400\n"
|
||||
"Last-Translator: Evgeniy Alekseev <esalexeev@gmail.com>\n"
|
||||
"Language-Team: Russian <kde-russian@lists.kde.ru>\n"
|
||||
"Language: ru\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
|
||||
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
|
||||
"X-Generator: Lokalize 1.5\n"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:32
|
||||
#. i18n: ectx: property (windowTitle), widget (QWidget, ConfigWindow)
|
||||
#: rc.cpp:3
|
||||
msgid "Form"
|
||||
msgstr "Form"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:42
|
||||
#. i18n: ectx: attribute (title), widget (QWidget, settings)
|
||||
#: rc.cpp:6
|
||||
msgid "Widget settings"
|
||||
msgstr "Настройки виджета"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:48
|
||||
#. i18n: ectx: property (text), widget (QLabel, label)
|
||||
#: rc.cpp:9
|
||||
msgid ""
|
||||
"Detailed information may be found on <a href=\"http://arcanis.name/projects/"
|
||||
"pytextmonitor/\">project homepage</a>"
|
||||
msgstr ""
|
||||
"Подробная информация может быть найдена на <a href=\"http://arcanis.name/ru/"
|
||||
"projects/pytextmonitor/\">домашней странице проекта</a>"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:69
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_time)
|
||||
#: rc.cpp:12
|
||||
msgid "Time"
|
||||
msgstr "Время"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:83
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_time)
|
||||
#: rc.cpp:15
|
||||
msgid ""
|
||||
"$time - time in default format\n"
|
||||
"$isotime - time in ISO format\n"
|
||||
"$shorttime - time in short format\n"
|
||||
"$longtime - time in log format\n"
|
||||
"$custom - custom time format"
|
||||
msgstr ""
|
||||
"$time - время в стандартном формате\n"
|
||||
"$isotime - время в ISO формате\n"
|
||||
"$shorttime - время в коротком формате\n"
|
||||
"$longtime - время в длинном формате\n"
|
||||
"$custom - свой формат времени"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:128
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_uptime)
|
||||
#: rc.cpp:22
|
||||
msgid "Uptime"
|
||||
msgstr "Время работы"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:139
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_uptime)
|
||||
#: rc.cpp:25
|
||||
msgid ""
|
||||
"$uptime - system uptime\n"
|
||||
"$custom - custom format"
|
||||
msgstr ""
|
||||
"$uptime - время работы\n"
|
||||
"$custom - свой формат"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:187
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_cpu)
|
||||
#: rc.cpp:29
|
||||
msgid "CPU"
|
||||
msgstr "CPU"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:203
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_cpu)
|
||||
#: rc.cpp:33
|
||||
#, no-c-format
|
||||
msgid ""
|
||||
"$cpu - total load CPU, %\n"
|
||||
"$cpu0 - load CPU for core 0, %\n"
|
||||
"...\n"
|
||||
"$cpu7 - load CPU for core 7, %"
|
||||
msgstr ""
|
||||
"$cpu - общая загрузка CPU, %\n"
|
||||
"$cpu0 - загрузка CPU для ядра 0, %\n"
|
||||
"...\n"
|
||||
"$cpu7 - загрузка CPU для ядра 7, %"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:251
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_cpuclock)
|
||||
#: rc.cpp:39
|
||||
msgid "CPU Clock"
|
||||
msgstr "Частота CPU"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:267
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_cpuclock)
|
||||
#: rc.cpp:42
|
||||
msgid ""
|
||||
"$cpucl - average CPU clock, MHz\n"
|
||||
"$cpucl0 - CPU clock for core 0, MHz\n"
|
||||
"...\n"
|
||||
"$cpucl7 - CPU clock for core 7, MHz"
|
||||
msgstr ""
|
||||
"$cpucl - средняя частота CPU, MHz\n"
|
||||
"$cpucl0 - частота CPU для ядра 0, MHz\n"
|
||||
"...\n"
|
||||
"$cpucl7 - частота CPU для ядра 7, MHz"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:315
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_temp)
|
||||
#: rc.cpp:48
|
||||
msgid "Temperature"
|
||||
msgstr "Температура"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:325
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_temp)
|
||||
#: rc.cpp:51
|
||||
msgid "$tempN - physical temperature on device N (from 0). Example: $temp0"
|
||||
msgstr "$tempN - физическая температура на устройстве N (от 0). Пример: $temp0"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:373
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_gpu)
|
||||
#: rc.cpp:54
|
||||
msgid "GPU"
|
||||
msgstr "GPU"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:383
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_gpu)
|
||||
#: rc.cpp:58
|
||||
#, no-c-format
|
||||
msgid "$gpu - gpu usage, %"
|
||||
msgstr "$gpu - использование GPU, %"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:431
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_gpuTemp)
|
||||
#: rc.cpp:61
|
||||
msgid "GPU Temp"
|
||||
msgstr "Температура GPU"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:441
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_gpuTemp)
|
||||
#: rc.cpp:64
|
||||
msgid "$gputemp - physical temperature on GPU"
|
||||
msgstr "$gputemp - физическая температура на GPU"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:489
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_mem)
|
||||
#: rc.cpp:67
|
||||
msgid "Memory"
|
||||
msgstr "Память"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:503
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_mem)
|
||||
#: rc.cpp:71
|
||||
#, no-c-format
|
||||
msgid ""
|
||||
"$mem - RAM usage, %\n"
|
||||
"$memmb - RAM usage, MB"
|
||||
msgstr ""
|
||||
"$mem - использование RAM, %\n"
|
||||
"$memmb - использование RAM, MB"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:551
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_swap)
|
||||
#: rc.cpp:75
|
||||
msgid "Swap"
|
||||
msgstr "Swap"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:565
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_swap)
|
||||
#: rc.cpp:79
|
||||
#, no-c-format
|
||||
msgid ""
|
||||
"$swap - swap usage, %\n"
|
||||
"$swapmb - swap usage, MB"
|
||||
msgstr ""
|
||||
"$swap - использование swap, %\n"
|
||||
"$swapmb - использование swap, MB"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:613
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_hdd)
|
||||
#: rc.cpp:83
|
||||
msgid "HDD"
|
||||
msgstr "HDD"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:623
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_hdd)
|
||||
#: rc.cpp:87
|
||||
#, no-c-format
|
||||
msgid "$hddN - usage for mount point N (from 0), %. Example: $hdd0"
|
||||
msgstr "$hddN - использование точки монтирования N (от 0), %. Пример: $hdd0"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:671
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_hddTemp)
|
||||
#: rc.cpp:90
|
||||
msgid "HDD Temp"
|
||||
msgstr "Температура HDD"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:681
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_hddTemp)
|
||||
#: rc.cpp:93
|
||||
msgid ""
|
||||
"$hddtempN - physical temperature on device N (from 0). Example: $hddtemp0"
|
||||
msgstr ""
|
||||
"$hddtempN - physical temperature on device N (from 0). Example: $hddtemp0 "
|
||||
"$hddtempN - температура на устройстве N (от 0). Пример: $hddtemp0"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:729
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_net)
|
||||
#: rc.cpp:96
|
||||
msgid "Network"
|
||||
msgstr "Сеть"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:744
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_net)
|
||||
#: rc.cpp:99
|
||||
msgid ""
|
||||
"$down - download speed, KB/s\n"
|
||||
"$up - upload speed, KB/s\n"
|
||||
"$netdev - current network device"
|
||||
msgstr ""
|
||||
"$down - скорость скачки, KB/s\n"
|
||||
"$up - скорость загрузки, KB/s\n"
|
||||
"$netdev - текущее устройство"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:792
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_bat)
|
||||
#: rc.cpp:104
|
||||
msgid "Battery"
|
||||
msgstr "Батарея"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:803
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_bat)
|
||||
#: rc.cpp:108
|
||||
#, no-c-format
|
||||
msgid ""
|
||||
"$bat - battery charge, %\n"
|
||||
"$ac - AC status"
|
||||
msgstr ""
|
||||
"$bat - заряд батареи, %\n"
|
||||
"$ac - статус адаптора питания"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:851
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_player)
|
||||
#. i18n: file: ui/configwindow.ui:1338
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_playerSelect)
|
||||
#: rc.cpp:112 rc.cpp:214
|
||||
msgid "Music player"
|
||||
msgstr "Музыкальный плеер"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:865
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_player)
|
||||
#: rc.cpp:115
|
||||
msgid ""
|
||||
"$album - song album\n"
|
||||
"$artist - song artist\n"
|
||||
"$progress - song progress\n"
|
||||
"$time - song duration\n"
|
||||
"$title - song title"
|
||||
msgstr ""
|
||||
"$album - альбом\n"
|
||||
"$artist - исполнитель\n"
|
||||
"$progress - прогресс\n"
|
||||
"$time - продолжительность\n"
|
||||
"$title - название"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:913
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_custom)
|
||||
#: rc.cpp:122
|
||||
msgid "Custom"
|
||||
msgstr "Своя команда"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:923
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_custom)
|
||||
#: rc.cpp:125
|
||||
msgid "$custom - get output from custom command"
|
||||
msgstr "$custom - получить информацию из своей команды"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:977
|
||||
#. i18n: ectx: attribute (title), widget (QWidget, advanced)
|
||||
#: rc.cpp:128
|
||||
msgid "Advanced"
|
||||
msgstr "Расширенные"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:991
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_timeFormat)
|
||||
#: rc.cpp:131
|
||||
msgid "Custom time format"
|
||||
msgstr "Свой формат времени"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1013
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_timeFormat)
|
||||
#: rc.cpp:134
|
||||
msgid ""
|
||||
"$dddd - long weekday\n"
|
||||
"$ddd - short weekday\n"
|
||||
"$dd - day\n"
|
||||
"$d - day w\\o zero\n"
|
||||
"$MMMM - long month\n"
|
||||
"$MMM - short month\n"
|
||||
"$MM - month\n"
|
||||
"$M - month w\\o zero\n"
|
||||
"$yyyy - year\n"
|
||||
"$yy - short year\n"
|
||||
"$hh - hours (24 only)\n"
|
||||
"$h - hours w\\o zero (24 only)\n"
|
||||
"$mm - minutes\n"
|
||||
"$m - minutes w\\o zero\n"
|
||||
"$ss - seconds\n"
|
||||
"$s - seconds w\\o zero"
|
||||
msgstr ""
|
||||
"$dddd - день недели (длинный)\n"
|
||||
"$ddd - день недели (короткий)\n"
|
||||
"$dd - день\n"
|
||||
"$d - день без 0\n"
|
||||
"$MMMM - месяц (длинный)\n"
|
||||
"$MMM - месяц (короткий)\n"
|
||||
"$MM - месяц\n"
|
||||
"$M - месяц без 0\n"
|
||||
"$yyyy - год\n"
|
||||
"$yy - год (короткий)\n"
|
||||
"$hh - часы (24)\n"
|
||||
"$h - часы без 0 (24)\n"
|
||||
"$mm - минуты\n"
|
||||
"$m - минуты без 0\n"
|
||||
"$ss - секунды\n"
|
||||
"$s - секунды без 0"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1033
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_uptimeFormat)
|
||||
#: rc.cpp:152
|
||||
msgid "Custom uptime format"
|
||||
msgstr "Свой формат аптайма"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1042
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_uptimeFormat)
|
||||
#: rc.cpp:155
|
||||
msgid ""
|
||||
"$ds - uptime days\n"
|
||||
"$hs - uptime hours\n"
|
||||
"$ms - uptime minutes"
|
||||
msgstr ""
|
||||
"$ds - дни работы\n"
|
||||
"$hs - часы\n"
|
||||
"$ms - минуты"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1064
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_tempDevice)
|
||||
#: rc.cpp:160
|
||||
msgid "Temperature devices"
|
||||
msgstr "Температурные устройства"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1090
|
||||
#. i18n: ectx: property (text), widget (QPushButton, pushButton_tempDevice)
|
||||
#. i18n: file: ui/configwindow.ui:1145
|
||||
#. i18n: ectx: property (text), widget (QPushButton, pushButton_mount)
|
||||
#. i18n: file: ui/configwindow.ui:1200
|
||||
#. i18n: ectx: property (text), widget (QPushButton, pushButton_hddDevice)
|
||||
#: rc.cpp:163 rc.cpp:173 rc.cpp:183
|
||||
msgid "Add"
|
||||
msgstr "Добавить"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1100
|
||||
#. i18n: ectx: property (toolTip), widget (QListWidget, listWidget_tempDevice)
|
||||
#. i18n: file: ui/configwindow.ui:1155
|
||||
#. i18n: ectx: property (toolTip), widget (QListWidget, listWidget_mount)
|
||||
#. i18n: file: ui/configwindow.ui:1210
|
||||
#. i18n: ectx: property (toolTip), widget (QListWidget, listWidget_hddDevice)
|
||||
#: rc.cpp:166 rc.cpp:176 rc.cpp:186
|
||||
msgid ""
|
||||
"Editable\n"
|
||||
"del - remove item"
|
||||
msgstr ""
|
||||
"Редактируемо\n"
|
||||
"del - удалить строку"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1119
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_mount)
|
||||
#: rc.cpp:170
|
||||
msgid "Mount points"
|
||||
msgstr "Точки монтирования"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1174
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_hddDevice)
|
||||
#: rc.cpp:180
|
||||
msgid "HDD devices"
|
||||
msgstr "HDD"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1227
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_netdir)
|
||||
#: rc.cpp:190
|
||||
msgid "Network directory"
|
||||
msgstr "Путь к интерфейсам"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1234
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_netdir)
|
||||
#: rc.cpp:193
|
||||
msgid "\"/sys/class/net\" by default"
|
||||
msgstr "\"/sys/class/net\" по умолчанию"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1254
|
||||
#. i18n: ectx: property (toolTip), widget (QCheckBox, checkBox_netdev)
|
||||
#: rc.cpp:196
|
||||
msgid "Disable auto select device and set specified device"
|
||||
msgstr "Отключить авто выбор устройства и использовать указанное"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1257
|
||||
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_netdev)
|
||||
#: rc.cpp:199
|
||||
msgid "Set network device"
|
||||
msgstr "Выберете сетевое устройство"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1290
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_batdev)
|
||||
#: rc.cpp:202
|
||||
msgid "Battery device"
|
||||
msgstr "Устройство батареи"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1297
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_batdev)
|
||||
#: rc.cpp:205
|
||||
msgid "\"/sys/class/power_supply/BAT0/capacity\" by default"
|
||||
msgstr "\"/sys/class/power_supply/BAT0/capacity\" по умолчанию"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1314
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_acdev)
|
||||
#: rc.cpp:208
|
||||
msgid "AC device"
|
||||
msgstr "Устройство AC"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1321
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_acdev)
|
||||
#: rc.cpp:211
|
||||
msgid "\"/sys/class/power_supply/AC/online\" by default"
|
||||
msgstr "\"/sys/class/power_supply/AC/online\" по умолчанию"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1358
|
||||
#. i18n: ectx: property (text), item, widget (QComboBox, comboBox_playerSelect)
|
||||
#: rc.cpp:217
|
||||
msgid "amarok"
|
||||
msgstr "amarok"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1363
|
||||
#. i18n: ectx: property (text), item, widget (QComboBox, comboBox_playerSelect)
|
||||
#: rc.cpp:220
|
||||
msgid "mpd"
|
||||
msgstr "mpd"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1368
|
||||
#. i18n: ectx: property (text), item, widget (QComboBox, comboBox_playerSelect)
|
||||
#: rc.cpp:223
|
||||
msgid "qmmp"
|
||||
msgstr "qmmp"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1386
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_customCommand)
|
||||
#: rc.cpp:226
|
||||
msgid "Custom command"
|
||||
msgstr "Своя команда"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1394
|
||||
#. i18n: ectx: property (toolTip), widget (QLineEdit, lineEdit_customCommand)
|
||||
#: rc.cpp:229
|
||||
msgid ""
|
||||
"Command to run, example:\n"
|
||||
"wget -qO- http://ifconfig.me/ip - get external IP"
|
||||
msgstr ""
|
||||
"Команда для запуска, например:\n"
|
||||
"wget -qO- http://ifconfig.me/ip - получить внешний IP"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1417
|
||||
#. i18n: ectx: attribute (title), widget (QWidget, tab)
|
||||
#: rc.cpp:233
|
||||
msgid "Tooltip"
|
||||
msgstr "Тултип"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1423
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_tooltip)
|
||||
#: rc.cpp:236
|
||||
msgid ""
|
||||
"CPU, CPU clock, memory, swap and network labels support graphical tooltip. "
|
||||
"To enable them just make needed checkbox fully checked."
|
||||
msgstr ""
|
||||
"Поля CPU, частота CPU, память, swap, сеть поддерживают графический тултип. "
|
||||
"Чтобы включить его, просто сделайте требуемые чекбоксы полностью чекнутыми."
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1444
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_tooltipNum)
|
||||
#: rc.cpp:239
|
||||
msgid "Number of values for tooltips"
|
||||
msgstr "Число хранящихся значений"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1499
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_cpuColor)
|
||||
#: rc.cpp:242
|
||||
msgid "CPU color"
|
||||
msgstr "Цвет CPU"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1539
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_cpuclockColor)
|
||||
#: rc.cpp:245
|
||||
msgid "CPU clock color"
|
||||
msgstr "Цвет частоты CPU"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1579
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_memColor)
|
||||
#: rc.cpp:248
|
||||
msgid "Memory color"
|
||||
msgstr "Цвет памяти"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1619
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_swapColor)
|
||||
#: rc.cpp:251
|
||||
msgid "Swap color"
|
||||
msgstr "Цвет swap"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1659
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_downColor)
|
||||
#: rc.cpp:254
|
||||
msgid "Download speed color"
|
||||
msgstr "Цвет скорости загрузки"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1699
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_upColor)
|
||||
#: rc.cpp:257
|
||||
msgid "Upload speed color"
|
||||
msgstr "Цвет скорости отдачи"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1745
|
||||
#. i18n: ectx: attribute (title), widget (QWidget, appearance)
|
||||
#: rc.cpp:260
|
||||
msgid "Appearance"
|
||||
msgstr "Внешний вид"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1759
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_interval)
|
||||
#: rc.cpp:263
|
||||
msgid "Time interval"
|
||||
msgstr "Интервал обновления"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1814
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_font)
|
||||
#: rc.cpp:266
|
||||
msgid "Font"
|
||||
msgstr "Шрифт"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1854
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_fontSize)
|
||||
#: rc.cpp:269
|
||||
msgid "Font size"
|
||||
msgstr "Размер шрифта"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1909
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_color)
|
||||
#: rc.cpp:272
|
||||
msgid "Font color"
|
||||
msgstr "Цвет шрифта"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1949
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_style)
|
||||
#: rc.cpp:275
|
||||
msgid "Font style"
|
||||
msgstr "Стиль шрифта"
|
||||
|
||||
#. i18n: file: ui/configwindow.ui:1999
|
||||
#. i18n: ectx: property (text), widget (QLabel, label_weight)
|
||||
#: rc.cpp:278
|
||||
msgid "Font weight"
|
||||
msgstr "Ширина шрифта"
|
||||
|
||||
#: rc.cpp:279
|
||||
msgctxt "NAME OF TRANSLATORS"
|
||||
msgid "Your names"
|
||||
msgstr "Evgeniy Alekseev"
|
||||
|
||||
#: rc.cpp:280
|
||||
msgctxt "EMAIL OF TRANSLATORS"
|
||||
msgid "Your emails"
|
||||
msgstr "esalexeev@gmail.com"
|
||||
|
||||
#~ msgid "@@/;@@ - mount point usage, %"
|
||||
#~ msgstr "@@/;@@ - использование точки монтирования, %"
|
||||
|
||||
#~ msgid "@@/dev/sda@@ - physical temperature on /dev/sda"
|
||||
#~ msgstr "@@/dev/sda@@ - физическая температура /dev/sda"
|
||||
|
||||
#~ msgid ""
|
||||
#~ "$net - network speed, down/up, KB/s\n"
|
||||
#~ "$netdev - current network device\n"
|
||||
#~ "@@eth0@@ - disable auto select device and set specified device"
|
||||
#~ msgstr ""
|
||||
#~ "$net - скорость передачи данных, down/up, KB/s\n"
|
||||
#~ "$netdev - используемое устройство\n"
|
||||
#~ "@@eth0@@ - отключить автовыбор устройства и установить указанное"
|