[flashing_keyboard] Remove plugin

Plugin does not work at the moment and will not work on Wayland
This commit is contained in:
Daniel Brötzmann
2020-04-29 21:31:34 +02:00
parent 3c904fa5de
commit 95d3b872ae
5 changed files with 0 additions and 208 deletions

View File

@@ -1 +0,0 @@
from .flashing_keyboard import FlashingKeyboard

View File

@@ -1,87 +0,0 @@
<?xml version="1.0"?>
<interface>
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy toplevel-contextual -->
<object class="GtkWindow" id="window1">
<child>
<object class="GtkTable" id="config_table">
<property name="visible">True</property>
<property name="border_width">6</property>
<property name="n_rows">3</property>
<property name="n_columns">2</property>
<property name="column_spacing">7</property>
<property name="row_spacing">5</property>
<child>
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">command 1:</property>
</object>
<packing>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">command 2:</property>
</object>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="command1">
<property name="width_request">300</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkEntry" id="command2">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="flash_cb">
<property name="label" translatable="yes">Do not flash the LED, only switch it on.</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="y_options"/>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
</child>
</object>
</interface>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 311 B

View File

@@ -1,111 +0,0 @@
import subprocess
from gi.repository import Gtk
from gi.repository import GObject
from gajim.common import app
from gajim.plugins import GajimPlugin
from gajim.plugins.helpers import log_calls
from gajim.plugins.gui import GajimPluginConfigDialog
from gajim.plugins.plugins_i18n import _
class FlashingKeyboard(GajimPlugin):
@log_calls('FlashingKeyboard')
def init(self):
self.description = _('Flashing keyboard led when there are unread messages.')
self.config_dialog = FlashingKeyboardPluginConfigDialog(self)
self.config_default_values = {
'command1': ("xset led named 'Scroll Lock'", ''),
'command2': ("xset -led named 'Scroll Lock'", ''),
'flash': (True, ''),
}
self.is_active = None
self.timeout = 500
self.timeout_off = int(self.timeout / 2)
self.id_0 = None
def on_event_added(self, event):
if event.show_in_systray:
self.flash_trigger()
def on_event_removed(self, event_list):
self.flash_trigger()
def flash_trigger(self):
if app.events.get_nb_systray_events():
if self.id_0:
return
if self.config['flash']:
self.id_0 = GObject.timeout_add(self.timeout, self.led_on)
else:
self.led_on()
self.id_0 = True
else:
if self.id_0:
if self.config['flash']:
GObject.source_remove(self.id_0)
self.id_0 = None
self.led_off()
def led_on(self):
subprocess.Popen('%s' % self.config['command1'], shell=True).wait()
if self.config['flash']:
GObject.timeout_add(self.timeout_off, self.led_off)
return True
def led_off(self):
subprocess.Popen('%s' % self.config['command2'], shell=True).wait()
@log_calls('FlashingKeyboard')
def activate(self):
app.events.event_added_subscribe(self.on_event_added)
app.events.event_removed_subscribe(self.on_event_removed)
if app.events.get_nb_systray_events():
if self.config['flash']:
self.id_0 = GObject.timeout_add(self.timeout, self.led_on)
else:
self.led_on()
self.id_0 = True
@log_calls('FlashingKeyboard')
def deactivate(self):
app.events.event_added_unsubscribe(self.on_event_added)
app.events.event_removed_unsubscribe(self.on_event_removed)
if self.id_0:
GObject.source_remove(self.id_0)
self.led_off()
class FlashingKeyboardPluginConfigDialog(GajimPluginConfigDialog):
def init(self):
self.GTK_BUILDER_FILE_PATH = self.plugin.local_file_path(
'config_dialog.ui')
self.xml = Gtk.Builder()
self.xml.set_translation_domain('gajim_plugins')
self.xml.add_objects_from_file(self.GTK_BUILDER_FILE_PATH,
['config_table'])
config_table = self.xml.get_object('config_table')
self.get_child().pack_start(config_table, True, True, 0)
self.xml.connect_signals(self)
def on_run(self):
self.isactive = self.plugin.active
if self.plugin.active:
app.plugin_manager.deactivate_plugin(self.plugin)
for name in ('command1', 'command2'):
widget = self.xml.get_object(name)
widget.set_text(self.plugin.config[name])
widget = self.xml.get_object('flash_cb')
widget.set_active(not self.plugin.config['flash'])
def on_close_button_clicked(self, widget):
widget = self.xml.get_object('command1')
self.plugin.config['command1'] = widget.get_text()
widget = self.xml.get_object('command2')
self.plugin.config['command2'] = widget.get_text()
widget = self.xml.get_object('flash_cb')
self.plugin.config['flash'] = not widget.get_active()
if self.isactive:
app.plugin_manager.activate_plugin(self.plugin)
GajimPluginConfigDialog.on_close_button_clicked(self, widget)

View File

@@ -1,9 +0,0 @@
[info]
name: Flashing Keyboard
short_name: flashing_keyboard
version: 1.3.0
description: Flashing keyboard LED when there are unread messages.
authors: Denis Fomin <fominde@gmail.com>
homepage: https://dev.gajim.org/gajim/gajim-plugins/wikis/flashingkeyboardplugin
min_gajim_version: 1.2.91
max_gajim_version: 1.3.90