diff --git a/vscodium@trymeouteh/files/vscodium@trymeouteh/examine.sh b/vscodium@trymeouteh/files/vscodium@trymeouteh/examine.sh new file mode 100755 index 00000000..d432f6f8 --- /dev/null +++ b/vscodium@trymeouteh/files/vscodium@trymeouteh/examine.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +## Here we handle exception. +## We will catch if currently right clicked directory actually exists, +## ... Or is it the root filesystem? +WORKING_DIR=$1 + + +## IF: WORKING_DIR is empty (eg. recents, trash or search results) --- does not exist +## OR: WORKING_DIR is / (eg. favorites or root filesystem) --- we don't touch root filesystem +if [[ -z "$WORKING_DIR" || "$WORKING_DIR" == '/' ]]; then + + # THEN: We exit with err. code 1, so that Nemo action will receive err. condition + # ...and won't continue executing, aka. won't show VSCode menu entry at all. + exit 1 +fi + +exit 0 \ No newline at end of file diff --git a/vscodium@trymeouteh/vscodium@trymeouteh.nemo_action.in b/vscodium@trymeouteh/vscodium@trymeouteh.nemo_action.in index 39765330..91b62850 100644 --- a/vscodium@trymeouteh/vscodium@trymeouteh.nemo_action.in +++ b/vscodium@trymeouteh/vscodium@trymeouteh.nemo_action.in @@ -3,5 +3,6 @@ _Name=Open in VSCodium _Comment=Open VSCodium in the selected folder Exec=codium %P Icon-Name=vscodium -Selection=Any +Conditions=exec ; +Selection=None Extensions=dir;