APP BLOCKER (macOS)
- 15 Devlogs
- 63 Total hours
I AM BUILDING AN APP BLOCKER WHICH WILL BLOCK THE APP FOR A SPECIFIC TIME AND THE TIME WOULD BE ENTERED BY THE USER
I AM BUILDING AN APP BLOCKER WHICH WILL BLOCK THE APP FOR A SPECIFIC TIME AND THE TIME WOULD BE ENTERED BY THE USER
Finally!!! I have created the MULTI-APP-BLOCKER!!! In this final session of app blocker I worked on the feature of blocking apps even after restarting the system if the current time is in the schedule. I literally worked on this feature for 3 days and it paid off. However this is not a strong feature because it takes around 3-5 minutes to block the application instantly after restarting the system. Normally, it immediately blocks the app. So, I worked on this feature in this final session and now I am going to set my APP BLOCKER out for rating soon. THANK YOU SO MUCH!!!
of so I have finally built a multi-app blocker. In this session I just made the GUI better, made a better backend and made it into a usable app. I added multiple schedule feature for a single app and then the feature of schedule types like today, specific date, specific days and every day from which the user can choose any and for multiple schedule I put a check that the second or the third or any later schedule should not overlap the earlier schedules. The App Blocker is working very nicely, but I want to fit the last piece of the puzzle and the is by making the App Blocker immune to computer restart or turning it on again after shutting down. So, I want to work on that that the app should be blocked even if the computer has been restarted or it has been turned on after shutting down. But, I can say that it is now a professional App Blocker and I would soon finish this project.
ok so finally, I have created a professional single-app blocker. In the earlier section, I wrote my code for JavaScript and I was thinking that I have created the app, but I was wrong. After writing the code, in this section, I downloaded electron and connected it to my code using two json files and 2 JavaScript files. After that I worked on error handling which was a very complicated part. Also I took the help of AI to identify what kind of errors can happen and what kind of handling I should put. Also, I created a section in my GUI where I would be giving the status of the app blocker like is the app blocked or is it not blocked or is there any problem. I have done this much and it is working ratty decently. Now I have decided to make it a Multi-App Blocker where the user can set different schedules for different apps and set when to block the apps like after setting the time on which days the user want to block the apps or else the user wants to block the app in two different sections. For eg- The user wants to block the app from 2:00 pm to 3 pm and then from 6 pm to 8 pm. So, I would be trying to keep that functionality also. And if possible, the coolest thing I would want to do is that allowing the user to keep a password on it so that no one can block unwanted apps for 24 hours. Hopefully, I can do all of this because I have this idea in my mid only and I have no planning so I would be working very hard till 31st October.
Let’s goooo everyone!! I have finally written my JavaScript code for my App Blocker. I am very happy as this was my first JavaScript code for this big project and I am very proud of myself as I wrote the whole code myself just taking the help of AI to know what step to take next. In this code I solved the time related problems like the checking of valid time, turning the time entered by the user into a 24 hour clock system and then turning it into a properly usable form. I also created a hardcoded list for now which included some app names, which would be replaced by my python list that would have all the app names downloaded in my system. And finally, I created an object containing app name, start time and end time. This object would be provided to my python code and it would block the app for that period of time.
Ok Everyone!! I have made the structure for my GUI and designed it properly. Now, the only thing left is JavaScript and the coming up of these languages together in Electron. But there is still one problem. Right now my App Blocker is blocking only one app at a time, butI want to make it multi-app blocker and also my app blocker is not working after it is closed, so I want it to work forever and keep checking the time.
Finally, I have completed the backend of my App Blocker and now I can start the work on my GUI and I would be using Electron to make my App Blocker into a real life desktop application. I am also very happy that Stardance has been extended till 31st October. I have given the final touches to my backend like the input of time by the user and in the future after making the GUI I would make the App Blocker block multiple apps. So, my next devlon would be of me updating you upon my GUI.
ok so I am posting this devlon cuz i got a message on slack that more than 10 hours would not be counted in the devlon time. So after HTML and CSS I am learning JavaScript to work and know about Electron and make the interface with it. Then i would do the small tasks such as setting the password and the user inputs at various places and multiple app blocking feature. I am learning JavaScript with Dave Gray’s JavaScript course(I know its a bit old but the best). And I have like 2 chapters left and then i would start learning about electron. And the best thing is that Stardance has been extended by 1 month.
ok so i have finally completed the course of CSS and HTML in just 5 days. this actually feels like an achievement to me. So, I learnt the basics of HTML and CSS that are required for my project. Now my next step would be to learn the basics of JavaScript and complete it in around 2 days and complete the APP BLOCKER.
ok everyone, in this devlok I have not created anything, but I have gained a lot of knowledge. So, to make the GUI of my APP BLOCKER I want to use Electron and for that in these 2 days I have learnt CSS and HTML which are the basic languages. earlier what I as doing was I knew very little about HTML but not CSS, so I had to use AI, but now I want to make APP BLOCKER without AI and for that I am learning HTML, CSS and JavaScript. So after these I would read about Electron and make the GUI for this APP BLOCKER. NOTE: given below is the screenshot of me learning not of the project.
Ok so earlier I was having a problem even after printing the deitionary and taking the number corresponding to it. the problem there was that my app blocker only blocked the apps that had no duplicates, which means like when i tried to block IDLE, I had 4 different versions of IDLE and after just telling my project that I need to block the IDLE it was not able to interpret which IDLE it had to block. So now I had to give it the parent folder also to find the mid but instead of trying two different ways to get the pid I gave the parent folder for every app and got the pid, hence dropping the idea of osascript. Then I continued my normal loop of blocking the app. Now I am happy it is blocking the app. Now i would first handle the small task like taking the start time and end time as the input from the user. Then I would add the feature of taking multiple apps as the input with their time and finally after all those things I would mage the GUI and end the project. In the image below is the part I added today.
ok so earlier I was using hardcoded list of apps to block them, then I started taking the app name as an input, but then I realised that I would then want the user to type the app name in a specific type that is needed by the osascript to provide me its pid. but then I got an idea to give a dropdown of apps downloaded in the user’s system and they just simply had to select that app. so, I used multiple lists and dictionaries and splitted the path of the app into the app name that can be displayed. for now I have made a dictionary with the names of apps and serial numbers corresponding to them so the user just have to select the number. but in future when I would make the gui, the user would then just have to click on it. but currently I am facing a problem that after am printing the names of apps and the user is selecting the number, some apps are being blocked and and some are not. so I am currently working on this problem. if somebody can help me, please comment below. it would be of great pleasure. THANK YOU!!
ok so earlier my I made the time tracker and the hardcoded list for particular apps and then merged both of them so that it would just close the hardcoded apps in that list but now I modified it and took input from the user, ran the terminal command mdfind to check if the app is running or not then used osascript to get the pid of the process and then used that pid to terminate the app. but there was a challenge to find the difference of closed apps and already running apps and after that to keep them blocked till the designated time. so today I worked on that and made a good app blocker which can be used but some modifications like the input of time from the user, input of multiple apps and creating the gui. so after working on that my program would be ready.
let’s go, today I added the loop for my program which was very important because earlier my program was just closing the app if it was running, but the user can again open it. now they couldn’t because I put all of that terminating part inside a loop that would work continuously for that time period.
ok so this is my second devlog for this project. today I made the part where I would get the names of all the running processes on my Mac and then I made a list for the apps that I need to block then I compared the all the running processes with the apps I need to block and then just printed that this app needs to be closed just for the testing purpose. now my next work would be to terminate the app and then to modify it I would take the input of the app and time from the user itself and then in the end I would create a good GUI to give it a look of a fully polished project.
ok so this is my first devlog of APP BLOCKER. this is a project where the app would be blocked between a specific period of time. and till now I have made the time system like for the testing purpose it would show blocked if the program is ran between the designated time period and would show allowed if not ran between the designated time. I also learnt about process and learnt how to print all the running processes using psutil (process and system utilities). now my target would be merging them after modifying both the codes