我们的想法是有一个干净和易于使用的dmenu
菜单,使用 ImageMagic
对 Flameshot 的输出进行一些基本的图像处理。目前为止在 Linux
上,最好的截图工具应该是 Flameshot
了,虽然功能很强大,但是缺少了一些定制化。 比如,无法对截图设置边框、圆角、添加水印、尺寸缩放等等。
使用过 ImageMagic(convert)
的都应该知道这款命令行应用有多强大,可以对图片进行任意的处理,dmenu_shot_plus
通过 ImageMagic
来进一步扩展 Flameshot
的功能。这里为大家带来这款通过扩展 Flameshot
截图脚本插件, 让 Flameshot
在 Linux
上功能更加丰富。 dmenu_shot_plus
对以前的版本进行了部分优化和改进。需要的朋友可以自己进一步深度开发,绝对可以媲美 Mac
以及 Win
上的一些截图应用。
主要功能:
- Bordered-Scaled: 截图边框加缩放,如果不输入缩放比例或尺寸,则直接截取带有边框和圆角的图片到剪贴板
- Trim: 剪所选区域周围多余的空白
- Remove_white: 有助于去除白色背景。它将用透明取代白色
- Negative: 反色,负片效果,类似胶卷
- Bordered: 在捕获的屏幕截图周围添加圆角边框
- Scaled: 截图缩放,将有助于减小图片的存储体积
- Select_Window: 截取指定窗口 flameshot 需升级到最新版本才能使用
默认情况下,所有的输出都被复制到剪贴板。
后续需要完善的功能:
- 长截图支持
- 截图OCR文字识别
- 截图转PDF
- 支持通过 dmenu_shot_plus 保存到保存图片到任意为止
- 支持截图直接上传到第三方图床,并返回链接地址
详细请查阅文档:说明文档.
After installation (which is basically copying a shell file to your PATH), you can either use the dmenu_shot
command in terminal or bind this command to a keyboard shortcut. If you don't know how, click on your Desktop Environment:
This script expects the user to have the following softwares installed:
- Flameshot
- dmenu (it can be custom built but should be available in the PATH)
- ImageMagic (specifically the
convert
command) - xclip
- make (This is only a dependency for automatic installation)
If you have the make
installed, you can check what dependencies are installed and which ones are missing using:
make check
```dmenu_shot
### Automatic Installation (不推荐)
When you have installed all the dependencies, simply do:
1. Clone this repo or download and extract the zip file
```sh
# To clone the repo
git clone https://github.com/yanzzchn/dmenu_shot_plus.git
- Install using the Makefile:
cd dmenu_shot_plus
make install
This will install the dmenu_shot to ~/.local/bin
(so it will NOT install it system-wise and will be only installed for the current user). This makes the command dmenu_shot
be usable in your terminal. All you need to do is to close your terminal and open it again and run dmenu_shot
.
- Clone this repo or download and extract the zip file
# To clone the repo
git clone https://github.com/yanzzchn/dmenu_shot_plus.git
- Copy the file to the location you want. I suggest
~/.local/bin
:
cd dmenu_shot_plus
sudo chmod +x dmenu_shot.sh
sudo ln -s ./dmenu_shot.sh /usr/local/bin/dmenu_shot
如果是Ubuntu用户,可以直接在系统设置里面配置快捷键。触发快捷键之后,就会直接运行dmenu_shot,选择截图类型之后,会自动调用 flameshot, 截图成功之后请务选择复制到剪贴板。 因为目前脚本还不支持将处理之后的截图保存到本地。 有需求的朋友可以自己进行二次开发,只需要将脚本中的剪贴板命令替换为直接的文件名和路径即可。
dmenu_shot
can be configured using a simple TOML file. The default path would be ~/.config/dmenu_shot/config.toml
but you can set a environment variable named DMENU_SHOT_CONF_PATH
to overwrite the default path and point the dmenu_shot
to a custom file.
Until this version we accept a section named [colors]
which can have the custom color values of the dmenu as shown below. You do not need to define all of them. You can also use comments and empty lines in the config file.
# Anything after # is considered comment
[colors]
normal_foreground = "#ff6600"
normal_background = "#8501a7"
selection_foreground = "#ffcc00"
selection_background = "#fa0164"
If there is something unexpected in the config file, you will see some error messages to help you fix the issue.
For some tools you can configure some of the default settings through the same config file. For every configurable action, you can create a section with the name format [action_{action_name}]
. For instance, for the "Bordered" you can have:
[action_bordered]
line_color = "#ff0066"
line_thickness = 2
corner_radius = 7
List of configurable actions:
- Bordered
If you have automatically installed dmenu_shot
, you can easily remove/uninstall it automatically as well:
make remove
This is a dmenu script and user does not need to insteract with it using the command line, but just in case, a very short help is available using --help
or -h
.
There is also a small help
available for the make
which can be seen using make help
and will output the following:
Available arguments:
- "make install" to install
- "make remove" to uninstall (remove)
- "make check" to check if you have all dependencies installed
- "make help" to show this help
To prevent this page to get lengthy, I moved the content of this part to contribute page.