aw-watcher-window
aw-watcher-window copied to clipboard
Needed: absolute file path in data model
I'm pulling out custom reports and I need the absolute path, not just the filename. From that you can get the real formatted/friendly app name, icon, and more. Hopefully it's not too awkward to get
Absolute path of what? Filename of what?
This watcher only gets the app name and title of the currently focused app from the window manager of each platform, I'm not sure how that relates to any path or filename?
Full path of the executable, I presume.
On Sun, 8 Sep 2019, 18:52 Johan Bjäreholt, [email protected] wrote:
Absolute path of what? Filename of what?
This watcher only gets the app name and title of the currently focused app from the window manager of each platform, I'm not sure how that relates to any path or filename?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ActivityWatch/aw-watcher-window/issues/36?email_source=notifications&email_token=AAKXDORX63BHBNEVB7T7OG3QIUUTXA5CNFSM4IURM4M2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6FUJKI#issuecomment-529220777, or mute the thread https://github.com/notifications/unsubscribe-auth/AAKXDOSOI3SO4BPGFOR3JQTQIUUTXANCNFSM4IURM4MQ .
If so, that would require manual implementations for all platforms. Xlib doesn't expose the executables path natively as far as I know, maybe there's a way to circumvent that though. For windows and macOS I have no idea.
From that you can get the real formatted/friendly app name, icon, and more.
There's an API at least in Xlib to get the icon of the currently focused window, but to save icons in the aw-servers database is probably not a good idea.
If it helps, https://github.com/sindresorhus/active-win gets the path.
From that you can get the real formatted/friendly app name, icon, and more.
There's an API at least in Xlib to get the icon of the currently focused window, but to save icons in the aw-servers database is probably not a good idea.
I'm not suggesting that to be clear. The "you" in that sentence is me/anyone who wants to create custom reports
Looks like active-win gets it on Linux by getting the PID of the active window and then looking up the path of the executable using /proc
.
Example for how to get it in the terminal on Linux:
PID=$(xprop | grep PID | grep -P -o '[0-9]+')
ls -l /proc/$PID/exe
From that you can get the real formatted/friendly app name, icon, and more.
There's an API at least in Xlib to get the icon of the currently focused window, but to save icons in the aw-servers database is probably not a good idea.
I'm not suggesting that to be clear. The "you" in that sentence is me/anyone who wants to create custom reports
Yeah I know, I was just thinking loudly. Such icons could be useful for the web-ui as well which was I brought it up.
Example for how to get it in the terminal on Linux:
PID=$(xprop | grep PID | grep -P -o '[0-9]+') ls -l /proc/$PID/exe
That only works for some processes. Works fine for example empathy and firefox but not for urxvt.