Skip to content

Commit

Permalink
Fix program trying to write config in the cwd
Browse files Browse the repository at this point in the history
  • Loading branch information
yezhiyi9670 committed Sep 20, 2024
1 parent 131c06a commit a4de7df
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 2 deletions.
30 changes: 30 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This file may be used to create an environment using:
# $ conda create --name <env> --file <this file>
# platform: win-64
altgraph=0.17.4=pypi_0
bzip2=1.0.8=h2bbff1b_6
ca-certificates=2024.7.2=haa95532_0
expat=2.6.3=h5da7b33_0
libffi=3.4.4=hd77b12b_1
openssl=3.0.15=h827c3e9_0
packaging=24.1=pypi_0
pefile=2024.8.26=pypi_0
pillow=10.4.0=pypi_0
pip=24.2=py312haa95532_0
psutil=6.0.0=pypi_0
pyinstaller=6.10.0=pypi_0
pyinstaller-hooks-contrib=2024.8=pypi_0
pynput=1.7.7=pypi_0
pystray=0.19.5=pypi_0
python=3.12.4=h14ffc60_1
pywin32-ctypes=0.2.3=pypi_0
setuptools=72.1.0=py312haa95532_0
six=1.16.0=pypi_0
sqlite=3.45.3=h2bbff1b_0
tk=8.6.14=h0416ee5_0
tzdata=2024a=h04d1e81_0
vc=14.40=h2eaa2aa_0
vs2015_runtime=14.40.33807=h98bb1dd_0
wheel=0.43.0=py312haa95532_0
xz=5.4.6=h8cc25b3_1
zlib=1.2.13=h8cc25b3_1
15 changes: 13 additions & 2 deletions slow-mouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,18 @@
import ctypes
import sys

version = '0.1.5'
version = '0.1.6'

def is_packaged():
if getattr(sys, 'frozen', False) and hasattr(sys, '_MEIPASS'):
return True
else:
return False

def get_program_dir():
return os.path.dirname(sys.executable if is_packaged() else __file__)

os.chdir(get_program_dir())

# ======= Self detect =======
class SelfDetect:
Expand Down Expand Up @@ -179,4 +190,4 @@ def set_key(val: str):

'Start'
if __name__ == '__main__':
icon_loop()
icon_loop()

0 comments on commit a4de7df

Please sign in to comment.