Skip to content

Instantly share code, notes, and snippets.

@junkdog
Last active December 11, 2015 17:08
Show Gist options
  • Save junkdog/4631947 to your computer and use it in GitHub Desktop.
Save junkdog/4631947 to your computer and use it in GitHub Desktop.
Open file inside a running instance of KDE Kate.
#/bin/bash
function full_path()
{
if [[ $1 == /* ]]; then
echo $1
else
echo `pwd`/$1
fi
}
if [ $# != 1 ]; then
echo "Usage: `basename $0` <file-name>"
exit 1
fi
if [ ! -f $1 ]; then
echo $1 does not exist.
exit 1
fi
qdbus `qdbus | grep org.kde.kate | head -n 1` \
/MainApplication org.kde.Kate.Application.openUrl \
file:`full_path $1` utf-8 >> /dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment