Thursday, February 23, 2012

Running a script when logging out of gnome.

Take a look at /etc/gdm/. You will find there a bunch of directories, especially those named PostLogin, PostSession and PreSession. You don't have to be a rocket scientist to figure out what they are for :)
Inside you will find file called "Default". Adding a path to your script will do (eg. /home/user/script/cleanup.sh). Just remember that it will affect all users and a scipt will run as root.
If you want something a bit more sophisticated you can add this.
logoutscript="$HOME/script/cleanup.sh";
if [ -x "$logoutscript" ] ; then
su $USER -c "$logoutscript"
fi
(I've found it on some linux related forum. Cant't locate it right now)
It will still affect all users, but will not run as root, and only if the script file really exists.

Sunday, March 15, 2009

How to disable generating previews of media files in Nautilus (GNOME), Fedora 10.

It would be the easiest to have gconf-editor installed.

By default, when you have this app installed, you can find it here:
Applications > System Tools > Configuration Editor

Go to:
desktop/gnome/thumbnailers

There you can find every file type that has preview enabled. To disable all of them at once just check "disable_all" in the "thumbnailers" entry, or you can just find the media type you don't want to have preview generated (they are listed as a sub-directories of "thumbnailers") and uncheck "enable" key.

Saturday, February 16, 2008

Howto - convert chm to html.

To do it, we'll need a tiny command line program - extract_chmLib, which is distributed with chmlib package almost in all distributions. However, if you're using Fedora 8 you probably need to download chmlib source code from here. The newest version available for me was 0.39. Extract it and compile:
./configure --enable-examples
make
Installation is not necessary. Extract_chmLib is hidden here:
src/.libs/extract_chmLib
To convert chm file to html, or rather extract html files from chm just type:
extract_chmLib file.chm output_directory/
What you end up with should be a website, which you can index using Beagle or Gnome Desktop. It saves a lot of time usually spend on digging through personal library.
Have a nice time compiling.

I've done it using Fedora 8, and needed only standard development packages.