Futura-Py / TimerX

A fluent Timer App, made completely in Python
https://timerx-app.netlify.app
MIT License
37 stars 5 forks source link

Just a command runner #113

Closed im-coder-lg closed 1 year ago

im-coder-lg commented 1 year ago

My new feature. @not-nef if you want, I'll make it even for Txt2.

Just is a command runner, like GNU Make, but easier and even with Windows support(make sure you have Git Bash too, it needs sh), so we can now just run simple commands than a long command.

If you want, I can add more scripts(or recipes) too.

Just: https://just.systems

netlify[bot] commented 1 year ago

Deploy Preview for timerx-app ready!

Name Link
Latest commit 749c9478cfa66d2aa1e4b3eff255844e6061962f
Latest deploy log https://app.netlify.com/sites/timerx-app/deploys/633fe9a75df3da00094b4b2b
Deploy Preview https://deploy-preview-113--timerx-app.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

im-coder-lg commented 1 year ago

And gradients for the site are not inbuilt, we need custom CSS.

im-coder-lg commented 1 year ago

This needs more work with PowerShell and Bash.

sumeshir26 commented 1 year ago

NICE!

not-nef commented 1 year ago

What commands is it supposed to run?

im-coder-lg commented 1 year ago

Check the Justfile on my branch!

sumeshir26 commented 1 year ago

@not-nef you need to install Just, which is a reallay powerfull command runner. I find it reallay usefull since I made a just script to build a exe

im-coder-lg commented 1 year ago

And it works even on Windows, so it's universal. Make sure you have Git Bash, Just needs a sh shell to work.

not-nef commented 1 year ago

Cool! I dont really see any use for it in txt2. I can have my batchfile execute the one thing i need which is compile an exe

im-coder-lg commented 1 year ago

Yeah, but you can't keep it for long, right? If Txt2 reaches prod, you have to make sure the repo is clean, right? One file to manage all builds would be better than multiple compilation files that should be in the ci folder.

im-coder-lg commented 1 year ago

Also, guys I think PyInstaller works properly now. The only issue is that even if Tkinter is installed on macOS or Linux, it doesn't recognize the module. It is rather, a system-level issue or an upstream issue, and since cx_Freeze seems to cause us a bit of inconvenience, I think it's time to jump boats.

I will, of course find a roundabout to use PyInstaller builds successfully on Macs and Linux PCs. Till then, it's best we use PyInstaller for Windows.

not-nef commented 1 year ago

Yeah but i cant make mac builds on windows so i will only need one command and it doesn't really matter if i hav a justfile or one batchfile

im-coder-lg commented 1 year ago

Who said you need a Mac to make Mac builds? Try AppImages, they can be an all-in-one package with an install script. Trust me, it works.

im-coder-lg commented 1 year ago

I found this on Reddit. It is two years old, but I bet it works.

https://www.reddit.com/r/Python/comments/gia4b1/making_python_appimages_using_a_single_command/

im-coder-lg commented 1 year ago

PS: AppImages work on macOS too.

sumeshir26 commented 1 year ago

@im-coder-lg We can use linuxdeploy for the AppData folder

sumeshir26 commented 1 year ago

I mean AppDir folder

im-coder-lg commented 1 year ago

There is nothing on Linux called AppDir. If you are talking libraries, the correct path is /usr/lib.

im-coder-lg commented 1 year ago

And anyone know about how to successfully run PyInstaller on Linux without missing dependency issues?

sumeshir26 commented 1 year ago

No, to build a AppImage you need a AppDir directory in the project root. Check the python-appimage docs What missibg deps error are you getting?

im-coder-lg commented 1 year ago

Yeah, Tkinter gone. Even though I installed it from the Pop!_ OS APT repos, which means the file can't find the module. I have an idea, I'll try tomorrow. Get some sleep guys.

sumeshir26 commented 1 year ago

Try installing from sudo apt-get install python3-tk

im-coder-lg commented 1 year ago

I just did this: sudo nala install python3-tk python-tk tk-dev -y to get all Tkinter files, and I think I know a fix. I'll do it tomorrow, and it's literally 10:21 PM IST, get some sleep.

im-coder-lg commented 1 year ago

I think I got it. Try this command after installing all requirements:

user@host~$ pyinstaller ./main.py --onefile --windowed --collect-data sv_ttk --collect-all tkinter --collect-all playsound --collect-all darkdetect --icon "./assets/logo.ico"

Then move the executable to the directory where the assets are present, then run the executable.

im-coder-lg commented 1 year ago

@not-nef try the same on your Mac Mini too.

sumeshir26 commented 1 year ago

And we can use the inno setup CI to build a installer using github avtions

im-coder-lg commented 1 year ago

Oh goody

btw what is this:

https://github.com/Futura-Py/TimerX/blob/b33bced3de0ba13ffe0e14a943f6c4db11a0f374/main.py#L39

no title?

im-coder-lg commented 1 year ago

I need to change some paths of the main.py file for Linux, since we need to add it to the OS, we have to make a .desktop file, and make sure assets are accessible through a share folder. I have an idea, and I know it will work.

im-coder-lg commented 1 year ago

Then, I have to make a script that runs with sudo to move it to the /usr directories and copy the .desktop file to the app list and desktop.

HuyHung1408 commented 1 year ago

Oh goody

btw what is this:

https://github.com/Futura-Py/TimerX/blob/b33bced3de0ba13ffe0e14a943f6c4db11a0f374/main.py#L39

no title?

yep no window name

im-coder-lg commented 1 year ago

I have to fix this too... My holidays will be over tomorrow... Why is a teenage life so cursed like this?

im-coder-lg commented 1 year ago

I think we should stick with PyInstaller from now on. @not-nef can you build TimerX with the given command(above) and test it?

not-nef commented 1 year ago

Remind me tomorrow

not-nef commented 1 year ago

yo @HuyHung1408 can i get collab access for mica run i have some ideas for it

HuyHung1408 commented 1 year ago

yo @HuyHung1408 can i get collab access for mica run i have some ideas for it

I added it for ya

not-nef commented 1 year ago

Thanks

im-coder-lg commented 1 year ago

Just merging this, forgot this.