| Hash | Commit message | Author | Date | Files | + | - |
1 | commit 63d0f80a286da7a9036ec00b3c6ba71b6c049a5e |
2 | Author: Connor Etherington <[email protected]> |
3 | Date: Mon Oct 2 08:59:13 2023 +0200 |
4 | |
5 | Auto-Commit Update - 20231002 |
6 | --- |
7 | BUILD/.pkg.pkg.tar.xz | Bin 78520 -> 0 bytes |
8 | BUILD/.pkg/Makefile | 92 ---- |
9 | BUILD/.pkg/README.md | 157 ------ |
10 | BUILD/.pkg/lfp.install | 9 - |
11 | .../lfpreviewer/X.cpython-310-x86_64-linux-gnu.so | Bin 105296 -> 0 bytes |
12 | .../lfpreviewer/X.cpython-311-x86_64-linux-gnu.so | Bin 34696 -> 0 bytes |
13 | BUILD/.pkg/lfpreviewer/lfpreviewer/X/X.c | 36 -- |
14 | BUILD/.pkg/lfpreviewer/lfpreviewer/X/X.h | 7 - |
15 | BUILD/.pkg/lfpreviewer/lfpreviewer/X/Xshm.c | 296 ----------- |
16 | BUILD/.pkg/lfpreviewer/lfpreviewer/X/Xshm.h | 7 - |
17 | BUILD/.pkg/lfpreviewer/lfpreviewer/X/display.c | 276 ---------- |
18 | BUILD/.pkg/lfpreviewer/lfpreviewer/X/display.h | 29 -- |
19 | BUILD/.pkg/lfpreviewer/lfpreviewer/X/math.h | 7 - |
20 | BUILD/.pkg/lfpreviewer/lfpreviewer/X/python.h | 11 - |
21 | BUILD/.pkg/lfpreviewer/lfpreviewer/X/util.h | 28 - |
22 | BUILD/.pkg/lfpreviewer/lfpreviewer/X/window.c | 316 ----------- |
23 | BUILD/.pkg/lfpreviewer/lfpreviewer/X/window.h | 7 - |
24 | BUILD/.pkg/lfpreviewer/lfpreviewer/__init__.py | 7 - |
25 | BUILD/.pkg/lfpreviewer/lfpreviewer/__main__.py | 59 --- |
26 | BUILD/.pkg/lfpreviewer/lfpreviewer/action.py | 294 ----------- |
27 | BUILD/.pkg/lfpreviewer/lfpreviewer/batch.py | 267 ---------- |
28 | BUILD/.pkg/lfpreviewer/lfpreviewer/conversion.py | 14 - |
29 | BUILD/.pkg/lfpreviewer/lfpreviewer/files.py | 47 -- |
30 | BUILD/.pkg/lfpreviewer/lfpreviewer/geometry.py | 20 - |
31 | BUILD/.pkg/lfpreviewer/lfpreviewer/layer.py | 253 --------- |
32 | BUILD/.pkg/lfpreviewer/lfpreviewer/lib/__init__.py | 0 |
33 | BUILD/.pkg/lfpreviewer/lfpreviewer/lib/lib.sh | 69 --- |
34 | .../lfpreviewer/lfpreviewer/lib/v0/__init__.py | 323 ------------ |
35 | BUILD/.pkg/lfpreviewer/lfpreviewer/library.py | 8 - |
36 | BUILD/.pkg/lfpreviewer/lfpreviewer/loading.py | 494 ------------------ |
37 | BUILD/.pkg/lfpreviewer/lfpreviewer/parser.py | 145 ------ |
38 | BUILD/.pkg/lfpreviewer/lfpreviewer/pattern.py | 12 - |
39 | BUILD/.pkg/lfpreviewer/lfpreviewer/process.py | 134 ----- |
40 | .../.pkg/lfpreviewer/lfpreviewer/query_windows.py | 99 ---- |
41 | BUILD/.pkg/lfpreviewer/lfpreviewer/scaling.py | 264 ---------- |
42 | BUILD/.pkg/lfpreviewer/lfpreviewer/terminal.py | 109 ---- |
43 | BUILD/.pkg/lfpreviewer/lfpreviewer/thread.py | 48 -- |
44 | BUILD/.pkg/lfpreviewer/lfpreviewer/tmux_util.py | 103 ---- |
45 | BUILD/.pkg/lfpreviewer/lfpreviewer/ui.py | 177 ------- |
46 | BUILD/.pkg/lfpreviewer/lfpreviewer/version.py | 5 - |
47 | BUILD/.pkg/lfpreviewer/lfpreviewer/xutil.py | 144 ----- |
48 | BUILD/.pkg/lfpreviewer/setup.py | 28 - |
49 | BUILD/.pkg/usr/bin/lfp | 4 - |
50 | BUILD/.pkg/usr/share/doc/lfp/README.md | 157 ------ |
51 | BUILD/.pkg/usr/share/lfp/cleaner | 8 - |
52 | BUILD/.pkg/usr/share/lfp/lfp | 14 - |
53 | BUILD/.pkg/usr/share/lfp/lfp-icons | 117 ----- |
54 | BUILD/.pkg/usr/share/lfp/lfpcd | 7 - |
55 | BUILD/.pkg/usr/share/lfp/lfprc | 579 --------------------- |
56 | BUILD/.pkg/usr/share/lfp/ocr/ocr.js | 56 -- |
57 | BUILD/.pkg/usr/share/lfp/ocr/package-lock.json | 27 - |
58 | BUILD/.pkg/usr/share/lfp/ocr/package.json | 19 - |
59 | BUILD/.pkg/usr/share/lfp/ocr/tesseract/LICENSE | 21 - |
60 | .../.pkg/usr/share/lfp/ocr/tesseract/package.json | 37 -- |
61 | BUILD/.pkg/usr/share/lfp/ocr/tesseract/readme.md | 96 ---- |
62 | .../usr/share/lfp/ocr/tesseract/src/index.d.ts | 195 ------- |
63 | .../.pkg/usr/share/lfp/ocr/tesseract/src/index.js | 58 --- |
64 | BUILD/.pkg/usr/share/lfp/ocr/yarn.lock | 8 - |
65 | BUILD/.pkg/usr/share/lfp/scope | 42 -- |
66 | BUILD/.pkg/usr/share/licenses/lfp/LICENSE | 27 - |
67 | BUILD/.pkg/usr/share/man/man1/lfp.1.gz | Bin 1916 -> 0 bytes |
68 | BUILD/PKGBUILD | 4 +- |
69 | BUILD/lfp-4.1.0-1-x86_64.pkg.tar.xz | Bin 0 -> 78412 bytes |
70 | BUILD/lfp/HEAD | 1 - |
71 | BUILD/lfp/config | 8 - |
72 | BUILD/lfp/description | 1 - |
73 | BUILD/lfp/hooks/applypatch-msg.sample | 15 - |
74 | BUILD/lfp/hooks/commit-msg.sample | 24 - |
75 | BUILD/lfp/hooks/fsmonitor-watchman.sample | 174 ------- |
76 | BUILD/lfp/hooks/post-update.sample | 8 - |
77 | BUILD/lfp/hooks/pre-applypatch.sample | 14 - |
78 | BUILD/lfp/hooks/pre-commit.sample | 49 -- |
79 | BUILD/lfp/hooks/pre-merge-commit.sample | 13 - |
80 | BUILD/lfp/hooks/pre-push.sample | 53 -- |
81 | BUILD/lfp/hooks/pre-rebase.sample | 169 ------ |
82 | BUILD/lfp/hooks/pre-receive.sample | 24 - |
83 | BUILD/lfp/hooks/prepare-commit-msg.sample | 42 -- |
84 | BUILD/lfp/hooks/push-to-checkout.sample | 78 --- |
85 | BUILD/lfp/hooks/sendemail-validate.sample | 77 --- |
86 | BUILD/lfp/hooks/update.sample | 128 ----- |
87 | BUILD/lfp/info/exclude | 6 - |
88 | ...ck-8e07188bfd62ea160e5d9f224baaab63a0e44c15.idx | Bin 88628 -> 0 bytes |
89 | ...k-8e07188bfd62ea160e5d9f224baaab63a0e44c15.pack | Bin 56751126 -> 0 bytes |
90 | ...ck-8e07188bfd62ea160e5d9f224baaab63a0e44c15.rev | Bin 12560 -> 0 bytes |
91 | BUILD/lfp/packed-refs | 2 - |
92 | BUILD/pkg/lfp/usr/bin/lfp | 4 - |
93 | BUILD/pkg/lfp/usr/bin/lfpreviewer | 33 -- |
94 | .../lfpreviewer-0.1.0-py3.10.egg-info/PKG-INFO | 12 - |
95 | .../lfpreviewer-0.1.0-py3.10.egg-info/SOURCES.txt | 35 -- |
96 | .../dependency_links.txt | 1 - |
97 | .../entry_points.txt | 2 - |
98 | .../lfpreviewer-0.1.0-py3.10.egg-info/requires.txt | 3 - |
99 | .../top_level.txt | 1 - |
100 | .../lfpreviewer/X.cpython-310-x86_64-linux-gnu.so | Bin 111600 -> 0 bytes |
101 | .../lib/python3.10/site-packages/lfpreviewer/X/X.c | 36 -- |
102 | .../python3.10/site-packages/lfpreviewer/X/Xshm.c | 296 ----------- |
103 | .../site-packages/lfpreviewer/X/display.c | 276 ---------- |
104 | .../site-packages/lfpreviewer/X/window.c | 316 ----------- |
105 | .../site-packages/lfpreviewer/__init__.py | 7 - |
106 | .../site-packages/lfpreviewer/__main__.py | 59 --- |
107 | .../__pycache__/__init__.cpython-310.opt-1.pyc | Bin 508 -> 0 bytes |
108 | .../__pycache__/__init__.cpython-310.pyc | Bin 508 -> 0 bytes |
109 | .../__pycache__/__main__.cpython-310.opt-1.pyc | Bin 1973 -> 0 bytes |
110 | .../__pycache__/__main__.cpython-310.pyc | Bin 1973 -> 0 bytes |
111 | .../__pycache__/action.cpython-310.opt-1.pyc | Bin 9651 -> 0 bytes |
112 | .../lfpreviewer/__pycache__/action.cpython-310.pyc | Bin 9651 -> 0 bytes |
113 | .../__pycache__/batch.cpython-310.opt-1.pyc | Bin 10837 -> 0 bytes |
114 | .../lfpreviewer/__pycache__/batch.cpython-310.pyc | Bin 10837 -> 0 bytes |
115 | .../__pycache__/conversion.cpython-310.opt-1.pyc | Bin 530 -> 0 bytes |
116 | .../__pycache__/conversion.cpython-310.pyc | Bin 530 -> 0 bytes |
117 | .../__pycache__/files.cpython-310.opt-1.pyc | Bin 1786 -> 0 bytes |
118 | .../lfpreviewer/__pycache__/files.cpython-310.pyc | Bin 1786 -> 0 bytes |
119 | .../__pycache__/geometry.cpython-310.opt-1.pyc | Bin 1121 -> 0 bytes |
120 | .../__pycache__/geometry.cpython-310.pyc | Bin 1121 -> 0 bytes |
121 | .../__pycache__/layer.cpython-310.opt-1.pyc | Bin 8537 -> 0 bytes |
122 | .../lfpreviewer/__pycache__/layer.cpython-310.pyc | Bin 8537 -> 0 bytes |
123 | .../__pycache__/library.cpython-310.opt-1.pyc | Bin 430 -> 0 bytes |
124 | .../__pycache__/library.cpython-310.pyc | Bin 430 -> 0 bytes |
125 | .../__pycache__/loading.cpython-310.opt-1.pyc | Bin 17686 -> 0 bytes |
126 | .../__pycache__/loading.cpython-310.pyc | Bin 17686 -> 0 bytes |
127 | .../__pycache__/parser.cpython-310.opt-1.pyc | Bin 5227 -> 0 bytes |
128 | .../lfpreviewer/__pycache__/parser.cpython-310.pyc | Bin 5227 -> 0 bytes |
129 | .../__pycache__/pattern.cpython-310.opt-1.pyc | Bin 795 -> 0 bytes |
130 | .../__pycache__/pattern.cpython-310.pyc | Bin 795 -> 0 bytes |
131 | .../__pycache__/process.cpython-310.opt-1.pyc | Bin 3521 -> 0 bytes |
132 | .../__pycache__/process.cpython-310.pyc | Bin 3521 -> 0 bytes |
133 | .../query_windows.cpython-310.opt-1.pyc | Bin 2661 -> 0 bytes |
134 | .../__pycache__/query_windows.cpython-310.pyc | Bin 2661 -> 0 bytes |
135 | .../__pycache__/scaling.cpython-310.opt-1.pyc | Bin 10006 -> 0 bytes |
136 | .../__pycache__/scaling.cpython-310.pyc | Bin 10006 -> 0 bytes |
137 | .../__pycache__/terminal.cpython-310.opt-1.pyc | Bin 2958 -> 0 bytes |
138 | .../__pycache__/terminal.cpython-310.pyc | Bin 2958 -> 0 bytes |
139 | .../__pycache__/thread.cpython-310.opt-1.pyc | Bin 1842 -> 0 bytes |
140 | .../lfpreviewer/__pycache__/thread.cpython-310.pyc | Bin 1842 -> 0 bytes |
141 | .../__pycache__/tmux_util.cpython-310.opt-1.pyc | Bin 3183 -> 0 bytes |
142 | .../__pycache__/tmux_util.cpython-310.pyc | Bin 3183 -> 0 bytes |
143 | .../__pycache__/ui.cpython-310.opt-1.pyc | Bin 6572 -> 0 bytes |
144 | .../lfpreviewer/__pycache__/ui.cpython-310.pyc | Bin 6572 -> 0 bytes |
145 | .../__pycache__/version.cpython-310.opt-1.pyc | Bin 303 -> 0 bytes |
146 | .../__pycache__/version.cpython-310.pyc | Bin 303 -> 0 bytes |
147 | .../__pycache__/xutil.cpython-310.opt-1.pyc | Bin 5092 -> 0 bytes |
148 | .../lfpreviewer/__pycache__/xutil.cpython-310.pyc | Bin 5092 -> 0 bytes |
149 | .../python3.10/site-packages/lfpreviewer/action.py | 294 ----------- |
150 | .../python3.10/site-packages/lfpreviewer/batch.py | 267 ---------- |
151 | .../site-packages/lfpreviewer/conversion.py | 14 - |
152 | .../python3.10/site-packages/lfpreviewer/files.py | 47 -- |
153 | .../site-packages/lfpreviewer/geometry.py | 20 - |
154 | .../python3.10/site-packages/lfpreviewer/layer.py | 253 --------- |
155 | .../site-packages/lfpreviewer/lib/__init__.py | 0 |
156 | .../lib/__pycache__/__init__.cpython-310.opt-1.pyc | Bin 154 -> 0 bytes |
157 | .../lib/__pycache__/__init__.cpython-310.pyc | Bin 154 -> 0 bytes |
158 | .../site-packages/lfpreviewer/lib/lib.sh | 69 --- |
159 | .../site-packages/lfpreviewer/lib/v0/__init__.py | 323 ------------ |
160 | .../v0/__pycache__/__init__.cpython-310.opt-1.pyc | Bin 11202 -> 0 bytes |
161 | .../lib/v0/__pycache__/__init__.cpython-310.pyc | Bin 11202 -> 0 bytes |
162 | .../site-packages/lfpreviewer/library.py | 8 - |
163 | .../site-packages/lfpreviewer/loading.py | 494 ------------------ |
164 | .../python3.10/site-packages/lfpreviewer/parser.py | 145 ------ |
165 | .../site-packages/lfpreviewer/pattern.py | 12 - |
166 | .../site-packages/lfpreviewer/process.py | 134 ----- |
167 | .../site-packages/lfpreviewer/query_windows.py | 99 ---- |
168 | .../site-packages/lfpreviewer/scaling.py | 264 ---------- |
169 | .../site-packages/lfpreviewer/terminal.py | 109 ---- |
170 | .../python3.10/site-packages/lfpreviewer/thread.py | 48 -- |
171 | .../site-packages/lfpreviewer/tmux_util.py | 103 ---- |
172 | .../lib/python3.10/site-packages/lfpreviewer/ui.py | 177 ------- |
173 | .../site-packages/lfpreviewer/version.py | 5 - |
174 | .../python3.10/site-packages/lfpreviewer/xutil.py | 144 ----- |
175 | BUILD/pkg/lfp/usr/share/doc/lfp/README.md | 157 ------ |
176 | BUILD/pkg/lfp/usr/share/lfp/cleaner | 8 - |
177 | BUILD/pkg/lfp/usr/share/lfp/lfp | 14 - |
178 | BUILD/pkg/lfp/usr/share/lfp/lfp-icons | 117 ----- |
179 | BUILD/pkg/lfp/usr/share/lfp/lfpcd | 7 - |
180 | BUILD/pkg/lfp/usr/share/lfp/lfprc | 579 --------------------- |
181 | BUILD/pkg/lfp/usr/share/lfp/ocr/ocr.js | 56 -- |
182 | BUILD/pkg/lfp/usr/share/lfp/ocr/package.json | 19 - |
183 | BUILD/pkg/lfp/usr/share/lfp/scope | 42 -- |
184 | BUILD/pkg/lfp/usr/share/licenses/lfp/LICENSE | 27 - |
185 | BUILD/pkg/lfp/usr/share/man/man1/lfp.1.gz | Bin 1916 -> 0 bytes |
186 | BUILD/src/lfp | 1 - |
187 | BUILD/tmpPKGB | 45 -- |
188 | BUILD/zst.sums | 8 - |
189 | PKGBUILD | 4 +- |
190 | 183 files changed, 6 insertions(+), 11951 deletions(-) |
191 | |
192 | diff --git a/BUILD/.pkg.pkg.tar.xz b/BUILD/.pkg.pkg.tar.xz |
193 | deleted file mode 100644 |
194 | index c9fdb8d..0000000 |
195 | Binary files a/BUILD/.pkg.pkg.tar.xz and /dev/null differ |
196 | diff --git a/BUILD/.pkg/Makefile b/BUILD/.pkg/Makefile |
197 | deleted file mode 100644 |
198 | index ac1b8bb..0000000 |
199 | --- a/BUILD/.pkg/Makefile |
200 | +++ /dev/null |
201 | @@ -1,92 +0,0 @@ |
202 | - |
203 | -PKG = lfp |
204 | -PREVIEWER = lfpreviewer |
205 | - |
206 | -INFO = $(shell uname -a) |
207 | -OST = $(shell lsb_release -d | sed 's|Description:\s*||') |
208 | -OS = $(shell lsb_release -d | sed 's|Description:\s*||'|cut -d\ -f1) |
209 | - |
210 | -ifeq ($(OS),Ubuntu) |
211 | - PACKAGE_MANAGER = apt |
212 | - INSTALL = sudo ${PACKAGE_MANAGER}-get install |
213 | - QUERY = sudo dpkg -S >/dev/null 2>&1 |
214 | - PKGS = python3-pip python3-setuptools libxres1 |
215 | -endif |
216 | - |
217 | -ifeq ($(OS),Debian) |
218 | - PACKAGE_MANAGER = apt |
219 | - INSTALL = sudo ${PACKAGE_MANAGER}-get install |
220 | - QUERY = sudo dpkg -S >/dev/null 2>&1 |
221 | - PKGS = python3-pip python3-setuptools libxres1 |
222 | -endif |
223 | - |
224 | -ifeq ($(OS),Arch) |
225 | - PACKAGE_MANAGER = pacman |
226 | - INSTALL = sudo ${PACKAGE_MANAGER} -Syy |
227 | - QUERY = sudo ${PACKAGE_MANAGER} -Qq >/dev/null 2>&1 |
228 | - PKGS = python-pip python-setuptools libxres |
229 | -endif |
230 | - |
231 | -ifeq ($(PACKAGE_MANAGER),) |
232 | -$(error > Unsupported OS: ${OST}) |
233 | -endif |
234 | - |
235 | -all: info |
236 | - |
237 | -lfpreviewer: |
238 | - @echo -e "\n\e[1;33m[+]\e[0m Installing ${PREVIEWER}...\n" |
239 | - @rm -rf ${PREVIEWER}/build ${PREVIEWER}/${PREVIEWER}.egg-info ${PREVIEWER}/dist |
240 | - @${QUERY} ${PKGS} || ${INSTALL} ${PKGS} |
241 | - @python3 -m pip install --upgrade pip |
242 | - @python3 -m pip install --upgrade setuptools |
243 | - @cd ${PREVIEWER} && python3 ./setup.py install && cd .. || true |
244 | - @which lfpreviewer >/dev/null 2>&1 || echo -e "\n\e[1;31m[-]\e[0m Please ensure you have sufficient premission to install ${PREVIEWER}." |
245 | - |
246 | -lfp: |
247 | - @echo -e "\n\e[1;33m[+]\e[0m Installing ${PKG}...\n" |
248 | - @sudo install -Dm755 usr/bin/* -t "${PKGDIR}/usr/bin" || true |
249 | - @sudo install -Dm755 usr/share/${PKG}/{${PKG},${PKG}cd,cleaner,scope} -t "${PKGDIR}/usr/share/${PKG}" || true |
250 | - @sudo install -Dm644 usr/share/${PKG}/{${PKG}-icons,${PKG}rc} -t "${PKGDIR}/usr/share/${PKG}" || true |
251 | - @sudo install -Dm644 usr/share/licenses/${PKG}/LICENSE "${PKGDIR}/usr/share/licenses/${PKG}/LICENSE" || true |
252 | - @sudo install -Dm644 usr/share/doc/${PKG}/README.md "${PKGDIR}/usr/share/doc/${PKG}/README.md" || true |
253 | - @sudo install -Dm644 usr/share/man/man1/${PKG}.1.gz "${PKGDIR}/usr/share/man/man1/${PKG}.1.gz" || true |
254 | - @[ ! -d /usr/share/lfp ] && echo -e "\n\e[1;31m[-]\e[0m Please ensure you have sufficient premission to install ${PKG}." || true |
255 | - |
256 | -install: lfpreviewer lfp cd-on-exit |
257 | - |
258 | -clean: |
259 | - @echo -e "\n\e[1;33m[+]\e[0m Cleaning up..." |
260 | - @sudo rm -rf ${PKGDIR}/lib/python3.*/site-packages/${PREVIEWER}* |
261 | - @sudo rm -rf ${PKGDIR}/usr/bin/${PREVIEWER} |
262 | - @sudo rm -rf ${PKGDIR}/usr/share/${PKG} |
263 | - @sudo rm -rf ${PKGDIR}/usr/bin/${PKG} |
264 | - @sudo rm -rf ${PKGDIR}/usr/bin/${PKG}cd |
265 | - @sudo rm -rf ${PKGDIR}/usr/bin/cleaner |
266 | - @sudo rm -rf ${PKGDIR}/usr/bin/scope |
267 | - @sudo rm -rf ${PKGDIR}/usr/share/licenses/${PKG} |
268 | - @sudo rm -rf ${PKGDIR}/usr/share/doc/${PKG} |
269 | - @sudo rm -rf ${PKGDIR}/usr/share/man/man1/${PKG}.1.gz |
270 | - |
271 | -info: |
272 | - @echo -e "\n\e[1;33m[*]\e[0m ${INFO}" |
273 | - |
274 | -help: |
275 | - @echo -e "\n Usage: make [all|install|uninstall|clean|distclean|preview|help]\n" |
276 | - @echo " all: build $(PKG)" |
277 | - @echo " install: install $(PKG)" |
278 | - @echo " uninstall: uninstall $(PKG)" |
279 | - @echo " clean: clean $(PKG)" |
280 | - @echo " distclean: clean $(PKG) and remove $(PKG) directory" |
281 | - @echo " preview: preview $(PKG)" |
282 | - @echo " help: show this help" |
283 | - |
284 | -cd-on-exit: |
285 | - @[ -d /usr/share/lfp ] && echo -e "\n\n\033[1;32m[+]\e[0;1m For on-exit directory changing, add the following line to your bash/zshrc\e[0m :\e[36m\n\n source '/usr/share/lfp/lfpcd'\n\e[0m" || echo -e "\n\033[1;31m[!]\e[0;1m Installation Failed!" |
286 | - |
287 | -uninstall: clean |
288 | - @echo -e "\n\e[1;32m[+]\e[0m ${PKG} successfully uninstalled" |
289 | - |
290 | -remove: uninstall |
291 | - |
292 | -.PHONY: info all lfpreviewer lfp install clean help cd-on-exit uninstall remove |
293 | - |
294 | diff --git a/BUILD/.pkg/README.md b/BUILD/.pkg/README.md |
295 | deleted file mode 100644 |
296 | index f3d345a..0000000 |
297 | --- a/BUILD/.pkg/README.md |
298 | +++ /dev/null |
299 | @@ -1,157 +0,0 @@ |
300 | - |
301 | -# An lf wrapper, with built-in previews and on-exit directory changing. |
302 | - |
303 | -### `lfp` is a simple wrapper for the `lf` file manager, with built-in file, image, and video previews, as well as on-exit directory changing. |
304 | -### The program makes use of `ueberzug` to preview images, documents, and video thumbnails. Preview behavior can be altered by editing the *scope* file. |
305 | - |
306 | -**Version: 4.1.0** |
307 | - |
308 | -*** |
309 | - |
310 | -## Usage: |
311 | - |
312 | -Run `lfp`. Optionally, a startup directory can be specified by a second argument. By default, `lfp` will launch in your current working directory. |
313 | -Icons for relative file types can be changed by editing the lfp-icons file in *'/usr/share/lfp/lfp-icons'*. |
314 | - |
315 | -**CD on exit:** |
316 | - |
317 | -For on-exit directory changing, add the following line to your bash/zshrc: |
318 | - |
319 | - source '/usr/share/lfp/lfpcd' |
320 | - |
321 | - |
322 | -**LFP OCR:** |
323 | - |
324 | -LFP OCR is a simple OCR script that uses tesseract to extract text from images. It can be used as a standalone script, or as a lfp action. |
325 | -All detected text is copied to your clipboard. |
326 | - |
327 | - |
328 | - |
329 | - |
330 | -## Installation |
331 | - |
332 | -### Arch Linux |
333 | - |
334 | -lfp is available in the AUR as `lfp` or `lfp-git` |
335 | - |
336 | - |
337 | -### Manual Installation |
338 | - |
339 | - tmp=$(mktemp -d); |
340 | - git clone https://gitlab.com/a4to/lfp.git ${tmp} && |
341 | - cd ${tmp} && sudo make clean install && cd - && |
342 | - rm -rf ${tmp} >/dev/null 2>&1 || true |
343 | - |
344 | - |
345 | -**To uninstall lfp:** |
346 | - |
347 | - sudo make uninstall |
348 | - |
349 | - |
350 | - |
351 | -## Prerequisites: |
352 | - |
353 | -* `lf`: the file manager |
354 | -* `zsh`: for scripting |
355 | -* `ueberzug`: for image previews |
356 | -* `ghostscript`: for PDF previews |
357 | -* `graphicsmagick`: for SVG and GIF previews |
358 | -* `ffmpeg`: for video file thumbnail previews |
359 | -* `dialog`: required by many functions outside the scope of image and video previews |
360 | -* `dunst`: to receive notifications upon task completion and so forth |
361 | -* `fzf`: for lfp's *fzfp* (fuzzy-finding) and *pushto* (git push) capabilities |
362 | -* `bat`: for text file previews |
363 | -* `git`: for cloning repos from within lfp |
364 | -* `lolcat`: used in lfp's *fzfp* function |
365 | - |
366 | -## Optional Dependencies: |
367 | - |
368 | -* `nodejs`: to make use of lfps built in node actions manager |
369 | -* `python3`: to make use of lfps built in python actions manager |
370 | - |
371 | - |
372 | - |
373 | -## Keybindings |
374 | - |
375 | -### Navigation: |
376 | - |
377 | -* **h**: Left |
378 | -* **j**: Down |
379 | -* **k**: Up |
380 | -* **l**: Right |
381 | - |
382 | - |
383 | -### Main Features and Functions: |
384 | - |
385 | -* **.**: Activate NodeManager |
386 | -* **,**: Activate PyManager |
387 | -* **o**: Activate LFP OCR |
388 | -* **v**: Toggle select all file(s) |
389 | -* **y**: Copy selected file(s) |
390 | -* **c**: Cut selected file(s) |
391 | -* **d**: Delete selected file(s) |
392 | -* **p**: Paste selected file(s) |
393 | -* **d**: Delete selected file(s) |
394 | -* **s**: Edit file you're currently hovering over |
395 | -* **n**: Create new directory |
396 | -* **m**: Play with mpv |
397 | -* **f**: Activate fzfp (lfp's fuzzy-finder) |
398 | -* **b**: Open file in default browser |
399 | -* **e**: Prompts you for a filename to edit/create |
400 | -* **t**: Prompts you for a filename for blank file to create |
401 | -* **x**: Execute selected file(s) |
402 | -* **z**: Open in `sxiv` (an image viewer) |
403 | -* **q**: Quit lfp |
404 | -* **\<Space\>**: Select file(s) |
405 | -* **\<Period\>**: (.) - Activates Node Actions, various npm/yarn actions / quick command execution |
406 | - |
407 | - |
408 | -### NodeManager: |
409 | - |
410 | -The NodeManager function provides various actions to manage a Node.js project, including: |
411 | - |
412 | -* **↑ Arrow**: Initialize a package.json file. |
413 | -* **↓ Arrow**: Select a javascript file to run. |
414 | -* **← Arrow**: Specify package(s) to install from npm. |
415 | -* **→ Arrow**: Start the server (yarn start). |
416 | -* **[h|d|m]**:: Start the server in development mode (yarn dev). |
417 | -* **[b|n]**: Build the project (yarn build). |
418 | -* **[i|I|,]**: Initialize a new npm project. |
419 | -* **[r]**: Remove specified packages. |
420 | -* **.**: Update the server (yarn). |
421 | -* **/**: Create a webserver on port 3000 (requires serve). |
422 | -* **q**: Exit. |
423 | - |
424 | - |
425 | -### PyManager: |
426 | - |
427 | -The PyManager function provides various actions to manage a Python project, including: |
428 | - |
429 | -* **↑ Arrow**: Create a new Conda environment at "./.🐍". |
430 | -* **↓ Arrow**: Select a python script to run. |
431 | -* **← Arrow**: Select package(s) to install from pypi. |
432 | -* **→ Arrow**: Run the main.py script if found. |
433 | -* **q**: Exit. |
434 | - |
435 | - |
436 | -### Additional Actions and Features: |
437 | - |
438 | -* **B**: Bulk rename |
439 | -* **E**: Extract archive |
440 | -* **D**: (sudo) Delete selected file(s) |
441 | -* **L**: Symlink selected file(s) to current directory |
442 | -* **H**: Create hardlink of selected file(s) to current directory |
443 | -* **R**: Create relative symlink of selected file(s) to current directory |
444 | -* **E**: Extract archive (bz2 rar gz tar tar.* tbz2 tgz zip Z 7z deb) |
445 | -* **C**: CopyPath, this feature copies the absolute path of the file youre currently hovering over to your clipboard |
446 | -* **\<Ctrl+c\>**: Quick clone a git repository without leaving lfp |
447 | -* **\<Ctrl+g\>**: Activate pushto - select a branch to push to (only works inside a git repo) |
448 | -* **\<Ctrl+b\>**: Open file in browser |
449 | -* **\<Ctrl+6\>**: Chmod 644 selected file(s) |
450 | -* **\<Ctrl+7\>**: Chmod 755 selected file(s) |
451 | -* **\<Ctrl+8\>**: Chmod 700 selected file(s) |
452 | -* **\<Enter\>**: Enter shell command |
453 | - |
454 | - |
455 | -And many more. |
456 | - |
457 | diff --git a/BUILD/.pkg/lfp.install b/BUILD/.pkg/lfp.install |
458 | deleted file mode 100644 |
459 | index 6c915df..0000000 |
460 | --- a/BUILD/.pkg/lfp.install |
461 | +++ /dev/null |
462 | @@ -1,9 +0,0 @@ |
463 | -post_install() { |
464 | - echo -e "\n \033[1;33m[+]\e[0;1;32m For on-exit directory changing, add the following line to your bash/zshrc\e[0m :\e[36m\n\n source '/usr/share/lfp/lfpcd'\n\n\n\e[0m" |
465 | -} |
466 | - |
467 | -post_upgrade() { |
468 | - which yarn >/dev/null 2>&1 && yarn install /usr/share/lfp/ocr || |
469 | - which npm >/dev/null 2>&1 && npm install /usr/share/lfp/ocr || |
470 | - true |
471 | -} |
472 | diff --git a/BUILD/.pkg/lfpreviewer/lfpreviewer/X.cpython-310-x86_64-linux-gnu.so b/BUILD/.pkg/lfpreviewer/lfpreviewer/X.cpython-310-x86_64-linux-gnu.so |
473 | deleted file mode 100755 |
474 | index 982026a..0000000 |
475 | Binary files a/BUILD/.pkg/lfpreviewer/lfpreviewer/X.cpython-310-x86_64-linux-gnu.so and /dev/null differ |
476 | diff --git a/BUILD/.pkg/lfpreviewer/lfpreviewer/X.cpython-311-x86_64-linux-gnu.so b/BUILD/.pkg/lfpreviewer/lfpreviewer/X.cpython-311-x86_64-linux-gnu.so |
477 | deleted file mode 100755 |
478 | index fcdf720..0000000 |
479 | Binary files a/BUILD/.pkg/lfpreviewer/lfpreviewer/X.cpython-311-x86_64-linux-gnu.so and /dev/null differ |
480 | diff --git a/BUILD/.pkg/lfpreviewer/lfpreviewer/X/X.c b/BUILD/.pkg/lfpreviewer/lfpreviewer/X/X.c |
481 | deleted file mode 100644 |
482 | index ac2c09a..0000000 |
483 | --- a/BUILD/.pkg/lfpreviewer/lfpreviewer/X/X.c |
484 | +++ /dev/null |
485 | @@ -1,36 +0,0 @@ |
486 | -#include "python.h" |
487 | -#include "display.h" |
488 | -#include "window.h" |
489 | -#include "Xshm.h" |
490 | - |
491 | - |
492 | -static PyModuleDef module = { |
493 | - PyModuleDef_HEAD_INIT, |
494 | - .m_name = "lfpreviewer.X", |
495 | - .m_doc = "Modul which implements the interaction with the Xshm extension.", |
496 | - .m_size = -1, |
497 | -}; |
498 | - |
499 | - |
500 | -PyMODINIT_FUNC |
501 | -PyInit_X(void) { |
502 | - PyObject *module_instance; |
503 | - if (PyType_Ready(&DisplayType) < 0 || |
504 | - PyType_Ready(&WindowType) < 0 || |
505 | - PyType_Ready(&ImageType) < 0) { |
506 | - return NULL; |
507 | - } |
508 | - |
509 | - module_instance = PyModule_Create(&module); |
510 | - if (module_instance == NULL) { |
511 | - return NULL; |
512 | - } |
513 | - |
514 | - Py_INCREF(&DisplayType); |
515 | - Py_INCREF(&WindowType); |
516 | - Py_INCREF(&ImageType); |
517 | - PyModule_AddObject(module_instance, "Display", (PyObject*)&DisplayType); |
518 | - PyModule_AddObject(module_instance, "OverlayWindow", (PyObject*)&WindowType); |
519 | - PyModule_AddObject(module_instance, "Image", (PyObject*)&ImageType); |
520 | - return module_instance; |
521 | -} |
522 | diff --git a/BUILD/.pkg/lfpreviewer/lfpreviewer/X/X.h b/BUILD/.pkg/lfpreviewer/lfpreviewer/X/X.h |
523 | deleted file mode 100644 |
524 | index 2523c59..0000000 |
525 | --- a/BUILD/.pkg/lfpreviewer/lfpreviewer/X/X.h |
526 | +++ /dev/null |
527 | @@ -1,7 +0,0 @@ |
528 | -#ifndef __X_H__ |
529 | -#define __X_H__ |
530 | -#include "python.h" |
531 | - |
532 | - |
533 | -PyModuleDef module; |
534 | -#endif |
535 | diff --git a/BUILD/.pkg/lfpreviewer/lfpreviewer/X/Xshm.c b/BUILD/.pkg/lfpreviewer/lfpreviewer/X/Xshm.c |
536 | deleted file mode 100644 |
537 | index b68919a..0000000 |
538 | --- a/BUILD/.pkg/lfpreviewer/lfpreviewer/X/Xshm.c |
539 | +++ /dev/null |
540 | @@ -1,296 +0,0 @@ |
541 | -#include "python.h" |
542 | - |
543 | -#include <stdbool.h> |
544 | -#include <sys/shm.h> |
545 | -#include <X11/Xlib.h> |
546 | -#include <X11/Xutil.h> |
547 | -#include <X11/extensions/XShm.h> |
548 | - |
549 | -#include "math.h" |
550 | -#include "util.h" |
551 | -#include "display.h" |
552 | - |
553 | -#define INVALID_SHM_ID -1 |
554 | -#define INVALID_SHM_ADDRESS (char*)-1 |
555 | -#define BYTES_PER_PIXEL 4 |
556 | - |
557 | - |
558 | -typedef struct { |
559 | - PyObject_HEAD |
560 | - int width; |
561 | - int height; |
562 | - int buffer_size; |
563 | - DisplayObject *display_pyobject; |
564 | - XShmSegmentInfo segmentInfo; |
565 | - XImage *image; |
566 | -} ImageObject; |
567 | - |
568 | - |
569 | -static inline Display * |
570 | -get_display(ImageObject *self) { |
571 | - return self->display_pyobject->event_display; |
572 | -} |
573 | - |
574 | -static bool |
575 | -Image_init_shared_memory(ImageObject *self) { |
576 | - self->segmentInfo.shmid = shmget( |
577 | - IPC_PRIVATE, |
578 | - self->buffer_size, |
579 | - IPC_CREAT | 0600); |
580 | - return self->segmentInfo.shmid != INVALID_SHM_ID; |
581 | -} |
582 | - |
583 | -static bool |
584 | -Image_map_shared_memory(ImageObject *self) { |
585 | - // Map the shared memory segment into the address space of this process |
586 | - self->segmentInfo.shmaddr = (char*)shmat(self->segmentInfo.shmid, 0, 0); |
587 | - |
588 | - if (self->segmentInfo.shmaddr != INVALID_SHM_ADDRESS) { |
589 | - self->segmentInfo.readOnly = true; |
590 | - // Mark the shared memory segment for removal |
591 | - // It will be removed even if this program crashes |
592 | - shmctl(self->segmentInfo.shmid, IPC_RMID, 0); |
593 | - return true; |
594 | - } |
595 | - |
596 | - return false; |
597 | -} |
598 | - |
599 | -static bool |
600 | -Image_create_shared_image(ImageObject *self) { |
601 | - Display *display = get_display(self); |
602 | - int screen = XDefaultScreen(display); |
603 | - // Allocate the memory needed for the XImage structure |
604 | - self->image = XShmCreateImage( |
605 | - display, XDefaultVisual(display, screen), |
606 | - DefaultDepth(display, screen), ZPixmap, 0, |
607 | - &self->segmentInfo, 0, 0); |
608 | - |
609 | - if (self->image) { |
610 | - self->image->data = (char*)self->segmentInfo.shmaddr; |
611 | - self->image->width = self->width; |
612 | - self->image->height = self->height; |
613 | - |
614 | - // Ask the X server to attach the shared memory segment and sync |
615 | - XShmAttach(display, &self->segmentInfo); |
616 | - XFlush(display); |
617 | - return true; |
618 | - } |
619 | - return false; |
620 | -} |
621 | - |
622 | -static void |
623 | -Image_destroy_shared_image(ImageObject *self) { |
624 | - if (self->image) { |
625 | - XShmDetach(get_display(self), &self->segmentInfo); |
626 | - XDestroyImage(self->image); |
627 | - self->image = NULL; |
628 | - } |
629 | -} |
630 | - |
631 | -static void |
632 | -Image_free_shared_memory(ImageObject *self) { |
633 | - if(self->segmentInfo.shmaddr != INVALID_SHM_ADDRESS) { |
634 | - shmdt(self->segmentInfo.shmaddr); |
635 | - self->segmentInfo.shmaddr = INVALID_SHM_ADDRESS; |
636 | - } |
637 | -} |
638 | - |
639 | -static void |
640 | -Image_finalise(ImageObject *self) { |
641 | - Image_destroy_shared_image(self); |
642 | - Image_free_shared_memory(self); |
643 | - Py_CLEAR(self->display_pyobject); |
644 | -} |
645 | - |
646 | -static int |
647 | -Image_init(ImageObject *self, PyObject *args, PyObject *kwds) { |
648 | - static char *kwlist[] = {"display", "width", "height", NULL}; |
649 | - PyObject *display_pyobject; |
650 | - |
651 | - if (!PyArg_ParseTupleAndKeywords( |
652 | - args, kwds, "O!ii", kwlist, |
653 | - &DisplayType, &display_pyobject, |
654 | - &self->width, &self->height)) { |
655 | - Py_INIT_RETURN_ERROR; |
656 | - } |
657 | - |
658 | - if (self->display_pyobject) { |
659 | - Image_finalise(self); |
660 | - } |
661 | - |
662 | - Py_INCREF(display_pyobject); |
663 | - self->display_pyobject = (DisplayObject*)display_pyobject; |
664 | - self->buffer_size = self->width * self->height * BYTES_PER_PIXEL; |
665 | - |
666 | - if (!Image_init_shared_memory(self)) { |
667 | - raiseInit(OSError, "could not init shared memory"); |
668 | - } |
669 | - |
670 | - if (!Image_map_shared_memory(self)) { |
671 | - raiseInit(OSError, "could not map shared memory"); |
672 | - } |
673 | - |
674 | - if (!Image_create_shared_image(self)) { |
675 | - Image_free_shared_memory(self); |
676 | - raiseInit(OSError, "could not allocate the XImage structure"); |
677 | - } |
678 | - |
679 | - Py_INIT_RETURN_SUCCESS; |
680 | -} |
681 | - |
682 | -static void |
683 | -Image_dealloc(ImageObject *self) { |
684 | - Image_finalise(self); |
685 | - Py_TYPE(self)->tp_free((PyObject*)self); |
686 | -} |
687 | - |
688 | -static PyObject * |
689 | -Image_copy_to(ImageObject *self, PyObject *args, PyObject *kwds) { |
690 | - // draws the image on the surface at x, y |
691 | - static char *kwlist[] = {"drawable", "x", "y", "width", "height", NULL}; |
692 | - Drawable surface; |
693 | - GC gc; |
694 | - int x, y; |
695 | - unsigned int width, height; |
696 | - Display *display = get_display(self); |
697 | - |
698 | - if (!PyArg_ParseTupleAndKeywords( |
699 | - args, kwds, "kiiII", kwlist, |
700 | - &surface, &x, &y, &width, &height)) { |
701 | - Py_RETURN_ERROR; |
702 | - } |
703 | - |
704 | - gc = XCreateGC(display, surface, 0, NULL); |
705 | - XShmPutImage(display, surface, gc, |
706 | - self->image, 0, 0, |
707 | - x, y, width, height, false); |
708 | - XFreeGC(display, gc); |
709 | - |
710 | - Py_RETURN_NONE; |
711 | -} |
712 | - |
713 | -static PyObject * |
714 | -Image_draw(ImageObject *self, PyObject *args, PyObject *kwds) { |
715 | - // puts the pixels on the image at x, y |
716 | - static char *kwlist[] = {"x", "y", "width", "height", "pixels", NULL}; |
717 | - int offset_x, offset_y; |
718 | - int width, height; |
719 | - int pixels_per_row; |
720 | - int source_pixels_per_row; |
721 | - int destination_pixels_per_row; |
722 | - int destination_offset_x_bytes; |
723 | - char *pixels; |
724 | - Py_ssize_t pixels_size; |
725 | - |
726 | - if (!PyArg_ParseTupleAndKeywords( |
727 | - args, kwds, "iiiis#", kwlist, |
728 | - &offset_x, &offset_y, &width, &height, |
729 | - &pixels, &pixels_size)) { |
730 | - Py_RETURN_ERROR; |
731 | - } |
732 | - |
733 | - Py_BEGIN_ALLOW_THREADS |
734 | - destination_offset_x_bytes = max(0, offset_x) * BYTES_PER_PIXEL; |
735 | - source_pixels_per_row = width * BYTES_PER_PIXEL; |
736 | - destination_pixels_per_row = self->width * BYTES_PER_PIXEL; |
737 | - pixels_per_row = min(width + min(offset_x, 0), self->width - max(offset_x, 0)) * BYTES_PER_PIXEL; |
738 | - |
739 | - if (offset_x + width > 0 && offset_x < self->width) { |
740 | - // < 0 -> start y = 0, min(surface.height, height - abs(offset)) |
741 | - // > 0 -> start y = offset, height = min(surface.height, height + offset) |
742 | - for (int y = max(0, offset_y); y < min(self->height, height + offset_y); y++) { |
743 | - // < 0 -> first row = abs(offset) => n row = y + abs(offset) |
744 | - // > 0 -> first row = - offset => n row = y - offset |
745 | - // => n row = y - offset |
746 | - int pixels_y = y - offset_y; |
747 | - void *destination = |
748 | - self->image->data + y * destination_pixels_per_row |
749 | - + destination_offset_x_bytes; |
750 | - void *source = pixels + pixels_y * source_pixels_per_row; |
751 | - |
752 | - if (! ((uintptr_t)self->image->data <= (uintptr_t)destination)) { |
753 | - raise(AssertionError, |
754 | - "The destination start address calculation went wrong.\n" |
755 | - "It points to an address which is before the start address of the buffer.\n" |
756 | - "%p not smaller than %p", |
757 | - self->image->data, destination); |
758 | - } |
759 | - if (! ((uintptr_t)destination + pixels_per_row |
760 | - <= (uintptr_t)self->image->data + self->buffer_size)) { |
761 | - raise(AssertionError, |
762 | - "The destination end address calculation went wrong.\n" |
763 | - "It points to an address which is after the end address of the buffer.\n" |
764 | - "%p not smaller than %p", |
765 | - destination + pixels_per_row, |
766 | - self->image->data + self->buffer_size); |
767 | - } |
768 | - if (! ((uintptr_t)pixels <= (uintptr_t)source)) { |
769 | - raise(AssertionError, |
770 | - "The source start address calculation went wrong.\n" |
771 | - "It points to an address which is before the start address of the buffer.\n" |
772 | - "%p not smaller than %p", |
773 | - pixels, source); |
774 | - } |
775 | - if (! ((uintptr_t)source + pixels_per_row |
776 | - <= (uintptr_t)pixels + pixels_size)) { |
777 | - raise(AssertionError, |
778 | - "The source end address calculation went wrong.\n" |
779 | - "It points to an address which is after the end address of the buffer." |
780 | - "%p not smaller than %p", |
781 | - source + pixels_per_row, |
782 | - pixels + pixels_size); |
783 | - } |
784 | - |
785 | - memcpy(destination, source, pixels_per_row); |
786 | - } |
787 | - } |
788 | - Py_END_ALLOW_THREADS |
789 | - |
790 | - Py_RETURN_NONE; |
791 | -} |
792 | - |
793 | -static PyMethodDef Image_methods[] = { |
794 | - {"copy_to", (PyCFunction)Image_copy_to, |
795 | - METH_VARARGS | METH_KEYWORDS, |
796 | - "Draws the image on the surface at the passed coordinate.\n" |
797 | - "\n" |
798 | - "Args:\n" |
799 | - " drawable (int): the surface to draw on\n" |
800 | - " x (int): the x position where this image should be placed\n" |
801 | - " y (int): the y position where this image should be placed\n" |
802 | - " width (int): the width of the area\n" |
803 | - " which should be copied to the drawable\n" |
804 | - " height (int): the height of the area\n" |
805 | - " which should be copied to the drawable"}, |
806 | - {"draw", (PyCFunction)Image_draw, |
807 | - METH_VARARGS | METH_KEYWORDS, |
808 | - "Places the pixels on the image at the passed coordinate.\n" |
809 | - "\n" |
810 | - "Args:\n" |
811 | - " x (int): the x position where the pixels should be placed\n" |
812 | - " y (int): the y position where the pixels should be placed\n" |
813 | - " width (int): amount of pixels per row in the passed data\n" |
814 | - " height (int): amount of pixels per column in the passed data\n" |
815 | - " pixels (bytes): the pixels to place on the image"}, |
816 | - {NULL} /* Sentinel */ |
817 | -}; |
818 | - |
819 | -PyTypeObject ImageType = { |
820 | - PyVarObject_HEAD_INIT(NULL, 0) |
821 | - .tp_name = "lfpreviewer.X.Image", |
822 | - .tp_doc = |
823 | - "An shared memory X11 Image\n" |
824 | - "\n" |
825 | - "Args:\n" |
826 | - " display (lfpreviewer.X.Display): the X11 display\n" |
827 | - " width (int): the width of this image\n" |
828 | - " height (int): the height of this image", |
829 | - .tp_basicsize = sizeof(ImageObject), |
830 | - .tp_itemsize = 0, |
831 | - .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, |
832 | - .tp_new = PyType_GenericNew, |
833 | - .tp_init = (initproc)Image_init, |
834 | - .tp_dealloc = (destructor) Image_dealloc, |
835 | - .tp_methods = Image_methods, |
836 | -}; |
837 | diff --git a/BUILD/.pkg/lfpreviewer/lfpreviewer/X/Xshm.h b/BUILD/.pkg/lfpreviewer/lfpreviewer/X/Xshm.h |
838 | deleted file mode 100644 |
839 | index ab61b4d..0000000 |
840 | --- a/BUILD/.pkg/lfpreviewer/lfpreviewer/X/Xshm.h |
841 | +++ /dev/null |
842 | @@ -1,7 +0,0 @@ |
843 | -#ifndef __XSHM_H__ |
844 | -#define __XSHM_H__ |
845 | -#include "python.h" |
846 | - |
847 | - |
848 | -extern PyTypeObject ImageType; |
849 | -#endif |
850 | diff --git a/BUILD/.pkg/lfpreviewer/lfpreviewer/X/display.c b/BUILD/.pkg/lfpreviewer/lfpreviewer/X/display.c |
851 | deleted file mode 100644 |
852 | index c9e4eee..0000000 |
853 | --- a/BUILD/.pkg/lfpreviewer/lfpreviewer/X/display.c |
854 | +++ /dev/null |
855 | @@ -1,276 +0,0 @@ |
856 | -#include "python.h" |
857 | - |
858 | -#include <X11/Xlib.h> |
859 | -#include <X11/extensions/XRes.h> |
860 | -#include <X11/extensions/XShm.h> |
861 | - |
862 | -#include "util.h" |
863 | -#include "display.h" |
864 | - |
865 | - |
866 | -#define INVALID_PID (pid_t)-1 |
867 | - |
868 | - |
869 | -#define REOPEN_DISPLAY(display) \ |
870 | - if (display != NULL) { \ |
871 | - XCloseDisplay(display); \ |
872 | - } \ |
873 | - display = XOpenDisplay(NULL); |
874 | - |
875 | -#define CLOSE_DISPLAY(display) \ |
876 | - if (display != NULL) { \ |
877 | - XCloseDisplay(display); \ |
878 | - display = NULL; \ |
879 | - } |
880 | - |
881 | - |
882 | -static int |
883 | -Display_init(DisplayObject *self, PyObject *args, PyObject *kwds) { |
884 | - // Two connections are opened as |
885 | - // a death lock can occur |
886 | - // if you listen for events |
887 | - // (this will happen in parallel in asyncio worker threads) |
888 | - // and request information (e.g. XGetGeometry) |
889 | - // simultaneously. |
890 | - REOPEN_DISPLAY(self->event_display); |
891 | - REOPEN_DISPLAY(self->info_display); |
892 | - |
893 | - if (self->event_display == NULL || |
894 | - self->info_display == NULL) { |
895 | - raiseInit(OSError, "could not open a connection to the X server"); |
896 | - } |
897 | - |
898 | - int _; |
899 | - if (!XResQueryExtension(self->info_display, &_, &_)) { |
900 | - raiseInit(OSError, "the extension XRes is required"); |
901 | - } |
902 | - |
903 | - if (!XShmQueryExtension(self->event_display)) { |
904 | - raiseInit(OSError, "the extension Xext is required"); |
905 | - } |
906 | - |
907 | - int screen = XDefaultScreen(self->info_display); |
908 | - self->screen_width = XDisplayWidth(self->info_display, screen); |
909 | - self->screen_height = XDisplayHeight(self->info_display, screen); |
910 | - self->bitmap_pad = XBitmapPad(self->info_display); |
911 | - self->bitmap_unit = XBitmapUnit(self->info_display); |
912 | - |
913 | - self->wm_class = XInternAtom(self->info_display, "WM_CLASS", False); |
914 | - self->wm_name = XInternAtom(self->info_display, "WM_NAME", False); |
915 | - self->wm_locale_name = XInternAtom(self->info_display, "WM_LOCALE_NAME", False); |
916 | - self->wm_normal_hints = XInternAtom(self->info_display, "WM_NORMAL_HINTS", False); |
917 | - |
918 | - Py_INIT_RETURN_SUCCESS; |
919 | -} |
920 | - |
921 | -static void |
922 | -Display_dealloc(DisplayObject *self) { |
923 | - CLOSE_DISPLAY(self->event_display); |
924 | - CLOSE_DISPLAY(self->info_display); |
925 | - Py_TYPE(self)->tp_free((PyObject*)self); |
926 | -} |
927 | - |
928 | - |
929 | -static int |
930 | -has_property(DisplayObject *self, Window window, Atom property) { |
931 | - Atom actual_type_return; |
932 | - int actual_format_return; |
933 | - unsigned long bytes_after_return; |
934 | - unsigned char* prop_to_return = NULL; |
935 | - unsigned long nitems_return; |
936 | - |
937 | - int status = XGetWindowProperty( |
938 | - self->info_display, window, property, 0, |
939 | - 0L, False, |
940 | - AnyPropertyType, |
941 | - &actual_type_return, |
942 | - &actual_format_return, |
943 | - &nitems_return, &bytes_after_return, &prop_to_return); |
944 | - if (status == Success && prop_to_return) { |
945 | - XFree(prop_to_return); |
946 | - } |
947 | - return status == Success && !(actual_type_return == None && actual_format_return == 0); |
948 | -} |
949 | - |
950 | - |
951 | -static PyObject * |
952 | -Display_get_child_window_ids(DisplayObject *self, PyObject *args, PyObject *kwds) { |
953 | - static char *kwlist[] = {"parent_id", NULL}; |
954 | - Window parent = XDefaultRootWindow(self->info_display); |
955 | - Window _, *children; |
956 | - unsigned int children_count; |
957 | - |
958 | - if (!PyArg_ParseTupleAndKeywords( |
959 | - args, kwds, "|k", kwlist, |
960 | - &parent)) { |
961 | - Py_RETURN_ERROR; |
962 | - } |
963 | - |
964 | - if (!XQueryTree( |
965 | - self->info_display, parent, |
966 | - &_, &_, &children, &children_count)) { |
967 | - raise(OSError, "failed to query child windows of %lu", parent); |
968 | - } |
969 | - |
970 | - PyObject *child_ids = PyList_New(0); |
971 | - if (children) { |
972 | - for (unsigned int i = 0; i < children_count; i++) { |
973 | - // assume that windows without essential properties |
974 | - // like the window title aren't shown to the user |
975 | - int is_helper_window = ( |
976 | - !has_property(self, children[i], self->wm_class) && |
977 | - !has_property(self, children[i], self->wm_name) && |
978 | - !has_property(self, children[i], self->wm_locale_name) && |
979 | - !has_property(self, children[i], self->wm_normal_hints)); |
980 | - if (is_helper_window) { |
981 | - continue; |
982 | - } |
983 | - PyObject *py_window_id = Py_BuildValue("k", children[i]); |
984 | - PyList_Append(child_ids, py_window_id); |
985 | - Py_XDECREF(py_window_id); |
986 | - } |
987 | - XFree(children); |
988 | - } |
989 | - |
990 | - return child_ids; |
991 | -} |
992 | - |
993 | -static PyObject * |
994 | -Display_get_window_pid(DisplayObject *self, PyObject *args, PyObject *kwds) { |
995 | - static char *kwlist[] = {"window_id", NULL}; |
996 | - Window window; |
997 | - long num_ids; |
998 | - int num_specs = 1; |
999 | - XResClientIdValue *client_ids; |