Giter Club home page Giter Club logo

rainmeter-python's Introduction

rainmeter-python

Originally created by jblume, now maintained by glitchassassin

New binaries built by chitao1234

Plugin for Rainmeter enabling Python 3.4/3.5 scripting (should be able to support later on versions)

Installation

New Releases: Github All Releases

Old Releases: Github All Releases

Unzip the DLL for your Python version and copy it to the 'Plugins' folder of your Rainmeter installation.

For this plugin to function, you'll need to install the Python distribution matching your Rainmeter's architecture (Win32 or x64). If in doubt, use Python x64. The corresponding 'python3x.dll' needs to be in your DLL search path; all standard installers of Python 3 automatically put the DLL into your System32 directory, so this should normally be the case. If you see an "Error 126" in Rainmeter's logs while trying to load the plugin, this is probably your issue.

Example (Simple)

[Measure]
Measure=Plugin
Plugin=Python
PythonHome=c:\Python35-x64
ScriptPath=default.py
ClassName=Measure
UpdateDivider=1
class Measure:
  def Reload(self, rm, maxValue):
    rm.RmLog(rm.LOG_NOTICE, "Reload called")

  def Update(self):
    return 1.0

  def GetString(self):
    return 'Test'

  def ExecuteBang(self, args):
    pass

  def Finalize(self):
    pass

Example (IMAP Unread Mail Count)

[Measure]
Measure=Plugin
Plugin=Python
ScriptPath=IMAP.py
PythonHome=c:\Python35-x64
ClassName=Measure
UpdateDivider=60
Username=username
Password=password
Host=mail.com
import imaplib

class Measure:
    def Reload(self, rm, maxValue):
        self.host = rm.RmReadString('Host', 'example.com', False)
        self.username = rm.RmReadString('Username', 'user', False)
        self.password = rm.RmReadString('Password', 'pass', False)

    def Update(self):
        con = imaplib.IMAP4(self.host)
        con.starttls()
        con.login(self.username, self.password)
        con.select('INBOX', True)
        _, msgnums = con.search(None, '(UNSEEN)')
        con.close()
        con.logout()
        return float(len(msgnums[0].split()))

Build

In Property Pages -> VC++ Directories, change Python directories in External Include Directories and Library Directories to your own, and build it

License

Licensed under GPLv3

Special Thanks

GitHub for providing .gitignore file

rainmeter-python's People

Contributors

chitao1234 avatar glitchassassin avatar jblume avatar

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.