Просмотр исходного кода

added arch pkgbuild and desktop file

Thomas Buck 5 лет назад
Родитель
Сommit
5338765680
5 измененных файлов: 72 добавлений и 8 удалений
  1. 24
    0
      linux/PKGBUILD
  2. 15
    0
      linux/README.md
  3. 23
    8
      linux/caselights
  4. 0
    0
      linux/caselights_icon.png
  5. 10
    0
      linux/de.xythobuz.caselights.desktop

+ 24
- 0
linux/PKGBUILD Просмотреть файл

@@ -0,0 +1,24 @@
1
+# Maintainer: Thomas Buck <thomas@xythobuz.de>
2
+pkgname=CaseLights
3
+pkgver=0.1
4
+pkgrel=1
5
+pkgdesc="RGB LED and UV strip controls"
6
+arch=('any')
7
+license=('unknown')
8
+depends=('python-pyqt5'
9
+         'python-pyserial')
10
+source=("caselights"
11
+        "caselights_icon.png"
12
+        "de.xythobuz.caselights.desktop")
13
+md5sums=(SKIP
14
+         SKIP
15
+         SKIP)
16
+
17
+package() {
18
+	mkdir -p "$pkgdir/usr/bin"
19
+	cp caselights "$pkgdir/usr/bin/caselights"
20
+	mkdir -p "$pkgdir/usr/share/pixmaps"
21
+	cp caselights_icon.png "$pkgdir/usr/share/pixmaps/caselights_icon.png"
22
+	mkdir -p "$pkgdir/usr/share/applications"
23
+	cp de.xythobuz.caselights.desktop "$pkgdir/usr/share/applications/de.xythobuz.caselights.desktop"
24
+}

+ 15
- 0
linux/README.md Просмотреть файл

@@ -0,0 +1,15 @@
1
+# CaseLights Linux Qt client
2
+
3
+Simple Python Qt Linux client for CaseLights. Install on Arch Linux like this:
4
+
5
+    makepkg
6
+    sudo pacman -U CaseLights-0.1.1-any.pkg.tar.xz
7
+
8
+Or on all other linux distros:
9
+
10
+	sudo cp caselights /usr/bin/caselights
11
+	sudo cp caselights_icon.png /usr/share/pixmaps/caselights_icon.png
12
+	sudo cp de.xythobuz.caselights.desktop /usr/share/applications/de.xythobuz.caselights.desktop
13
+
14
+Then run it from your desktop environment menu or even add it to the autostart there.
15
+

linux/caselights.py → linux/caselights Просмотреть файл

@@ -1,20 +1,26 @@
1
+#!/usr/bin/env python3
2
+
1 3
 # CaseLights Linux Qt System Tray client
2 4
 # depends on:
3 5
 # - python-pyqt5
4 6
 # - python-pyserial
5 7
 
6
-import sys
8
+import sys
9
+import os.path
7 10
 import serial, serial.tools, serial.tools.list_ports
8 11
 from PyQt5 import QtWidgets, QtGui, QtCore
9 12
 from PyQt5.QtWidgets import QSystemTrayIcon, QAction, QMenu
10 13
 from PyQt5.QtGui import QIcon, QPixmap
11 14
 from PyQt5.QtCore import QCoreApplication, QSettings
12 15
 
13
-class CaseLights():
16
+class CaseLights():
14 17
     name = "CaseLights"
15 18
     vendor = "xythobuz"
16 19
     version = "0.1"
17 20
 
21
+    iconPath = "/usr/share/pixmaps/"
22
+    iconName = "caselights_icon.png"
23
+
18 24
     staticColors = [
19 25
         [ "Off",     "0",   "0",   "0", None ],
20 26
         [ "Red",   "255",   "0",   "0", None ],
@@ -25,7 +31,6 @@ class CaseLights():
25 31
 
26 32
     usedPort = None
27 33
     serial = None
28
-
29 34
     menu = None
30 35
     portMenu = None
31 36
     portActions = None
@@ -44,10 +49,6 @@ class CaseLights():
44 49
         if self.usedPort is not None:
45 50
             self.connect()
46 51
 
47
-        pic = QPixmap(32, 32)
48
-        pic.load("icon.png")
49
-        icon = QIcon(pic)
50
-
51 52
         self.menu = QMenu()
52 53
 
53 54
         colorMenu = QMenu("&Colors")
@@ -72,11 +73,25 @@ class CaseLights():
72 73
         self.quitAction.triggered.connect(self.exit)
73 74
         self.menu.addAction(self.quitAction)
74 75
 
76
+        iconPathName = ""
77
+        if os.path.isfile(self.iconName):
78
+            iconPathName = self.iconName
79
+        elif os.path.isfile(self.iconPath + self.iconName):
80
+            iconPathName = self.iconPath + self.iconName
81
+        else:
82
+            print("no icon found")
83
+
84
+        icon = QIcon()
85
+        if iconPathName is not "":
86
+            pic = QPixmap(32, 32)
87
+            pic.load(iconPathName)
88
+            icon = QIcon(pic)
89
+
75 90
         trayIcon = QSystemTrayIcon(icon)
76 91
         trayIcon.setToolTip(self.name + " " + self.version)
77 92
         trayIcon.setContextMenu(self.menu)
78 93
         trayIcon.setVisible(True)
79
-        
94
+
80 95
         sys.exit(app.exec_())
81 96
 
82 97
     def exit(self):

linux/icon.png → linux/caselights_icon.png Просмотреть файл


+ 10
- 0
linux/de.xythobuz.caselights.desktop Просмотреть файл

@@ -0,0 +1,10 @@
1
+[Desktop Entry]
2
+Type=Application
3
+Version=1.0
4
+Name=CaseLights
5
+Comment=RGB LED and UV strip controls
6
+Path=/usr/bin
7
+Exec=caselights
8
+Icon=/usr/share/pixmaps/caselights_icon.png
9
+Terminal=false
10
+Categories=Utility;

Загрузка…
Отмена
Сохранить