May 31, 2008

Install fonts using nautilus-actions

Nautilus-Actions installs custom entries in the context menu in nautilus. I needed a simple way to install fonts so I wrote a command for nautilus-actions.

Set "Path:" to bash
Set Parameters to -c "if zenity --question --text=\"Would you like to install the font system wide?\" --title=\"Install to System\"; then gksudo cp %M /usr/share/fonts/truetype/local/%m; else cp %M ~/.fonts/%m; fi; exit 0;".

If you do not want to install nautilus actions you can simply create a Nautilus script.

The contents of the script should be

#!/bin/bash
if zenity --question --text="Would you like to install the font system wide?" --title="Install to System"; then
for $i in $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS; do
gksudo cp $i /usr/share/fonts/truetype/local/$(basename $i)
done
else
for $i in $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS; do
cp $i ~/.fonts/$(basename $i)
done
fi
exit 0

Save this script in '~/.gnome2/nautilus-scripts' and make it executable (chmod u+x).

May 25, 2008

PCMan File Manager: 7z and rar archives

By default, pcmanfm will not extract/create 7zip and Rar archives. Extracting rar archives is already implemented but not enabled by default while the ability to extract 7z archives is not implemented at all. To enable the extraction of rar and 7zip archives and the creation of 7zip archives open src/ptk/ptk-file-archiver.c:


Uncomment:


{
"application/x-rar",
NULL,
"unrar -o- e",
".rar", TRUE
}

And add this below:


{
"application/x-7z-compressed",
"7zr a -bd -y",
"7zr x -bd -y",
".7z", TRUE
}

Next, insert a comma, after the end bracket of the rar section.
The archive handlers section should endup looking like this:

const ArchiveHandler handlers[]=
{
{
"application/x-bzip-compressed-tar",
"tar --bzip2 -cvf",
"tar --bzip2 -xvf",
".tar.bz2", TRUE
},
{
"application/x-compressed-tar",
"tar -czvf",
"tar -xzvf",
".tar.gz", TRUE
},
{
"application/zip",
"zip -r",
"unzip",
".zip", TRUE
},
{
"application/x-tar",
"tar -cvf",
"tar -xvf",
".tar", TRUE
},
{
"application/x-rar",
NULL,
"unrar -o- e",
".rar", TRUE
},
{
"application/x-7z-compressed",
"7zr a -bd -y",
"7zr x -bd -y",
".7z", TRUE
}
};
C0mpile with a standard ./configure; make; make install or ./configure; make; checkinstall.

Qalculate: The best calculator program

I finaly found the (almost) perfect calculator program, qalculate. It can solve/factor equations, work with significant figures, work with trigonometry, and much more.
Screenshots:
HistoryKeypadSolve

May 21, 2008

Install Flash Player 10 in liferea

Installing flash player 10 in Ubuntu does not install it for Liferea


The fix for this is very simple:
1. First install Flash Player 10 using this Tutorial
2. Next execute this command in the terminal:
sudo ln -s /usr/lib/firefox-addons/plugins/libflashplayer.so /usr/lib/xulrunner-addons/plugins/libflashplayer.so
Flash Player 10 should now work in Liferea

May 16, 2008

Tip: Purge Auto-installed packages with Aptitude

When switching from apt-get to aptitude, I discovered that aptitude, unlike apt-get, does not purge configuration files of auto-removed packages when given the command aptitude purge package. The fix for this is very simple.


In order to purge configuration files only when the purge command is given you must either specify the --purge-unused option in the command or create an alias. To create an alias add this alias command='sudo aptitude purge --purge-unused' to ~/.bashrc. Command is the command that you would like to assign for purging the packages.


To always purge configuration files for auto-removed packages add Aptitude::Purge-Unused=true to /etc/apt/apt.conf.d/05aptitude. This will cause aptitude to always purge configuration files for all auto-removed packages regardless of weather or not the command was aptitude purge or aptitude remove.

May 13, 2008

Rarcrack: Crack zip, rar, and 7z files

I have just tested rarcrack and love it. Rarcrack cracks password protected rar, 7z, and zip archives. Sadly, it's not in the Ubuntu repository. I have therefor compiled a deb: rarcrack.deb. I have not included this deb in my PPA because I compiled it with debianpackagemaker.

May 3, 2008

Make Firefox 3's autocomplete bar work with a dark theme

I use MurrinaAngustifolium as my gtk theme but, because it is a dark theme, it does not always play nicely with other applications. One problem that I have finally fixed is the drop-down auto-complete menu for the location bar. Put the following code in your userChrome.css file (or use stylish).


@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
.ac-comment {
font-size: 100% !important;
color: #dddddd !important;
}
.ac-comment[selected="true"] { color: #56aaff !important; }

.ac-url-text {
font-size: 100% !important;
color: #555555 !important;
}

.ac-url-text[selected="true"] { color: #666666 !important; }
.autocomplete-richlistbox {
background: #1a1a1a !important;
}
.autocomplete-richlistitem[selected="true"] {
background: #000000 !important;
tooltip {
background-color: #1a1a1a !important;
color: #ffffff !important;
}
}

This code also makes some of the tooltips black.