xprop 脚本取得 窗口的资源属性
下面的脚本能够输出选定窗口的属性,输出符合xmonad配置文件要求的字符串,原文链接自此处。以下的脚本在原文的基础上做了一部分小修正。具体如下:
1#! /bin/sh
2exec xprop -notype
3 -f WM_NAME 8s ':n title =? $0n'
4 -f WM_CLASS 8s ':n appName =? $0n className =? $1n'
5 -f WM_WINDOW_ROLE 8s ':n stringProperty "WM_WINDOW_ROLE" =? $0n'
6 WM_NAME WM_CLASS WM_WINDOW_ROLE
7 ${1+"$@"}
关于xprop里面8s的作用可以看man xprop
捐赠本站(Donate)
如您感觉文章有用,可扫码捐赠本站!(If the article useful, you can scan the QR code to donate))
- Author: shisekong
- Link: https://blog.361way.com/xprop/3006.html
- License: This work is under a 知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议. Kindly fulfill the requirements of the aforementioned License when adapting or creating a derivative of this work.