bassmanitram / actions-for-nautilus Goto Github PK
View Code? Open in Web Editor NEWAn extension to the Gnome "Files" file manager that allows you to add arbitrary actions to the file selection context menu.
License: Apache License 2.0
An extension to the Gnome "Files" file manager that allows you to add arbitrary actions to the file selection context menu.
License: Apache License 2.0
I want to zip a file by using 7zip, here is my shell:
a="%F"; 7z a -si -bd -tzip "newZip.zip" <<< "$(echo -n "$a" | tr '\n' ' ')"
but it not works, so i want to see the debug output.
can you tell me how can I get the nautilus stdout
:(
How to popular the context menu options; say I added this context menu "Open in VS Code" I want to move to the top of the context menu, it should be the first appears before the "Open" option.
Hi @bassmanitram ,
My original command that work fine :
ffmpeg -y -i "%d/%b" "%d/%w.mp4"
My same command using pipe to another one to display progress bar :
ffmpeg -y -i "%d/%b" "%d/%w.mp4" 2>&1 | LANG=C yad --progress --pulsate --center --no-buttons --auto-close --title "Video Converting" --progress-text="Please wait while your video(s) file(s) gets converted..." --height=50
This last one doesn't work, running « nautilus --no-desktop », report error :
ffmpeg version 6.1.1-0ubuntu1~22.04.sav0.1 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 11 (Ubuntu 11.4.0-1ubuntu1~22.04)
configuration: --prefix=/usr --extra-version='0ubuntu1~22.04.sav0.1' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-amf --enable-gnutls --enable-ladspa --enable-lcms2 --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libharfbuzz --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-sndio --enable-libjxl --enable-pocketsphinx --enable-librsvg --enable-avisynth --enable-libfdk-aac --enable-libilbc --enable-librist --enable-vapoursynth --enable-libvmaf --enable-crystalhd --enable-libmfx --enable-libsvthevc --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libplacebo --enable-librav1e --enable-libsvtav1 --enable-shared
libavutil 58. 29.100 / 58. 29.100
libavcodec 60. 31.102 / 60. 31.102
libavformat 60. 16.100 / 60. 16.100
libavdevice 60. 3.100 / 60. 3.100
libavfilter 9. 12.100 / 9. 12.100
libswscale 7. 5.100 / 7. 5.100
libswresample 4. 12.100 / 4. 12.100
libpostproc 57. 3.100 / 57. 3.100
Unrecognized option '-progress'.
Error splitting the argument list: Option not found
Do you have any idea on how to fix it ?
Here is a video of command directly launch from shell :
Hi,
On my side I always tend to make debian package whenever it is possible...
On that way, I also always use commit TAG as the debian package versioning, to be able to find quickly what exact version is installed/running.
To do that, I have :
bigbob@bigbob-t480s:~/tmp/Building/actions-for-nautilus/actions-for-nautilus$ ln -sf packaging/doc/actions-for-nautilus debian
bigbob@bigbob-t480s:~/tmp/Building/actions-for-nautilus/actions-for-nautilus$ echo '--- Makefile-orig 2023-12-29 20:18:15.790419491 +0100
+++ Makefile 2023-12-29 20:25:07.476102657 +0100
@@ -2,7 +2,7 @@
nautilus_path=`which nautilus`
GLOBALLOC=/usr/share
LOCALLOC=~/.local/share
-VERSION=1.6.1
+VERSION := $(shell git --git-dir .git --work-tree . describe --always --tags | cut -c2-)
install:
mkdir -p $(LOCALLOC)/nautilus-python/extensions/actions-for-nautilus' | patch -p0
patching file Makefile
bigbob@bigbob-t480s:~/tmp/Building/actions-for-nautilus/actions-for-nautilus$
bigbob@bigbob-t480s:~/tmp/Building/actions-for-nautilus/actions-for-nautilus$ DEBEMAIL="COLIN Stephane <[email protected]>" dch -b -v $(git --git-dir .git --work-tree . describe --always --tags | cut -c2-) "Update to latest GIT Version..." && sed -i '$!N; /^\(.*\)\n\1$/!P; D' debian/changelog ; head -10 debian/changelog
dch warning: Previous package version was Debian native whilst new version is not
actions-for-nautilus (1.6.1-4-g0a3c7ce) UNRELEASED; urgency=medium
* Update to latest GIT Version...
-- COLIN Stephane <[email protected]> Fri, 29 Dec 2023 20:47:00 +0100
actions-for-nautilus (1.6.1) stable; urgency=high
* Fix config server being open on all interfaces
* Fix config server not being closed by FF tab close
bigbob@bigbob-t480s:~/tmp/Building/actions-for-nautilus/actions-for-nautilus$
bigbob@bigbob-t480s:~/tmp/Building/actions-for-nautilus/actions-for-nautilus$ rm dist/* ; fakeroot make deb
rm -rf build
mkdir -p build//usr/share/nautilus-python
mkdir -p build//usr/share/actions-for-nautilus-configurator
mkdir -p build//usr/share/applications
mkdir -p build//usr/share/doc/actions-for-nautilus
mkdir -p build/DEBIAN
cp -r --preserve=mode,timestamps extensions build//usr/share/nautilus-python
cp -r --preserve=mode,timestamps configurator/* build//usr/share/actions-for-nautilus-configurator
rm build//usr/share/actions-for-nautilus-configurator/javascript/jquery.min.js
LOC=/usr/share python3 -c 'import os,sys; sys.stdout.write(os.path.expandvars(sys.stdin.read()))' \
< build//usr/share/actions-for-nautilus-configurator/actions-for-nautilus-configurator.desktop \
> build//usr/share/applications/actions-for-nautilus-configurator.desktop
VERSION=1.6.1-4-g0a3c7ce python3 -c 'import os,sys; sys.stdout.write(os.path.expandvars(sys.stdin.read()))' \
< packaging/DEBIAN/control \
> build/DEBIAN/control
cp -r --preserve=mode,timestamps packaging/doc build//usr/share
cp README.md build//usr/share/doc/actions-for-nautilus
cp RELEASE-NOTES.md build//usr/share/doc/actions-for-nautilus/NEWS
mv build//usr/share/actions-for-nautilus-configurator/README.md build//usr/share/doc/actions-for-nautilus/configurator.README.md
gzip -n9 build//usr/share/doc/actions-for-nautilus/NEWS
gzip -n9 build//usr/share/doc/actions-for-nautilus/changelog
find build/ -type d -exec chmod 0755 {} \;
find build/ -type f -exec chmod 0644 {} \;
chmod +x build//usr/share/actions-for-nautilus-configurator/start-configurator.sh
dpkg-deb -Z gzip --build build dist/actions-for-nautilus_1.6.1-4-g0a3c7ce_all.deb
dpkg-deb: construction du paquet « actions-for-nautilus » dans « dist/actions-for-nautilus_1.6.1-4-g0a3c7ce_all.deb ».
lintian dist/actions-for-nautilus_1.6.1-4-g0a3c7ce_all.deb
running with root privileges is not recommended!
E: actions-for-nautilus: debian-changelog-file-missing-or-wrong-name
W: actions-for-nautilus: copyright-without-copyright-notice
bigbob@bigbob-t480s:~/tmp/Building/actions-for-nautilus/actions-for-nautilus$
bigbob@bigbob-t480s:~/tmp/Building/actions-for-nautilus/actions-for-nautilus$ ls dist/
actions-for-nautilus_1.6.1-4-g0a3c7ce_all.deb
bigbob@bigbob-t480s:~/tmp/Building/actions-for-nautilus/actions-for-nautilus$
Hope it help...
When you move a command action that is in error (particularly, has the min/max inconsistency error) "past" a menu item, the command action in error becomes a menu action - with even more errors!
After the configuration page is closed, the port in which the configuration page is being hosted on is still open. This is a huge security vulnerability, how can we circumvent this?
First, many thanks for keeping this project alive. It's a key part of my professional workflow!
I am trying to add the following command (as I would write in a terminal):
pdfseparate myfile.pdf %d-myfile.pdf
which creates 0-myfile.pdf
, 1-myfile.pdf
, ... for each page of the original file.
As you can see pdfseparate
requires %d
to execute otherwise it fails and complains : must contain '%d' (or any variant respecting printf format) if more than one page should be extracted, in order to print the page number
I'm looking for a way to run this in actions-for-nautilus
.
pdfseparate %F %d-myfile.pdf
does not work because both %F
and %d
are changed.
I have not managed to write this command in actions-for-nautilus
that makes it run successfully.
I need to be able to use %F
as a placeholder but keep %d
as is. How can I escape a specific part of the command?
Followed the install instructions:
I don't see any commands in the right-click menu of an image file.
For example, a file containing an exclamation point :
bigbob@bigbob-t480s:~/Téléchargements$ ll Renouvellement\ de\ Votre\ Domaine\ blacktiger.tech\ Avant\ l\'Expiration\ \!.eml
3158596 -rw-rw-r-- 1 bigbob bigbob 12612 2023-12-22 15:22:35.350213309 +0100 Renouvellement de Votre Domaine blacktiger.tech Avant l'Expiration !.eml
bigbob@bigbob-t480s:~/Téléchargements$
The log of « Nautilus » say :
bigbob@bigbob-t480s:~/Téléchargements$ # Stop Nautilus
nautilus -q
# Restart with `stdout` and `stderr` being displayed at the terminal
nautilus --no-desktop
Traceback (most recent call last):
File "/usr/share/nautilus-python/extensions/actions-for-nautilus/actions_for_nautilus.py", line 56, in _run_command
final_command_line = list(map(lambda arg: arg.replace("\\\\","!§ESCBACKSLASH§µ").replace("\\", "").replace("!§ESCBACKSLASH§µ","\\"),shlex.split(final_command_line)))
File "/usr/lib/python3.10/shlex.py", line 315, in split
return list(lex)
File "/usr/lib/python3.10/shlex.py", line 300, in __next__
token = self.get_token()
File "/usr/lib/python3.10/shlex.py", line 109, in get_token
raw = self.read_token()
File "/usr/lib/python3.10/shlex.py", line 191, in read_token
raise ValueError("No closing quotation")
ValueError: No closing quotation
bigbob@bigbob-t480s:~/Téléchargements$
Dear Martin,
thanks a lot that you started with this project. I use the file manager actions a lot was deeply disappointed that support for nautilus was dropped (it still works in Nemo though).
Anyway I get some warning/error messages when trying to install the deb package via Gdebi, see below:
E: actions-for-nautilus: depends-on-essential-package-without-using-version Suggests: bash
E: actions-for-nautilus: extended-description-is-empty
E: actions-for-nautilus: no-changelog usr/share/doc/actions-for-nautilus/changelog.gz (native package)
E: actions-for-nautilus: no-copyright-file
E: actions-for-nautilus: privacy-breach-uses-embedded-file You may use the libjs-bootstrap package. (https://cdn.jsdelivr.net/npm/bootstrap@latest/dist/css/bootstrap.min.css) [usr/share/actions-for-nautilus-configurator/actions-for-nautilus-configurator.html]
E: actions-for-nautilus: privacy-breach-uses-embedded-file You may use the libjs-jquery package. (https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js) [usr/share/actions-for-nautilus-configurator/actions-for-nautilus-configurator.html]
E: actions-for-nautilus: wrong-file-owner-uid-or-gid usr/ 1000/1000
E: actions-for-nautilus: wrong-file-owner-uid-or-gid usr/share/ 1000/1000
E: actions-for-nautilus: wrong-file-owner-uid-or-gid usr/share/actions-for-nautilus-configurator/ 1000/1000
E: actions-for-nautilus: wrong-file-owner-uid-or-gid usr/share/actions-for-nautilus-configurator/README.md 1000/1000
E: actions-for-nautilus: wrong-file-owner-uid-or-gid usr/share/actions-for-nautilus-configurator/actions-for-nautilus-configurator.desktop 1000/1000
E: actions-for-nautilus: wrong-file-owner-uid-or-gid usr/share/actions-for-nautilus-configurator/actions-for-nautilus-configurator.html 1000/1000
E: actions-for-nautilus: wrong-file-owner-uid-or-gid usr/share/actions-for-nautilus-configurator/actions-for-nautilus-configurator.py 1000/1000
E: actions-for-nautilus: wrong-file-owner-uid-or-gid usr/share/actions-for-nautilus-configurator/actions-for-nautilus.schema.json 1000/1000
E: actions-for-nautilus: wrong-file-owner-uid-or-gid usr/share/actions-for-nautilus-configurator/command-line-help.html 1000/1000
E: actions-for-nautilus: wrong-file-owner-uid-or-gid usr/share/actions-for-nautilus-configurator/find-a-port.py 1000/1000
E: actions-for-nautilus: wrong-file-owner-uid-or-gid usr/share/actions-for-nautilus-configurator/sample-config.json 1000/1000
E: actions-for-nautilus: wrong-file-owner-uid-or-gid usr/share/actions-for-nautilus-configurator/start-configurator.sh 1000/1000
E: actions-for-nautilus: wrong-file-owner-uid-or-gid usr/share/actions-for-nautilus-configurator/sub-menu.png 1000/1000
E: actions-for-nautilus: wrong-file-owner-uid-or-gid usr/share/actions-for-nautilus-configurator/test.html 1000/1000
E: actions-for-nautilus: wrong-file-owner-uid-or-gid usr/share/applications/ 1000/1000
E: actions-for-nautilus: wrong-file-owner-uid-or-gid usr/share/applications/actions-for-nautilus-configurator.desktop 1000/1000
E: actions-for-nautilus: wrong-file-owner-uid-or-gid usr/share/nautilus-python/ 1000/1000
E: actions-for-nautilus: wrong-file-owner-uid-or-gid usr/share/nautilus-python/extensions/ 1000/1000
E: actions-for-nautilus: wrong-file-owner-uid-or-gid usr/share/nautilus-python/extensions/actions-for-nautilus.py 1000/1000
E: actions-for-nautilus: wrong-file-owner-uid-or-gid usr/share/nautilus-python/extensions/actions-for-nautilus/ 1000/1000
E: actions-for-nautilus: wrong-file-owner-uid-or-gid usr/share/nautilus-python/extensions/actions-for-nautilus/actions_for_nautilus.py 1000/1000
E: actions-for-nautilus: wrong-file-owner-uid-or-gid usr/share/nautilus-python/extensions/actions-for-nautilus/afn_config.py 1000/1000
E: actions-for-nautilus: wrong-file-owner-uid-or-gid usr/share/nautilus-python/extensions/actions-for-nautilus/afn_menu.py 1000/1000
E: actions-for-nautilus: wrong-file-owner-uid-or-gid usr/share/nautilus-python/extensions/actions-for-nautilus/afn_place_holders.py 1000/1000
W: actions-for-nautilus: description-synopsis-starts-with-article
W: actions-for-nautilus: non-standard-dir-perm usr/ 0775 != 0755
W: actions-for-nautilus: non-standard-dir-perm usr/share/ 0775 != 0755
W: actions-for-nautilus: non-standard-dir-perm usr/share/actions-for-nautilus-configurator/ 0775 != 0755
W: actions-for-nautilus: non-standard-dir-perm usr/share/applications/ 0775 != 0755
W: actions-for-nautilus: non-standard-dir-perm usr/share/nautilus-python/ 0775 != 0755
W: actions-for-nautilus: non-standard-dir-perm usr/share/nautilus-python/extensions/ 0775 != 0755
W: actions-for-nautilus: non-standard-dir-perm usr/share/nautilus-python/extensions/actions-for-nautilus/ 0775 != 0755
W: actions-for-nautilus: non-standard-executable-perm usr/share/actions-for-nautilus-configurator/actions-for-nautilus-configurator.desktop 0775 != 0755
W: actions-for-nautilus: non-standard-executable-perm usr/share/actions-for-nautilus-configurator/actions-for-nautilus-configurator.py 0775 != 0755
W: actions-for-nautilus: non-standard-executable-perm usr/share/actions-for-nautilus-configurator/start-configurator.sh 0775 != 0755
W: actions-for-nautilus: non-standard-file-perm usr/share/actions-for-nautilus-configurator/README.md 0664 != 0644
W: actions-for-nautilus: non-standard-file-perm usr/share/actions-for-nautilus-configurator/actions-for-nautilus-configurator.html 0664 != 0644
W: actions-for-nautilus: non-standard-file-perm usr/share/actions-for-nautilus-configurator/actions-for-nautilus.schema.json 0664 != 0644
W: actions-for-nautilus: non-standard-file-perm usr/share/actions-for-nautilus-configurator/command-line-help.html 0664 != 0644
W: actions-for-nautilus: non-standard-file-perm usr/share/actions-for-nautilus-configurator/find-a-port.py 0664 != 0644
W: actions-for-nautilus: non-standard-file-perm usr/share/actions-for-nautilus-configurator/sample-config.json 0664 != 0644
W: actions-for-nautilus: non-standard-file-perm usr/share/actions-for-nautilus-configurator/sub-menu.png 0664 != 0644
W: actions-for-nautilus: non-standard-file-perm usr/share/actions-for-nautilus-configurator/test.html 0664 != 0644
W: actions-for-nautilus: non-standard-file-perm usr/share/applications/actions-for-nautilus-configurator.desktop 0664 != 0644
W: actions-for-nautilus: non-standard-file-perm usr/share/nautilus-python/extensions/actions-for-nautilus.py 0664 != 0644
W: actions-for-nautilus: non-standard-file-perm usr/share/nautilus-python/extensions/actions-for-nautilus/actions_for_nautilus.py 0664 != 0644
W: actions-for-nautilus: non-standard-file-perm usr/share/nautilus-python/extensions/actions-for-nautilus/afn_config.py 0664 != 0644
W: actions-for-nautilus: non-standard-file-perm usr/share/nautilus-python/extensions/actions-for-nautilus/afn_menu.py 0664 != 0644
W: actions-for-nautilus: non-standard-file-perm usr/share/nautilus-python/extensions/actions-for-nautilus/afn_place_holders.py 0664 != 0644
W: actions-for-nautilus: privacy-breach-generic [] (https://cdn.jsdelivr.net/npm/spectre.css@latest/dist/spectre-icons.min.css) [usr/share/actions-for-nautilus-configurator/actions-for-nautilus-configurator.html]
W: actions-for-nautilus: privacy-breach-generic [] (https://use.fontawesome.com/releases/v5.6.3/css/all.css) [usr/share/actions-for-nautilus-configurator/actions-for-nautilus-configurator.html]
W: actions-for-nautilus: privacy-breach-generic [<link rel="stylesheet"\n??href="https://cdn.jsdelivr.net/npm/@json-editor/json-editor@latest/dist/css/jsoneditor.min.css">] (https://cdn.jsdelivr.net/npm/@json-editor/json-editor@latest/dist/css/jsoneditor.min.css) [usr/share/actions-for-nautilus-configurator/actions-for-nautilus-configurator.html]
W: actions-for-nautilus: privacy-breach-generic [<script src="https://cdn.jsdelivr.net/npm/@json-editor/json-editor@latest/dist/nonmin/jsoneditor.js">] (https://cdn.jsdelivr.net/npm/@json-editor/json-editor@latest/dist/nonmin/jsoneditor.js) [usr/share/actions-for-nautilus-configurator/actions-for-nautilus-configurator.html]
W: actions-for-nautilus: script-not-executable [usr/share/applications/actions-for-nautilus-configurator.desktop]
W: actions-for-nautilus: synopsis-too-long
W: actions-for-nautilus: unknown-section GNOME Desktop Environment
W: actions-for-nautilus: unusual-interpreter /usr/bin/python [usr/share/actions-for-nautilus-configurator/actions-for-nautilus-configurator.py]
W: actions-for-nautilus: unusual-interpreter /usr/bin/python [usr/share/actions-for-nautilus-configurator/find-a-port.py]
W: actions-for-nautilus: unusual-interpreter xdg-open [usr/share/actions-for-nautilus-configurator/actions-for-nautilus-configurator.desktop]
W: actions-for-nautilus: unusual-interpreter xdg-open [usr/share/applications/actions-for-nautilus-configurator.desktop]
Lintian finished with exit status 0`
Did not have that so far.
Anyway a big THANK YOU so far.
`
May I know if there is a way to request for user input in action?
A simple example would be to create a file using gedit.
gedit filename where filename is provided by user before executed?
E.g. the following mimetype "not" rules:
!application/pdf
!audio/*
should mean that the command is not displayed for PDFs nor for any audio file.
What it actually does is display the command for both because the algorithm is wrong - since an audio file is not a PDF, it displays, and since a PDF is not an audio file, it displays.
I'm working on it!
Hi first of all thank you for your amazing app i love it, it really helps with my workflow and me just being more productive over all.
I just noticed that on my personal PC at home i cant save or even click help so i investigated and found out that jquery wasn't loading, after i took a look in the actions-for-nautilus-configurator.py
script i saw that the path for the minified jquery file was "path": "/usr/share/javascript/jquery/jquery.min.js",
so i just quickly changed the path to be "path": "./javascript/jquery.min.js",
bc i saw that you're shipping it with all the other files necessary.
i don't know if that's intended behavior or just an oversight that for example the make install should install jquery into this path but since you're shipping it with all the other files in ./javascript/ i think this can be a fix for now.
here my now working code again:
#!/usr/bin/python3
import http.server
import json
import sys
import os
import shutil
import datetime
PORT = 8000
HOME = os.environ.get('HOME')
# config_html = "./actions-for-nautilus-configurator.html"
# cmdline_help = "./command-line-help.html"
config_file = HOME + \
"/.local/share/actions-for-nautilus/config.json"
# config_schema = "./actions-for-nautilus.schema.json"
# favicon = "./sub-menu.png"
textual_mimes = [
"text/html",
"application/json",
"text/css",
"application/javascript"
]
docs = {
"/": {
"path": "./actions-for-nautilus-configurator-container.html",
"mimetype": "text/html",
"default": None
},
"/actions-for-nautilus-configurator-container.html": {
"path": "./actions-for-nautilus-configurator-container.html",
"mimetype": "text/html",
"default": None
},
"/actions-for-nautilus-configurator.html": {
"path": "./actions-for-nautilus-configurator.html",
"mimetype": "text/html",
"default": None
},
"/config": {
"path": config_file,
"mimetype": "application/json",
"default": "{\"actions\":[],\"debug\":false}"
},
"/schema": {
"path": "./actions-for-nautilus.ui.schema.json",
"mimetype": "application/json",
"default": None
},
"/actions-for-nautilus-configurator-help.html": {
"path": "./actions-for-nautilus-configurator-help.html",
"mimetype": "text/html",
"default": None
},
"/favicon.ico": {
"path": "./images/sub-menu.png",
"mimetype": "image/png",
"default": None
},
"/webfonts/fa-solid-900.woff2": {
"path": "./packages/fa-solid-900.woff2",
"mimetype": "font/woff2",
"default": None
},
"/images/ANY": {
"path": "./images/",
"mimetype": "image/png",
"default": None
},
"/javascript/jquery.min.js": {
"path": "./javascript/jquery.min.js",
"mimetype": "application/javascript",
"default": None
},
"/javascript/ANY": {
"path": "./javascript/",
"mimetype": "application/javascript",
"default": None
},
"/css/ANY": {
"path": "./css/",
"mimetype": "text/css",
"default": None
},
}
[...]
IMHO, it is better to use « fakeroot » to build the debian package :
bigbob@bigbob-ux331un:~/tmp/Building/actions-for-nautilus/actions-for-nautilus$ fakeroot make deb rm -rf build mkdir -p build//usr/share/nautilus-python mkdir -p build//usr/share/actions-for-nautilus-configurator mkdir -p build//usr/share/applications mkdir -p build//usr/share/doc/actions-for-nautilus mkdir -p build/DEBIAN cp -r --preserve=mode,timestamps extensions build//usr/share/nautilus-python cp -r --preserve=mode,timestamps configurator/* build//usr/share/actions-for-nautilus-configurator rm build//usr/share/actions-for-nautilus-configurator/javascript/jquery.min.js LOC=/usr/share python3 -c 'import os,sys; sys.stdout.write(os.path.expandvars(sys.stdin.read()))' \ < build//usr/share/actions-for-nautilus-configurator/actions-for-nautilus-configurator.desktop \ > build//usr/share/applications/actions-for-nautilus-configurator.desktop VERSION=1.6.0 python3 -c 'import os,sys; sys.stdout.write(os.path.expandvars(sys.stdin.read()))' \ < packaging/DEBIAN/control \ > build/DEBIAN/control cp -r --preserve=mode,timestamps packaging/doc build//usr/share cp README.md build//usr/share/doc/actions-for-nautilus cp RELEASE-NOTES.md build//usr/share/doc/actions-for-nautilus/NEWS mv build//usr/share/actions-for-nautilus-configurator/README.md build//usr/share/doc/actions-for-nautilus/configurator.README.md gzip -n9 build//usr/share/doc/actions-for-nautilus/NEWS gzip -n9 build//usr/share/doc/actions-for-nautilus/changelog find build/ -type d -exec chmod 0755 {} \; find build/ -type f -exec chmod 0644 {} \; chmod +x build//usr/share/actions-for-nautilus-configurator/start-configurator.sh dpkg-deb -Z gzip --build build dist/actions-for-nautilus_1.6.0_all.deb dpkg-deb: construction du paquet « actions-for-nautilus » dans « dist/actions-for-nautilus_1.6.0_all.deb ». lintian dist/actions-for-nautilus_1.6.0_all.deb running with root privileges is not recommended! W: actions-for-nautilus: copyright-without-copyright-notice bigbob@bigbob-ux331un:~/tmp/Building/actions-for-nautilus/actions-for-nautilus$
I commonly use this extension for VS Code; it would be better if I see the editor's icon in the context menu.
to compress pdf via gs
{
"type": "command",
"label": "compress pdf",
"command_line": "gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dNOPAUSE -dQUIET -dBATCH -dAutoRotatePages=/None -dPDFSETTINGS=/ebook -r100 -sOutputFile=%w\"_compressed.pdf\" %b",
"cwd": "%d",
"mimetypes": [
"application/pdf"
],
"filetypes": [
"standard"
]
},
-r sets the resolution and has a strong effect on file size; you may also delete -r in this case the file size is strongly effected by
-dPDFSETTINGS=/ebook if you set this to -dPDFSETTINGS=/screen you get tiny pdfs with very low resolution
Thanks again for this nice tool & Merry Xmas
Dear Martin,
reading carefully your manual I wanted to take the advantage of the repetition behaviour with SINGULAR placeholders. The command (echo %f) appears to be repeated but repeatedly on the first entry. That is what I understand from the output:
`COMMAND 0
['echo', '/home/georg/Bilder/Bilder (home-hd)/import/Sony RX-100M3/2022/2022-08-27']
COMMAND 1
['echo', '/home/georg/Bilder/Bilder (home-hd)/import/Sony RX-100M3/2022/2022-08-27']
/home/georg/Bilder/Bilder (home-hd)/import/Sony RX-100M3/2022/2022-08-27
COMMAND 2
['echo', '/home/georg/Bilder/Bilder (home-hd)/import/Sony RX-100M3/2022/2022-08-27']
/home/georg/Bilder/Bilder (home-hd)/import/Sony RX-100M3/2022/2022-08-27
/home/georg/Bilder/Bilder (home-hd)/import/Sony RX-100M3/2022/2022-08-27
COMMAND 3
['echo', '/home/georg/Bilder/Bilder (home-hd)/import/Sony RX-100M3/2022/2022-08-27']
COMMAND 4
['echo', '/home/georg/Bilder/Bilder (home-hd)/import/Sony RX-100M3/2022/2022-08-27']
/home/georg/Bilder/Bilder (home-hd)/import/Sony RX-100M3/2022/2022-08-27
COMMAND 5
['echo', '/home/georg/Bilder/Bilder (home-hd)/import/Sony RX-100M3/2022/2022-08-27']
/home/georg/Bilder/Bilder (home-hd)/import/Sony RX-100M3/2022/2022-08-27
/home/georg/Bilder/Bilder (home-hd)/import/Sony RX-100M3/2022/2022-08-27
`
The behaviour is the same with %d, %f and %b.
$ nautilus 1
Fatal Python error: pycore_create_interpreter: can't make main interpreter
Python runtime state: preinitialized
After installing python3-nautilus
, I get this error whenever I attempt to open Nautilus in any way. I was able to install AFN and modify config, but I can't see it because python3-nautilus
breaks Nautilus.
How can I fix this?
Hi, I've been playing around with this amazing program for the past few hours trying to understand how it works and hopefully come up with useful quick actions for my context menu. In doing so I found that certain commands that run fine in the terminal, won't work when used as a command for Actions For Nautilus. For example:
du -sh ~/Downloads | xargs -I {} zenity --info --text={} --width 150
This command creates a new dialog window using zenity displaying the output of the du
command. When translated to AFN however, it doesn't seem to do anything.
du -sh %d | xargs -I {} zenity --info --text={} --width 150
I've tried several combinations of placeholders such as %D
or %F
, as well as alternative ways to capture the output of the command to feed into zenity (quoting the placeholder, specifying the current working directory, etc).
I've also enabled debugging output but again there's no output to be seen anywhere, even after running Nautilus from the terminal.
Here's the JSON produced by this action rule as described:
{
"type": "command",
"label": "Calculate total size",
"command_line": "du -sh %D | xargs -I {} zenity --info --text={} --height 150",
"filetypes": [
"directory"
]
},
As a side note (I can create another issue if you want), I think it would be extremely useful to have a button to force the updated configuration to take place rather than waiting for 30 seconds.
Thanks!
Is it possible, or could it be made possible, to add options to the top of the context menu? I want to be able to double-click an image and have it open in the standard image viewer, but then to right-click it and directly have the option "Open in pinta" (for example). Currently, it seems the closest I can get with stock nautilus is "Open with Other Application" which then requires me to navigate a list of possibilities, and the closest I can get with actions-for-nautilus
is an "Open with pinta" option way down at the bottom of the context menu. Or is there another option I haven't yet found?
Difficult to reproduce, but for me when I deleted a command action a menu action further down the list was interpreted as a command action and lost all its submenu configuration as well as being marked invalid.
Workaround - use the JSON editor to handle this kind of thing until a fix is available.
Hello,
I'd like to contribute an "Open in VS Code" configuration to the project wiki. This is not an issue but Github doesn't support pull requests for wikis.
Looking at a google search for adding "Open in VS Code" to the context menu this is a fairly sought after feature.
The following configuration has worked for me on Ubuntu 22.04 and 22.10
, {
"type": "command",
"label": "Open in VS Code",
"command_line": "code --new-window %f",
"filetypes": [
"directory",
"file"
]
}
This doesn't seem to work properly on Debian 11, Gnome 43.6, Wayland.
The elevated prompt authentication window prompt comes up but after entering the credentials the terminal won't open.
The json configuration web portal can be accessed by anyone connected to the same network if he/she knows the port number it is running on. Is it possible to close the server from the UI or any other way?
Hello,
Today I installed the most recent version of actions-for-nautilus on a new machine and saw that none of the changes made in the web interface save to the config.json file.
sudo apt install python3-nautilus python3-gi procps
git clone git clone https://github.com/bassmanitram/actions-for-nautilus.git
cd actions-for-nautilus
make install
After this I did a full reboot
Both the actions-for-nautilus
and actions-for-nautilus-configurator
are present in my Home/local/share/
directory
'nautilus-actions-configurator' web interface launched from from 'applications' shortcut
No changes made to the configuration are actually saved after saving. I tried editing names, deleting commands, and adding new commands. Running nautilus -q
and sudo reboot
after saving changes did not work.
Manually editing the config.json
still works
Ubunut 22.04.1
GNOME nautilus 42.2
Is there a way to configure "Desktop" ? and Not just inside Folders?
Hello,
I am not sure if I am using the right terminology, but I noticed as I tried to bookmark the web interface for easy access in my web browser that the "port" being used seems to change every time the app is being started. Would there be a way for this port to be fixed to allow bookmark, either by default or as an option in the interface where the user can specify the port to be used?
I'm guessing this would require some update in this file and probably a restart of nautilus to take the change into account. If ports with lower numbers are likely to be taken, perhaps limit the ports to being 10000+ or even higher number to minimise the risk of this being already being taken?
From @markd89
One minor thing and I think this is my system.. but in the configurator I had to change:
xdg-open http://localhost:$PORT # >> /tmp/a4n-start.log
to
firefox http://localhost:$PORT # >> /tmp/a4n-start.log
Palemoon is my default browser and didn't like something there.
Hi,
Is there a way to handle simple and double quotes in filenames, for example :
@bassmanitram Thank you for maintaining this useful tool. I am on Ubuntu 22.04 Mate desktop. Is is possible to use this with Caja file manager?
Regards.
I have strange behavior on one computer.
If I open the link inside terminal, except from the fact I can't render properly, I can see AFN answering and serving the content :
root@oem-ThinkPad-P15-Gen-1:~# lynx -dump http://localhost:60125
IFRAME: [1]/actions-for-nautilus-configurator.html
IFRAME: [2]/actions-for-nautilus-configurator-help.html
Références
1. http://localhost:60125/actions-for-nautilus-configurator.html
2. http://localhost:60125/actions-for-nautilus-configurator-help.html
root@oem-ThinkPad-P15-Gen-1:~#
But the link doesn't render at all inside browser :
First, this is great replacement for the old nautilus-actions package. Thanks!
The only feature that I miss from the old days is the ShowIfTrue
condition that let you specify a command whose output would determine whether to show an action or not.
For example I had an Eject action to detach mounted filesystems defined by
Exec=umount %f
ShowIfTrue=sed -z 's/.*\\s%f\\>.*/true/' /etc/mtab
This would add even more flexibility on top of mime, file type and path pattern conditions.
There is a small mistake filling up from time to time /var/log/syslog:
Aug 9 22:13:48 InaUbuntu org.gnome.Nautilus[3732]: Traceback (most recent call last): Aug 9 22:13:48 InaUbuntu org.gnome.Nautilus[3732]: File "/usr/share/nautilus-python/extensions/actions-for-nautilus/actions_for_nautilus.py", line 25, in get_background_items Aug 9 22:13:48 InaUbuntu org.gnome.Nautilus[3732]: return afn_menu.create_menu_items(self.config.get_config(), [file], "Background", _run_command) Aug 9 22:13:48 InaUbuntu org.gnome.Nautilus[3732]: File "/usr/share/nautilus-python/extensions/actions-for-nautilus/afn_menu.py", line 12, in create_menu_items Aug 9 22:13:48 InaUbuntu org.gnome.Nautilus[3732]: my_files = list(map(lambda file: { Aug 9 22:13:48 InaUbuntu org.gnome.Nautilus[3732]: File "/usr/share/nautilus-python/extensions/actions-for-nautilus/afn_menu.py", line 15, in <lambda> Aug 9 22:13:48 InaUbuntu org.gnome.Nautilus[3732]: "basename": os.path.basename(file.get_location().get_path()), Aug 9 22:13:48 InaUbuntu org.gnome.Nautilus[3732]: File "/usr/lib/python3.10/posixpath.py", line 142, in basename Aug 9 22:13:48 InaUbuntu org.gnome.Nautilus[3732]: p = os.fspath(p) Aug 9 22:13:48 InaUbuntu org.gnome.Nautilus[3732]: TypeError: expected str, bytes or os.PathLike object, not NoneType
It is repeated in blocks.
Hello,
I love this utility but I was wondering if it would be possible to hide/disable entries in the web interface so they can be kept as template or for future use without being deleted.
For instance, there could be a checkbox somewhere to disable it which would grey out the text and remove them from the export but leave them in the list?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.