這個問題指的是。 Linux Ubuntu,使用Cinnamon桌面
一個桌面上可以顯示幾個程式視窗。我怎樣才能通過bash獲得滑鼠指標在哪個視窗上的WID呢?
uj5u.com熱心網友回復:
我現在不能測驗這個,但是也許xdotool提供了一種方法來獲得滑鼠指標下的視窗。來自man xdotool:
getmouselocation [--shell]
輸出滑鼠游標的x、y、螢屏、和視窗id。
我假設提到的視窗ID屬于滑鼠游標下的視窗。要檢索它,請使用
declare "$(xdotool getmouselocation --shell | grep WINDOW)"
echo "$WINDOW"
然后,該視窗ID可用于其他工具,如xwininfo -id <wdid>以獲得更多資訊。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/324029.html
標籤:
上一篇:洗掉多個檔案的命令
