This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Unity indicator for evolution-less clock and date display | |
# author: phil ayres | |
# 24 Oct 2011 | |
import gobject | |
import gtk | |
import appindicator | |
import os, sys | |
import time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <fcntl.h> | |
#include <unistd.h> | |
#include <string.h> | |
#include <errno.h> | |
#include <stdlib.h> | |
#include <sys/epoll.h> | |
#include <sys/types.h> | |
int main(int argc, char** argv) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os import getpid | |
class HarmattanCompositor(object): | |
# Atoms | |
XA_ATOM = 4 | |
XA_STRING = 31 | |
XA_WINDOW = 33 | |
# Contants |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
""" | |
Print out the apps and clients that are inhibiting session actions like log out, user switching, suspending or idle. | |
%InsertOptionParserUsage% | |
Example: | |
track_session_inhibitors & | |
Todo: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# ____________ | |
# getkwargs.sh | |
# | |
# -- Gives you simple Python-esque arguments in Bash | |
# ie: your_function_or_script never=always sync daemon=True | |
# | |
# TODO Enhance interface with standard opts support: -p|--path[=blah] | |
# | |
# ~trevorj 05/05/2013 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Quick and dirty implementation of mounting a local volume using Gio. | |
# For people who were scratching their heads like me. | |
# Code below based on infos from: | |
# http://stackoverflow.com/questions/5709454/gio-check-if-volume-is-mounted | |
# http://stackoverflow.com/questions/1991206/accessing-samba-shares-with-gio-in-python/2051628#2051628 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- Mode: Python; py-indent-offset: 4 -*- | |
# vim: tabstop=4 shiftwidth=4 expandtab | |
# | |
# Copyright (C) 2010 Red Hat, Inc., John (J5) Palmieri <[email protected]> | |
# | |
# This library is free software; you can redistribute it and/or | |
# modify it under the terms of the GNU Lesser General Public | |
# License as published by the Free Software Foundation; either | |
# version 2.1 of the License, or (at your option) any later version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
# | |
# dockbar.py | |
# | |
# Example program places a coloured bar across the top of the | |
# current monitor | |
# | |
# demonstrates | |
# | |
# (a) creating the bar as an undecorated "dock" window |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
def coroutine(func): | |
"""A decorator to automatically prime coroutines""" | |
def start(*args, **kwargs): | |
cr = func(*args, **kwargs) | |
next(cr) | |
return cr | |
return start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
import appindicator | |
import gtk | |
import urllib2 | |
class IPIndicator(appindicator.Indicator): | |
""" | |
An indicator displaying public IP address. |
OlderNewer