Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions follow-desktop-link@DopeyDave/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### 1.0

* Initial Release
19 changes: 19 additions & 0 deletions follow-desktop-link@DopeyDave/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Follow a Link
========================

Description
-----------

This Action adds the ability to follow a .desktop type link back to its source folder.

The behavior is similar to the Windows "open file location" functionality.

This following Actions should be paired for a complete package:
* create-link-desktop@DopeyDave
* create-link-here@DopeyDave
* follow-desktop-link@DopeyDave (You Are Here)

Usage
-----------

Right click on a shortcut file (.desktop type). Select the new option "Follow Link to Target".
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

for file in "$@"; do
# Extract the target path from the URL= line
url=$(grep -E '^URL=' "$file" | sed -E 's/^URL=//')

# Remove the file:// prefix if present
target="${url#file://}"

# Decode any URL-encoded characters (like spaces (%20) in path)
target=$(printf '%b' "${target//%/\\x}")

if [[ -d "$target" ]]; then
nemo "$target"
elif [[ -f "$target" ]]; then
nemo --no-desktop --browser "$(dirname "$target")"
else
zenity --error --text="Target not found or invalid: $target"
fi
done
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"description": "Follow a .desktop link (shortcut) back to its source folder",
"uuid": "follow-desktop-link@DopeyDave",
"name": "Follow a Link",
"author": "DopeyDave",
"version": "1.0"
}
8 changes: 8 additions & 0 deletions follow-desktop-link@DopeyDave/[email protected]_action.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Nemo Action]
_Name=Follow Link to Target
_Comment=Open the target file or folder from this .desktop shortcut
Exec=<follow-desktop-link@DopeyDave/[email protected] "%F">
Icon-Name=go-home-symbolic
Selection=notnone
Extensions=desktop;
Quote=double
3 changes: 3 additions & 0 deletions follow-desktop-link@DopeyDave/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"author": "DopeyDave"
}