zoukankan      html  css  js  c++  java
  • 去掉Wine微信和QQ的黑框

    1. 安装xdotool

    2. 使用下面的脚本

    #!/usr/bin/python3.8
    
    import os
    import sys
    import time
    import getopt
    
    
    def remove_shadow(app_class):
        for wid in os.popen('xdotool search --onlyvisible --class ' + app_class).readlines():
            if len(wid) > 1:
                wdn = os.popen('xdotool getwindowname %s' % wid[:-1]).readline()[:-1]
                print('window id: %s; window name: %s' % (wid[:-1], wdn))
                if wdn == '':  # 移除掉装饰窗口
                    os.system('xdotool windowunmap %s' % wid[:-1])
    
    
    def check_app_running(app_exe):
        result = os.popen(
            "ps -ef | grep %s | awk '{print "/proc/"$2"/cwd"}' | xargs ls -l | grep drive_c" % app_exe).readlines()
        return len(result) > 0
    
    
    def handle(app_exe, app_class):
        check_app_alive_max_count = 0
        while True:
            running = check_app_running(app_exe)
            if running:
                remove_shadow(app_class)
                check_app_alive_max_count = 0
            else:
                check_app_alive_max_count = check_app_alive_max_count + 1
                if check_app_alive_max_count > 3:  # 三次没有检测程序启动,退出
                    exit()
            time.sleep(5)  # 休眠5秒
    
    
    if __name__ == '__main__':
        opts, args = getopt.getopt(sys.argv[1:], "e:c:", ["exe=", "class="])
        exe_name = None
        class_name = None
        for opt_name, opt_value in opts:
            if opt_name in ('-e', '--exe'):
                exe_name = opt_value
            elif opt_name in ('-c', '--class'):
                class_name = opt_value
        if exe_name is not None and class_name is not None:
            handle(exe_name, class_name)
  • 相关阅读:
    通信收发单元
    WOSA协议(转)
    CcTalk (网络协议)(转)
    0x和H都表示十六进制有什么区别吗?
    select()函数以及FD_ZERO、FD_SET、FD_CLR、FD_ISSET(转)
    &是什么运算符(转)
    NDK的Paths and Symbols设定
    android JNI调用(转)
    scrapy-redis基础和介绍
    scrapy-redis介绍(一)
  • 原文地址:https://www.cnblogs.com/soongkun/p/15074526.html
Copyright © 2011-2022 走看看