Gui for viewing logfiles
Posted: 10. Sep 2011, 12:39
Hi I'm looking for GUI to view logfiles with Salix Xfce. Something like the "Gnome System Log Viewer". Does anyone know one?
Code: Select all
#!/bin/bash
# Name this script what you like and chmod +x
# This script will give you a file selection pop up opened to
# /var/log. Select any text log file hi enter and it will be
# opened in another pop up for viewing. Alternatively, uncomment
# the first zenity command and comment out the second and you will
# get a pop up in which you can enter a path and file name to do
# the sme thing. Create a desktop icon with a path to this script
# or a desktop file in /usr/share/applications that you can add
# to a menu.
#log_file=`zenity --entry \
# --window-icon=$icon \
# --title="Enter log file path" \
# --text="Enter the path to the logfile you want to view"`
log_file=`zenity --file-selection \
--filename="/var/log/" \
--title="Select a log file"`
rtrn=$?
if [ "${rtrn}" == "1" ]; then
exit 1
fi
cat $log_file | \
zenity --text-info \
--title "Showing $log_file" \
--width 850 --height 600
rtrn=$?
i if [ "${rtrn}" == "1" ]; then
exit 1
fi
# end of script