Hi community,
I am absolute beginner with ubuntu. I created service to run a piece of code( bash script ). I want to get current active window using script, used xdotool package for this.
Code to get current active window name is
Code:
xdotool getactivewindow getwindowname
. When I run this code in terminal, I am getting the output whatever be the current active window name of logged in user. I want to run this script automatically so I created service.
When I copy this code in executable file which gets executed by service I created, It is giving window is null because services are run by root and there is no window belongs to root user. Code is trying to get current active window name of root user but I need whoever logged in user current active window name. How can we create service that can be run by particular local user instead of root user?
Bookmarks