Is it possible to insert an entry to Nautilus scripts in Thunar right-click menu?
I know that Thunar has it's custom actions, but I've got dozens of Nautilus scritps and I really want to achieve this.
Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
Nautilus scripts in Thunar right-click menu?
Re: Nautilus scripts in Thunar right-click menu?
As you're already aware of that, I hope you also know the usual /bin/bash <your_script> %F method.efrpcabo wrote:I know that Thunar has it's custom actions..
May be you also know that these custom actions are stored as an xml file : <your home directory>/.config/Thunar/uca.xml
So, just to clarify your question -
- Do you want ONE simple entry in right-click menu that opens a sub-menu listing all of your *Nautilus* scripts?
- Are you using Nautilus along with Thunar?
- What is your DE (I'm assuming xfce4)?
I may not provide an alternative (quicker, easier) solution, but what *I think* you want to achieve looks interesting to me, so just joining in.
Re: Nautilus scripts in Thunar right-click menu?
i think op hopes that nautilus scripts can be made "compatible" with thunar in some magical way, or "imported into thunar".
i don't know what syntax they use (i think i remember that they are NOT shell scripts), i don't know what syntax thunar uses, but that is what you have to look at first. maybe show us an example script.
i don't know what syntax they use (i think i remember that they are NOT shell scripts), i don't know what syntax thunar uses, but that is what you have to look at first. maybe show us an example script.
Re: Nautilus scripts in Thunar right-click menu?
@v&n
thank you very much for pointing me in the right direction
and that info alone made me able to use successfully all the nautilus scripts I've tested so far in thunar
that would aloud the use of the same scripts in both filemanagers at the same time
but Thunar is the default filemanager in my system and with these sub-menu listing I would have no need for Nautilus
in fact, despite the fact I also like Nautilus, the only reason I'm using it is because of Nautilus scripts that make my life much easier
especially with it's automatic sub-menus that mimic the scripts' directory's hierarchy
Thunar's custom actions are great, but if you have many of scripts like I do, the sub-menu listing is really necessary to organize them properly
so, if you or someone else could help solve this, it would be extremely helpful not only for me but I guess also for many other users
thank you very much for pointing me in the right direction
No, I didn'tv&n wrote:I hope you also know the usual /bin/bash <your_script> %F method.
and that info alone made me able to use successfully all the nautilus scripts I've tested so far in thunar
Yes, I knew thatv&n wrote: May be you also know that these custom actions are stored as an xml file : <your home directory>/.config/Thunar/uca.xml
Yes, I am using both filemanagersv&n wrote:Are you using Nautilus along with Thunar?
Yes, I'm using xfce4v&n wrote:What is your DE (I'm assuming xfce4)?
Yes, that's exactly what I'd like to achievev&n wrote:Do you want ONE simple entry in right-click menu that opens a sub-menu listing all of your *Nautilus* scripts?
that would aloud the use of the same scripts in both filemanagers at the same time
but Thunar is the default filemanager in my system and with these sub-menu listing I would have no need for Nautilus
in fact, despite the fact I also like Nautilus, the only reason I'm using it is because of Nautilus scripts that make my life much easier
especially with it's automatic sub-menus that mimic the scripts' directory's hierarchy
Thunar's custom actions are great, but if you have many of scripts like I do, the sub-menu listing is really necessary to organize them properly
so, if you or someone else could help solve this, it would be extremely helpful not only for me but I guess also for many other users
Re: Nautilus scripts in Thunar right-click menu?
Yes, Nautilus scripts are shell scriptsdebiman wrote:i think op hopes that nautilus scripts can be made "compatible" with thunar in some magical way, or "imported into thunar".
i don't know what syntax they use (i think i remember that they are NOT shell scripts), i don't know what syntax thunar uses, but that is what you have to look at first. maybe show us an example script.
and like I said above I was able to use them successfully inserting this in the command field like v&n sugested me:
/bin/bash /path_to_script/my_script %F
Like you asked, here are some examples of scripts I use:
copy file and rename the new file using it's new timestamp:
#!/bin/sh
TS=$( date +%Y%m%d_%H%M%S )
for i in "$@"; do cp "$i" "$TS.${i##*.}"; done
chmod to 777:
#!/bin/bash
chmod 777 -R "$@"
copy folder and rename the new folder using it's new timestamp:
#!/bin/sh
TS=$( date +%Y%m%d_%H%M%S )
cp -r "$@" $TS
create folder with the same name of the selected file and move the file inside the folder
#!/bin/sh
set -e
for file do
case "$file" in
*/*) TMPDIR="${file%/*}"; file="${file##*/}";;
*) TMPDIR=".";;
esac
temp="$(mktemp -d)"
mv -- "$file" "$temp"
#this line removes the file extension
mv -- "$temp" "$TMPDIR/${file%.*}"
#if I want to keep the file extension, use this line instead
#mv -- "$temp" "$TMPDIR/$file"
done
print all files inside folder:
#!/bin/sh
for FILE in ./*.pdf ; do lpr "$FILE" ; done
print all files inside folder, but only the first page of each file:
#!/bin/sh
for FILE in ./*.pdf ; do lp -o page-ranges=1 "$FILE" ; done
print only selected files:
#!/bin/sh
lpr "$@"
print only selected files, but only the first page of each file:
#!/bin/sh
lpr -o page-ranges=1 "$@"
move the selected file to a predefined folder, but before that, opens a small window so the user can write the new file name, and appends a timestamp prefix:
#!/bin/bash
newname=$(zenity --entry --text "new name?")
TS1=$( date +%Y%m%d )
TS2=$( date +%H%M%S )
if [ -d /home/user1/temp/temp_PDF ]; then
mv $@ /home/user1/temp/temp_PDF/$TS1" "$TS2" "FRU\ BPI" ""$newname".pdf
nautilus /home/user1/temp/temp_PDF
fi
if [ ! -d /home/user1/temp/temp_PDF ]; then
mkdir /home/user1/temp/temp_PDF
mv $@ /home/user1/temp/temp_PDF/$TS1" "$TS2" "FRU\ BPI" ""$newname".pdf
nautilus /home/user1/temp/temp_PDF
fi
or just one line commands like:
create a folder named with the current timestamp:
mkdir $(date '+%Y%m%d_%H%M%S')
open terminal:
xfce4-terminal
take a screenshot and save it to desktop named with the timestamp:
scrot -s ~/Desktop/'%Y%m%d_%H%M%S.png'
redefine the date and time of photos:
exiftool -AllDates='2015:05:25 22:38:55' -overwrite_original 5.jpeg
change a virtualbox virtual machine uuid:
VBoxManage internalcommands sethduuid $@ 12345678-1234-1234-1234-$(date '+13%m%d%H%M%S')
Re: Nautilus scripts in Thunar right-click menu?
Glad I could be of at least some help.efrpcabo wrote:No, I didn'tv&n wrote:I hope you also know the usual /bin/bash <your_script> %F method.
and that info alone made me able to use successfully all the nautilus scripts I've tested so far in thunar
Yes the sub-menu style would be great. Unfortunately I don't know if it is even possible in Thunar ritght-click menu, hence my curiosity.
Re: Nautilus scripts in Thunar right-click menu?
Make a custom action that runs a script for each category of scripts you want under the same heading. The script makes a zenity list of the scripts in its category and passes the arguments to the script that does the real work. That way, a few custom actions give you access to a large number of scripts.
Re: Nautilus scripts in Thunar right-click menu?
ok, well that makes things easy then.efrpcabo wrote:Yes, Nautilus scripts are shell scripts
Re: Nautilus scripts in Thunar right-click menu?
Thank you, I've never thought of that.fsmithred wrote:Make a custom action that runs a script for each category of scripts you want under the same heading. The script makes a zenity list of the scripts in its category and passes the arguments to the script that does the real work. That way, a few custom actions give you access to a large number of scripts.
I'm going to try that.