Git Product home page Git Product logo

thunar-custom-actions's Introduction

Thunar Custom Actions

Build Status

The following actions can also be used in nautilus or any other file manager that supports custom actions. I personally prefer thunar because of speed.

If any of the actions don't work anymore (especially the upload ones), please report here, so I can fix it.


Latest added action:

  • thunar-gpg-sign.sh
  • thunar-gpg-verify-signature.sh
  • thunar-video-to-gif.sh

Actions

Multimedia

Type GUI
This action converts any image file to a png image. (Should also work with layered PSD files).
Requirements: convert
Thunar settings:

name value
Name Convert to png
Command thunar-convert-to-png.sh -f %f
File pattern *
Appear on Image files

Type GUI
This action converts any image file to a jpg image. (Should also work with layered PSD files).
Requirements: convert
Thunar settings:

name value
Name Convert to jpg
Command thunar-convert-to-jpg.sh -f %f
File pattern *
Appear on Image files

Type GUI
This action pops up a zenity-based window and displays encoding information for an audio or video file.
Requirements: zenity and ffmpeg
Thunar settings:

name value
Name Media info
Command thunar-media-info.sh -f %f -t %n
File pattern *
Appear on Audio files, Video files

Type GUI
This action pops up a zenity-based window (or via read on the shell) asking for the final video width and creates a high quality gif from your input video.

High quality gif: This is achieved by doing a two-way-run. The first run creates the color palette from the video and the second run creates the gif based on that palette.

Requirements: ffmpeg
Optional: zenity for gui output
Note: Works for cli-only (-c) or via zenity-gui Thunar settings:

name value
Name Video to Gif
Command thunar-video-to-gif.sh -f %f
File pattern *
Appear on Video files

Security

Type GUI
This action will encrypt/decrypt a file based on openssl's symmetric encryption.
Requirements: openssl and zenity
Thunar settings:

name value
Name Openssl Encrypt/Decrypt
Command thunar-openssl-encrypt-decrypt.sh -f %f
File pattern *
Appear on Everything

For detailed explanation and screenshots see this blog entry: alan-mushi.github.io

Type GUI
This action pops up a zenity-based window letting you choose from your gpg recipients and encrypts and signs the file with your chosen gpg key. (Asymmetric encryption).
Requirements: gpg, zenity and pinentry-gtk-2
Thunar settings:

name value
Name GPG Encrypt
Command thunar-gpg-encrypt.sh -f %f
File pattern *
Appear on Everything

Type GUI
This action pops up a terminal window for password entry and decrypts the file with your private gpg key. (Asymmetric encryption).
Requirements: gpg
Todo: Make gui-based password entry form.
Thunar settings:

name value
Name GPG Decrypt
Command urxvtcd -e thunar-gpg-decrypt.sh -f %f
File pattern *
Appear on Other files

Type GUI
This action pops up a zenity-based window, let's you choose from a list of your secret keys and creates an ascii-armored separate signature file.
Requirements: gpg and zenity
Thunar settings:

name value
Name GPG Sign
Command thunar-gpg-sign.sh -f %f
File pattern *
Appear on Other files

Type GUI
This action pops up a zenity-based window and displays information about the encryption of the current file. (Asymmetric encryption).
Requirements: gpg and zenity
Thunar settings:

name value
Name GPG Info
Command thunar-gpg-info.sh -f %f
File pattern *
Appear on Other files

Type GUI
This action pops up a zenity-based window and displays verification information about the gpg signature.
Requirements: gpg and zenity
Thunar settings:

name value
Name GPG Verify Signature
Command thunar-gpg-verify-signature.sh.sh -f %f
File pattern *
Appear on Other files

Uploads

Type GUI
This action pastes a text file to gist (in private mode) and pops up a zenity-based window displaying the paste url (shortened). Additionally the paste url will also be copied to clipboard.
Requirements: zenity and gist
Thunar settings:

name value
Name Paste to gist
Command thunar-paste-to-gist.sh -f %f
File pattern *
Appear on Text files

Type GUI
This action pastes a text file to pastebin and pops up a zenity-based window displaying the paste url.
Requirements: zenity and curl
Note: The pastebin API only allows 25 pastes per free account per every 24 hours. I have added two API keys inside the source. If however you plan on using this thunar action, make sure to get your own API key and replace it. The second thought I had is not to use the API directly, but try to use the normal upload form via curl so that no API key is required at all.
Todo: Expand file type recognition to set the proper syntax highlighting scheme for var PB_API_FORMAT.
Thunar settings:

name value
Name Paste to pastebin
Command thunar-paste-to-pastebin.sh -f %f
File pattern *
Appear on Text files

Type GUI
This action uploads an image file to imgur and pops up a zenity-based window displaying the upload url.
Requirements: zenity, gawk, curl
Note: Upload key is included :-)
Todo: Evaluate if it is possible to get rid of gawk requirement.
Thunar settings:

name value
Name Upload to imgur
Command thunar-upload-to-imgur.sh -f %f
File pattern *
Appear on Image files

Type GUI
This action uploads an image file to postimage.org and pops up a zenity-based window displaying the upload url.
Requirements: zenity, gawk, curl
Todo: Evaluate if it is possible to get rid of gawk requirement.
Thunar settings:

name value
Name Upload to postimage
Command thunar-upload-to-postimage.sh -f %f
File pattern *
Appear on Image files

General Setup

All actions require the -f parameter which specifies the file to work on. Prior Thunar/Nautilus integration you can test them all on the command line to make sure they do what they are supposed to do:

thunar-action.sh -f /path/to/file

The equivilent thunar command would be:

/path/to/thunar-action.sh -f %f

Note about substitutions in Thunar:

%f    The path to the first selected file
%F    The paths to all selected files
%d    Directory containing the file that is passed in %f
%D    Directory containing the files that are passed in %F
%n    The first selected filename (without path)
%N    The selected filenames (without paths)

TODO / Ideas

  • Image: convert from ... to anything via list (dropdown or radio) of target formats (jpg, png, gif, etc). Possibly also some convert options via slider or checkboxes.
  • Video: encode/re-encode videos to target format (dropdown or radio for target formats). Also some ffmpeg quality options via slider, textfields and/or checkboxes
  • Video to gif

Contributions

Thanks to the following for contributing:

License

license

thunar-custom-actions's People

Contributors

cytopia avatar matiasw avatar taner1es 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

thunar-custom-actions's Issues

thunar-gpg-info.sh only shows sender not recipient

thunar-gpg-info.sh only show the identity of the sender not of the recipient.

How is to supposed to get the identity of the recipient if you query gpg with gpg --list-secret-keys shouldnt it be gpg --list-public-keys,. Otherwise gpg only prints your own identity (sender) not the recipient.

zenity --info --no-markup --text="Encrypted for: ${recipientKey} ${recipient}"

Or did you mean Encrypted from:?

Algorithm field grayed out

I am using Debian 9 xfce.
on the dialogue box the algorithm field is grayed out.
I choose encrypt and I enter a key but I cannot pick an algorithm.

This returns:
enc: Unknown cipher
enc: Use -help for summary.
return code: 1

screenshot_2017-09-12_17-44-51
screenshot_2017-09-12_17-45-09

Debian 8 and thunar-gpg-encrypt.sh

Hi, I ran across your scripts and gave them a try in a (fresh) Debian stretch install and only had one problem with it.

For some reason the bits and key columns used in the chooseRecipient and chooseSecret were reversed (maybe gpg's version? mine is 1.4.20) and zenity was trying to use the bits instead of the key name for encryption resulting in an error. So after a apt-get install pinentry-gtk2:

gpg: skipped "2048R": secret key not available

Setting the collumn to --print-column=2 and swapping places for
--column=\"Bit\" --column=\"Key\" --column=\"Recipient\" ${pubkeys}"
instead of
--column=\"Key\" --column=\"Bit\" --column=\"Recipient\" ${pubkeys}"

That fixed it for me.

upload-to-imgur.sh not displaying upload URL

It's come to my attention that uploading an image through the imgur script displays a zenity window with no URL. Also spits out a 'no such option' for -f.

kevin@volt-Thinkpad-T42 ~/Pictures $ thunar-upload-to-imgur.sh -f starwars.png
This option is not available. Please see --help for all possible usages.
Linux Mint 17.3, screenie: http://i.imgur.com/mV0kmVv.png

Thunar encrypt is not working

Hi

In my case Thunar encrypt is not working because is not able to detect my public and private keys

I think the error is in the sed parameter of this fileds

pubkeys="$(gpg --list-public-keys \ | grep -A 1 "^pub" \ | sed -n -e "s:^pub *\([A-Za-z0-9]\+\)/\([A-F0-9]\+\) .*$:\1 \2:p" -e "s:^uid *\(.*\)$:\"\1\":p" \ | tr '\n' ' ')"

seckeys="$(gpg --list-secret-keys \ | grep -A 1 "^sec" \ | sed -n -e "s:^sec *\([A-Za-z0-9]\+\)/\([A-F0-9]\+\) .*$:\1 \2:p" -e "s:^uid *\(.*\)$:\"\1\":p" \ | tr '\n' ' ')"

Funtoo, upload to imgur not working

 »»»» ./Scripts/thunar-upload-to-imgur.sh /home/lozenge/Wallpaper/paper1.png                                                                                                                                             0|05:06:30
Failed to execute process './Scripts/thunar-upload-to-imgur.sh'. Reason:
exec: Exec format error
The file './Scripts/thunar-upload-to-imgur.sh' is marked as an executable but could not be run by the operating system.

thunar-upload-to-postimage.sh not working

The thunar-upload-to-postimage.sh script does not work for me (anymore?). After the "upload", the zenity popup just displays

https?://([^/

When I try to display the curl output file, it seems to be just the postimage front page.
It might be because they changed the website recently, there is even a "Return to the old site" link at the bottom of the page.
As a temporary hack, it is still possible to use the old interface. (I don't want to submit this as a pull request, because it is too nasty)

  1. Change curl upload address to old.postimage.org
  2. Change the grep pattern of resulting webpage
    ZTEXT="$(echo "${TEXT}" | grep -E -o '\w*.postimg.org/[[:alnum:]]+/[[:graph:]]+.(jpg|gif|png)' | awk 'NR==2')"
    This modification looks for image links according to a rough pattern and then uses the second one, because that seems to be the "Direct Link" image.

thunar-gpg-encrypt.sh encrypting folders [feature request]

Right know it's only possible to encrypt single files. For convenience it would be nice to check if the selected file is a folder and if so wrap it inside a archive. Something like ...

$ tar -c foldername | gpg2 -e > folder.tar.gpg

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.