First I created the script and put it in .local/bin:
Code: Select all
#!bin/bash
echo "Enter keyword" && read keyword && grep -i --color=always "$keyword" "$1"; read
Then I created a desktop file and put it in local/share/applications:
Code: Select all
[Desktop Entry]
Name=grepper
Comment=Grep keyword in selected file
Exec=/home/abacus7/.local/bin/grepper %f
Icon=terminal
Type=Application
Terminal=true