From dba767e8ff1599a0b4cf8fb3dc06ac0cce727748 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Wed, 6 Jan 2016 15:11:44 +0800 Subject: i3: update configuration for i3wm * Update i3 wm config * Add i3blocks.conf * Remove py3status --- .i3/py3status/backup/dpms.py | 44 --------- .i3/py3status/backup/empty_class.py | 41 --------- .i3/py3status/backup/glpi.py | 52 ----------- .i3/py3status/backup/i3bar_click_events.py | 127 -------------------------- .i3/py3status/backup/netdata.py | 132 --------------------------- .i3/py3status/backup/ns_checker.py | 57 ------------ .i3/py3status/backup/pingdom.py | 59 ------------- .i3/py3status/backup/pomodoro.py | 123 -------------------------- .i3/py3status/backup/sysdata.py | 137 ----------------------------- .i3/py3status/backup/weather_yahoo.py | 106 ---------------------- .i3/py3status/backup/whoami.py | 26 ------ 11 files changed, 904 deletions(-) delete mode 100644 .i3/py3status/backup/dpms.py delete mode 100644 .i3/py3status/backup/empty_class.py delete mode 100644 .i3/py3status/backup/glpi.py delete mode 100644 .i3/py3status/backup/i3bar_click_events.py delete mode 100644 .i3/py3status/backup/netdata.py delete mode 100644 .i3/py3status/backup/ns_checker.py delete mode 100644 .i3/py3status/backup/pingdom.py delete mode 100644 .i3/py3status/backup/pomodoro.py delete mode 100644 .i3/py3status/backup/sysdata.py delete mode 100644 .i3/py3status/backup/weather_yahoo.py delete mode 100644 .i3/py3status/backup/whoami.py (limited to '.i3/py3status/backup') diff --git a/.i3/py3status/backup/dpms.py b/.i3/py3status/backup/dpms.py deleted file mode 100644 index 783c53c..0000000 --- a/.i3/py3status/backup/dpms.py +++ /dev/null @@ -1,44 +0,0 @@ -from os import system - - -class Py3status: - """ - This module allows activation and deactivation - of DPMS (Display Power Management Signaling) - by clicking on 'DPMS' in the status bar. - - Written and contributed by @tasse: - Andre Doser - """ - def __init__(self): - """ - Detect current state on start. - """ - self.run = system('xset -q | grep -iq "DPMS is enabled"') == 0 - - def dpms(self, i3status_output_json, i3status_config): - """ - Display a colorful state of DPMS. - """ - result = { - 'full_text': 'DPMS', - 'name': 'dpms' - } - if self.run: - result['color'] = i3status_config['color_good'] - else: - result['color'] = i3status_config['color_bad'] - return (0, result) - - def on_click(self, json, i3status_config, event): - """ - Enable/Disable DPMS on left click. - """ - if event['button'] == 1: - if self.run: - self.run = False - system("xset -dpms") - else: - self.run = True - system("xset +dpms") - system("killall -USR1 py3status") diff --git a/.i3/py3status/backup/empty_class.py b/.i3/py3status/backup/empty_class.py deleted file mode 100644 index 077269c..0000000 --- a/.i3/py3status/backup/empty_class.py +++ /dev/null @@ -1,41 +0,0 @@ -class Py3status: - """ - Empty and basic py3status class. - - NOTE: py3status will NOT execute: - - methods starting with '_' - - methods decorated by @property and @staticmethod - - NOTE: reserved method names: - - 'kill' method for py3status exit notification - - 'on_click' method for click events from i3bar - """ - def kill(self, i3status_output_json, i3status_config): - """ - This method will be called upon py3status exit. - """ - pass - - def on_click(self, i3status_output_json, i3status_config, event): - """ - This method will be called when a click event occurs on this module's - output on the i3bar. - - Example 'event' json object: - {'y': 13, 'x': 1737, 'button': 1, 'name': 'empty', 'instance': 'first'} - """ - pass - - def empty(self, i3status_output_json, i3status_config): - """ - This method will return an empty text message - so it will NOT be displayed on your i3bar. - - If you want something displayed you should write something - in the 'full_text' key of your response. - - See the i3bar protocol spec for more information: - http://i3wm.org/docs/i3bar-protocol.html - """ - response = {'full_text': '', 'name': 'empty', 'instance': 'first'} - return (0, response) diff --git a/.i3/py3status/backup/glpi.py b/.i3/py3status/backup/glpi.py deleted file mode 100644 index 929749d..0000000 --- a/.i3/py3status/backup/glpi.py +++ /dev/null @@ -1,52 +0,0 @@ -# You need MySQL-python from http://pypi.python.org/pypi/MySQL-python -import MySQLdb - - -class Py3status: - """ - This example class demonstrates how to display the current total number of - open tickets from GLPI in your i3bar. - - It features thresholds to colorize the output and forces a low timeout to - limit the impact of a server connectivity problem on your i3bar freshness. - - Note that we don't have to implement a cache layer as it is handled by - py3status automagically. - """ - def count_glpi_open_tickets(self, json, i3status_config): - response = {'full_text': '', 'name': 'glpi_tickets'} - - # user-defined variables - CRIT_THRESHOLD = 20 - WARN_THRESHOLD = 15 - MYSQL_DB = '' - MYSQL_HOST = '' - MYSQL_PASSWD = '' - MYSQL_USER = '' - POSITION = 0 - - mydb = MySQLdb.connect( - host=MYSQL_HOST, - user=MYSQL_USER, - passwd=MYSQL_PASSWD, - db=MYSQL_DB, - connect_timeout=5, - ) - mycr = mydb.cursor() - mycr.execute('''select count(*) - from glpi_tickets - where closedate is NULL and solvedate is NULL;''') - row = mycr.fetchone() - if row: - open_tickets = int(row[0]) - if i3status_config['colors']: - if open_tickets > CRIT_THRESHOLD: - response.update({'color': i3status_config['color_bad']}) - elif open_tickets > WARN_THRESHOLD: - response.update( - {'color': i3status_config['color_degraded']} - ) - response['full_text'] = '%s tickets' % open_tickets - mydb.close() - - return (POSITION, response) diff --git a/.i3/py3status/backup/i3bar_click_events.py b/.i3/py3status/backup/i3bar_click_events.py deleted file mode 100644 index 792965c..0000000 --- a/.i3/py3status/backup/i3bar_click_events.py +++ /dev/null @@ -1,127 +0,0 @@ -from subprocess import Popen -from time import time - - -class Py3status: - """ - This module allows you to take actions based on click events made on - the i3status modules. For example, thanks to this module you could - launch the wicd GUI when clicking on the ethernet or wireless module - of your i3status output ! - - IMPORTANT: - This module file name is reserved and should NOT be changed if you - want py3status to handle your i3status modules click events ! - - The behavior described above will only work if this file is named - 'i3bar_click_events.py' ! - """ - def __init__(self): - """ - This is where you setup your actions based on your i3status config. - - Configuration: - -------------- - self.actions = { - "": { -