https://wiki.archlinux.org/api.php?action=feedcontributions&user=Sn6uv&feedformat=atomArchWiki - User contributions [en]2024-03-29T13:21:25ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Mathics&diff=348120Mathics2014-12-04T10:39:47Z<p>Sn6uv: mathics 0.7 automatically handles database creation</p>
<hr />
<div>[[Category:Mathematics and science]]<br />
{{Related articles start}}<br />
{{Related|Matlab}}<br />
{{Related|Octave}}<br />
{{Related|Mathematica}}<br />
{{Related articles end}}<br />
<br />
[http://www.mathics.org Mathics] is a free CAS (Computer Algebra System) for symbolic mathematical computations that uses [[Python]] as its main language. It aims at achieving a Mathematica-compatible syntax and functions. It relies mostly on Sympy for most mathematical tasks and, optionally, Sage for more advanced stuff.<br />
<br />
== Installation ==<br />
Mathics can be installed with the package {{AUR|mathics}}, available in [[AUR]].<br />
<br />
== Using Mathics ==<br />
Mathics can be used through a CLI or a web interface<br />
=== Mathics CLI ===<br />
Just execute from a command line:<br />
$ mathics<br />
=== Mathics web interface === <br />
Execute from the command line:<br />
$ mathicsserver<br />
and then open localhost:8000 with your web browser.</div>Sn6uvhttps://wiki.archlinux.org/index.php?title=Conky&diff=181999Conky2012-02-04T12:14:06Z<p>Sn6uv: Python script is now compatible with python2 and python3. Removed redundant if clause. Wget line appears broken - curl seems better. Should use of wget be replaced by curl?</p>
<hr />
<div>[[Category:Status monitoring and notification (English)]]<br />
[[Category:Eye candy (English)]]<br />
{{i18n|Conky}}<br />
[[fr:Conky]]<br />
<br />
Conky is a system monitor software for the X Window System. It is available for GNU/Linux and FreeBSD. It is free software released under the terms of the GPL license. Conky is able to monitor many system variables including CPU, memory, swap, disk space, temperature, top, upload, download, system messages, and much more. It is extremely configurable, however, the configuration can be a little hard to understand. Conky is a fork of torsmo.<br />
<br />
==Installation and configuration==<br />
*[[pacman|Install]] the {{Pkg|conky}} package which is available in the [[Official Repositories|official repositories]].<br />
*Edit the {{ic|~/.conkyrc}} config file using an example configuration file from [http://conky.sourceforge.net/screenshots.html homeproject-screenshot]<br />
*Alternatively, you can use the default config at {{ic|/etc/conky/conky.conf}}:<br />
$ cp /etc/conky/conky.conf ~/.conkyrc<br />
<br />
==AUR packages==<br />
<br />
In addition to the basic {{Pkg|conky}} package in the [[Official Repositories|official repositories]], there are various [[Arch User Repository|AUR]] packages available with extra compile options enabled.<br />
<br />
*Install {{AUR|conky-cli}} for conky without X11 dependencies<br />
*Install {{AUR|conky-nvidia}} for nvidia support.<br />
*Install {{AUR|conky-lua}} for lua support.<br />
*Install {{AUR|conky-lua-nv}} for both lua and nvidia support.<br />
<br />
==Tips and tricks==<br />
===Enable real transparency (KDE4)===<br />
Since version 1.8.0, Conky suppports real transparency. To enable it (and make it work nicely with KDE4), add these lines to {{ic|~/.conkyrc}}:<br />
own_window yes<br />
own_window_transparent yes<br />
own_window_argb_visual yes<br />
own_window_type normal<br />
own_window_class conky-semi<br />
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager<br />
This replaces the {{Pkg|feh}} method described below.<br />
<br />
===Autostart with xfce4===<br />
In {{ic|.conkyrc}} file:<br />
own_window_type override<br />
<br />
<br />
Add a {{ic|~/.config/autostart/conky.desktop}}:<br />
[Desktop Entry]<br />
Encoding=UTF-8<br />
Version=0.9.4<br />
Type=Application<br />
Name=conky<br />
Comment=<br />
Exec=conky -d<br />
StartupNotify=false<br />
Terminal=false<br />
Hidden=false<br />
<br />
===Prevent flickering===<br />
Conky needs Double Buffer Extension (DBE) support from the X server to prevent flickering because it cannot update the window fast enough without it. It can be enabled in {{ic|/etc/X11/xorg.conf}} with {{ic|Load "dbe"}} line in {{ic|Section "Module"}}. The xorg.conf file has been replaced (1.8.x patch upwards) by {{ic|/etc/X11/xorg.conf.d}} which contains the particular configuration files. ''DBE'' is loaded automatically.<br />
<br />
To verify: <br />
# grep dbe /var/log/Xorg.0.log<br />
<br />
Output (should be similar):<br />
# [ 86.101] (II) LoadModule: "dbe"<br />
# [ 86.101] (II) Loading /usr/lib/xorg/modules/extensions/libdbe.so<br />
# [ 86.111] (II) Module dbe: vendor="X.Org Foundation"<br />
<br />
To enable double-buffer check to have in {{ic|~/.conkyrc}}:<br />
# Place below the other options, not below TEXT or XY<br />
double_buffer yes<br />
<br />
===Do not minimize on Show Desktop (Compiz)===<br />
If the 'Show Desktop' button or key-binding minimizes Conky along with all other windows, start the Compiz configuration settings manager, go to "General Options" and uncheck the "Hide Skip Taskbar Windows" option.<br />
<br />
===Integrate with KDesktop===<br />
Conky with screenshot configuration generate problems with icons visualization. So there are some steps to follow.<br />
*Add these lines to {{ic|~/.conkyrc}}:<br />
own_window yes<br />
own_window_type normal<br />
own_window_transparent yes<br />
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager<br />
*If this setting is on, comment it out or delete the line:<br />
minimum_size<br />
*To automatically start Conky, create this symlink:<br />
$ ln -s /usr/bin/conky ~/.kde/share/autostart/conkylink<br />
For KDE4 users:<br />
$ ln -s /usr/bin/conky ~/.kde4/Autostart/conkylink<br />
*[[pacman|Install]] the {{Pkg|feh}} package which is available in the [[Official Repositories|official repositories]].<br />
*Make a script to allow transparency with the desktop<br />
For KDE3 users<br />
$ nano -w ~/.kde/share/autostart/fehconky <br />
<br />
#!/bin/bash<br />
feh --bg-scale `dcop kdesktop KBackgroundIface currentWallpaper 1`<br />
For KDE4 users<br />
$ nano -w ~/.kde4/Autostart/fehconky<br />
<br />
#!/bin/bash<br />
feh --bg-scale "`grep 'wallpaper=' ~/.kde4/share/config/plasma-desktop-appletsrc | tail --lines=1 | sed 's/wallpaper=//'`"<br />
use {{ic|--bg-center}} if you use a centered wallpaper.<br />
*Make it executable<br />
$ chmod +x ~/.kde/share/autostart/fehconky<br />
KDE4<br />
$ chmod +x ~/.kde4/Autostart/fehconky<br />
*Instead of using a script, you can add the corresponding line to the bottom of {{ic|~/.conkyrc}}<br />
For KDE3<br />
${exec feh --bg-scale `dcop kdesktop KBackgroundIface currentWallpaper 1`}<br />
For KDE4<br />
${exec feh --bg-scale "`grep 'wallpaper=' ~/.kde4/share/config/plasma-desktop-appletsrc | tail --lines=1 | sed 's/wallpaper=//'`"}<br />
<br />
===Display package update information===<br />
*[https://bbs.archlinux.org/viewtopic.php?id=68104 Paconky] - Displays package update information in a user-defined format. The output of this program can be included in Conky with the {{ic|<nowiki>${execpi}</nowiki>}} command.<br />
*[https://bbs.archlinux.org/viewtopic.php?id=53761 Scrolling Notifications] - Prints scrolling update notifications. From the author of Paconky.<br />
*[https://bbs.archlinux.org/viewtopic.php?id=57291 Perl Script] - Simpler and earlier script from the author of Paconky. Prints only the number of packages needing an update.<br />
*[https://bbs.archlinux.org/viewtopic.php?id=37284 Python Script] - Fairly configurable update notification program in [[Python]].<br />
*[https://bbs.archlinux.org/viewtopic.php?pid=483742#p483742 Bash Script] - [[Bash]] script for users that have enabled ShowSize.<br />
<br />
===Display weather forecast===<br />
See [https://bbs.archlinux.org/viewtopic.php?id=37381 this thread].<br />
<br />
===Display RSS feeds===<br />
Conky has the ability to display RSS feeds natively without the need for an outside script to run and output into Conky. For example, to display the titles of the ten most recent Planet Arch updates and refresh the feed every minute, you would put this into your {{ic|~/.conkyrc}}:<br />
<br />
${rss http://planet.archlinux.org/rss20.xml 1 item_titles 10 }<br />
<br />
===Display Distrowatch Arch Linux ranking===<br />
See [https://bbs.archlinux.org/viewtopic.php?id=88779 this thread].<br />
<br />
===Display rTorrent stats===<br />
See [https://bbs.archlinux.org/viewtopic.php?id=67304 this thread].<br />
<br />
===Display number of new emails (Gmail)===<br />
Create a file named {{ic|gmail.py}} in a convenient location (this example uses {{ic|~/.scripts/}}) with the following [[Python]] code:<br />
import os<br />
<br />
#Enter your username and password below within double quotes<br />
# eg. username="username" and password="password"<br />
username="****"<br />
password="****"<br />
com="wget -q -O - https://"+username+":"+password+"@mail.google.com/mail/feed/atom --no-check-certificate"<br />
temp=os.popen(com)<br />
msg=temp.read()<br />
index=msg.find("<fullcount>")<br />
index2=msg.find("</fullcount>")<br />
fc=int(msg[index+11:index2])<br />
print(str(fc)+" new")<br />
<br />
Some users report problems with wget. If this script returns a ValueError, try replacing the wget line with<br />
[[Python]] code:<br />
com='curl -s -u "{}:{}" https://mail.google.com/mail/feed/atom'.format(username, password)<br />
as suggested [https://bbs.archlinux.org/viewtopic.php?id=130608 here]. A similar change can be made if using a Google App mail account (below).<br />
<br />
Add the following string to your {{ic|~/.conkyrc}} in order the check your Gmail account for new email every five minutes (300 seconds) and display:<br />
${execpi 300 python ~/.scripts/gmail.py}<br />
<br />
====Other Methods====<br />
The same way, but with using {{ic|grep}} and {{ic|sed}} for filtering output of {{ic|wget}}:<br />
<br />
$ wget -q -O - https://mail.google.com/a/'''domain'''/feed/atom \<br />
> --http-user='''login'''@'''domain''' \<br />
> --http-password='''password''' \ <br />
> --no-check-certificate | \<br />
> grep fullcount | sed 's/<[^0-9]*>//g'<br />
<br />
instead of words '''login, domain, password''' you must type yours data.<br />
<br />
Alternatively, you can use [http://www.stunnel.org/ stunnel] which is provided by the {{Pkg|stunnel}} package.<br />
<br />
The following configuration is taken from [http://conky.sourceforge.net/faq.html Conky's FAQ]<br />
<br />
Modify {{ic|/etc/stunnel/stunnel.conf}} as follows, and then start the {{ic|stunnel}} [[Daemon|daemon]]:<br />
# Service-level configuration for TLS server<br />
[imap]<br />
client = yes<br />
accept = 143<br />
connect = imap.gmail.com:143<br />
protocol = imap<br />
sslVersion = TLSv1<br />
# Service-level configuration for SSL server<br />
[imaps]<br />
client = yes<br />
accept = 993<br />
connect = imap.gmail.com:993<br />
<br />
The only thing left is our {{ic|~/.conkyrc}}:<br />
imap localhost username * -i 120 -p 993<br />
TEXT<br />
Inbox: ${imap_unseen}/${imap_messages}<br />
<br />
Here I used * as the password for Conky to ask for it at start, but you do not ''have'' to do it.<br />
<br />
====Google Apps====<br />
The above Python script did not work for me and my Google Apps account. I modified the script below to work with a Google App mail account [[Python]] code:<br />
import os<br />
<br />
#Enter your domain, username and password below within double quotes<br />
# eg. domain="yourdomain.com", username="username" and password="password"<br />
domain="yourdomain.com"<br />
username="username"<br />
password="password"<br />
com="wget -q -O - https://mail.google.com/a/"+domain+"/feed/atom --http-user="+username+"@"+domain+" --http-password="+password+" --no-check-certificate"<br />
temp=os.popen(com)<br />
msg=temp.read()<br />
index=msg.find("<fullcount>")<br />
index2=msg.find("</fullcount>")<br />
fc=int(msg[index+11:index2])<br />
print(str(fc)+" new")<br />
<br />
===Display new emails (IMAP + SSL)===<br />
Conky has built in support for IMAP accounts but does not support SSL. This can be provided using this script from [http://www.unix.com/shell-programming-scripting/115322-perl-conky-gmail-imap-unread-message-count.html this forum post]. This requires the Perl/CPAN Modules Mail::IMAPClient and IO::Socket::SSL which are in the {{AUR|perl-mail-imapclient}} and {{Pkg|perl-io-socket-ssl}} packages<br />
<br />
Create a file named {{ic|imap.pl}} in a location to be read by Conky. In this file, add (with the appropriate changes):<br />
#!/usr/bin/perl<br />
<br />
# gimap.pl by gxmsgx<br />
# description: get the count of unread messages on imap<br />
<br />
use strict;<br />
use Mail::IMAPClient;<br />
use IO::Socket::SSL;<br />
<br />
my $username = 'example.username'; <br />
my $password = 'password123'; <br />
<br />
my $socket = IO::Socket::SSL->new(<br />
PeerAddr => 'imap.server',<br />
PeerPort => 993<br />
)<br />
or die "socket(): $@";<br />
<br />
my $client = Mail::IMAPClient->new(<br />
Socket => $socket,<br />
User => $username,<br />
Password => $password,<br />
)<br />
or die "new(): $@";<br />
<br />
if ($client->IsAuthenticated()) {<br />
my $msgct;<br />
<br />
$client->select("INBOX");<br />
$msgct = $client->unseen_count||'0';<br />
print "$msgct\n";<br />
}<br />
<br />
$client->logout();<br />
<br />
Add to {{ic|~/.conkyrc}}:<br />
${execpi 300 ~/.conky/imap.pl} <br />
or wherever you saved the file.<br />
<br />
Alternatively, you can use stunnel as shown above: [[Conky#How to display the number of new emails (Gmail) in Conky]]<br />
<br />
== User-contributed configuration examples ==<br />
=== Graysky ===<br />
[[http://img9.imageshack.us/img9/3153/imageffj.jpg Screen shot]]<br />
<br />
[[https://github.com/graysky2/configs/raw/master/dotfiles/.conkyrc Here]] it is - modify to fit your system. Optimized for a quad core chip w/ several hdds (although one of them is not connected for this screenshot) and an nvidia graphics card. You can easily modify this to a dual or single core system with one or whatever number of hdds.<br />
<br />
==A sample rings script with nvidia support:==<br />
<br />
{{bc|1=<br />
1 # -- Conky settings -- #<br />
2 background no<br />
3 update_interval 1<br />
4 <br />
5 cpu_avg_samples 2<br />
6 net_avg_samples 2<br />
7 <br />
8 override_utf8_locale yes<br />
9 <br />
10 double_buffer yes<br />
11 no_buffers yes<br />
12 <br />
13 text_buffer_size 2048<br />
14 imlib_cache_size 0<br />
15 <br />
16 # -- Window specifications -- #<br />
17 <br />
18 own_window yes<br />
19 own_window_type normal<br />
20 own_window_transparent yes<br />
21 own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below<br />
22 <br />
23 border_inner_margin 0<br />
24 border_outer_margin 0<br />
25 <br />
26 minimum_size 320 800<br />
27 maximum_width 320<br />
28 <br />
29 alignment bottom_right<br />
30 gap_x 0<br />
31 gap_y 0<br />
32 <br />
33 # -- Graphics settings -- #<br />
34 draw_shades no<br />
35 draw_outline no<br />
36 draw_borders no<br />
37 draw_graph_borders yes<br />
38 <br />
39 # -- Text settings -- #<br />
40 use_xft yes<br />
41 xftfont MaiandraGD:size=24<br />
42 xftalpha 0.4<br />
43 <br />
44 uppercase no<br />
45 <br />
46 default_color 888888<br />
47 <br />
48 # -- Lua Load -- #<br />
49 lua_load ~/conky/lua/lua.lua<br />
50 lua_draw_hook_pre ring_stats<br />
51 <br />
52 TEXT<br />
53 ${alignr}${voffset 53}${goto 90}${font MaiandraGD:size=11}${time %A, %d %B %Y}<br />
54 <br />
55 <br />
56 ${voffset 5}${goto 164}${font MaiandraGD:size=16}${time %H:%M}<br />
57 <br />
58 <br />
59 <br />
60 ${voffset -40}${goto 100}${font MaiandraGD:size=9}Kernel:${offset 70}Uptime:<br />
61 ${goto 90}${font MaiandraGD:size=9}$kernel${offset 40}$uptime<br />
62 ${voffset 57}${goto 117}${font snap:size=8}${cpu cpu0}%<br />
63 ${goto 117}${cpu cpu1}%<br />
64 ${goto 117}CPU<br />
65 ${voffset 19}${goto 145}${memperc}%<br />
66 ${goto 145}$swapperc%<br />
67 ${goto 145}MEM<br />
68 ${voffset 25}${goto 170}${nvidia gpufreq}<br />
69 ${goto 170}${nvidia memfreq}<br />
70 ${goto 170}GPU<br />
71 ${voffset 27}${goto 198}${totaldown ppp0}<br />
72 ${goto 198}${totalup ppp0}<br />
73 ${goto 205}NET<br />
74 ${voffset 21}<br />
75 ${goto 222}${fs_used /home}<br />
76 ${goto 230}DISK<br />
<br />
}}<br />
*And the required lua.lua script:<br />
<br />
{{bc|1=<br />
1 --[[<br />
2 Ring Meters by londonali1010 (2009)<br />
3 <br />
4 This script draws percentage meters as rings. It is fully customisable; all options are described in the script.<br />
5 <br />
6 IMPORTANT: if you are using the 'cpu' function, it will cause a segmentation fault if it tries to draw a ring straight away. The if s tatement on line 145 uses a delay to make sure that this does not happen. It calculates the length of the delay by the number of updat es since Conky started. Generally, a value of 5s is long enough, so if you update Conky every 1s, use update_num > 5 in that if state ment (the default). If you only update Conky every 2s, you should change it to update_num > 3; conversely if you update Conky every 0 .5s, you should use update_num > 10. ALSO, if you change your Conky, is it best to use "killall conky; conky" to update it, otherwise the update_num will not be reset and you will get an error.<br />
7 <br />
8 To call this script in Conky, use the following (assuming that you save this script to ~/scripts/rings.lua):<br />
9 lua_load ~/scripts/rings-v1.2.1.lua<br />
10 lua_draw_hook_pre ring_stats<br />
11 <br />
12 Changelog:<br />
13 + v1.2.1 -- Fixed minor bug that caused script to crash if conky_parse() returns a nil value (20.10.2009)<br />
14 + v1.2 -- Added option for the ending angle of the rings (07.10.2009)<br />
15 + v1.1 -- Added options for the starting angle of the rings, and added the "max" variable, to allow for variables that output a numer ical value rather than a percentage (29.09.2009)<br />
16 + v1.0 -- Original release (28.09.2009)<br />
17 ]]<br />
18 <br />
19 settings_table = {<br />
20 {<br />
21 -- Edit this table to customise your rings.<br />
22 -- You can create more rings simply by adding more elements to settings_table.<br />
23 -- "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.<br />
24 name='time',<br />
25 -- "arg" is the argument to the stat type, e.g. if in Conky you would write ${cpu cpu0}, 'cpu0' would be the argument . If you would not use an argument in the Conky variable, use ''.<br />
26 arg='%I.%M',<br />
27 -- "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.<br />
28 max=12,<br />
29 -- "bg_colour" is the colour of the base ring.<br />
30 bg_colour=0x888888,<br />
31 -- "bg_alpha" is the alpha value of the base ring.<br />
32 bg_alpha=0.3,<br />
33 -- "fg_colour" is the colour of the indicator part of the ring.<br />
34 fg_colour=0x888888,<br />
35 -- "fg_alpha" is the alpha value of the indicator part of the ring.<br />
36 fg_alpha=0.5,<br />
37 -- "x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky wi ndow.<br />
38 x=191, y=145,<br />
39 -- "radius" is the radius of the ring.<br />
40 radius=32,<br />
41 -- "thickness" is the thickness of the ring, centred around the radius.<br />
42 thickness=4,<br />
43 -- "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or n egative.<br />
44 start_angle=0,<br />
45 -- "end_angle" is the ending angle of the ring, in degrees, clockwise from top. Value can be either positive or negat ive, but must be larger (e.g. more clockwise) than start_angle.<br />
46 end_angle=360<br />
47 },<br />
48 {<br />
49 name='time',<br />
50 arg='%M.%S',<br />
51 max=60,<br />
52 bg_colour=0x888888,<br />
53 bg_alpha=0.3,<br />
54 fg_colour=0x888888,<br />
55 fg_alpha=0.5,<br />
56 x=191, y=145,<br />
57 radius=37,<br />
58 thickness=4,<br />
59 start_angle=0,<br />
60 end_angle=360<br />
61 },<br />
62 {<br />
63 name='time',<br />
64 arg='%S',<br />
65 max=60,<br />
66 bg_colour=0x888888,<br />
67 bg_alpha=0.3,<br />
68 fg_colour=0x888888,<br />
69 fg_alpha=0.5,<br />
70 x=191, y=145,<br />
71 radius=42,<br />
72 thickness=4,<br />
73 start_angle=0,<br />
74 end_angle=360<br />
75 },<br />
76 {<br />
77 name='cpu',<br />
78 arg='cpu0',<br />
79 max=100,<br />
80 bg_colour=0x888888,<br />
81 bg_alpha=0.3,<br />
82 fg_colour=0x888888,<br />
83 fg_alpha=0.5,<br />
84 x=140, y=300,<br />
85 radius=26,<br />
86 thickness=5,<br />
87 start_angle=-90,<br />
88 end_angle=180<br />
89 },<br />
90 {<br />
91 name='cpu',<br />
92 arg='cpu1',<br />
93 max=100,<br />
94 bg_colour=0x888888,<br />
95 bg_alpha=0.3,<br />
96 fg_colour=0x888888,<br />
97 fg_alpha=0.5,<br />
98 x=140, y=300,<br />
99 radius=20,<br />
100 thickness=5,<br />
101 start_angle=-90,<br />
102 end_angle=180<br />
103 },<br />
104 {<br />
105 name='memperc',<br />
106 arg='',<br />
107 max=100,<br />
108 bg_colour=0x888888,<br />
109 bg_alpha=0.3,<br />
110 fg_colour=0x888888,<br />
111 fg_alpha=0.5,<br />
112 x=170, y=350,<br />
113 radius=26,<br />
114 thickness=5,<br />
115 start_angle=-90,<br />
116 end_angle=180<br />
117 },<br />
118 {<br />
119 name='swapperc',<br />
120 arg='',<br />
121 max=100,<br />
122 bg_colour=0x888888,<br />
123 bg_alpha=0.3,<br />
124 fg_colour=0x888888,<br />
125 fg_alpha=0.5,<br />
126 x=170, y=350,<br />
127 radius=20,<br />
128 thickness=5,<br />
129 start_angle=-90,<br />
130 end_angle=180<br />
131 },<br />
132 {<br />
133 name='time',<br />
134 arg='%d',<br />
135 max=31,<br />
136 bg_colour=0x888888,<br />
137 bg_alpha=0.3,<br />
138 fg_colour=0x888888,<br />
139 fg_alpha=0.5,<br />
140 x=191, y=145,<br />
141 radius=50,<br />
142 thickness=5,<br />
143 start_angle=-140,<br />
144 end_angle=-30<br />
145 },<br />
146 {<br />
147 name='time',<br />
148 arg='%m',<br />
149 max=12,<br />
150 bg_colour=0x888888,<br />
151 bg_alpha=0.3,<br />
152 fg_colour=0x888888,<br />
153 fg_alpha=0.5,<br />
154 x=191, y=145,<br />
155 radius=50,<br />
156 thickness=5,<br />
157 start_angle=30,<br />
158 end_angle=140<br />
159 },<br />
160 -- {<br />
161 -- name='fs_used_perc',<br />
162 -- arg='/',<br />
163 -- max=100,<br />
164 -- bg_colour=0x888888,<br />
165 -- bg_alpha=0.3,<br />
166 -- fg_colour=0x888888,<br />
167 -- fg_alpha=0.5,<br />
168 -- x=260, y=503,<br />
169 -- radius=26,<br />
170 -- thickness=5,<br />
171 -- start_angle=-90,<br />
172 -- end_angle=180<br />
173 -- },<br />
174 {<br />
175 name='fs_used_perc',<br />
176 arg='/home',<br />
177 max=100,<br />
178 bg_colour=0x888888,<br />
179 bg_alpha=0.3,<br />
180 fg_colour=0x888888,<br />
181 fg_alpha=0.5,<br />
182 x=260, y=503,<br />
183 radius=20,<br />
184 thickness=5,<br />
185 start_angle=-90,<br />
186 end_angle=180<br />
187 },<br />
188 {<br />
189 name='totalup',<br />
190 arg='ppp0',<br />
191 max=2,<br />
192 bg_colour=0x888888,<br />
193 bg_alpha=0.3,<br />
194 fg_colour=0x888888,<br />
195 fg_alpha=0.5,<br />
196 x=230, y=452,<br />
197 radius=20,<br />
198 thickness=5,<br />
199 start_angle=-90,<br />
200 end_angle=180<br />
201 },<br />
202 {<br />
203 name='totaldown',<br />
204 arg='ppp0',<br />
205 max=2,<br />
206 bg_colour=0x888888,<br />
207 bg_alpha=0.3,<br />
208 fg_colour=0x888888,<br />
209 fg_alpha=0.5,<br />
210 x=230, y=452,<br />
211 radius=26,<br />
212 thickness=5,<br />
213 start_angle=-90,<br />
214 end_angle=180<br />
215 },<br />
216 {<br />
217 name='nvidia',<br />
218 arg='gpufreq',<br />
219 max=475,<br />
220 bg_colour=0x888888,<br />
221 bg_alpha=0.3,<br />
222 fg_colour=0x888888,<br />
223 fg_alpha=0.5,<br />
224 x=200, y=401,<br />
225 radius=26,<br />
226 thickness=5,<br />
227 start_angle=-90,<br />
228 end_angle=180<br />
229 },<br />
230 {<br />
231 name='nvidia',<br />
232 arg='memfreq',<br />
233 max=700,<br />
234 bg_colour=0x888888,<br />
235 bg_alpha=0.3,<br />
236 fg_colour=0x888888,<br />
237 fg_alpha=0.5,<br />
238 x=200, y=401,<br />
239 radius=20,<br />
240 thickness=5,<br />
241 start_angle=-90,<br />
242 end_angle=180<br />
243 },<br />
244 }<br />
245 <br />
246 require 'cairo'<br />
247 <br />
248 function rgb_to_r_g_b(colour,alpha)<br />
249 return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha<br />
250 end<br />
251 <br />
252 function draw_ring(cr,t,pt)<br />
253 local w,h=conky_window.width,conky_window.height<br />
254 <br />
255 local xc,yc,ring_r,ring_w,sa,ea=pt['x'],pt['y'],pt['radius'],pt['thickness'],pt['start_angle'],pt['end_angle']<br />
256 local bgc, bga, fgc, fga=pt['bg_colour'], pt['bg_alpha'], pt['fg_colour'], pt['fg_alpha']<br />
257 <br />
258 local angle_0=sa*(2*math.pi/360)-math.pi/2<br />
259 local angle_f=ea*(2*math.pi/360)-math.pi/2<br />
260 local t_arc=t*(angle_f-angle_0)<br />
261 <br />
262 -- Draw background ring<br />
263 <br />
264 cairo_arc(cr,xc,yc,ring_r,angle_0,angle_f)<br />
265 cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))<br />
266 cairo_set_line_width(cr,ring_w)<br />
267 cairo_stroke(cr)<br />
268 <br />
269 -- Draw indicator ring<br />
270 <br />
271 cairo_arc(cr,xc,yc,ring_r,angle_0,angle_0+t_arc)<br />
272 cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))<br />
273 cairo_stroke(cr)<br />
274 end<br />
275 <br />
276 function conky_ring_stats()<br />
277 local function setup_rings(cr,pt)<br />
278 local str=''<br />
279 local value=0<br />
280 <br />
281 str=string.format('${%s %s}',pt['name'],pt['arg'])<br />
282 str=conky_parse(str)<br />
283 <br />
284 value=tonumber(str)<br />
285 if value == nil then value = 0 end<br />
286 pct=value/pt['max']<br />
287 <br />
288 draw_ring(cr,pct,p<nowiki><nowiki>Insert non-formatted text here</nowiki>'''Bold text'''</nowiki>t)<br />
289 end<br />
290 <br />
291 if conky_window==nil then return end<br />
292 local cs=cairo_xlib_surface_create(conky_window.display,conky_window.drawable,conky_window.visual, conky_window.width,conky_w indow.height)<br />
293 <br />
294 local cr=cairo_create(cs)<br />
295 <br />
296 local updates=conky_parse('${updates}')<br />
297 update_num=tonumber(updates)<br />
298 <br />
299 if update_num>5 then<br />
300 for i in pairs(settings_table) do<br />
301 setup_rings(cr,settings_table[i])<br />
302 end<br />
303 end<br />
304 end<br />
~ <br />
}}<br />
== A note about symbolic fonts ==<br />
<br />
Many of the more decorated .conkyrc's use the fonts PizzaDude Bullets and Pie Charts for Maps. They are available from the AUR as 'ttf-pizzadude-bullets' and 'ttf-piechartsformaps' respectively, or they can be found and downloaded with a quick search and manually installed using the instructions in [[Fonts]].<br />
<br />
== Universal method to enable true transparency ==<br />
<br />
Transparency is a strange beast in Conky, but there is a way to universally apply true transparency with any environment or window manager by using xcompmgr and transset-df. Install xcompmgr from [extra] and transset-df from [community] with {{ic|pacman -Sy xcompmgr transset-df}}. These packages both have the same 3 dependencies, so this is the lightest method for composition available, for those of you using standalone window managers in order to achieve the leanest setup you can manage (or whatever reason you have :D)<br />
<br />
NOTE: This may conflict with any other compositing manager you are already using.<br />
<br />
Check xcompmgr documentation to help you decide which compositing options you would like to enable. The following is a common standard command.<br />
<br />
{{bc|<br />
xcompmgr -c -t-5 -l-5 -r4.2 -o.55 &<br />
}}<br />
<br />
Make sure conky is running with {{ic|conky &}}. Use transset-df to enable transparency on the Conky window. Set '.5' to any value in the range 0 - 1.<br />
<br />
{{bc|<br />
transset-df .5 -n Conky<br />
}}<br />
<br />
This should give your conky window true transparency. If you get an error like, <br />
{{hc|$ transset-df .5 -n Conky|No Window matching Conky exists!}}<br />
Verify that conky is running, and use xprop and click on the conky window to find the name you should pass to {{ic|transset-df}}. <br />
{{hc|$ xprop &#124; grep WM_NAME|2=WM_NAME(STRING) = "Conky (ArchitectLinux)"}}<br />
<br />
In this case, "Conky" is right, but for you it may be different, so be sure to use your output instead. If ~/.conkyrc has {{ic|own_window_type panel}} then this xprop invocation may show now output. Try using any of the following options instead. {{ic|<nowiki>own_window_type {dock,normal,override,desktop}</nowiki>}}<br />
<br />
Use this in ~/.xinitrc to have transparent conky run when you {{ic|startx}}.<br />
<br />
{{bc|<br />
xcompmgr -c -t-5 -l-5 -r4.2 -o.55 &<br />
conky -d; sleep 1 && transset-df .5 -n Conky<br />
}}<br />
<br />
== External links ==<br />
*[http://bbs.archlinux.org/viewtopic.php?id=39906 Conky Configs on arch forums]<br />
*[http://conky.sourceforge.net/ Official website]<br />
*[http://freshmeat.net/projects/conky/ Conky] on [[wikipedia:Freshmeat|Freshmeat]]<br />
*[http://sourceforge.net/projects/conky/ Conky] on [[wikipedia:sourceforge.net|SourceForge]]<br />
*[irc://chat.freenode.org/conky #conky] IRC chat channel on [[wikipedia:Freenode|freenode]]<br />
*[http://novel.evilcoder.org/wiki/index.php?title=ConkyFAQ&oldid=12463 FAQ]</div>Sn6uv