SweetFX Settings DB
Latest forum threads
1 hour ago
1 hour, 53 minutes ago
3 hours, 2 minutes ago
5 hours, 57 minutes ago

Open link target

Preset for Nautilus Script
Created by Bilu
Added April 17, 2022
Updated 17 Apr 16:46 CEST
Shader used: Other
Preset description:
Using the downloaded file didn't work for me. Do it manually instead: - create a file called "Open link target" - copy & paste the settings and save the file - follow the instructions below: #============================================================================== # # Move the file to the location path for Nautilus scripts: # ~/.local/share/nautilus/scripts # # # Make it executable: # touch ~/.local/share/nautilus/scripts/"Open link target" # chmod +x ~/.local/share/nautilus/scripts/"Open link target" # #==============================================================================
Download preset Show / Hide settings
#!/bin/bash #============================================================================== # # Move the file to the location path for Nautilus scripts: # ~/.local/share/nautilus/scripts # # # Make it executable: # touch ~/.local/share/nautilus/scripts/"Open link target" # chmod +x ~/.local/share/nautilus/scripts/"Open link target" # #============================================================================== #============================================================================== # INIT VARIABLES # may depends of your system DIRNAME='/usr/bin/dirname' GREP='/bin/grep' NAUTILUS='/usr/bin/nautilus' PERL='/usr/bin/perl' READLINK='/bin/readlink' XDG_OPEN='/usr/bin/xdg-open' #============================================================================== # MAIN # lets check if object is selected : [ "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" == "" ] # retrieve the first object selected : first_object=`echo "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" \ | $PERL -ne 'print;exit'` # lets check if local path : [ `echo "$first_object" | $GREP -c "^/"` -eq 0 ] # retrieve the target path : if [ -L "$first_object" ] ; then # symbolic link target=`$READLINK -f "$first_object"` else # not a symbolic link : target="$first_object" fi target_to_open_in_nautilus="$target" ### GO : let's open $NAUTILUS --no-desktop --select "$target_to_open_in_nautilus" exit 0 ### EOF

Screenshots

Comments

You need to be logged in to post a comment