Changed path configuration to its own file. Now user don't need to edit the python script to change path.

main
YandolsZX 2 years ago
parent 0869602195
commit c676cb31e7
  1. 9
      chatterino_process_monitor.py
  2. 4
      settings.ini

@ -1,3 +1,4 @@
import configparser
import psutil
import time
import os
@ -38,9 +39,11 @@ def create_tray_icon():
if __name__ == '__main__':
print("Yandols' Chatterino Process Monitor Script")
# Set path to Chatterino
program_executable = "chatterino.exe"
program_dir = "C:\\Program Files\\Chatterino7"
# Load settings from config file
config = configparser.ConfigParser()
config.read('settings.ini')
program_executable = config.get('ChatterinoMonitor', 'chatterino_exe')
program_dir = config.get('ChatterinoMonitor', 'chatterino_directory')
program_path = program_dir + "\\" + program_executable
# Create system tray icon

@ -0,0 +1,4 @@
[ChatterinoMonitor]
chatterino_exe=chatterino.exe
chatterino_directory=C:\\Program Files\\Chatterino7
# Please use double slashes \\ in your paths if a single slash \ does not work for you.
Loading…
Cancel
Save