AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-598062

Ahmad Ismail's questions

Martin Hope
Ahmad Ismail
Asked: 2023-07-17 15:30:02 +0800 CST

通过单击活动概述中工作区的缩略图来切换到工作区,而无需选择窗口

  • 5

如何通过单击活动概述中工作区的缩略图来切换到工作区,而不选择窗口。

我的意思是,当我使用键绑定时Move to workspace on the left / right,它只是移动到工作区。但是,当我单击活动概述中的工作区缩略图时,它会等到我选择一个窗口。我不要那个。我想在单击缩略图后立即移动到工作区。我怎样才能做到这一点?

gnome
  • 2 个回答
  • 16 Views
Martin Hope
Ahmad Ismail
Asked: 2021-05-25 03:09:44 +0800 CST

rsync 无法删除 .git/objects 目录文件

  • 1

我正在运行命令:

rsync -ab --delete-delay /media/blueray/WDRed /media/blueray/UltrastarDaily 

为了清楚起见,--delete-delay如果文件从源中删除,它会删除目标文件 ( )。

它产生以下输出(部分输出):

rsync: open "/media/blueray/UltrastarDaily/WDRed/_Working/_NotesFiltered/.git/objects/aa/0f7214d22e712099a0d3509c72308146893e57" failed: Permission denied (13)
rsync: open "/media/blueray/UltrastarDaily/WDRed/_Working/_NotesFiltered/.git/objects/ab/b150515f74a76f331ee275ef2768a91115b320" failed: Permission denied (13)
rsync: open "/media/blueray/UltrastarDaily/WDRed/_Working/_NotesFiltered/.git/objects/ab/baad7a7409b4d0bbdcef7c9890bb1f5d46a823" failed: Permission denied (13)
rsync: open "/media/blueray/UltrastarDaily/WDRed/_Working/_NotesFiltered/.git/objects/b3/8ed79ad4f5956cfa129fe1df0e9ec00c746672" failed: Permission denied (13)
rsync: open "/media/blueray/UltrastarDaily/WDRed/_Working/_NotesFiltered/.git/objects/b5/8f91ac5efdc0e53a83eba11a0e632a4dea73ec" failed: Permission denied (13)
rsync: open "/media/blueray/UltrastarDaily/WDRed/_Working/_NotesFiltered/.git/objects/b5/abcc64e88d77813bdc47005f9accb72746326a" failed: Permission denied (13)
rsync: open "/media/blueray/UltrastarDaily/WDRed/_Working/_NotesFiltered/.git/objects/b5/f6af97229a1bd644fc58a9c54c136f880fa530" failed: Permission denied (13)
rsync: open "/media/blueray/UltrastarDaily/WDRed/_Working/_NotesFiltered/.git/objects/b6/400def87b4544f9ef2b246be8170e5b03a686c" failed: Permission denied (13)

我检查了文件权限。它显示:

% ls -lg
.r--r--r--  128 blueray blueray  7 Feb  4:36 0f7214d22e712099a0d3509c72308146893e57
.r--r--r--  100 blueray blueray 18 Dec  2020 4c43240f470ae0d19198beab1ceee59b8ba400
.r--r--r--  236 blueray blueray 18 Dec  2020 9b80263fab88c02738a91bbe15763801b415fd
.r--r--r--  626 blueray blueray 18 Dec  2020 47ffc8062e197dc9c76f199032a2fe5f0c40a8
.r--r--r-- 1.1M blueray blueray  5 Apr 23:13 217fc19b7887fe3ba24f828aa2880235e16158
.r--r--r-- 2.4k blueray blueray 22 May 23:47 677b3290ebd20ff33b0496f76e1e71e6566e07
.r--r--r--  25k blueray blueray 18 Dec  2020 7682be228dd8c0e303d9bb51c2388ab122afe3
.r--r--r--  350 blueray blueray  7 Feb  4:36 a33ca86640f0614b80bbb27bdcf7941c5c04f9
.r--r--r-- 122k blueray blueray 22 May 23:47 a70c7a10521b3c0e320385f1528e8975bb1b16
.r--r--r--  209 blueray blueray 18 Dec  2020 a86944d79a34ef90d3d9f4db20a9622a920695
.r--r--r-- 1.2k blueray blueray 18 Dec  2020 b93b3e139d6362c6120193a49ee635ceeeba85
.r--r--r-- 1.3k blueray blueray 18 Dec  2020 c9b598d13d373fe0d789d9f6211e9bbb244a8e
.r--r--r--  385 blueray blueray 18 Dec  2020 cdda3fa1a3f0bbfda08072c20eba28bec1dcf8
.r--r--r--  137 blueray blueray 18 Dec  2020 d11be88a036d4b42fb9826db1f74b2ff818577
.r--r--r-- 1.1M blueray blueray 18 Dec  2020 fae0391be02b5054ad949e684ebe8bcb151ac0

如果我给这些 git 对象写权限,那么 rsync 命令就可以工作。

我的问题是,我在备份目录中有很多 git repos。每次提交后,我无法访问每个目录并更改权限。

如果我能给rsyncgit 对象的文件写权限,那就更好了。实际上,任何不涉及到每个目录并在每次提交后更改权限的解决方法都会更好。

command-line
  • 1 个回答
  • 200 Views
Martin Hope
Ahmad Ismail
Asked: 2021-03-03 05:24:54 +0800 CST

如何调试 /etc/NetworkManager/dispatcher.d 脚本

  • 2

文档说:

   NetworkManager will execute scripts in the /etc/NetworkManager/dispatcher.d directory 

它还说:

   The environment contains more information about the interface and the connection. The
   following variables are available for the use in the dispatcher scripts:

   NM_DISPATCHER_ACTION
       The dispatcher action like "up" or "dhcp4-change", identical to the first command line
       argument. Since NetworkManager 1.12.0.

       ......

我的问题是,当环境变量仅在此上下文中可用时,我如何测试或调试这些脚本。

bash
  • 1 个回答
  • 235 Views
Martin Hope
Ahmad Ismail
Asked: 2021-01-21 01:36:31 +0800 CST

从树命令输出创建目录结构

  • 3

我有tree一些目录结构的命令输出(在文本文件中)。它看起来像:

% cat tree.txt
.
├── grandpartest
│   └── partest
│       └── test
│           ├── empty-asciidoc-document.adoc
│           └── empty-asciidoc-document1.adoc
├── grandpartest2
│   └── partest2
│       └── test2
│           ├── empty-asciidoc-document.adoc
│           ├── empty-asciidoc-document1.adoc
│           └── empty-asciidoc-document2.adoc
├── grandpartest3
│   └── partest3
│       └── test3
│           ├── empty-asciidoc-document.adoc
│           ├── empty-asciidoc-document1.adoc
│           ├── empty-asciidoc-document2.adoc
│           └── empty-asciidoc-document3.adoc
└── tree.txt

9 directories, 10 files

有什么方法可以解析这些文本文件以创建类似的目录结构?

我知道我可以使用mkdir -p并touch创建这个目录结构。但我感兴趣的主要是解析文本文件以获取与这些命令一起使用的值。

更新1:

根据@muru 的要求

% cat tree-j.txt
[{"type":"directory","name": ".","contents":[
    {"type":"directory","name":"grandpartest","contents":[
      {"type":"directory","name":"partest","contents":[
        {"type":"directory","name":"test","contents":[
          {"type":"file","name":"empty-asciidoc-document.adoc"},
          {"type":"file","name":"empty-asciidoc-document1.adoc"}
        ]}
      ]}
    ]},
    {"type":"directory","name":"grandpartest2","contents":[
      {"type":"directory","name":"partest2","contents":[
        {"type":"directory","name":"test2","contents":[
          {"type":"file","name":"empty-asciidoc-document.adoc"},
          {"type":"file","name":"empty-asciidoc-document1.adoc"},
          {"type":"file","name":"empty-asciidoc-document2.adoc"},
          {"type":"directory","name":"Untitled Folder","contents":[
          ]}
        ]}
      ]}
    ]},
    {"type":"directory","name":"grandpartest3","contents":[
      {"type":"directory","name":"partest3","contents":[
        {"type":"directory","name":"test3","contents":[
          {"type":"file","name":"empty-asciidoc-document.adoc"},
          {"type":"file","name":"empty-asciidoc-document1.adoc"},
          {"type":"file","name":"empty-asciidoc-document2.adoc"},
          {"type":"file","name":"empty-asciidoc-document3.adoc"}
        ]}
      ]}
    ]},
    {"type":"file","name":"tree.txt"},
    {"type":"file","name":"tree-j.txt"}
  ]},
  {"type":"report","directories":10,"files":11}
]

% cat tree-j.txt | parse-tree
Traceback (most recent call last):
  File "/home/blueray/_resources/dotfiles/python/parse-tree", line 18, in <module>
    process(structure)
  File "/home/blueray/_resources/dotfiles/python/parse-tree", line 10, in process
    os.mkdir(entry["name"])
FileExistsError: [Errno 17] File exists: '.'
command-line
  • 1 个回答
  • 994 Views
Martin Hope
Ahmad Ismail
Asked: 2020-07-10 02:24:57 +0800 CST

获取放置在 `~/.icons` 中的图标名称

  • 0

如果我们去/usr/share/applications图标名称就像

Icon=org.gnome.Screenshot
Icon=preferences-desktop-theme

假设,我有一个图标~/.icons/search.png

如何将该图标用作应用程序图标。我知道我可以使用

Icon=~/.icons/search.png

但我正在尝试使用图标名称。

icons .desktop
  • 1 个回答
  • 82 Views
Martin Hope
Ahmad Ismail
Asked: 2019-05-20 08:15:16 +0800 CST

无法从“odrs.gnome.org”下载更新:未能下载 https://odrs.gnome.org/1.0/reviews/api/ratings:服务不可用:<html>

  • 3

我刚刚安装了 Ubuntu Budgie 19.04

当我尝试在软件中心工作时,它说 -

Unable to download updates from "odrs.gnome.org": failed to download https://odrs.gnome.org/1.0/reviews/api/ratings: Service Unavailable: <html>

在此处输入图像描述

software-center budgie
  • 1 个回答
  • 6585 Views
Martin Hope
Ahmad Ismail
Asked: 2018-11-17 20:55:50 +0800 CST

Kubuntu 18.10 - 如何在任务管理器(面板)上使窗口列表更大

  • 1

我禁用了当前窗口

System Settings > Desktop Behaviour > Desktop Effects > (Disable) Present Windows

我还禁用了任务栏(面板)工具提示

Right Click Panel > Configure Icon-Only Task Manager > Uncheck Show tooltips

因此,当我单击任务管理器上的组图标时,它可能会显示Window List.

在此处输入图像描述

我怎样才能使这个列表更大,以便提供完整的细节。

就像是 -

在此处输入图像描述

PS:我从Task Switcher *中制作了第二张图片以给出一个粗略的想法。


[*]系统设置 > 窗口管理 > 任务切换器 > 信息而不是微风

kde kubuntu
  • 1 个回答
  • 1430 Views
Martin Hope
Ahmad Ismail
Asked: 2018-10-24 04:58:08 +0800 CST

启用 lsyncd 的服务在 PC 重新启动时不会自动启动 - 活动:不活动(死)

  • 2

我通过合并所有以前的编辑来超级简化了这个问题

lsyncd 配置文件/etc/lsyncd/lsyncd.conf.lua

settings {
    logfile = "/media/blueray/WDRed/_LsyncLog/lsyncd.log",
    statusFile = "/media/blueray/WDRed/_LsyncLog/lsyncd-status.log",
    pidfile="/media/blueray/WDRed/_LsyncLog/lsyncd.pid",
    statusInterval = 5,
    nodaemon = false,
}

sync {
    default.rsync,
    source    = "/media/blueray/Data/",
    target    = "/media/blueray/WDRed/_LsyncBackup/",
    delay     = 0, 
    exclude = { "/_RedoBackup" },
    rsync     = {
        binary   = "/usr/bin/rsync",
        archive  = true,
        compress = true,
        _extra = { "--backup-dir=/media/blueray/WDRed/_LsyncDeletedBackup/" },
    }
}

lsyncd 服务文件/home/blueray/.config/systemd/user/lsyncd.service

[Unit]
Description=Live Syncing (Mirror) Daemon
After=network.target remote-fs.target media-blueray-Data.mount media-blueray-WDRed.mount
Wants=media-blueray-Data.mount media-blueray-WDRed.mount
Requires=media-blueray-Data.mount media-blueray-WDRed.mount

[Service]
Type=forking
ExecStart=/usr/bin/lsyncd /etc/lsyncd/lsyncd.conf.lua
PIDFile=/media/blueray/WDRed/_LsyncLog/lsyncd.pid
ExecReload=/bin/kill -HUP $MAINPID
ExecStop=/bin/kill $MAINPID
Restart=always

[Install]
WantedBy=multi-user.target

重启前

blueray@blueray-i58600K:~$ systemctl --user start lsyncd
blueray@blueray-i58600K:~$ systemctl --user enable lsyncd
blueray@blueray-i58600K:~$ systemctl --user status lsyncd
● lsyncd.service - Live Syncing (Mirror) Daemon
   Loaded: loaded (/home/blueray/.config/systemd/user/lsyncd.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2018-10-29 11:58:22 +06; 11s ago
 Main PID: 1921 (lsyncd)
   CGroup: /user.slice/user-1000.slice/[email protected]/lsyncd.service
           └─1921 /usr/bin/lsyncd /etc/lsyncd/lsyncd.conf.lua

Oct 29 11:58:22 blueray-i58600K systemd[916]: Starting Live Syncing (Mirror) Daemon...
Oct 29 11:58:22 blueray-i58600K systemd[916]: Started Live Syncing (Mirror) Daemon.
blueray@blueray-i58600K:~$ 

重启后

blueray@blueray-i58600K:~$ systemctl --user status lsyncd
● lsyncd.service - Live Syncing (Mirror) Daemon
   Loaded: loaded (/home/blueray/.config/systemd/user/lsyncd.service; enabled; vendor preset: enabled)
   Active: inactive (dead)
blueray@blueray-i58600K:~$ 

如您所见,如果我发出命令,此服务运行良好systemctl --user start lsyncd

为什么虽然我给出了命令但它没有自动启动systemctl --user enable lsyncd。为什么Active: inactive (dead)重启后显示?

kde server kubuntu services systemd
  • 2 个回答
  • 2615 Views
Martin Hope
Ahmad Ismail
Asked: 2018-10-22 22:21:05 +0800 CST

KDE Plasma - 不在“新建”菜单中提供扩展名

  • 3

使用 KUbuntu 18.04.1

当我,

right click in empty space > Create New > File Type

文件名不包含扩展名。

电流输出

我希望文件名包含如下图所示的扩展名。

预期产出

所以,到目前为止我检查的是 -

我去/usr/share/templates/查了TextFile.desktop。它指向.source/TextFile.txt

/usr/share/templates/.source/TextFile.txt

是一个带有扩展名的纯文本文件。所以,据我了解,新文件应该带有扩展名。

经过进一步调查,我发现虽然创建的 LibreOffice 文件在 Libreoffice 中自动打开,但这些文件也没有扩展名。

kde kubuntu dolphin
  • 1 个回答
  • 1160 Views
Martin Hope
Ahmad Ismail
Asked: 2018-10-14 02:11:57 +0800 CST

KUbuntu - 如何在“图标查看模式”中排序

  • 1

我正在使用 Kubuntu 18.04.1

默认文件浏览器是 Dolphin。

我知道我可以在Details View 模式下进行排序。

但是,我想在图标视图模式中右键单击并按名称或类型排序。

默认情况下,我在 Dolphin 中找不到此选项。

在此处输入图像描述

有什么解决方法吗?

kde kubuntu dolphin
  • 1 个回答
  • 92 Views
Martin Hope
Ahmad Ismail
Asked: 2018-10-08 04:24:40 +0800 CST

如何在 Kate 中安装脚本以及现有脚本在哪里?

  • 4

我正在使用 KUbuntu 18.04.1

我正在尝试安装Kate 脚本:Kate 中的字数。

在此处输入图像描述

文件说

要安装,请将 wordcount.desktop 和 wordcount.sh 复制到 ~/.kde/share/apps/kate/scripts/。

但是,没有文件夹命名

凯特在~/.kde/share/apps/.

不过,起初我应该创建一个名为kate并粘贴内容的目录。

但是应该已经有一些内容了,因为安装了 Emmet、Editing 等插件。

那么,如何在 Kate 中安装脚本以及现有脚本在哪里?

kde kubuntu kate
  • 2 个回答
  • 1144 Views
Martin Hope
Ahmad Ismail
Asked: 2018-10-06 23:20:33 +0800 CST

KUbuntu Pin 子菜单上的 Check 和 Default Checkboxes 的作用是什么

  • 1

我习惯于在 Windows 任务栏中固定应用程序。

在 Kubuntu 中,当我右键单击面板中的图标时,有一个称为 pin 的选项。在其子菜单上几乎没有选项。

在此处输入图像描述

我理解On All Activities和On the Current Activity。(不同的activity就像不同的桌面。它不同于虚拟桌面的概念。我们可以在Activity内部创建虚拟桌面。所以,我认为这很清楚。)

但是,我不明白为什么Check和Default复选框在那里。

谁能解释一下?

kde kubuntu
  • 1 个回答
  • 72 Views
Martin Hope
Ahmad Ismail
Asked: 2018-10-06 23:00:00 +0800 CST

KUbuntu 快捷方式关闭与退出

  • 1

KDE的文档页面说

Ctrl+Q 退出

Alt+F4 关

两者似乎都以相同的方式工作。它们之间有什么区别?

kde shortcuts shortcut-keys kubuntu
  • 2 个回答
  • 845 Views
Martin Hope
Ahmad Ismail
Asked: 2018-10-05 01:53:47 +0800 CST

从终端运行和用作快捷方式时显示不同行为的命令

  • 2

我正在使用 KUbuntu 18.04.1

我正在尝试使用 spectacle(KUbuntu 的屏幕截图应用程序)和 gocr(OCR 工具)从屏幕截图中提取文本

如果我在 Konsole(KUbuntu 终端)中一个接一个地发出命令

第一的:

spectacle -r -b -n -o /home/UserName/Documents/Translate/input.jpg

第二:

gocr -i /home/UserName/Documents/Translate/input.jpg | xsel -b

有用。

如果我创建一个 bash 文件screen_ts.sh并将代码

#!/bin/bash
# Dependencies: gocr xsel

# Take Screenshot and Save it to a File
spectacle -r -b -n -o /home/UserName/Documents/Translate/input.jpg

# Extract text from the saved file
gocr -i /home/UserName/Documents/Translate/input.jpg | xsel -b

exit

打开 Konsole 并输入./screen_ts.sh,它可以工作

但是,如果我使文件可执行并双击,它会截取屏幕截图,但不会将文本保存在剪贴板中。

如果我再次使用创建自定义快捷方式

自定义快捷方式 > 触发器Alt + Q和操作/home/UserName/Documents/Translate/screen_ts.sh

KUbuntu 自定义快捷方式

它会截取屏幕截图,但不会将文本保存在剪贴板中。 与双击相同的行为。

这里发生了什么?

kde command-line shortcut-keys kubuntu bash
  • 1 个回答
  • 156 Views
Martin Hope
Ahmad Ismail
Asked: 2018-06-23 19:27:18 +0800 CST

我如何知道软件是否具有 KDE 或 GNOME 依赖项?

  • 2

我开始知道有桌面独立应用程序和桌面依赖应用程序。

在 Fedora 论坛主题Gnome vs KDE 应用程序中,有这样的:

请记住“KDE 应用程序”和“Qt 应用程序”以及“GNOME 应用程序”和“GTK+ 应用程序”之间的区别。其实很简单。GTK+ 和 Qt 是分别与 GNOME 和 KDE 相关联的图形工具包(嗯,主要是;现在两者都在这个领域之外产生了很多功能)。仅使用 GTK+ 提供的资源的应用程序是 GTK+ 应用程序,而不是 GNOME 应用程序;您无需正确安装任何 GNOME 即可安装或使用它。Qt 和 KDE 同上——您可以编写一个应用程序,使其仅使用 Qt 工具包但不使用任何 KDE 功能,这是一个 Qt 应用程序而不是 KDE 应用程序。

实际上,任何“GNOME 应用”也是“GTK+ 应用”,任何“KDE 应用”也是“Qt 应用”,但反之则不然。与在 GNOME 上运行 KDE 应用程序或在 KDE 上运行 GNOME 应用程序相比,在 GNOME 上运行 Qt 应用程序或在 KDE 上运行 GTK+ 应用程序不太可能导致任何功能缺失,并且会导致资源使用量的增加较少。在 KDE 上运行 GTK+ 应用程序特别常见,特别是因为所有 Fedora 配置工具和 PackageKit 都是 GTK+ 应用程序。

它还表示:

有些人更喜欢只从他们运行的桌面安装应用程序,以确保他们不会意外使用非本机应用程序并使用额外的内存或错过功能等等。这确实是一种个人喜好,取决于您对“另一方”应用程序的依赖程度。

我大概就是那些人中的一员。因此,在安装软件之前,我需要知道软件是否具有特定的 KDE 或 GNOME 桌面环境依赖项。

我从How are KDE Apps Able to Run under GNOME 中找到?为 GNOME 编写的程序将使用libgdkand libgtk,而 KDE 程序将使用libQtCorewith libQtGui。

在安装程序之前,如何轻松知道程序是否具有这些依赖项?

是否有更好的解决方案来了解程序是否具有任何特定的 DE 依赖项?

software-installation gnome kde gtk qt
  • 1 个回答
  • 1560 Views
Martin Hope
Ahmad Ismail
Asked: 2018-06-05 04:26:54 +0800 CST

无法更改 Ubuntu Mate 18.04 的默认文件管理器

  • 5

我使用安装了 Nemo

sudo add-apt-repository ppa:webupd8team/nemo3
sudo apt update
sudo apt install nemo

然后我去了Preferred Application -> System -> File Manager -> Files

注意:Nemo 喜欢称自己为文件

但它并没有改变默认的文件管理器。

所以,为了仔细检查,我使用了我的 ubuntu mate 可启动 USB(试试 ubuntu)。使用相同的过程检查是否可以将 Nemo 设置为默认文件管理器。但它也不在那里工作吗?

我想提一下xdg-open $HOME开放的尼莫。

/usr/share/applications/mate/当我在某处读取显示的应用程序Preferred Application取自该位置时,我是否应该更改任何内容。

如果我需要更改任何文件,我需要更改什么文件,更改内容是什么?

终端解决方案是什么?

更新 1

桌面中的Home和Computer图标是 by Mate Tweak,它造成了所有的混乱。无论默认文件管理器是什么,Mate Tweak生成的图标始终打开。Caja

但是当我创建一个目录快捷方式时,它会默认在 Nemo 中打开。

default default-programs filemanager ubuntu-mate 18.04
  • 1 个回答
  • 3508 Views
Martin Hope
Ahmad Ismail
Asked: 2018-05-24 13:55:46 +0800 CST

如何删除 youtube-dlg - Ubuntu Mate

  • 3

我正在使用 Ubuntu 伴侣。

我安装了youtube-dl-gui从

http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu/pool/main/y/youtube-dlg/

已下载youtube-dlg_0.4-1~webupd8~zesty4_all.deb

然后双击该文件并安装它。

当我需要移除它时,我打开synaptic并移除了youtube-dlg包裹。

仍然有一些元素仍然存在,它与我youtube-dl使用apt-get install youtube-dl.

我能做些什么?

ppa apt deb youtube-dl
  • 1 个回答
  • 1634 Views
Martin Hope
Ahmad Ismail
Asked: 2018-05-20 06:07:21 +0800 CST

Capture2Text - Ubuntu Mate 中的替代方案(直接从屏幕捕获文本)

  • 3

我在这个网站上发现了几个类似的问题,但无法完成这个过程。

来自如何使用 OCR 工具从屏幕区域即时提取文本的答案?以及如何在部分屏幕截图上使用 OCR 来获取文本?

首先我安装了依赖项

sudo apt-get install tesseract-ocr
sudo apt-get install imagemagick
sudo apt-get install scrot
sudo apt-get install xsel

然后我将以下脚本放入/home/blueray/Documents/Translate/screen_ts.sh

#!/bin/bash 
# Dependencies: tesseract-ocr imagemagick scrot xsel

SCR_IMG=`mktemp`
trap "rm $SCR_IMG*" EXIT

scrot -s $SCR_IMG.png -q 100    
# increase image quality with option -q from default 75 to 100

mogrify -modulate 100,0 -resize 400% $SCR_IMG.png 
#should increase detection rate

tesseract $SCR_IMG.png $SCR_IMG &> /dev/null
cat $SCR_IMG.txt | xsel -bi

exit

请注意,我删除了

select tesseract_lang in eng rus equ ;do break;done
# Quick language menu, add more if you need other languages.

希望它只会考虑英语。如果不是这种情况,请告诉我。

现在当我把

bash /home/blueray/Documents/Translate/screen_ts.sh

它按我的意愿工作。

在 Windows 中,使用 Capture2Text,我曾经使用Win+Q将屏幕的一部分捕获为文本。所以,我检查了如何设置自定义键盘快捷键来控制音量?

我去了Menu-> Searched for Keyboard Shortcuts -> Click

在此处输入图像描述

  1. 然后我点击Add
  2. 名称:Capture2Text
  3. 命令:bash /home/blueray/Documents/Translate/screen_ts.sh
  4. 已点击Apply
  5. 点击右侧的快捷方式。
  6. 按下 WinQ

现在,当我按下 时WinQ,什么也没有发生。我究竟做错了什么?

keyboard shortcut-keys bash mate 18.04
  • 2 个回答
  • 2981 Views
Martin Hope
Ahmad Ismail
Asked: 2016-09-23 09:04:21 +0800 CST

YouTube-dl - 自动编号以区分批处理文件中提到的不同播放列表?

  • 2

我的youtube-dl.conf是 -

-u <User Name>
-p <Password>
-i
-c
--no-warnings
--console-title
--batch-file='batch-file.txt'
--autonumber-size 3 
-o 'MyVideos/%(playlist_title)s/%(chapter_number)s - %(chapter)s/%(autonumber)s-%(title)s.%(ext)s'
-f 'bestvideo[height<=720]+bestaudio/best[height<=720]'

批处理文件.txt

URL1
URL2
URL3

问题是,当我在批处理文件中放入多个播放列表时,自动编号无法区分不同的播放列表。

例如,如果 URL1(播放列表的 URL)有 21 个视频,最后一个视频的自动编号为 21,那么 URL2(第二个播放列表)的第一个视频的自动编号为 22。

我希望每个播放列表都以 1 开头。

有没有办法解决这个问题。

youtube-dl
  • 1 个回答
  • 1254 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve