小编Lan*_*ngo的帖子

Gnome 3 和 .desktop 文件 - “允许/禁止启动做什么”?

我知道在创建 .desktop 文件时,可以将 metadata::trusted 设置为 true 和 false,以便能够将图标作为可执行文件启动。然而,让我感兴趣的是以下事实:

  1. 当右键单击 .desktop 文件并“允许启动”时,它所做的唯一一件事就是将 metadata::trusted 设置为 true。但是,正如预期的那样,该图标会立即更改为 .desktop 文件 Icon= 中描述的图标。

  2. 但是,当通过命令行将 metadata::trusted 设置为 false 或 true 时,图标似乎不会改变其行为 $ gio set android-studio.desktop metadata::trusted false

一旦我手动刷新桌面(Alt + F2 >> 重启),环境就会刷新并且图标再次变为可执行,但整个环境都会重新启动。

那么,在设置了 metadata::trusted 之后,“允许/禁止启动”究竟做了什么?它如何在不刷新整个桌面的情况下刷新 .desktop 本身中的元数据?

desktop gnome refresh launch

6
推荐指数
1
解决办法
1604
查看次数

从Google云端硬盘获取Whatsapp备份文件

我目前正在使用以下脚本从Google云端硬盘获取常规文件。它工作正常,基本上是来自用户@ user115202的代码。

现在,我需要将其用于Whatsapp备份,该备份存储在GoogleDrive的“备份”下,而不是常规文件。

该工具WhatsApp的Google Drive提取器(Google Drive API)似乎不再起作用。

有人知道替代品吗?

import requests

def download_file_from_google_drive(id, destination):
    def get_confirm_token(response):
        for key, value in response.cookies.items():
            if key.startswith('download_warning'):
                return value

        return None

    def save_response_content(response, destination):
        CHUNK_SIZE = 32768

        with open(destination, "wb") as f:
            for chunk in response.iter_content(CHUNK_SIZE):
                if chunk: # filter out keep-alive new chunks
                    f.write(chunk)

    URL = "https://docs.google.com/uc?export=download"

    session = requests.Session()

    response = session.get(URL, params = { 'id' : id }, stream = True)
    token = get_confirm_token(response)

    if token:
        params = { 'id' : id, …
Run Code Online (Sandbox Code Playgroud)

python whatsapp google-drive-api

4
推荐指数
1
解决办法
5735
查看次数

标签 统计

desktop ×1

gnome ×1

google-drive-api ×1

launch ×1

python ×1

refresh ×1

whatsapp ×1