Skip to content

Commit da85f9a

Browse files
2025 prune
0 parents  commit da85f9a

File tree

3 files changed

+417
-0
lines changed

3 files changed

+417
-0
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018-2025 Vlastimil Burián
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
[![Download the latest version](https://img.shields.io/badge/Download-Latest%20version-orange)](https://github.com/burianvlastimil/lightshot-print-screen-linux-handler/releases/latest)         [![MIT License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/burianvlastimil/lightshot-print-screen-linux-handler/?tab=MIT-1-ov-file)
2+
3+
***
4+
5+
# Lightshot print screen Linux handler
6+
7+
This script handles global print screen keystrokes for you to fully enjoy [Lightshot screenshot tool](https://app.prntscr.com/en/) (home page) on any Linux/Unix.
8+
9+
It is a standard [POSIX](https://en.wikipedia.org/wiki/POSIX) (wiki) shell script, it should work in any [Linux](https://en.wikipedia.org/wiki/Linux) (wiki) or more generally any [Unix](https://en.wikipedia.org/wiki/Unix) (wiki) distribution (more precisely, your [shell](https://en.wikipedia.org/wiki/Unix_shell) (wiki)).
10+
11+
## What the script does NOT
12+
13+
- It does not download Lightshot for you.
14+
- It does not install Lightshot for you.
15+
- It does not launch Lightshot for you!
16+
17+
## What the script actually does
18+
19+
This script's sole purpose is to simulate/send hotkey to Lightshot, be it Print, Control + Print, or anything else completely.
20+
21+
***
22+
23+
## Requirements
24+
25+
- One necessary command-line tool to have manually installed (same package name):
26+
- [`xdotool`](https://manpages.ubuntu.com/manpages/jammy/man1/xdotool.1.html) (Ubuntu man page): In Ubuntu the package is in the _universe_ part of the official archive.
27+
28+
- One more necessary package which should be pre-installed on most [distributions](https://en.wikipedia.org/wiki/Linux_distribution) (wiki):
29+
- `procps` containing [`pgrep`](https://linux.die.net/man/1/pgrep) (man page): In Ubuntu the package is in the _main_ part of the official archive.
30+
31+
- [X Window System](https://en.wikipedia.org/wiki/X_Window_System) (wiki), with any [desktop environment](https://en.wikipedia.org/wiki/Desktop_environment) (wiki).
32+
33+
- [Lightshot](https://app.prntscr.com/en/wine-lightshot.html) (installation info page) properly installed into [Wine](https://www.winehq.org/) (home page).
34+
35+
***
36+
37+
## Usage instructions
38+
39+
### Download and Preparation
40+
41+
Visit the [latest release download page](https://github.com/burianvlastimil/lightshot-print-screen-linux-handler/releases/latest) (direct link). If you download the file `lightshot-print-screen`, you will need to open your terminal and give it **permission to read and execute** to all users with:
42+
43+
```
44+
chmod 755 lightshot-print-screen
45+
```
46+
47+
Note, that you will be able to avoid this step of changing permissions if you download the source code or clone the repository. However, I advise you to download that single file directly as you will not have to remove anything afterward.
48+
49+
### General
50+
51+
Now you need to place it somewhere, e.g. to your home directory inside `~/bin`, and put a path to it e.g. in Linux Mint Cinnamon to the:
52+
53+
**Keyboard****Shortcuts****Custom Shortcuts** → click on button named **Add custom shortcut** and fill the form out.
54+
55+
### Command-line interface
56+
57+
Let me just point out, that there are many error checks along the whole script, so I advise you to run it within your terminal while your Lightshot is running to possibly debug any and all misbehaviors.
58+
59+
There is also the help switch (not `--help`):
60+
61+
```
62+
./lightshot-print-screen -h
63+
```
64+
65+
which will point out the possibility for you to feed the key combination you have configured in your Lightshot interface without ever editing the script:
66+
67+
```
68+
Project: Lightshot print screen Linux handler
69+
Version: 9.0 (2025-Apr-21)
70+
GitHub : https://burian.work/lightshot
71+
--------------------------------------------------------------------
72+
Description: This script works with XDOTOOL to trigger Print Screen
73+
key combination in Lightshot application installed on Linux in Wine.
74+
The script, however, won't launch Lightshot for you due to variable
75+
installation locations which make it impossible. You need to run it!
76+
License is MIT. The code can be further enhanced by others provided
77+
that any new copies have my copyright notice included in every case.
78+
--------------------------------------------------------------------
79+
Usage in terminal: ./lightshot-print-screen [-k HotKey]
80+
81+
-k HotKey: Optional switch requiring one argument,
82+
which is the print screen hotkey combination.
83+
For the left Control key and the Print Screen key
84+
that would be -k Control_L+Print (as an example).
85+
86+
-h: Show this help.
87+
88+
Usage in desktop environment:
89+
90+
You need to find Keyboard shortcuts, and re-map Print to run
91+
this script, an example from Linux Mint is placed on GitHub.
92+
93+
Author:
94+
Copyright 2018-2025
95+
Vlastimil Burián
96+
info@vlastimilburian.cz
97+
```
98+
99+
### Graphical interface
100+
101+
There is none. This script however launches the Lightshot screenshot tool directly, same as if you right-clicked on its tray icon and then clicked _Take a screenshot_.
102+
103+
***
104+
105+
## Screenshot from Linux Mint Cinnamon keyboard settings
106+
107+
![Screenshot from Linux Mint Cinnamon keyboard settings](https://www.vlastimilburian.cz/github_images/lightshot-linux-mint-20.png)
108+
109+
***
110+
111+
## Reporting bugs and suggestions
112+
113+
Please open a [new issue ticket](https://github.com/burianvlastimil/lightshot-print-screen-linux-handler/issues/new) (direct link).

0 commit comments

Comments
 (0)