Edit code and rename files to prepare for .deb packaging
authorAdrian Iain Lam <adrianiainlam@users.noreply.github.com>
Mon, 18 Sep 2017 11:56:06 +0000 (19:56 +0800)
committerAdrian Iain Lam <adrianiainlam@users.noreply.github.com>
Mon, 18 Sep 2017 16:04:19 +0000 (00:04 +0800)
14 files changed:
icon.svg [deleted file]
indicator-keyboard-led.desktop [new file with mode: 0755]
indicator-keyboard-led.py
indicator-keyboard-led.svg [new file with mode: 0644]
locale/default.pot [deleted file]
locale/en/LC_MESSAGES/default.mo [deleted file]
locale/en/LC_MESSAGES/default.po [deleted file]
locale/en/LC_MESSAGES/indicator-keyboard-led.mo [new file with mode: 0644]
locale/en/LC_MESSAGES/indicator-keyboard-led.po [new file with mode: 0644]
locale/fr/LC_MESSAGES/default.mo [deleted file]
locale/fr/LC_MESSAGES/default.po [deleted file]
locale/fr/LC_MESSAGES/indicator-keyboard-led.mo [new file with mode: 0644]
locale/fr/LC_MESSAGES/indicator-keyboard-led.po [new file with mode: 0644]
locale/indicator-keyboard-led.pot [new file with mode: 0644]

diff --git a/icon.svg b/icon.svg
deleted file mode 100644 (file)
index d711e58..0000000
--- a/icon.svg
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-<svg
-   xmlns:dc="http://purl.org/dc/elements/1.1/"
-   xmlns:cc="http://creativecommons.org/ns#"
-   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-   xmlns:svg="http://www.w3.org/2000/svg"
-   xmlns="http://www.w3.org/2000/svg"
-   xmlns:xlink="http://www.w3.org/1999/xlink"
-   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
-   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
-   width="48px"
-   height="48px"
-   id="svg11300"
-   sodipodi:version="0.32"
-   inkscape:version="0.91 r13725"
-   sodipodi:docname="icon.svg"
-   inkscape:output_extension="org.inkscape.output.svg.inkscape"
-   version="1.1">
-  <metadata
-     id="metadata4">
-    <rdf:RDF>
-      <cc:Work
-         rdf:about="">
-        <dc:format>image/svg+xml</dc:format>
-        <dc:type
-           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
-        <dc:creator>
-          <dc:Agent>
-            <dc:title>Jakub Steiner</dc:title>
-          </dc:Agent>
-        </dc:creator>
-        <dc:contributor>Adrian I Lam</dc:contributor>
-        <dc:source>http://jimmac.musichall.cz</dc:source>
-        <cc:license
-           rdf:resource="http://creativecommons.org/licenses/publicdomain/" />
-        <dc:title>Caps Lock icon</dc:title>
-        <dc:subject>caps lock</dc:subject>
-      </cc:Work>
-      <cc:License
-         rdf:about="http://creativecommons.org/licenses/publicdomain/">
-        <cc:permits
-           rdf:resource="http://creativecommons.org/ns#Reproduction" />
-        <cc:permits
-           rdf:resource="http://creativecommons.org/ns#Distribution" />
-        <cc:permits
-           rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
-      </cc:License>
-    </rdf:RDF>
-  </metadata>
-  <g
-     id="layer1"
-     inkscape:label="Layer 1"
-     inkscape:groupmode="layer">
-    <path
-       style="fill:#dfdbd2;"
-       d="M 22.9375 3.0058594 C 15.653591 3.2371063 10.824219 6.7870543
-          10.824219 14.107422 L 10.824219 21.578125 L 9.1855469 21.578125 C
-          7.9827519 21.578125 7 22.41744 7 23.46875 L 7 43.109375 C 7 44.160685
-          7.9827519 45.000002 9.1855469 45 L 38.84375 45 C 40.046563 45 41
-          44.160684 41 43.109375 L 41 23.46875 C 41 22.417442 40.046563
-          21.578125 38.84375 21.578125 L 37.175781 21.578125 L 37.205078
-          14.228516 C 37.205078 6.4577795 31.964524 3.1017737 24.03125
-          3.0058594 C 23.661384 3.0013294 23.295735 2.9944354 22.9375 3.0058594
-          z M 23.666016 7.9160156 C 23.79987 7.9129356 23.953309 7.9160156
-          24.091797 7.9160156 C 32.893949 7.9160156 32.217687 14.260075
-          32.347656 16.150391 L 32.347656 21.578125 L 15.773438 21.578125 L
-          15.773438 16.181641 C 15.742128 14.306334 15.227932 8.1089033
-          23.666016 7.9160156 z M 22.21875 24 L 25.75 24 C 26.442384 25.281385
-          27.114759 26.580467 27.767578 27.896484 C 28.420397 29.212502
-          29.073744 30.598189 29.726562 32.052734 C 30.399164 33.50728
-          31.083007 35.048076 31.775391 36.675781 C 32.487557 38.303487
-          33.228487 40.077922 34 42 L 29.964844 42 C 29.68789 41.290043
-          29.400252 40.589125 29.103516 39.896484 C 28.80678 39.203844
-          28.521094 38.492898 28.244141 37.765625 L 19.578125 37.765625 C
-          19.301171 38.492898 19.015486 39.211918 18.71875 39.921875 L
-          17.886719 42 L 14 42 C 14.771513 40.077922 15.502929 38.303487
-          16.195312 36.675781 C 16.887696 35.048076 17.560072 33.50728
-          18.212891 32.052734 C 18.885492 30.598189 19.548353 29.212502
-          20.201172 27.896484 C 20.853991 26.580467 21.526366 25.281385
-          22.21875 24 z M 23.910156 27.480469 C 23.455161 28.398218 22.931362
-          29.516014 22.337891 30.832031 C 21.764201 32.148049 21.16038
-          33.576062 20.527344 35.117188 L 27.292969 35.117188 C 26.659932
-          33.576062 26.046597 32.138021 25.453125 30.804688 C 24.859653
-          29.471354 24.345369 28.363586 23.910156 27.480469 z "
-       id="path2086" />
-  </g>
-</svg>
diff --git a/indicator-keyboard-led.desktop b/indicator-keyboard-led.desktop
new file mode 100755 (executable)
index 0000000..78c9958
--- /dev/null
@@ -0,0 +1,10 @@
+#!/usr/bin/env xdg-open
+
+[Desktop Entry]
+Name=indicator-keyboard-led
+Type=Application
+Exec=/usr/bin/indicator-keyboard-led.py
+Icon=indicator-keyboard-led
+Hidden=false
+NoDisplay=false
+X-GNOME-Autostart-enabled=true
index 7f78bc6..9213a83 100755 (executable)
@@ -40,9 +40,9 @@ from gi.repository import Gdk, Gtk, AppIndicator3
 APP_NAME = 'indicator-keyboard-led'
 APP_VERSION = '1.1'
 
-SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
+ICON_LOCATION = '/usr/share/icons/hicolor/scalable/apps/' + APP_NAME + '.svg'
 import gettext
-t = gettext.translation('default', os.path.join(SCRIPT_DIR, 'locale'))
+t = gettext.translation(APP_NAME, '/usr/share/locale')
 _ = t.gettext
 
 class IndicatorKeyboardLED:
@@ -50,7 +50,7 @@ class IndicatorKeyboardLED:
         self.validate_order(order)
 
         self.indicator = AppIndicator3.Indicator.new(
-            APP_NAME, os.path.join(SCRIPT_DIR, 'icon.svg'),
+            APP_NAME, ICON_LOCATION,
             AppIndicator3.IndicatorCategory.APPLICATION_STATUS)
         self.indicator.set_status(AppIndicator3.IndicatorStatus.ACTIVE)
 
diff --git a/indicator-keyboard-led.svg b/indicator-keyboard-led.svg
new file mode 100644 (file)
index 0000000..d711e58
--- /dev/null
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="48px"
+   height="48px"
+   id="svg11300"
+   sodipodi:version="0.32"
+   inkscape:version="0.91 r13725"
+   sodipodi:docname="icon.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   version="1.1">
+  <metadata
+     id="metadata4">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:creator>
+          <dc:Agent>
+            <dc:title>Jakub Steiner</dc:title>
+          </dc:Agent>
+        </dc:creator>
+        <dc:contributor>Adrian I Lam</dc:contributor>
+        <dc:source>http://jimmac.musichall.cz</dc:source>
+        <cc:license
+           rdf:resource="http://creativecommons.org/licenses/publicdomain/" />
+        <dc:title>Caps Lock icon</dc:title>
+        <dc:subject>caps lock</dc:subject>
+      </cc:Work>
+      <cc:License
+         rdf:about="http://creativecommons.org/licenses/publicdomain/">
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#Reproduction" />
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#Distribution" />
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
+      </cc:License>
+    </rdf:RDF>
+  </metadata>
+  <g
+     id="layer1"
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer">
+    <path
+       style="fill:#dfdbd2;"
+       d="M 22.9375 3.0058594 C 15.653591 3.2371063 10.824219 6.7870543
+          10.824219 14.107422 L 10.824219 21.578125 L 9.1855469 21.578125 C
+          7.9827519 21.578125 7 22.41744 7 23.46875 L 7 43.109375 C 7 44.160685
+          7.9827519 45.000002 9.1855469 45 L 38.84375 45 C 40.046563 45 41
+          44.160684 41 43.109375 L 41 23.46875 C 41 22.417442 40.046563
+          21.578125 38.84375 21.578125 L 37.175781 21.578125 L 37.205078
+          14.228516 C 37.205078 6.4577795 31.964524 3.1017737 24.03125
+          3.0058594 C 23.661384 3.0013294 23.295735 2.9944354 22.9375 3.0058594
+          z M 23.666016 7.9160156 C 23.79987 7.9129356 23.953309 7.9160156
+          24.091797 7.9160156 C 32.893949 7.9160156 32.217687 14.260075
+          32.347656 16.150391 L 32.347656 21.578125 L 15.773438 21.578125 L
+          15.773438 16.181641 C 15.742128 14.306334 15.227932 8.1089033
+          23.666016 7.9160156 z M 22.21875 24 L 25.75 24 C 26.442384 25.281385
+          27.114759 26.580467 27.767578 27.896484 C 28.420397 29.212502
+          29.073744 30.598189 29.726562 32.052734 C 30.399164 33.50728
+          31.083007 35.048076 31.775391 36.675781 C 32.487557 38.303487
+          33.228487 40.077922 34 42 L 29.964844 42 C 29.68789 41.290043
+          29.400252 40.589125 29.103516 39.896484 C 28.80678 39.203844
+          28.521094 38.492898 28.244141 37.765625 L 19.578125 37.765625 C
+          19.301171 38.492898 19.015486 39.211918 18.71875 39.921875 L
+          17.886719 42 L 14 42 C 14.771513 40.077922 15.502929 38.303487
+          16.195312 36.675781 C 16.887696 35.048076 17.560072 33.50728
+          18.212891 32.052734 C 18.885492 30.598189 19.548353 29.212502
+          20.201172 27.896484 C 20.853991 26.580467 21.526366 25.281385
+          22.21875 24 z M 23.910156 27.480469 C 23.455161 28.398218 22.931362
+          29.516014 22.337891 30.832031 C 21.764201 32.148049 21.16038
+          33.576062 20.527344 35.117188 L 27.292969 35.117188 C 26.659932
+          33.576062 26.046597 32.138021 25.453125 30.804688 C 24.859653
+          29.471354 24.345369 28.363586 23.910156 27.480469 z "
+       id="path2086" />
+  </g>
+</svg>
diff --git a/locale/default.pot b/locale/default.pot
deleted file mode 100644 (file)
index cbdf24f..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-msgid ""
-msgstr ""
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-# indicator long label
-msgid "Num"
-msgstr ""
-
-# indicator long label
-msgid "Caps"
-msgstr ""
-
-# indicator long label
-msgid "Scroll"
-msgstr ""
-
-# indicator short label
-msgid "N"
-msgstr ""
-
-# indicator short label
-msgid "C"
-msgstr ""
-
-# indicator short label
-msgid "S"
-msgstr ""
-
-# menu entry
-msgid "Num Lock"
-msgstr ""
-
-# menu entry
-msgid "Caps Lock"
-msgstr ""
-
-# menu entry
-msgid "Scroll Lock"
-msgstr ""
-
-# menu entry
-msgid "Quit"
-msgstr ""
diff --git a/locale/en/LC_MESSAGES/default.mo b/locale/en/LC_MESSAGES/default.mo
deleted file mode 100644 (file)
index 1088045..0000000
Binary files a/locale/en/LC_MESSAGES/default.mo and /dev/null differ
diff --git a/locale/en/LC_MESSAGES/default.po b/locale/en/LC_MESSAGES/default.po
deleted file mode 100644 (file)
index 1370bfd..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-msgid ""
-msgstr ""
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-# indicator long label
-msgid "Num"
-msgstr "Num"
-
-# indicator long label
-msgid "Caps"
-msgstr "Caps"
-
-# indicator long label
-msgid "Scroll"
-msgstr "Scroll"
-
-# indicator short label
-msgid "N"
-msgstr "N"
-
-# indicator short label
-msgid "C"
-msgstr "C"
-
-# indicator short label
-msgid "S"
-msgstr "S"
-
-# menu entry
-msgid "Num Lock"
-msgstr "Num Lock"
-
-# menu entry
-msgid "Caps Lock"
-msgstr "Caps Lock"
-
-# menu entry
-msgid "Scroll Lock"
-msgstr "Scroll Lock"
-
-# menu entry
-msgid "Quit"
-msgstr "Quit"
diff --git a/locale/en/LC_MESSAGES/indicator-keyboard-led.mo b/locale/en/LC_MESSAGES/indicator-keyboard-led.mo
new file mode 100644 (file)
index 0000000..1088045
Binary files /dev/null and b/locale/en/LC_MESSAGES/indicator-keyboard-led.mo differ
diff --git a/locale/en/LC_MESSAGES/indicator-keyboard-led.po b/locale/en/LC_MESSAGES/indicator-keyboard-led.po
new file mode 100644 (file)
index 0000000..1370bfd
--- /dev/null
@@ -0,0 +1,45 @@
+msgid ""
+msgstr ""
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+# indicator long label
+msgid "Num"
+msgstr "Num"
+
+# indicator long label
+msgid "Caps"
+msgstr "Caps"
+
+# indicator long label
+msgid "Scroll"
+msgstr "Scroll"
+
+# indicator short label
+msgid "N"
+msgstr "N"
+
+# indicator short label
+msgid "C"
+msgstr "C"
+
+# indicator short label
+msgid "S"
+msgstr "S"
+
+# menu entry
+msgid "Num Lock"
+msgstr "Num Lock"
+
+# menu entry
+msgid "Caps Lock"
+msgstr "Caps Lock"
+
+# menu entry
+msgid "Scroll Lock"
+msgstr "Scroll Lock"
+
+# menu entry
+msgid "Quit"
+msgstr "Quit"
diff --git a/locale/fr/LC_MESSAGES/default.mo b/locale/fr/LC_MESSAGES/default.mo
deleted file mode 100644 (file)
index 011f9fc..0000000
Binary files a/locale/fr/LC_MESSAGES/default.mo and /dev/null differ
diff --git a/locale/fr/LC_MESSAGES/default.po b/locale/fr/LC_MESSAGES/default.po
deleted file mode 100644 (file)
index e1e6b04..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-msgid ""
-msgstr ""
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-# indicator long label
-msgid "Num"
-msgstr "Num"
-
-# indicator long label
-msgid "Caps"
-msgstr "Maj"
-
-# indicator long label
-msgid "Scroll"
-msgstr "Défil"
-
-# indicator short label
-msgid "N"
-msgstr "N"
-
-# indicator short label
-msgid "C"
-msgstr "M"
-
-# indicator short label
-msgid "S"
-msgstr "D"
-
-# menu entry
-msgid "Num Lock"
-msgstr "Verr num"
-
-# menu entry
-msgid "Caps Lock"
-msgstr "Verr Maj"
-
-# menu entry
-msgid "Scroll Lock"
-msgstr "Arrêt défil"
-
-# menu entry
-msgid "Quit"
-msgstr "Quitter"
diff --git a/locale/fr/LC_MESSAGES/indicator-keyboard-led.mo b/locale/fr/LC_MESSAGES/indicator-keyboard-led.mo
new file mode 100644 (file)
index 0000000..011f9fc
Binary files /dev/null and b/locale/fr/LC_MESSAGES/indicator-keyboard-led.mo differ
diff --git a/locale/fr/LC_MESSAGES/indicator-keyboard-led.po b/locale/fr/LC_MESSAGES/indicator-keyboard-led.po
new file mode 100644 (file)
index 0000000..e1e6b04
--- /dev/null
@@ -0,0 +1,45 @@
+msgid ""
+msgstr ""
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+# indicator long label
+msgid "Num"
+msgstr "Num"
+
+# indicator long label
+msgid "Caps"
+msgstr "Maj"
+
+# indicator long label
+msgid "Scroll"
+msgstr "Défil"
+
+# indicator short label
+msgid "N"
+msgstr "N"
+
+# indicator short label
+msgid "C"
+msgstr "M"
+
+# indicator short label
+msgid "S"
+msgstr "D"
+
+# menu entry
+msgid "Num Lock"
+msgstr "Verr num"
+
+# menu entry
+msgid "Caps Lock"
+msgstr "Verr Maj"
+
+# menu entry
+msgid "Scroll Lock"
+msgstr "Arrêt défil"
+
+# menu entry
+msgid "Quit"
+msgstr "Quitter"
diff --git a/locale/indicator-keyboard-led.pot b/locale/indicator-keyboard-led.pot
new file mode 100644 (file)
index 0000000..cbdf24f
--- /dev/null
@@ -0,0 +1,45 @@
+msgid ""
+msgstr ""
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+# indicator long label
+msgid "Num"
+msgstr ""
+
+# indicator long label
+msgid "Caps"
+msgstr ""
+
+# indicator long label
+msgid "Scroll"
+msgstr ""
+
+# indicator short label
+msgid "N"
+msgstr ""
+
+# indicator short label
+msgid "C"
+msgstr ""
+
+# indicator short label
+msgid "S"
+msgstr ""
+
+# menu entry
+msgid "Num Lock"
+msgstr ""
+
+# menu entry
+msgid "Caps Lock"
+msgstr ""
+
+# menu entry
+msgid "Scroll Lock"
+msgstr ""
+
+# menu entry
+msgid "Quit"
+msgstr ""