summaryrefslogtreecommitdiff
path: root/plugin/blinkyfications.pl
blob: 6736e87f61f3e65558afff84d457e0d80cd41b83 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#
# blinkyfication
#
#
# Copyright (C) 2016 Christian Pointner <equinox@spreadspace.org>
#
# This file is part of blinkyfication.
#
# blinkyfication is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Free Software Foundation.
#
# blinkyfication is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with blinkyfication. If not, see <http://www.gnu.org/licenses/>.
#
use Purple;

%PLUGIN_INFO = (
  perl_api_version => 2,
  name => "blinkyfications",
  version => "0.1",
  summary => "Make notifications blink again!",
  description => "Blink when there are messages or other events.",
  author => "Christian Pointner <equinox\@spreadspace.org>",
  url => "https://git.spreadspace.org/blinkyfications.git",
  load => "plugin_load",
  unload => "plugin_unload",
  prefs_info => "prefs_info_cb"
);

sub plugin_init {
  return %PLUGIN_INFO;
}

sub plugin_load {
  my $plugin = shift;
  Purple::Debug::info("blinkyfications", "make notifications blink again!\n");
  Purple::Prefs::add_none("/plugins/core/blinkyfications");
  Purple::Prefs::add_string("/plugins/core/blinkyfications/device", "/dev/ttyACM0");
}

sub plugin_unload {
  my $plugin = shift;
  Purple::Debug::info("blinkyfications", "i get it, i'm just too damn blinky... bye-bye!\n");
}

sub prefs_info_cb {
  $frame = Purple::PluginPref::Frame->new();

  $ppref = Purple::PluginPref->new_with_name_and_label("/plugins/core/blinkyfications/device", "Blinky-Device");
  $ppref->set_type(2);
  $ppref->set_max_length(32);
  $frame->add($ppref);

  return $frame;
}