Just an example:
My mimeapps.list has the content:
Code: Select all
[Added Associations]
text/plain=test.desktop;
Code: Select all
[Desktop Entry]
Type=Application
Name=test
Exec=lxterminal -e python /home/sworddragon/Data/test.py --var1 %u --var2 test2
NoDisplay=true
Code: Select all
import optparse
arguments = optparse.OptionParser()
arguments.add_option('--var1', dest = 'var1')
arguments.add_option('--var2', dest = 'var2')
(option, arguments) = arguments.parse_args()
print(option.var1)
raw_input('')
If I right click the click.txt and select test lxterminal show me /home/sworddragon/Data/click.txt. I don't know how to access the directory with a variable.