1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-18 02:55:12 +00:00

Merge branch 'master' of ssh://git.omp.am/home/omp/git/conky

This commit is contained in:
Nikolas Garofil 2009-06-07 11:41:29 +02:00
commit bcbeb402c0
14 changed files with 4414 additions and 3621 deletions

View File

@ -8,6 +8,11 @@
# This script also updates the vim and nano syntax files so it doesn't have to
# be done manually.
#
# Requires the ElementTree Python module for the sorting stuff, see:
# http://effbot.org/zone/element-index.htm
#
# You should also install htmltidy, but it's not necessary.
#
import os.path
import re
@ -211,4 +216,33 @@ file.truncate(0)
file.seek(0)
file.writelines(lines)
file.close()
print 'sorting/tidying docs...'
# sort the docs by variable/config setting
import string
import xml.etree.ElementTree as ET
vars_xml = ET.parse(file_names['variables'])
config_xml = ET.parse(file_names['config_settings'])
getkey = lambda x: x.findtext('term/command/option')
vars = vars_xml.getroot()
vars[:] = sorted(vars, key=getkey)
configs = config_xml.getroot()
configs[:] = sorted(configs, key=getkey)
vars_xml.write(file_names['variables'])
config_xml.write(file_names['config_settings'])
def tidy(file):
command = ['tidy', '-qim', '-xml', '-utf8', '--indent-spaces', '4']
os.system('%s %s 2>/dev/null' % (string.join(command), file))
tidy(file_names['variables'])
tidy(file_names['config_settings'])
print "done."

View File

@ -13,10 +13,17 @@
<para></para></listitem>
</varlistentry>
<varlistentry>
<term><command><option>-D | --debug</option></command></term>
<listitem>
Increase debugging output, ie. -DD for more debugging
<para></para></listitem>
</varlistentry>
<varlistentry>
<term><command><option>-a | --alignment=</option></command><option>ALIGNMENT</option></term>
<listitem>
Text alignment on screen, {top,bottom,middle}_{left,right,middle} or none
Text alignment on screen, {top,bottom,middle}_{left,right,middle} or none. Can also be abbreviated with first chars of position, ie. tr for top_right.
<para></para></listitem>
</varlistentry>
@ -90,6 +97,13 @@
<para></para></listitem>
</varlistentry>
<varlistentry>
<term><command><option>-X | --display=</option></command><option>DISPLAY</option></term>
<listitem>
X11 display to use
<para></para></listitem>
</varlistentry>
<varlistentry>
<term><command><option>-x </option></command><option>X_COORDINATE</option></term>
<listitem>

File diff suppressed because it is too large Load Diff

View File

@ -16,7 +16,7 @@
<firstname>Brenden</firstname>
<surname>Matthews</surname>
</author>
<date>2009-05-16</date>
<date>2009-06-06</date>
</refentryinfo>
<refmeta>
@ -79,7 +79,6 @@
</para>
<para>
Gentoo users -- Conky is in Gentoo's Portage... simply use "emerge app-admin/conky" for installation.
There is also usually an up-to-date ebuild within Conky's package or in the git repo.
</para>
<para>
Debian, etc. users -- Conky should be in your repositories, and can be installed by doing

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -12,7 +12,7 @@ endif
syn region ConkyrcComment start=/^\s*#/ end=/$/
syn keyword ConkyrcSetting alias alignment append_file background border_margin border_width color0 color1 color2 color3 color4 color5 color6 color7 color8 color9 colorN cpu_avg_samples default_bar_size default_color default_gauge_size default_graph_size default_outline_color default_shade_color diskio_avg_samples display double_buffer draw_borders draw_graph_borders draw_outline draw_shades font gap_x gap_y if_up_strictness imap imlib_cache_size lua_load mail_spool max_port_monitor_connections max_specials max_user_text maximum_width minimum_size mpd_host mpd_password mpd_port music_player_interval net_avg_samples no_buffers out_to_console out_to_stderr out_to_x override_utf8_locale overwrite_file own_window own_window_class own_window_colour own_window_hints own_window_title own_window_transparent own_window_type pad_percents pop3 sensor_device short_units show_graph_range show_graph_scale stippled_borders temperature_unit template template0 template1 template2 template3 template4 template5 template6 template7 template8 template9 text text_buffer_size top_cpu_separate top_name_width total_run_times update_interval uppercase use_spacer use_xft xftalpha xftfont
syn keyword ConkyrcSetting alias alignment append_file background border_margin border_width color0 color1 color2 color3 color4 color5 color6 color7 color8 color9 colorN cpu_avg_samples default_bar_size default_color default_gauge_size default_graph_size default_outline_color default_shade_color diskio_avg_samples display double_buffer draw_borders draw_graph_borders draw_outline draw_shades font gap_x gap_y if_up_strictness imap imlib_cache_flush_interval imlib_cache_size lua_load mail_spool max_port_monitor_connections max_specials max_user_text maximum_width minimum_size mpd_host mpd_password mpd_port music_player_interval net_avg_samples no_buffers out_to_console out_to_stderr out_to_x override_utf8_locale overwrite_file own_window own_window_class own_window_colour own_window_hints own_window_title own_window_transparent own_window_type pad_percents pop3 sensor_device short_units show_graph_range show_graph_scale stippled_borders temperature_unit template template0 template1 template2 template3 template4 template5 template6 template7 template8 template9 text text_buffer_size top_cpu_separate top_name_width total_run_times update_interval uppercase use_spacer use_xft xftalpha xftfont
syn keyword ConkyrcConstant
\ above
@ -49,7 +49,7 @@ syn region ConkyrcVar start=/\$\w\@=/ end=/\W\@=\|$/ contained contains=ConkyrcV
syn match ConkyrcVarStuff /{\@<=/ms=s contained nextgroup=ConkyrcVarName
syn keyword ConkyrcVarName contained nextgroup=ConkyrcNumber,ConkyrcColour skipwhite acpiacadapter acpifan acpitemp addr addrs adt746xcpu adt746xfan alignc alignr apcupsd apcupsd_cable apcupsd_charge apcupsd_lastxfer apcupsd_linev apcupsd_load apcupsd_loadbar apcupsd_loadgauge apcupsd_loadgraph apcupsd_model apcupsd_name apcupsd_status apcupsd_temp apcupsd_timeleft apcupsd_upsmode apm_adapter apm_battery_life apm_battery_time audacious_bar audacious_bitrate audacious_channels audacious_filename audacious_frequency audacious_length audacious_length_seconds audacious_main_volume audacious_playlist_length audacious_playlist_position audacious_position audacious_position_seconds audacious_status audacious_title battery battery_bar battery_percent battery_short battery_time bmpx_album bmpx_artist bmpx_bitrate bmpx_title bmpx_track bmpx_uri buffers cached color color0 color1 color2 color3 color4 color5 color6 color7 color8 color9 combine conky_build_arch conky_build_date conky_version cpu cpubar cpugauge cpugraph disk_protect diskio diskio_read diskio_write diskiograph diskiograph_read diskiograph_write downspeed downspeedf downspeedgraph draft_mails else endif entropy_avail entropy_bar entropy_poolsize eval eve exec execbar execgauge execgraph execi execibar execigauge execigraph execp execpi flagged_mails font forwarded_mails freq freq_g fs_bar fs_bar_free fs_free fs_free_perc fs_size fs_type fs_used fs_used_perc goto gw_iface gw_ip hddtemp head hr hwmon i2c i8k_ac_status i8k_bios i8k_buttons_status i8k_cpu_temp i8k_left_fan_rpm i8k_left_fan_status i8k_right_fan_rpm i8k_right_fan_status i8k_serial i8k_version ibm_brightness ibm_fan ibm_temps ibm_volume iconv_start iconv_stop if_empty if_existing if_gw if_match if_mixer_mute if_mounted if_mpd_playing if_running if_smapi_bat_installed if_up if_updatenr if_xmms2_connected image imap_messages imap_unseen ioscheduler kernel laptop_mode lines loadavg loadgraph lua lua_bar lua_gauge lua_graph lua_parse lua_read_parse machine mails mboxscan mem membar memeasyfree memfree memgauge memgraph memmax memperc mixer mixerbar mixerl mixerlbar mixerr mixerrbar moc_album moc_artist moc_bitrate moc_curtime moc_file moc_rate moc_song moc_state moc_timeleft moc_title moc_totaltime monitor monitor_number mpd_album mpd_artist mpd_bar mpd_bitrate mpd_elapsed mpd_file mpd_length mpd_name mpd_percent mpd_random mpd_repeat mpd_smart mpd_status mpd_title mpd_track mpd_vol nameserver new_mails nodename nvidia obsd_product obsd_sensors_fan obsd_sensors_temp obsd_sensors_volt obsd_vendor offset outlinecolor pb_battery platform pop3_unseen pop3_used pre_exec processes read_tcp replied_mails rss running_processes scroll seen_mails shadecolor smapi smapi_bat_bar smapi_bat_perc smapi_bat_power smapi_bat_temp sony_fanspeed stippled_hr swap swapbar swapmax swapperc sysname tab tail tcp_portmon template0 template1 template2 template3 template4 template5 template6 template7 template8 template9 texeci time top top_mem top_time totaldown totalup trashed_mails tztime unflagged_mails unforwarded_mails unreplied_mails unseen_mails updates upspeed upspeedf upspeedgraph uptime uptime_short user_names user_number user_terms user_times utime voffset voltage_mv voltage_v wireless_ap wireless_bitrate wireless_essid wireless_link_bar wireless_link_qual wireless_link_qual_max wireless_link_qual_perc wireless_mode words xmms2_album xmms2_artist xmms2_bar xmms2_bitrate xmms2_comment xmms2_date xmms2_duration xmms2_elapsed xmms2_genre xmms2_id xmms2_percent xmms2_playlist xmms2_size xmms2_smart xmms2_status xmms2_timesplayed xmms2_title xmms2_tracknr xmms2_url
syn keyword ConkyrcVarName contained nextgroup=ConkyrcNumber,ConkyrcColour skipwhite acpiacadapter acpifan acpitemp addr addrs adt746xcpu adt746xfan alignc alignr apcupsd apcupsd_cable apcupsd_charge apcupsd_lastxfer apcupsd_linev apcupsd_load apcupsd_loadbar apcupsd_loadgauge apcupsd_loadgraph apcupsd_model apcupsd_name apcupsd_status apcupsd_temp apcupsd_timeleft apcupsd_upsmode apm_adapter apm_battery_life apm_battery_time audacious_bar audacious_bitrate audacious_channels audacious_filename audacious_frequency audacious_length audacious_length_seconds audacious_main_volume audacious_playlist_length audacious_playlist_position audacious_position audacious_position_seconds audacious_status audacious_title battery battery_bar battery_percent battery_short battery_time bmpx_album bmpx_artist bmpx_bitrate bmpx_title bmpx_track bmpx_uri buffers cached color color0 color1 color2 color3 color4 color5 color6 color7 color8 color9 combine conky_build_arch conky_build_date conky_version cpu cpubar cpugauge cpugraph disk_protect diskio diskio_read diskio_write diskiograph diskiograph_read diskiograph_write downspeed downspeedf downspeedgraph draft_mails else endif entropy_avail entropy_bar entropy_perc entropy_poolsize eval eve exec execbar execgauge execgraph execi execibar execigauge execigraph execp execpi flagged_mails font forwarded_mails freq freq_g fs_bar fs_bar_free fs_free fs_free_perc fs_size fs_type fs_used fs_used_perc goto gw_iface gw_ip hddtemp head hr hwmon i2c i8k_ac_status i8k_bios i8k_buttons_status i8k_cpu_temp i8k_left_fan_rpm i8k_left_fan_status i8k_right_fan_rpm i8k_right_fan_status i8k_serial i8k_version ibm_brightness ibm_fan ibm_temps ibm_volume iconv_start iconv_stop if_empty if_existing if_gw if_match if_mixer_mute if_mounted if_mpd_playing if_running if_smapi_bat_installed if_up if_updatenr if_xmms2_connected image imap_messages imap_unseen ioscheduler kernel laptop_mode lines loadavg loadgraph lua lua_bar lua_gauge lua_graph lua_parse lua_read_parse machine mails mboxscan mem membar memeasyfree memfree memgauge memgraph memmax memperc mixer mixerbar mixerl mixerlbar mixerr mixerrbar moc_album moc_artist moc_bitrate moc_curtime moc_file moc_rate moc_song moc_state moc_timeleft moc_title moc_totaltime monitor monitor_number mpd_album mpd_artist mpd_bar mpd_bitrate mpd_elapsed mpd_file mpd_length mpd_name mpd_percent mpd_random mpd_repeat mpd_smart mpd_status mpd_title mpd_track mpd_vol nameserver new_mails nodename nvidia obsd_product obsd_sensors_fan obsd_sensors_temp obsd_sensors_volt obsd_vendor offset outlinecolor pb_battery platform pop3_unseen pop3_used pre_exec processes read_tcp replied_mails rss running_processes scroll seen_mails shadecolor smapi smapi_bat_bar smapi_bat_perc smapi_bat_power smapi_bat_temp sony_fanspeed stippled_hr swap swapbar swapmax swapperc sysname tab tail tcp_portmon template0 template1 template2 template3 template4 template5 template6 template7 template8 template9 texeci time top top_mem top_time totaldown totalup trashed_mails tztime unflagged_mails unforwarded_mails unreplied_mails unseen_mails updates upspeed upspeedf upspeedgraph uptime uptime_short user_names user_number user_terms user_times utime voffset voltage_mv voltage_v wireless_ap wireless_bitrate wireless_essid wireless_link_bar wireless_link_qual wireless_link_qual_max wireless_link_qual_perc wireless_mode words xmms2_album xmms2_artist xmms2_bar xmms2_bitrate xmms2_comment xmms2_date xmms2_duration xmms2_elapsed xmms2_genre xmms2_id xmms2_percent xmms2_playlist xmms2_size xmms2_smart xmms2_status xmms2_timesplayed xmms2_title xmms2_tracknr xmms2_url
hi def link ConkyrcComment Comment
hi def link ConkyrcSetting Keyword

View File

@ -1267,43 +1267,64 @@ static struct text_object *construct_text_object(const char *s,
if (arg) {
obj->data.net = get_net_stat(arg);
} else {
CRIT_ERR("wireless_essid: needs an argument");
// default to DEFAULTNETDEV
char *buf = strndup(DEFAULTNETDEV, text_buffer_size);
obj->data.net = get_net_stat(buf);
free(buf);
}
END OBJ(wireless_mode, INFO_NET)
if (arg) {
obj->data.net = get_net_stat(arg);
} else {
CRIT_ERR("wireless_mode: needs an argument");
// default to DEFAULTNETDEV
char *buf = strndup(DEFAULTNETDEV, text_buffer_size);
obj->data.net = get_net_stat(buf);
free(buf);
}
END OBJ(wireless_bitrate, INFO_NET)
if (arg) {
obj->data.net = get_net_stat(arg);
} else {
CRIT_ERR("wireless_bitrate: needs an argument");
// default to DEFAULTNETDEV
char *buf = strndup(DEFAULTNETDEV, text_buffer_size);
obj->data.net = get_net_stat(buf);
free(buf);
}
END OBJ(wireless_ap, INFO_NET)
if (arg) {
obj->data.net = get_net_stat(arg);
} else {
CRIT_ERR("wireless_ap: needs an argument");
// default to DEFAULTNETDEV
char *buf = strndup(DEFAULTNETDEV, text_buffer_size);
obj->data.net = get_net_stat(buf);
free(buf);
}
END OBJ(wireless_link_qual, INFO_NET)
if (arg) {
obj->data.net = get_net_stat(arg);
} else {
CRIT_ERR("wireless_link_qual: needs an argument");
// default to DEFAULTNETDEV
char *buf = strndup(DEFAULTNETDEV, text_buffer_size);
obj->data.net = get_net_stat(buf);
free(buf);
}
END OBJ(wireless_link_qual_max, INFO_NET)
if (arg) {
obj->data.net = get_net_stat(arg);
} else {
CRIT_ERR("wireless_link_qual_max: needs an argument");
// default to DEFAULTNETDEV
char *buf = strndup(DEFAULTNETDEV, text_buffer_size);
obj->data.net = get_net_stat(buf);
free(buf);
}
END OBJ(wireless_link_qual_perc, INFO_NET)
if (arg) {
obj->data.net = get_net_stat(arg);
} else {
CRIT_ERR("wireless_link_qual_perc: needs an argument");
// default to DEFAULTNETDEV
char *buf = strndup(DEFAULTNETDEV, text_buffer_size);
obj->data.net = get_net_stat(buf);
free(buf);
}
END OBJ(wireless_link_bar, INFO_NET)
SIZE_DEFAULTS(bar);
@ -1311,7 +1332,10 @@ static struct text_object *construct_text_object(const char *s,
arg = scan_bar(arg, &obj->a, &obj->b);
obj->data.net = get_net_stat(arg);
} else {
CRIT_ERR("wireless_link_bar: needs an argument");
// default to DEFAULTNETDEV
char *buf = strndup(DEFAULTNETDEV, text_buffer_size);
obj->data.net = get_net_stat(buf);
free(buf);
}
#endif /* HAVE_IWLIB */
@ -1586,13 +1610,19 @@ static struct text_object *construct_text_object(const char *s,
if (arg) {
obj->data.net = get_net_stat(arg);
} else {
CRIT_ERR("downspeed needs argument");
// default to DEFAULTNETDEV
char *buf = strndup(DEFAULTNETDEV, text_buffer_size);
obj->data.net = get_net_stat(buf);
free(buf);
}
END OBJ(downspeedf, INFO_NET)
if (arg) {
obj->data.net = get_net_stat(arg);
} else {
CRIT_ERR("downspeedf needs argument");
// default to DEFAULTNETDEV
char *buf = strndup(DEFAULTNETDEV, text_buffer_size);
obj->data.net = get_net_stat(buf);
free(buf);
}
#ifdef X11
END OBJ(downspeedgraph, INFO_NET)
@ -1602,7 +1632,7 @@ static struct text_object *construct_text_object(const char *s,
&obj->e, &obj->char_a, &obj->char_b);
// default to DEFAULTNETDEV
buf = strndup(buf ? buf : "DEFAULTNETDEV", text_buffer_size);
buf = strndup(buf ? buf : DEFAULTNETDEV, text_buffer_size);
obj->data.net = get_net_stat(buf);
free(buf);
#endif /* X11 */
@ -1927,14 +1957,20 @@ static struct text_object *construct_text_object(const char *s,
if (arg) {
obj->data.net = get_net_stat(arg);
} else {
CRIT_ERR("addr needs argument");
// default to DEFAULTNETDEV
char *buf = strndup(DEFAULTNETDEV, text_buffer_size);
obj->data.net = get_net_stat(buf);
free(buf);
}
#if defined(__linux__)
END OBJ(addrs, INFO_NET)
if (arg) {
obj->data.net = get_net_stat(arg);
} else {
CRIT_ERR("addrs needs argument");
// default to DEFAULTNETDEV
char *buf = strndup(DEFAULTNETDEV, text_buffer_size);
obj->data.net = get_net_stat(buf);
free(buf);
}
#endif /* __linux__ */
END OBJ(tail, 0)
@ -2387,14 +2423,20 @@ static struct text_object *construct_text_object(const char *s,
if (arg) {
obj->data.net = get_net_stat(arg);
} else {
CRIT_ERR("totaldown needs argument");
// default to DEFAULTNETDEV
char *buf = strndup(DEFAULTNETDEV, text_buffer_size);
obj->data.net = get_net_stat(buf);
free(buf);
}
END OBJ(totalup, INFO_NET)
obj->data.net = get_net_stat(arg);
if (arg) {
obj->data.net = get_net_stat(arg);
} else {
CRIT_ERR("totalup needs argument");
// default to DEFAULTNETDEV
char *buf = strndup(DEFAULTNETDEV, text_buffer_size);
obj->data.net = get_net_stat(buf);
free(buf);
}
END OBJ(updates, 0)
END OBJ_IF(if_updatenr, 0)
@ -2409,13 +2451,19 @@ static struct text_object *construct_text_object(const char *s,
if (arg) {
obj->data.net = get_net_stat(arg);
} else {
CRIT_ERR("upspeed needs argument");
// default to DEFAULTNETDEV
char *buf = strndup(DEFAULTNETDEV, text_buffer_size);
obj->data.net = get_net_stat(buf);
free(buf);
}
END OBJ(upspeedf, INFO_NET)
if (arg) {
obj->data.net = get_net_stat(arg);
} else {
CRIT_ERR("upspeedf needs argument");
// default to DEFAULTNETDEV
char *buf = strndup(DEFAULTNETDEV, text_buffer_size);
obj->data.net = get_net_stat(buf);
free(buf);
}
#ifdef X11
@ -2426,7 +2474,7 @@ static struct text_object *construct_text_object(const char *s,
&obj->e, &obj->char_a, &obj->char_b);
// default to DEFAULTNETDEV
buf = strndup(buf ? buf : "DEFAULTNETDEV", text_buffer_size);
buf = strndup(buf ? buf : DEFAULTNETDEV, text_buffer_size);
obj->data.net = get_net_stat(buf);
free(buf);
#endif
@ -2989,12 +3037,12 @@ static char *handle_template(const char *tmpl, const char *args)
args_dup = strdup(args);
p = args_dup;
while (*p) {
while (*p && (*p == ' ' && p > args_dup && *(p - 1) != '\\'))
while (*p && (*p == ' ' && (p == args_dup || *(p - 1) != '\\')))
p++;
if (p > args_dup && *(p - 1) == '\\')
p--;
p_old = p;
while (*p && (*p != ' ' || p == args_dup || *(p - 1) == '\\'))
while (*p && (*p != ' ' || (p > args_dup && *(p - 1) == '\\')))
p++;
if (*p) {
(*p) = '\0';
@ -3467,6 +3515,7 @@ static void generate_text_internal(char *p, int p_max_size,
struct text_object root, struct information *cur)
{
struct text_object *obj;
int need_to_load_fonts = 0;
/* for the OBJ_top* handler */
struct process **needed = 0;
@ -3902,6 +3951,7 @@ static void generate_text_internal(char *p, int p_max_size,
#ifdef X11
OBJ(font) {
new_font(p, obj->data.s);
need_to_load_fonts = 1;
}
#endif /* X11 */
/* TODO: move this correction from kB to kB/s elsewhere
@ -4073,7 +4123,7 @@ static void generate_text_internal(char *p, int p_max_size,
read_exec(cmd, p, text_buffer_size);
barnum = get_barnum(p);
if (barnum >= 0.0) {
if (barnum > 0) {
new_graph(p, obj->a, obj->b, obj->c, obj->d, round_to_int(barnum),
100, 1, showaslog, tempgrad);
}
@ -4514,8 +4564,8 @@ static void generate_text_internal(char *p, int p_max_size,
free(tmp_info);
}
OBJ(lua_bar) {
int per;
if (llua_getinteger(obj->data.s, &per)) {
double per;
if (llua_getnumber(obj->data.s, &per)) {
#ifdef X11
if(output_methods & TO_X) {
new_bar(p, obj->a, obj->b, (per/100.0 * 255));
@ -4530,15 +4580,15 @@ static void generate_text_internal(char *p, int p_max_size,
}
#ifdef X11
OBJ(lua_graph) {
int per;
if (llua_getinteger(obj->data.s, &per)) {
double per;
if (llua_getnumber(obj->data.s, &per)) {
new_graph(p, obj->a, obj->b, obj->c, obj->d,
(per/100.0 * 255), 100, 1, obj->char_a, obj->char_b);
per, obj->e, 1, obj->char_a, obj->char_b);
}
}
OBJ(lua_gauge) {
int per;
if (llua_getinteger(obj->data.s, &per)) {
double per;
if (llua_getnumber(obj->data.s, &per)) {
new_gauge(p, obj->a, obj->b, (per/100.0 * 255));
}
}
@ -5733,6 +5783,12 @@ static void generate_text_internal(char *p, int p_max_size,
}
obj = obj->next;
}
#ifdef X11
/* load any new fonts we may have had */
if (need_to_load_fonts) {
load_fonts();
}
#endif /* X11 */
}
double current_update_time, next_update_time, last_update_time;
@ -6444,7 +6500,6 @@ static void draw_line(char *s)
} else {
cur_y += font_ascent();
}
set_font();
font_h = font_height();
break;
}
@ -6875,7 +6930,6 @@ static void main_loop(void)
|| ev.xconfigure.y != 0)) {
fixed_pos = 1;
} */
set_font();
}
break;
@ -7140,7 +7194,6 @@ static void reload_config(void)
}
#ifdef X11
x_initialised = NO;
if (output_methods & TO_X) {
X11_initialisation();
}
@ -7163,10 +7216,10 @@ static void reload_config(void)
}
text_buffer = malloc(max_user_text);
memset(text_buffer, 0, max_user_text);
update_text();
#ifdef X11
X11_create_window();
#endif /* X11 */
update_text();
}
}
@ -7444,6 +7497,36 @@ static _Bool append_works(const char *path)
}
#ifdef X11
#ifdef DEBUG
/* WARNING, this type not in Xlib spec */
int x11_error_handler(Display *d, XErrorEvent *err)
__attribute__((noreturn));
int x11_error_handler(Display *d, XErrorEvent *err)
{
ERR("X Error: type %i Display %lx XID %li serial %lu error_code %i request_code %i minor_code %i other Display: %lx\n",
err->type,
(long unsigned)err->display,
(long)err->resourceid,
err->serial,
err->error_code,
err->request_code,
err->minor_code,
(long unsigned)d
);
abort();
}
int x11_ioerror_handler(Display *d)
__attribute__((noreturn));
int x11_ioerror_handler(Display *d)
{
ERR("X Error: Display %lx\n",
(long unsigned)d
);
abort();
}
#endif /* DEBUG */
static void X11_initialisation(void)
{
if (x_initialised == YES) return;
@ -7451,6 +7534,12 @@ static void X11_initialisation(void)
init_X11(disp);
set_default_configurations_for_x();
x_initialised = YES;
#ifdef DEBUG
_Xdebug = 1;
/* WARNING, this type not in Xlib spec */
XSetErrorHandler(&x11_error_handler);
XSetIOErrorHandler(&x11_ioerror_handler);
#endif /* DEBUG */
}
static void X11_destroy_window(void)
@ -7468,6 +7557,7 @@ static void X11_destroy_window(void)
#endif /* HAVE_XDAMAGE */
destroy_window();
}
x_initialised = NO;
}
static char **xargv = 0;
@ -7486,7 +7576,7 @@ static void X11_create_window(void)
xargv, xargc);
#endif /* OWN_WINDOW */
selected_font = 0;
setup_fonts();
load_fonts();
update_text_area(); /* to position text/window on screen */
@ -7501,7 +7591,6 @@ static void X11_create_window(void)
create_gc();
set_font();
draw_stuff();
x11_stuff.region = XCreateRegion();
@ -7926,7 +8015,7 @@ static void load_config_file(const char *f)
#else
CONF("use_xft") {
if (string_to_bool(value)) {
ERR("Xft not enabled");
ERR("Xft not enabled at compile time");
}
}
CONF("xftfont") {
@ -8514,7 +8603,7 @@ static void print_help(const char *prog_name) {
"file.\n"
" -v, --version version\n"
" -q, --quiet quiet mode\n"
" -D, --debug increase debugging output\n"
" -D, --debug increase debugging output, ie. -DD for more debugging\n"
" -c, --config=FILE config file to load\n"
#ifdef CONFIG_OUTPUT
" -C, --print-config print the builtin default config to stdout\n"

View File

@ -32,26 +32,20 @@ int selected_font = 0;
int font_count = -1;
struct font_list *fonts = NULL;
void set_font(void)
void setup_fonts(void)
{
if ((output_methods & TO_X) == 0) {
return;
}
#ifdef XFT
if (use_xft) {
if (window.xftdraw != NULL) {
XftDrawDestroy(window.xftdraw);
}
if (use_xft && !window.xftdraw) {
window.xftdraw = XftDrawCreate(display, window.drawable,
DefaultVisual(display, screen), DefaultColormap(display, screen));
} else
#endif
{
XSetFont(display, window.gc, fonts[selected_font].font->fid);
}
#endif
}
int addfont(const char *data_in)
int add_font(const char *data_in)
{
if ((output_methods & TO_X) == 0) {
return 0;
@ -73,7 +67,7 @@ int addfont(const char *data_in)
fonts = realloc(fonts, (sizeof(struct font_list) * (font_count + 1)));
memset(&fonts[font_count], 0, sizeof(struct font_list));
if (fonts == NULL) {
CRIT_ERR("realloc in addfont");
CRIT_ERR("realloc in add_font");
}
// must account for null terminator
if (strlen(data_in) < DEFAULT_TEXT_BUFFER_SIZE) {
@ -82,7 +76,7 @@ int addfont(const char *data_in)
fonts[font_count].font_alpha = 0xffff;
#endif
} else {
CRIT_ERR("Oops...looks like something overflowed in addfont().");
CRIT_ERR("Oops...looks like something overflowed in add_font().");
}
return font_count;
}
@ -121,7 +115,7 @@ void free_fonts(void)
XftFontClose(display, fonts[i].xftfont);
fonts[i].xftfont = 0;
} else
#endif
#endif /* XFT */
{
XFreeFont(display, fonts[i].font);
fonts[i].font = 0;
@ -131,6 +125,12 @@ void free_fonts(void)
fonts = 0;
font_count = -1;
selected_font = 0;
#ifdef XFT
if (window.xftdraw) {
XftDrawDestroy(window.xftdraw);
window.xftdraw = 0;
}
#endif /* XFT */
}
void load_fonts(void)
@ -145,12 +145,9 @@ void load_fonts(void)
if (use_xft && fonts[i].xftfont) {
continue;
} else if (use_xft) {
/* if (fonts[i].xftfont != NULL && selected_font == 0) {
XftFontClose(display, fonts[i].xftfont);
} */
fonts[i].xftfont = XftFontOpenName(display, screen,
fonts[i].name);
if (fonts[i].xftfont != NULL) {
if (fonts[i].xftfont) {
continue;
}
@ -171,10 +168,6 @@ void load_fonts(void)
}
#endif
/* load normal font */
/* if (fonts[i].font != NULL) {
XFreeFont(display, fonts[i].font);
} */
if (fonts[i].font || (fonts[i].font = XLoadQueryFont(display, fonts[i].name)) == NULL) {
ERR("can't load font '%s'", fonts[i].name);
if ((fonts[i].font = XLoadQueryFont(display, "fixed")) == NULL) {

View File

@ -70,8 +70,8 @@ extern struct font_list *fonts;
extern int selected_font;
extern int font_count;
void set_font(void);
int addfont(const char *);
void setup_fonts(void);
int add_font(const char *);
void set_first_font(const char *);
void free_fonts(void);
void load_fonts(void);

View File

@ -165,7 +165,7 @@ char *llua_getstring_read(const char *function, const char *arg)
return ret;
}
int llua_getinteger(const char *args, int *per)
int llua_getnumber(const char *args, double *ret)
{
char *func;
@ -174,9 +174,9 @@ int llua_getinteger(const char *args, int *per)
func = llua_do_call(args, 1);
if(func) {
if(!lua_isnumber(lua_L, -1)) {
ERR("llua_getinteger: function %s didn't return an integer, result discarded", func);
ERR("llua_getnumber: function %s didn't return a number, result discarded", func);
} else {
*per = lua_tointeger(lua_L, -1);
*ret = lua_tonumber(lua_L, -1);
lua_pop(lua_L, 1);
return 1;
}

View File

@ -26,13 +26,20 @@
#include <lauxlib.h>
#include <lualib.h>
/* initialize lua stuff */
void llua_init(void);
/* load a lua script */
void llua_load(const char *script);
/* call a function with args, and return a string from it (must be free'd) */
char *llua_getstring(const char *args);
/* call a function with args, and return a string from it (must be free'd) */
char *llua_getstring_read(const char *function, const char *arg);
int llua_getinteger(const char *args, int *per);
/* call a function with args, and put the result in ret */
int llua_getnumber(const char *args, double *ret);
/* close lua stuff */
void llua_close(void);
#ifdef HAVE_SYS_INOTIFY_H
/* check our lua inotify status */
void llua_inotify_query(int wd, int mask);
#endif /* HAVE_SYS_INOTIFY_H */

View File

@ -254,8 +254,7 @@ void new_font(char *buf, char *args)
if (s->font_added > font_count || !s->font_added || (strncmp(args, fonts[s->font_added].name, DEFAULT_TEXT_BUFFER_SIZE) != EQUAL) ) {
int tmp = selected_font;
selected_font = s->font_added = addfont(args);
load_fonts();
selected_font = s->font_added = add_font(args);
selected_font = tmp;
}
} else {

View File

@ -70,12 +70,11 @@ static Window find_subwindow(Window win, int w, int h);
/* X11 initializer */
void init_X11(const char *disp)
{
if (display) {
XCloseDisplay(display);
}
if (!display) {
if ((display = XOpenDisplay(disp)) == NULL) {
CRIT_ERR("can't open display: %s", XDisplayName(0));
}
}
screen = DefaultScreen(display);
display_width = DisplayWidth(display, screen);