# HG changeset patch # User Jeff Hammel # Date 1375979764 25200 # Node ID 6797477f6a8fc0cabede25a426ff4d56cb22ad86 # Parent a9890ec0eab6abc3072e2c91e4cf9b98ba883583 adding conky diff -r a9890ec0eab6 -r 6797477f6a8f .conkyrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.conkyrc Thu Aug 08 09:36:04 2013 -0700 @@ -0,0 +1,59 @@ +# Conky, a system monitor, based on torsmo + +alignment top_left +background no +border_width 1 +cpu_avg_samples 2 +default_color white +default_outline_color white +default_shade_color lightslategray +double_buffer yes +draw_borders no +draw_graph_borders yes +draw_outline no +draw_shades no +use_xft yes +xftfont DejaVu Sans Mono:size=12 +gap_x 30 +gap_y 30 +minimum_size 5 5 +net_avg_samples 2 +no_buffers yes +out_to_console no +out_to_stderr no +extra_newline no +own_window yes +own_window_class Conky +own_window_transparent yes +own_window_type desktop +short_units yes +stippled_borders 0 +time_in_seconds yes +update_interval 0.1 +uppercase no +use_spacer none +use_xft yes +show_graph_scale no +show_graph_range no + +TEXT +${scroll 16 $sysname $kernel on $machine | } +$hr +${color grey}Uptime:$color $uptime +${color grey}Frequency:$color $freq MHz +${color grey}RAM Usage:$color $mem/$memmax - $memperc% ${membar 4} +${color grey}Swap Usage:$color $swap/$swapmax - $swapperc% ${swapbar 4} +${color grey}CPU Usage:$color $cpu% ${cpubar 4} +${color grey}Processes:$color $processes ${color grey}Running:$color $running_processes +$hr +${color grey}File system: + / $color${fs_used /}/${fs_size /} ${fs_bar 6 /} +${color grey}Networking: +Up:$color ${upspeed eth0} ${color grey} - Down:$color ${downspeed eth0} +$hr +${color grey}Name PID CPU% MEM% +${color lightgrey} ${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1} +${color lightgrey} ${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2} +${color lightgrey} ${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3} +${color lightgrey} ${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4} +${color lightgrey} ${top name 5} ${top pid 5} ${top cpu 5} ${top mem 5} diff -r a9890ec0eab6 -r 6797477f6a8f python/hgrc.py --- a/python/hgrc.py Thu Aug 08 01:07:40 2013 -0700 +++ b/python/hgrc.py Thu Aug 08 09:36:04 2013 -0700 @@ -3,32 +3,40 @@ """ Script for modifying hgrc files. -Actions: -(TBD) +If no arguments specified, the repository given by `hg root` is used. """ + # imports import optparse import os +import subprocess import sys from ConfigParser import RawCOnfigParser as ConfigParser def main(args=sys.argv[1:]): - # command line parser + # parse command line arguments usage = '%prog [options] repository <...>' parser = optparse.OptionParser(usage=usage, description=__doc__) - parser.add_option('-p', '--print', dest='print_hgrc', + parser.add_option('-l', '--list', dest='list_hgrc', action='store_true', default=False, - help="print full path to hgrc files and exit") + help="list full path to hgrc files") parser.add_option('--ssh', dest='default_push_ssh', action='store_true', default=False, help="use `default` entries for `default-push`") parser.add_option('--push', '--default-push', dest='default_push', help="set [paths] default-push location") options, args = options.parse_args(args) + + # if not specified, use repo from `hg root` if not args: - parser.print_usage() - parser.exit() + args = [subprocess.check_output(['hg', 'root'])] + + # if not specified, set a default action + default_action = 'default_push_ssh' + actions = ('default_push', + 'default_push_ssh', + ) # find all hgrc files hgrc = [] @@ -78,10 +86,10 @@ # XXX this code path is untenable config[path]. - if options.print_hgrc: - # print the chosen hgrc paths and you're done + # print the chosen hgrc paths + if options.list_hgrc: print '\n'.join(hgrc) - parser.exit() + if __name__ == '__main__': main()