Giter Club home page Giter Club logo

actions-for-nautilus's People

Contributors

bassmanitram avatar lukas-schillinger avatar nova1545 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

actions-for-nautilus's Issues

No issue - good !

I made a user make install. Works smoothly.

And configured one of the actions I started to miss from Gnome 42:

grafik

The nested structure in Folder actions and Copy is very nice as well.

Georg

how can I see the debug output?

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 move menu entries to the top?

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.

Using pipe to another command to display progress bar...

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 :

simplescreenrecorder-2024-03-06_02.10.46.mp4

Auto TAG debian package with github commit...

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 :

  1. Created a symbolic link :
bigbob@bigbob-t480s:~/tmp/Building/actions-for-nautilus/actions-for-nautilus$ ln -sf packaging/doc/actions-for-nautilus debian
  1. I have modified the « Makefile » like this :
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$
  1. I have updated the « changelog » using this command line :
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$
  1. Then I have build the package with :
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$
  1. This ending with the « debian » package named like this :
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...

Does not work with commands that use placeholders

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?

Not working on Ubuntu 22.10

Followed the install instructions:

  • Downloaded and installed the deb
  • Ran Actions for Nautilus Configurator
  • Added my command
  • Restarted Nautilus

I don't see any commands in the right-click menu of an image file.

actions-for-nautilus doesn't handle specials character in filenames...

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$

deb package

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.
`

Action that requires user input

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?

Highlight Save button in Orange for unsaved settings

Hello, I note that the save button changes colour (to indicate that it can be clicked on) when there are unsaved changes but I don't find the change particularly visible.

saved changes
image
unsaved changes
image

May I suggest using something more visible like some sort of orange (#ffad55 shown below)?
image

Multiple "not" rules do not resolve correctly.

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!

JQuery gets 404 in configurator

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
    },
}
[...]

Use fakeroot for « make deb »...

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$

not an issue, for the Wiki

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

repetition behaviour not working correctly

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.

Breaks on Ubuntu 22

$ 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?

Certain commands don't seem to work with zenity

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!

Add commands to top of context menu

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?

Deletion and moving of actions occasionally corrupts other actions

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.

Add "Open in VS Code" to Wiki

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"
    ]
}

Open a terminal as root in a specific folder

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 Configuration UI is open to all

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?

Web UI not saving config edits

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.

Install Steps

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

Steps to Reproduce Issue

'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

System Specs

Ubunut 22.04.1
GNOME nautilus 42.2

Nautilus Desktop

Is there a way to configure "Desktop" ? and Not just inside Folders?

Static port for web interface

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?
image

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?

Blank page when starting AFN

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 :

image

ShowIfTrue feature would be nice!

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.

Python3.10 type error in /var/log/syslog

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.

hide/disable entries in the web interface

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.