Tutorial(s): Thunar Custom Actions--- simplify what you do

Here is where you can post tips and tricks to share with other users of MX. Do not ask for help in this Forum.
Message
Author
User avatar
Buck Fankers
Posts: 744
Joined: Sat Mar 10, 2018 9:06 pm

Re: Tutorial(s): Thunar Custom Actions--- simplify what you do

#31 Post by Buck Fankers »

Anyone has any good compress image custom action code? I was using this one bellow in the terminal and looks like it is working as custom action also:

Code: Select all

for file in *.*; do convert $file -quality 10 compressed-$file; done
file pattern: *
Appears if selection contains: Directories & Image Files
install: imagemagick

This one works for compressing JPEG and JPG image files. I don't have anything for PNG files yet. I have read, that OptiPNG is good for compressing PNG files. Anyway I would be interested in anything you galls and guys may have :grin:

User avatar
Buck Fankers
Posts: 744
Joined: Sat Mar 10, 2018 9:06 pm

Re: Tutorial(s): Thunar Custom Actions--- simplify what you do

#32 Post by Buck Fankers »

For removing metadata from all kind of files, looks like MAT is the best choice:

http://xmodulo.com/remove-file-metadata-linux.html

Anyone has any custom action code already done with the mat?

Edit, scratch "all kind" part. mat-gui can't handle pdf or pictures. But it is useful for office document files, so still forth having it.

User avatar
Buck Fankers
Posts: 744
Joined: Sat Mar 10, 2018 9:06 pm

Re: Tutorial(s): Thunar Custom Actions--- simplify what you do

#33 Post by Buck Fankers »

Buck Fankers wrote: Wed Aug 07, 2019 10:54 am I have read, that OptiPNG is good for compressing PNG files.
Looks like OptiPNG does two things, removes metadata and compresses the file. But works as name indicates only for PNG files.
Command: (works good as Thunar Custom Action)

Code: Select all

optipng -o2 -strip all *
Mat code is bellow, but mat is also quite limited. You can use this for Thunar Custom Action command:

Code: Select all

mat .

User avatar
Buck Fankers
Posts: 744
Joined: Sat Mar 10, 2018 9:06 pm

Re: Tutorial(s): Thunar Custom Actions--- simplify what you do

#34 Post by Buck Fankers »

Someone gave me ms office files and 'mat' didn't clean them, but it did clean ODS (Libre), so looks like 'mat' is not that useful.

User avatar
manyroads
Posts: 2623
Joined: Sat Jun 30, 2018 6:33 pm

Re: Tutorial(s): Thunar Custom Actions--- simplify what you do

#35 Post by manyroads »

I think you might want to open a thread on your topic Buck.
Pax vobiscum,
Mark Rabideau - ManyRoads Genealogy -or- eirenicon llc. (geeky stuff)
i3wm, bspwm, hlwm, dwm, spectrwm ~ Linux #449130
"For every complex problem there is an answer that is clear, simple, and wrong." -- H. L. Mencken

User avatar
Buck Fankers
Posts: 744
Joined: Sat Mar 10, 2018 9:06 pm

Re: Tutorial(s): Thunar Custom Actions--- simplify what you do

#36 Post by Buck Fankers »

manyroads wrote: Thu Aug 08, 2019 6:16 pm I think you might want to open a thread on your topic Buck.
That is interesting. Apparently I still don't understand how this forum works. Was I off topic?
I posted few more custom actions and had few questions about them.
Is it better if 'thunar custom actions' posts are spread across different threads?
Anyway, will refrain from now on to post anything else in this one, no problem, just strange...

User avatar
manyroads
Posts: 2623
Joined: Sat Jun 30, 2018 6:33 pm

Re: Tutorial(s): Thunar Custom Actions--- simplify what you do

#37 Post by manyroads »

Buck Fankers wrote: Fri Aug 09, 2019 2:01 am
manyroads wrote: Thu Aug 08, 2019 6:16 pm I think you might want to open a thread on your topic Buck.
That is interesting. Apparently I still don't understand how this forum works. Was I off topic?
I posted few more custom actions and had few questions about them.
Is it better if 'thunar custom actions' posts are spread across different threads?
Anyway, will refrain from now on to post anything else in this one, no problem, just strange...
My comment was solely based on the fact that you seem enthusiastic about a particular issue that needs more visibility than it will get at page 4 of what is supposed to be listing of functionng thunar commands. Once you figure out what works, by all means add it.
Pax vobiscum,
Mark Rabideau - ManyRoads Genealogy -or- eirenicon llc. (geeky stuff)
i3wm, bspwm, hlwm, dwm, spectrwm ~ Linux #449130
"For every complex problem there is an answer that is clear, simple, and wrong." -- H. L. Mencken

User avatar
Srdjan
Posts: 73
Joined: Thu Sep 12, 2019 3:39 pm

Re: Tutorial(s): Thunar Custom Actions--- simplify what you do

#38 Post by Srdjan »

Could someone help me with this one:

Thunar Custom Action command from context menus:

When I select one or more files it will:

If just files (no folders)

1. Send one or more selected files as attachments on my own e-mail address
with current date as mail subject and "Backup" as mail body text.

If folders or folders + some files selected:

2. Compress all selected, give the that archive file name in format
current_date.tar.gz, and then send it as attachment on my e-mail address
with current date as mail subject and "Backup" as mail body text.

Context menu item should be titled "Backup selection on my e-mail"

Preferably is should use some light terminal mail tool which is already
installed on MX (if there is one) to perform sending mail.

skidoo
Posts: 753
Joined: Tue Sep 22, 2015 6:56 pm

Re: Tutorial(s): Thunar Custom Actions--- simplify what you do

#39 Post by skidoo »

Have you considered crafting a solution utilizing SendTo ?
https://docs.xfce.org/xfce/thunar/send-to

...Thunar also ships the thunar-sendto-email plugin, which adds the entry Mail Recipient to the menu.
This feature opens the default mail composer with the selected files attached to a new email.
If the selection contains at least one folder, the selected items are automatically added to a ZIP archive before attaching them to the email.
If the selection contains multiple files, or a single file which is larger than 200 Kib, the user will be prompted whether to pack the files into a ZIP archive or attach them to the message as uncompressed, individual files.

Like most other features of Thunar, the Send To menu can be easily extended by users and application developers with new targets, using standard desktop entry files. These files must be installed into one of the $XDG_DATA_DIRS/Thunar/sendto/ folders (see the XDG Base Directory Specification for details about the $XDG_DATA_DIRS variable).
The targeted email client (perhaps one different from your "daily driver") can probably be configured to automatically apply a default template (title: YY/MM/DD backup) and you may discover it will often be desirable to have the option to add other notes-to-self into the message body. Also, once the mail client has been triggered via an initial SendTo operation, you'll be free to browse across directories and drag-n-drop further cherrypicked files.

As for the compression, you can Ctrl+ select a group of files within Thunar, then create new archive, then SendTo the newly-created archivefile. A custom action for THIS step might be desirable, one which will both create an archivefile and copy-to-clipboard a manifest of the selected filenames (which you would manually paste into email message body)(remember, it might be desirable to attach multiple archive and/or individual files to a single email)

User avatar
Srdjan
Posts: 73
Joined: Thu Sep 12, 2019 3:39 pm

Re: Tutorial(s): Thunar Custom Actions--- simplify what you do

#40 Post by Srdjan »

The targeted email client (perhaps one different from your "daily driver") can probably be configured to automatically apply a default template (title: YY/MM/DD backup) and you may discover it will often be desirable to have the option to add other notes-to-self into the message body. Also, once the mail client has been triggered via an initial SendTo operation, you'll be free to browse across directories and drag-n-drop further cherrypicked files.
The thing is that I would like it to work exactly as described, no need for further picking, files, directories, editing mail body...
so just this exactly:

1. Send one or more selected files as attachments on my own e-mail address
with current date as mail subject and "Backup" as mail body text.

If folders or folders + some files selected:

2. Compress all selected, give the that archive file name in format
current_date.tar.gz, and then send it as attachment on my e-mail address
with current date as mail subject and "Backup" as mail body text..

If someone know one-liner (a bit more complex I don't know how to write it) that could be put in Thunar Context menu to do this, I would appreciate it :)

Post Reply

Return to “Tips & Tricks by users”