minha nova paixão é discordar de post de dev caga regra no linkedin, aqueles nego que posta só pro click bait que posta o obvio.
ChatGPT struggled to provide a simple script for this task. It became apparent that for complex tasks, breaking them into smaller, manageable problems was more effective for AI assistance. However, the ultimate solution was found in the documentation. The AI's suggestion to retrieve the window ID by application title worked for the initial window, but became impractical for subsequent forms with varying titles. The getwindowfocus option in xdotool provided the necessary solution.
By running the script every 2 seconds, the focused window was moved to X(0) and Y(0), effectively centering it (assuming full-screen windows).
This type of solution highlights the limitations of AI in handling complex, macro-level problems. While AI can be helpful, it often lacks the ability to grasp the bigger picture.
#blog #tech
Chatgpt não ajudou com um script simples, quando se trata de uma tarefa complexa é melhor quebrar o problema em pequenos problemas e dai ele pode ajudar. Mas o que resolveu mesmo foi ler a documentação, pois a solução dada pela I.A era pegar o id da janela pelo título da aplicação. Funcionou pra primeira janela porém saber o título de todos os outros forms ficou inviável, a solução foi ler a documentação e achar a opção `getwindowfocus do xdotool.
Assim rodando o script a cada 2 segundos a janela que tiver o foco é movida ao X(0) e Y(0) resultando na centralização da janela, considerando que as janelas tem o tamanho total da tela.
Esse tipo de solução que acho díficil a IA se virar sozinha, ela ajuda mas não consegue ver o macro.
#blog #tech