You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
468 B
Plaintext
27 lines
468 B
Plaintext
4 years ago
|
#!/bin/bash
|
||
|
|
||
|
DIRECTORY="$(readlink -f "$(dirname "$(dirname "$0")")")"
|
||
|
|
||
|
file="$6"
|
||
|
echo "$file" > "$DIRECTORY/data/current-viewed-logfile"
|
||
|
|
||
|
if command -v mousepad ;then
|
||
|
mousepad "$file" &
|
||
|
pid=$!
|
||
|
elif command -v leafpad ;then
|
||
|
leafpad "$file" &
|
||
|
pid=$!
|
||
|
else
|
||
|
#for text_editor function
|
||
|
source "${DIRECTORY}/api"
|
||
|
text_editor "$file" &
|
||
|
pid=$!
|
||
|
fi
|
||
|
|
||
|
while [ "$(cat "$DIRECTORY/data/current-viewed-logfile")" == "$file" ];do
|
||
|
sleep 1
|
||
|
done
|
||
|
kill $pid 2>/dev/null
|
||
|
|
||
|
|