fixed gui, fixed systemd service file in install script

This commit is contained in:
Josh Ashton
2023-12-11 12:36:47 -07:00
parent 268b14ebd3
commit 60e9844b92
2 changed files with 7 additions and 7 deletions
+6 -7
View File
@@ -15,11 +15,10 @@ hover = '#C6CAED'
class Application(ctk.CTk): class Application(ctk.CTk):
def __init__(self): def __init__(self):
super().__init__(master) super().__init__()
self.master = master self.title("Battery Monitor")
self.master.title("Battery Monitor") self.geometry("960x540")
self.master.geometry("960x540") self.resizable(False, False)
self.master.resizable(False, False)
data = [] data = []
@@ -45,12 +44,12 @@ class Application(ctk.CTk):
ax.grid() ax.grid()
# Create a canvas to display the plot in the Tkinter window # Create a canvas to display the plot in the Tkinter window
canvas = FigureCanvasTkAgg(fig, master=root) canvas = FigureCanvasTkAgg(fig, master=self)
canvas.get_tk_widget().pack() canvas.get_tk_widget().pack()
def read_file(self, data): def read_file(self, data):
with open('/usr/local/etc/data.txt', 'r') as f: with open('/usr/local/etc/data.txt', 'r') as f:
reader = csv.reader(csvfile) reader = csv.reader(f)
for row in reader: for row in reader:
data.append(row) data.append(row)
+1
View File
@@ -46,6 +46,7 @@ if [[ "$OSTYPE" == "linux-gnu"* ]]; then
sudo echo "[Unit]" > $SERVICE sudo echo "[Unit]" > $SERVICE
sudo echo "Description=Battery Monitor" >> $SERVICE sudo echo "Description=Battery Monitor" >> $SERVICE
sudo echo "After=network.target" >> $SERVICE
sudo echo "[Service]" >> $SERVICE sudo echo "[Service]" >> $SERVICE
sudo echo "ExecStart=$CWD/battery-mon" >> $SERVICE sudo echo "ExecStart=$CWD/battery-mon" >> $SERVICE
sudo echo "User=$USER" >> $SERVICE sudo echo "User=$USER" >> $SERVICE