rebuild into very basic version and changend build/install method to nuitka and ~/.bin/lc
This commit is contained in:
parent
e3bd42a19d
commit
47cf161af5
2
controller/build.sh
Executable file
2
controller/build.sh
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
# python -m nuitka --follow-imports main.py
|
||||||
|
python -m nuitka main.py
|
||||||
@ -1,6 +1,9 @@
|
|||||||
mkdir -p ~/.config/lc
|
# mkdir -p ~/.config/lc
|
||||||
cp cava.conf ~/.config/lc/cava.conf
|
# cp cava.conf ~/.config/lc/cava.conf
|
||||||
sudo chmod 666 ~/.config/lc/cava.conf
|
# sudo chmod 666 ~/.config/lc/cava.conf
|
||||||
sudo mkdir -p /var/lib/lc
|
# sudo mkdir -p /var/lib/lc
|
||||||
sudo cp gui.py controller.py /var/lib/lc/
|
# sudo cp gui.py controller.py /var/lib/lc/
|
||||||
sudo ln -s /var/lib/lc/controller.py /bin/lc
|
# sudo ln -s /var/lib/lc/controller.py /bin/lc
|
||||||
|
|
||||||
|
mkdir -p ~/.bin
|
||||||
|
cp main.bin ~/.bin/lc
|
||||||
|
|||||||
@ -1,23 +1,10 @@
|
|||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
import socket
|
import socket
|
||||||
import os
|
import os
|
||||||
import subprocess
|
|
||||||
from threading import Thread
|
|
||||||
import curses
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import click
|
|
||||||
import pickle
|
import pickle
|
||||||
import re
|
import re
|
||||||
import webview
|
import sys
|
||||||
|
|
||||||
# function generate fibonacci sequence
|
|
||||||
def fibonacci(n):
|
|
||||||
if n == 0:
|
|
||||||
return 0
|
|
||||||
elif n == 1:
|
|
||||||
return 1
|
|
||||||
else:
|
|
||||||
return fibonacci(n-1) + fibonacci(n-2)
|
|
||||||
|
|
||||||
async def scan_for_pi() -> dict():
|
async def scan_for_pi() -> dict():
|
||||||
ip = socket.gethostbyname(socket.gethostname())
|
ip = socket.gethostbyname(socket.gethostname())
|
||||||
@ -66,7 +53,7 @@ def load_config(path=os.path.expanduser("~/.config/lc/lc.conf")):
|
|||||||
with open(path, 'rb') as f:
|
with open(path, 'rb') as f:
|
||||||
return [PI(ip) for ip in pickle.load(f)]
|
return [PI(ip) for ip in pickle.load(f)]
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
print("Config does not exist")
|
print(f"Config does not exist. Run {sys.argv[0]} search.")
|
||||||
exit()
|
exit()
|
||||||
|
|
||||||
def save_config(obj, path=os.path.expanduser("~/.config/lc/lc.conf")):
|
def save_config(obj, path=os.path.expanduser("~/.config/lc/lc.conf")):
|
||||||
@ -84,21 +71,14 @@ def set_pixels(color):
|
|||||||
pi.send(color)
|
pi.send(color)
|
||||||
pi.disconnect()
|
pi.disconnect()
|
||||||
|
|
||||||
@click.command()
|
|
||||||
@click.argument("arg", nargs=-1)
|
|
||||||
# @click.option("-s", help="Set HEX Color: -s ffffff")
|
|
||||||
# @click.option("-v", help="Set HEX Color as base visualizer color: -v ffffff")
|
|
||||||
def main(arg):
|
def main(arg):
|
||||||
if arg == ():
|
arg = ('help') if len(arg) == 0 else arg
|
||||||
pass
|
|
||||||
|
|
||||||
match arg[0]:
|
match arg[0]:
|
||||||
case "help":
|
|
||||||
print("lc [help|set|search|list]")
|
|
||||||
|
|
||||||
case "set":
|
case "set":
|
||||||
if len(arg) < 2:
|
if len(arg) < 2:
|
||||||
print("color argument missing")
|
print("color argument missing")
|
||||||
|
return
|
||||||
set_pixels(arg[1])
|
set_pixels(arg[1])
|
||||||
|
|
||||||
case "search":
|
case "search":
|
||||||
@ -114,8 +94,13 @@ def main(arg):
|
|||||||
case "music":
|
case "music":
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
case _:
|
||||||
|
print("lc [help|set|search|list]")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main(sys.argv[1:])
|
||||||
|
|
||||||
# def helpmenu():
|
# def helpmenu():
|
||||||
# print("light controll\n")
|
# print("light controll\n")
|
||||||
@ -1,54 +0,0 @@
|
|||||||
altair==5.0.1
|
|
||||||
altgraph==0.17.3
|
|
||||||
attrs==23.1.0
|
|
||||||
blinker==1.6.2
|
|
||||||
bottle==0.12.25
|
|
||||||
cachetools==5.3.1
|
|
||||||
certifi==2023.5.7
|
|
||||||
charset-normalizer==3.1.0
|
|
||||||
click==8.1.3
|
|
||||||
decorator==5.1.1
|
|
||||||
gitdb==4.0.10
|
|
||||||
GitPython==3.1.31
|
|
||||||
idna==3.4
|
|
||||||
importlib-metadata==6.7.0
|
|
||||||
Jinja2==3.1.2
|
|
||||||
jsonschema==4.17.3
|
|
||||||
markdown-it-py==3.0.0
|
|
||||||
MarkupSafe==2.1.3
|
|
||||||
mdurl==0.1.2
|
|
||||||
numpy==1.25.0
|
|
||||||
packaging==23.1
|
|
||||||
pandas==2.0.3
|
|
||||||
Pillow==9.5.0
|
|
||||||
protobuf==4.23.3
|
|
||||||
proxy-tools==0.1.0
|
|
||||||
pyarrow==12.0.1
|
|
||||||
pycairo==1.24.0
|
|
||||||
pydeck==0.8.1b0
|
|
||||||
Pygments==2.15.1
|
|
||||||
PyGObject==3.44.1
|
|
||||||
pyinstaller==5.13.0
|
|
||||||
pyinstaller-hooks-contrib==2023.4
|
|
||||||
Pympler==1.0.1
|
|
||||||
pyrsistent==0.19.3
|
|
||||||
python-dateutil==2.8.2
|
|
||||||
pytz==2023.3
|
|
||||||
pytz-deprecation-shim==0.1.0.post0
|
|
||||||
pywebview==4.2.2
|
|
||||||
requests==2.31.0
|
|
||||||
rich==13.4.2
|
|
||||||
six==1.16.0
|
|
||||||
smmap==5.0.0
|
|
||||||
streamlit==1.24.0
|
|
||||||
tenacity==8.2.2
|
|
||||||
toml==0.10.2
|
|
||||||
toolz==0.12.0
|
|
||||||
tornado==6.3.2
|
|
||||||
typing_extensions==4.7.0
|
|
||||||
tzdata==2023.3
|
|
||||||
tzlocal==4.3.1
|
|
||||||
urllib3==2.0.3
|
|
||||||
validators==0.20.0
|
|
||||||
watchdog==3.0.0
|
|
||||||
zipp==3.15.0
|
|
||||||
Loading…
Reference in New Issue
Block a user