To display the current watson status in your i3 bar using conky:
- in the conky configuration, add:
{"full_text": "${texeci 5 ~/.config/i3/watson-status}"}- in
~/.config/i3/watson-status:
#!/bin/bash
watson status |
sed -r '| #!/usr/bin/env python3 | |
| # -*- coding: utf-8 -*- | |
| # Copyright © 2016 Yannick Loiseau <[email protected]> | |
| # This work is free. You can redistribute it and/or modify it under the | |
| # terms of the Do What The Fuck You Want To Public License, Version 2, | |
| # as published by Sam Hocevar. See http://www.wtfpl.net/ for more details. | |
| """ | |
| on-modify hook for taskwarrior. | |
| This hook connects taskwarrior and watson. |
To display the current watson status in your i3 bar using conky:
{"full_text": "${texeci 5 ~/.config/i3/watson-status}"}~/.config/i3/watson-status:#!/bin/bash
watson status |
sed -r '| #!/bin/bash | |
| # | |
| # Copyright © 2016 Yannick Loiseau <[email protected]> | |
| # This work is free. You can redistribute it and/or modify it under the | |
| # terms of the Do What The Fuck You Want To Public License, Version 2, | |
| # as published by Sam Hocevar. See http://www.wtfpl.net/ for more details. | |
| # | |
| #============================================================================== | |
| # Script to check if you are working on a project with Watson and display a | |
| # notification when: |
| import unittest | |
| class MetaTest(type): | |
| def __new__(cls, name, bases, attrs): | |
| for k, v in attrs['generation_data'].items(): | |
| def test_function(self): | |
| self.assertTrue(v[0]**2, v[1]) | |
| attrs['test_%s' % k] = test_function | |
| return super(MetaTest, cls).__new__(cls, name, bases, attrs) |
| import requests | |
| def doi2bib(doi): | |
| """ | |
| Return a bibTeX string of metadata for a given DOI. | |
| """ | |
| url = "http://dx.doi.org/" + doi | |
| headers = {"accept": "application/x-bibtex"} |
| /** | |
| * Casper script to restart Alwaysdata processes. | |
| * | |
| * Usage: | |
| * $ casperjs kill.js [email protected] mysecretpassword | |
| */ | |
| var casper = require('casper').create(); | |
| casper.start("https://admin.alwaysdata.com/login/"); |
| # Get the binary from ActiveState. | |
| $ wget http://downloads.activestate.com/ActivePython/releases/2.7.2.5/ActivePython-2.7.2.5-linux-x86_64.tar.gz | |
| # Create a src directory at the root of your account. | |
| $ mkdir src | |
| # Install python 2.7 | |
| $ ActivePython-2.7.2.5-linux-x86/install.sh | |
| # The installer will prompt you to choose a directory. As the default is /opt/ActivePython-2.7, choose | |
| # the previously created directory. | |
| Enter directory in which to install ActivePython. Leave blank and | |
| press 'Enter' to use the default [/opt/ActivePython-2.7]. |