Jordan Callicoat

Here are two other versions of the script in case somebody doesn't have ruby installed. 

======== 

Python version:

#!/usr/bin/python

import os, sys

if (not sys.argv[1] or sys.argv[1][0] == '/'):
    os.system('thunar %s' % sys.argv[1])
elif (sys.argv[2][0:7] == 'file://'):
    os.system('thunar %s' % sys.argv[2])
else:
    os.system('nautilus.real %s' % ' '.join(sys.argv[1:]))
#os.system('zenity --info --text="%s"' % ' '.join(sys.argv[1:])) #DEBUG

========

Shell script version:

#!/bin/bash

if [ -z "${1}" ] || [ "${1:0:1}" == "/" ]; then
    thunar "${1}"
elif [ "${2:0:7}" == "file://" ]; then
    thunar "${2}"
else
    nautilus.real "${@}"
fi
#zenity --info --text="${@}" #DEBUG

Rispondi

  • Linee e paragrafi vanno a capo automaticamente.
Maggiori informazioni sulle opzioni di formattazione.