Skip to content
This repository has been archived by the owner on Apr 24, 2022. It is now read-only.

Commit

Permalink
Improve the open scripts, LP #371626, Thanks astolia.
Browse files Browse the repository at this point in the history
  • Loading branch information
tualatrix committed May 19, 2009
1 parent 1c7c36d commit 118c272
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 5 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Expand Up @@ -10,6 +10,7 @@
* Fix the thousand years of bug LP #339261, Broken pipe when get apt
cache.
* Fix the xdg name error in ScriptWorker, add debug mode.
* Improve the open scripts, LP #371626, Thanks astolia.

2009-05-02 TualatriX <tualatrix@gmail.com>

Expand Down
15 changes: 13 additions & 2 deletions data/scripts/open-with-your-favourite-text-editor
@@ -1,3 +1,14 @@
#!/bin/bash

script-worker open $NAUTILUS_SCRIPT_SELECTED_URIS
IFS='
'
i=1
for url in $NAUTILUS_SCRIPT_SELECTED_URIS
do
if [ -n "`echo $url | grep 'file:///'`" ];then
script-worker open `echo "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" | cut -f$i -d'
'` &
else
script-worker open "$url" &
fi
i=$(($i+1))
done
15 changes: 13 additions & 2 deletions data/scripts/open-with-your-favourite-text-editor-as-root
@@ -1,3 +1,14 @@
#!/bin/bash

script-worker open $NAUTILUS_SCRIPT_SELECTED_URIS root
IFS='
'
i=1
for url in $NAUTILUS_SCRIPT_SELECTED_URIS
do
if [ -n "`echo $url | grep 'file:///'`" ];then
script-worker open `echo "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" | cut -f$i -d'
'` root &
else
script-worker open "$url" root &
fi
i=$(($i+1))
done
6 changes: 5 additions & 1 deletion scripts/script-worker.in
Expand Up @@ -5,4 +5,8 @@ python_exec=@PYTHON@

cd ${tweakdir}
export PYTHONPATH="$PYTHONPATH:${tweakdir}"
exec ${python_exec} -OO ScriptWorker.py $*
ARG1="$1"
shift
ARG2="$1"
shift
exec ${python_exec} -OO ScriptWorker.py "$ARG1" "$ARG2" "$*"

0 comments on commit 118c272

Please sign in to comment.