Giter Club home page Giter Club logo

conkyrc's Introduction

Conky config and scripts

Contents

  • conkyrc-generator.py - Script to create a config based on a template and properties of the running system
  • conkyrc-template - Config jinja2 template
  • config-example.py - Example config file to conkyrc-generator
  • Conky.ttf - Font with symbols
  • ping.lua - Lua script to show ping delay value and graph
  • transmission-status.py - Script to show transmission torrents status
  • conkyrc-example - Example generated conkyrc

conkyrc-generator.py

Usage: ./conkyrc-generator.py > ~/.conkyrc

The main purpose of the script is the generate a final conkyrc config based on a jinja2 template.

This approach has the following benefits compared with a static conkyrc:

  • Loops to dynamically write multiple identical lines, as is common on conkyrc configs.
  • Separate the conkyrc structure from the details of the running system.
  • Adapt the generated conkyrc to the running system, like number of CPUs, hard drives, etc.
  • Share the same template between different machines, with few or no changes to a separate config file.
  • Eliminates the need for lots of conditional statements in conkyrc that messes up the layout, just to support different systems.

It automatically gets the info from the running system to make available the following variables to the template:

  • config.cpu_number - Number of CPU cores
  • config.cpu_model - CPU model string from /proc/cpuinfo
  • config.swap - Boolean for swap space configured or not
  • config.disks - List of the non-removable hard-drives detected
  • config.filesystems - List of filesystems in non-removable disks
  • config.interfaces - List of network interfaces with IP and excluding the loopback interface

conkyrc-template

Jinja2 conkyrc template to be used with the conkyrc-generator.py

The content of variables can be included by doing {{variable_name}}.

The complete reference for the templating language can be found on the Jinja website.

config.py

This file is evaluated by the conkyrc-generated and can be used the override the automatic variables created, or create new variables to include in the template.

The following variables are expected by the included conkyrc-template:

  • config.debug - Boolean to print debug information
  • torrents_host - Host where transmission-daemon is running, or None to exclude the torrents section

Since any python code can be included here, it can also be used to remove or add specific filesystems or disks to the generated arrays.

Conky.ttf

TrueType font with symbols of hardware and other stuff to be used as headers of sections.

Create on https://glyphter.com/ and modified with FontForge.

ping.lua

Lua script to extend conky with new functions to show ping delay value and graph.

Print the numeric value: ${lua_parse router_ping_string}

Print the graph of the value history: ${lua_graph router_ping 9,90 ff8c00 ff8c00}

Must be included in the conkyrc with the line: lua_load ~/.conky/ping.lua

It reads the file /tmp/router_status and expects one line containing something like 5.30 ms.

This was designed to be used with my pingrage script here, which pings the desired host in a loop and outputs the delay to the file.

transmission-status.py

Script that outputs the active torrents from a local or remote transmission-daemon.

The output contains color codes to be parsed by conky.

conkyrc-example

Example of the conkyrc generated by the combination of the conkyrc-generater.py, conkyrc-template and config-example.py included here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.