diff --git a/gui/.vscode/settings.json b/gui/.vscode/settings.json new file mode 100644 index 0000000..d2a6c12 --- /dev/null +++ b/gui/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "python.pythonPath": "/usr/bin/python" +} \ No newline at end of file diff --git a/gui/app.spec b/gui/app.spec new file mode 100644 index 0000000..cf3ab07 --- /dev/null +++ b/gui/app.spec @@ -0,0 +1,33 @@ +# -*- mode: python ; coding: utf-8 -*- + +block_cipher = None + + +a = Analysis(['app.py'], + pathex=['/home/julian/git/audioMux/gui'], + binaries=[], + datas=[], + hiddenimports=[], + hookspath=[], + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False) +pyz = PYZ(a.pure, a.zipped_data, + cipher=block_cipher) +exe = EXE(pyz, + a.scripts, + a.binaries, + a.zipfiles, + a.datas, + [], + name='app', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + upx_exclude=[], + runtime_tmpdir=None, + console=False ) diff --git a/gui/dist/gui_linux b/gui/dist/gui_linux new file mode 100755 index 0000000..dd2d3ac Binary files /dev/null and b/gui/dist/gui_linux differ diff --git a/gui/icon.svg b/gui/icon.svg new file mode 100644 index 0000000..e51b82a --- /dev/null +++ b/gui/icon.svg @@ -0,0 +1,77 @@ + + + + + + + + + + image/svg+xml + + + + + + + + 1 + + diff --git a/gui/icon/1.png b/gui/icon/1.png new file mode 100644 index 0000000..f0478ba Binary files /dev/null and b/gui/icon/1.png differ diff --git a/gui/tray.py b/gui/tray.py new file mode 100644 index 0000000..445488c --- /dev/null +++ b/gui/tray.py @@ -0,0 +1,55 @@ +import wx +from wx import adv + +def create_menu_item(menu, label, func): + item = wx.MenuItem(menu, -1, label) + menu.Bind(wx.EVT_MENU, func, id=item.GetId()) + menu.AppendItem(item) + return item + + +class Tray(wx.adv.TaskBarIcon): + def __init__(self, parent): + super().__init__() + self.Bind(wx.adv.EVT_TASKBAR_LEFT_DOWN, self.OnLeftDown) + self.SetIcon(wx.Icon("icon/1.png")) + self.parent = parent + + def CreatePopupMenu(self): + menu = wx.Menu() + hidem = wx.MenuItem(menu, wx.ID_ANY, 'Show Window') + menu.Bind(wx.EVT_MENU, self.ShowParent, id=hidem.GetId()) + menu.Append(hidem) + menu.AppendSeparator() + + quitm = wx.MenuItem(menu, wx.ID_ANY, 'Quit') + menu.Bind(wx.EVT_MENU, self.OnExit, id=quitm.GetId()) + menu.Append(quitm) + return menu + + def CreateSelectionMenu(self): + return None + + def OnLeftDown(self, event): + menu = self.CreateSelectionMenu() + if menu: + self.PopupMenu(menu) + + + def OnExit(self, event): + # close self and parent + wx.CallAfter(self.Destroy) + wx.CallAfter(self.parent.Destroy) + + def ShowParent(self, evt): + self.parent.Show() + +if __name__ == "__main__": + app = wx.App() + + + # create an empty frame to keep the main loop running + Tray(wx.Frame(None)) + + app.MainLoop() + \ No newline at end of file