Score:0

How can I execute a command before login?

ng flag

Ubuntu 20.04 LTS

I want to execute the command xdotool mousemove 960 540 to center my mouse pointer before login. I can do it just by adding the command to Startup Applications, but then it only runs after login. Any suggestions if it is possible?

pLumo avatar
in flag
What is your actual problem? Please read https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem
EODCraft Staff avatar
cn flag
Search `crontab`
br flag
@pogodemon before login? do you mean on the GDM Login Screen, you want the mouse cursor in the center of the screen instead of default bottom right?
pogodemon avatar
ng flag
@UnKNOWn Yes, that's what I want
pogodemon avatar
ng flag
@pLumo Hello, it is my first time here. My problem is that my mouse cursor appears on bottom right of my screen instead of the center when it boots. I tried to correct it and found the command I posted here by Googling. It works when I enter my password and log in, but I need it to work prior to that as well.
pasman pasmański avatar
mx flag
Try this: https://unix.stackexchange.com/questions/450835/how-to-execute-command-before-user-login-on-linux
pogodemon avatar
ng flag
@pasmanpasmański I tried the GDM method but unfortunately I couldn't get it to work. I am supposed to put the path to the script I need before the "exit 0", right?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.