This commit is contained in:
Abhorrent_Anger 2019-10-30 08:55:50 +02:00
parent c4c649fa88
commit 9f9dd97a87
1 changed files with 14 additions and 20 deletions

View File

@ -5,22 +5,13 @@ import prof
last_window_jid = None last_window_jid = None
unfocused_jid = {} unfocused_jid = {}
def test_thread(): def led_notify(state_on=True):
pass
def call_command(state_on=True):
if state_on: if state_on:
command = prof.settings_string_get("lednotification", "command_on", "xset led 3") command = prof.settings_string_get("lednotification", "command_on", "xset led 3")
else: else:
command = prof.settings_string_get("lednotification", "command_off", "xset -led 3") command = prof.settings_string_get("lednotification", "command_off", "xset -led 3")
subprocess.call(command, shell=True) subprocess.call(command, shell=True)
def enable_led(state_on=True): # Can be expanded for different ways to call LED changes
call_command(state_on)
def led_notify(state_on=True):
enable_led(state_on)
def prof_on_chat_win_focus(barejid): def prof_on_chat_win_focus(barejid):
on_focus(barejid) on_focus(barejid)
return None return None
@ -106,12 +97,15 @@ def _cmd_say(arg1=None, arg2=None):
prof.cons_show(test_message_off) prof.cons_show(test_message_off)
prof_on_chat_win_focus(barejid) prof_on_chat_win_focus(barejid)
prof.cons_show(test_message_fin) prof.cons_show(test_message_fin)
else: else:
print_settings()
def print_settings():
enabled = prof.settings_string_get("lednotification", "enabled", "on") enabled = prof.settings_string_get("lednotification", "enabled", "on")
command_on = prof.settings_string_get("lednotification", "command_on", "xset led 3") command_on = prof.settings_string_get("lednotification", "command_on", "xset led 3")
command_off = prof.settings_string_get("lednotification", "command_off", "xset -led 3") command_off = prof.settings_string_get("lednotification", "command_off", "xset -led 3")
rooms = prof.settings_string_get("lednotification", "rooms", "off") rooms = prof.settings_string_get("lednotification", "rooms", "off")
prof.cons_show("")
prof.cons_show("LED notification plugin settings:") prof.cons_show("LED notification plugin settings:")
prof.cons_show("enabled: " + enabled) prof.cons_show("enabled: " + enabled)
prof.cons_show("command on: " + command_on) prof.cons_show("command on: " + command_on)