Showing posts with label Tweak Kubuntu (Feisty). Show all posts
Showing posts with label Tweak Kubuntu (Feisty). Show all posts

Friday, February 15, 2008

KDE Trash + Kmenu in AWN (ugly, ugly hacks)

Some day, I want to be free of kicker and rely solely on Avant Window Navigator to manage my various programs. Unfortunately, AWN is very Gnome-centric: it has a main menu plug-in and a trash plug-in, but both are Gnome-only. Fortunately, there's a way to get a similar effect on KDE -- kinda.

NOTE: FOLLOWING THE INSTRUCTIONS FOR MODIFYING THE TRASH PLUG-IN WILL LIKELY DESTROY A GNOME INSTALL. ONLY USE IT IF YOU USE KDE EXCLUSIVELY, AND HAVE NO DESIRE TO USE GNOME.

Firstly, the trash. AWN's trash plug-in looks for Trash in a different folder from KDE, so we have to change where it looks. First, remove the old Trash folder:
mv ~/.Trash ~/.Trash_old
Now, create a link so the Gnome trash folder points to the KDE trash folder:
ln -s ~/.local/share/Trash/files ~/.Trash
We have to edit Nautilus, the Gnome file manager, so that it will load KDE the way we want when we tell the trash applet to open the trash folder. So back up nautilus, and then open it as root:
sudo mv /usr/bin/nautilus /usr/bin/nautilus.old
sudo kwrite /usr/bin/nautilus
Now, replace whatever's in that file with the following:
#!/bin/sh
#
# /usr/bin/nautilus
#
# Avant Window Navigator Trash Aplet Hack for KDE
#
# Copyleft 2007 A. Tres Finocchiaro
#
# This script is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation

if [ "$1" = "trash:" ]; then
exec konqueror "$@/"
else
exec konqueror "$@"
fi

exit 0
Save, and you're done. AWN's trash applet now works with KDE.

Now, the menu "hack" is much less tightly integrated. Right-click AWN, select preferences, select launchers and click the add button. Call the command anything you like, and give it whatever icon suits your fancy. Now, make sure the command reads:
dcop kicker kicker popupKMenu 0
Add it to the AWN launch bar however you like. Now, hide kicker by opening up kcontrol and going to Desktop, then Panels, and finally the hiding tab. Select hide automatically. Now you have a button on your dock that will launch the kmenu.

Friday, January 11, 2008

Katapult and Compiz shadow

Does Katapult look funny when you've got compiz enabled? A sort of transparent box seems to appear underneath it whenever you use it, but it looked fine you started compiz?

The fix is easy. Open up the compiz settings manager, and head to the window decoration plugin. In there, make sure the Shadow window box reads:
any -name="katapult"
Now katapult will look just fine when next you use it.

Wednesday, December 26, 2007

Separate(ish) Bookmarks for Konqueror's Browser and File Manager mode

It's been ages since I've posted an honest-to-god HOWTO here. I suspect this is partly 'cause I haven't actually been tweaking my system all that much -- I've pretty much got my Feisty Kubuntu set up exactly how I like it, and the thought of messing about with it, just makes me feel tired. However, given that the 8.04 release of Kubuntu is going to come with the option of KDE 4.0, I may very well be tempted to reverse that stance, even though the KDE4 system is likely to be a bit buggy or featureless compared to the 3.5 series.

Anyways, onto the HOWTO. Once upon a time, I used Konqueror as both a browser and a file manager. It did both well, except I wasn't pleased with how it looked, and I wanted one set of bookmarks for the web, and one for my hard drive and not both at the same time. I also wanted one set of buttons for web browsing, and one for file browsing. How to resolve the dilemma?

Answer: metabar.

Ok, open up konqueror in file browsing mode: on kubuntu the easiest way to do this is to go to the systems menu applet (on a default kubuntu install, it's on the bottom panel next to the kmenu button) and open up, say, your home directory.

Now, under the view menu in konqueror, select "Show Navigation Panel". This can also be done by hitting the F9 button on your keyboard. A panel should appear on the left side of konqueror. From the choices on it, open the metabar.

The metabar basically provides you with information on each file you select: size, permissions, previews. It also comes with actions and links. Those last two are how you're going to customize konqueror.

Right-click anywhere in the metabar area and select "configure metabar". Under the "Actions" tab that opens, add any file-browsing specific actions you'd like (things like "open in terminal" or the "up" button.) Then, under the "Links" tab, and any file-browsing specific links you'd like, things like your home directory or network places. When you've got the configuration you'd like, go to the "Settings" menu and select "Save View Profile File Management" and save your configuration.

I personally find other options of the navigation panel to be useless and it's presence ugly, so I hide it by default. To do this, open a terminal and type:
kwrite ~/.kde/share/config/konqsidebartng.rc
and set the HideTabs value to equal true. Now when you open konqueror, only the metabar will be showing.

Finally, configure the main konqueror toolbar to include whatever buttons you like by right-clicking it and selecting "configure toolbar". I personally only keep web-specific buttons there, like back, forward, reload, home, etc. but customize it however you wish. Finally, consider adding some flair to your metabar by going to kde-look and searching for metabar themes. I personally like the Advance Blue theme from this set. To install them, simply download the file from the site, right-click the metabar, choose "configure metabar" and then under the "General" tab, press "install new theme" and select the file you downloaded. It will now be available as a theme option in the drop-down list next to the install button.

Tuesday, October 9, 2007

Improve True Type Font Rendering on Feisty

As a student, I get assigned written reports with a fair amount of regularity. It's not uncommon, when going over the instructions, to read that the assignment must be X pages long, be double spaced, have 1-inch margins, and yes, use Times New Roman. Turns out that teachers are now wise to the formatting tricks we've been using to slip in under page counts, so formatting has been more-or-less standardized.

Long story short, even if I'm on Linux, I have to be using Microsofts' True Type fonts anyways. Given that, I suppose I may as well make them look pretty.

The first order of business is to install the fonts. From a terminal type:
sudo aptitude install msttcorefonts
Now, open up your apt sources list:
kdesu kwrite /etc/apt/sources.list
Ok, scroll to the end, add the following to the file and save:
deb http://www.telemail.fi/mlind/ubuntu feisty fonts
Now type:
wget http://www.telemail.fi/mlind/ubuntu/937215FF.gpg -O- | sudo apt-key add -
Install the new rendering packages:
sudo aptitude update && sudo aptitude install libfreetype6 libcairo2 libxft2
sudo dpkg-reconfigure fontconfig-config
(When prompted choose Native, Always, No bitmapped fonts, in that order)
Finally, download the package from here:
http://www.osresources.com/files/centos-windows-fonts/fontconfig.tbz
and install it with:
sudo tar xvjpf fontconfig.tbz -C /etc/fonts/

Personally, I've enabled KDE's anti-aliasing settings (found under System Settings --> Appearances --> Fonts). They're using full subpixel hinting, but are excluding the range from 0.0 to 8.0. So far, that seems to make TrueType fonts look more or less as they do on Windows.

Saturday, October 6, 2007

Improve Ubuntu Boot time and Responsiveness

Whether or not these changes will have any effect depends largely on your specific hardware setup. Still, I doubt this would actually harm anything.

First, are you using a dual-core or other processor that supports hyperthreading (also called multithreading)? If so, open up /etc/init.d/rc:
kdesu kwrite /etc/init.d/rc
Now, find the line that says "CONCURRENCY" and make it read "CONCURRENCY=shell".

Secondly, do you have a lot of RAM? If so, you probably don't need your computer to touch your swap file much. Open up /etc/sysctl.conf:
kdesu kwrite /etc/sysctl.conf

Now, scroll to the bottom and add the line "vm.swappiness=0" to the file. Save, and exit.

Are you using broadband? Open up /etc/sysctl.conf again:
kdesu kwrite /etc/sysctl.conf
Now, scroll to the bottom and add the following to the file:
net.core.rmem_default = 524288
net.core.rmem_max = 524288
net.core.wmem_default = 524288
net.core.wmem_max = 524288
net.ipv4.tcp_wmem = 4096 87380 524288
net.ipv4.tcp_rmem = 4096 87380 524288
net.ipv4.tcp_mem = 524288 524288 524288
net.ipv4.tcp_rfc1337 = 1
net.ipv4.ip_no_pmtu_disc = 0
net.ipv4.tcp_sack = 1
net.ipv4.tcp_fack = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_ecn = 0
net.ipv4.route.flush = 1
Save and exit. Type:
sudo sysctl -p
and you're done.

Finally, since you made a bunch of changes, it's best to reprofile your boot-up sequence. You can read more about it here. Basically the system reads all the files it needs to boot up, puts them in order, and saves the list so it can boot faster the next time. Here's how you do it:

  1. At the bootup menu (GRUB), select your default kernel. You may need to press ESC to see this menu.

  2. Press e for edit.

  3. Choose the first line (it should start with "kernel"). Press e again.

  4. Move to the end of the line, then add the word profile. Press enter.

  5. Press b to boot.

  6. Let the system boot to the login screen, and wait for all disk activity to stop

  7. Reboot your system, and enjoy the results

It's a good idea to reprofile:
  • After you install Ubuntu and get the system set up the way you like,
    After doing a major upgrade, such as to the next version of Ubuntu. No need to do it for regular updates, etc.

  • After setting up prelink (if you use it), since that could cause bootup files to change locations on your hard drive

  • After restoring your entire system from backups, as that would change locations of files on your hard drive.

Sunday, September 23, 2007

Speed Up and Integrate Firefox

Don't get me wrong, Kubuntu comes with a very capable web browser in Konqueror -- except that Konqueror isn't compatible with everything. Although I love Konq's integration with the rest of KDE, it doesn't work well with Facebook or my University's website or Windows Live Mail (which I still use, since I've had that email since grade 7 and everyone knows it by now. Also it's a good email to toss at the various companies that want to know what mine is). So I've switched to Firefox.

Speed Up Firefox

Taken from this website, this section is all about getting firefox to load webpages faster. First, type "about: config" in the location bar.

  1. Search for network.http.pipelining, and change its' value to true

  2. Search for network.http.pipelining.maxrequests, and change its' value to 8

  3. Search for network.http.proxy.pipelining and change its' value to true

  4. Search for network.dns.disableIPv6 and change its' value to true

  5. Search for plugin.expose_full_path and change its' value to true

  6. Right click anywhere in the list, select new, then integer. Create a value called nglayout.initialpaint.delay and set its' value to 0

  7. Right click anywhere in the list, select new, then integer. Create a value called content.notify.backoffcount and set its' value to 5

  8. Right click anywhere in the list, select new, then integer. Create a value called ui.submenuDelay and set its' value to 0

  9. Right click anywhere in the list, select new, then integer. Create a value called browser.cache.memory.capacity and set its' value to the maximum memory you wish Firefox to use at a given time. 16MB is a good default, so enter 16384

  10. Search for layout.spellcheckDefault, and set its' value to 2. Now Firefox will check spelling on both input fields and text areas

Integrate Firefox with KDE


Now that we've got Firefox loading webpages faster, it would be nice if it started to use KDE programs and dialogs rather than the default Gnome ones or embedded players. So let's teach the old fox some new tricks.

  1. Go here and download the kgtk deb. Right-click the file, and install it. Now, open up the KDE menu editor (select "run command" from the menu and type in kmenuedit) and find the entry for Firefox. Change the command value to read "kgtk-wrapper firefox %u", save and exit. Now Firefox will open files in the usual KDE style.

  2. Open up any webpage in Firefox, go to File, and tell Firefox to print the page using "PostScript/default" -- it should be the default if you haven't installed any printers yet. Now type "about:config" into the location bar again, and search for print.printer_PostScript/default.print_command. Change its' value to read kprinter. Now, right click anywhere in the list, select new and boolean. Create a value called print.always_print_silent and set its' value to true. Finally, right click anywhere in the list, select new and boolean. Create a value called print.postscript.cups.enabled and set its' value to false. There! Now Firefox will use the normal KDE dialog to print files

  3. Open up about:config. Search for network.protocol-handler.external.mailto and make sure its' set to true. Now, right click anywhere in the list, select new and string. Create a value called network.protocol-handler.app.mailto and set its' value to kmail. Firefox will now open e-mail files in kmail.

  4. Open up adept, and install the kget program. Now, download the Flashgot extension. Restart Firefox, and configure Flashgot to use kget as a download manager. (Personally, I like Firefox's native download manager, so I don't use this tip. But if you wanted the complete KDE Firefox experience...)

  5. Open up about:config. Search for browser.download.hide_plugins_without_extensions and set its' value to false. Now, go to the Edit menu, select preference, then content and then click the manage button next to file types. Change all the values dealing with audio files to use "/usr/bin/amarok" to open them. Now when you download an mp3 Firefox will automatically play it with KDEs' premier music player.

  6. Now that we've got Firefox all KDEified, we may as well make it our default browser. Open up System Settings and select default applications. Select Webbrowser and set it to open Firefox in the following browser: kgtk-wrapper firefox. Apply the settings and you're done!
There! Now your speeded up Firefox integrates into KDE almost as well as Konqueror, while allowing you to maintain compatibility with just about every site on the web.

Saturday, September 22, 2007

Speed Up Amarok Collection

Whereas my last two posts were compiled from several different sources, this one was ripped off wholesale from this fellows' blog. I reproduce it here largely for my own convenience.

First, install MySQL:
sudo aptitude install mysql-server mysql-client
. Next, give yourself a MySQL password (replacing the capitalized work PASSWORD with a password of your own invention):
mysqladmin -u root password PASSWORD
Finally, create the database for Amarok (once again substituting the password you chose instead of PASSWORD).
mysql -p -u root
CREATE DATABASE amarok;
USE mysql;
GRANT ALL ON amarok.* TO amarok@localhost IDENTIFIED BY 'PASSWORD';
FLUSH PRIVILEGES;
quit
Fire up Amarok, choose settings, configure Amarok, Collection. Use the following settings:

Hostname: 127.0.0.1
Database: amarok
Port: 3306
Username: amarok
Password: Your Password

Now Amarok's collection should be much speedier.

Get Screenlets working with Kubuntu

Right, well, you've managed to get yourself a nice composited environment to play with. One of the coolest features of this is the "widget layer", which basically functions like the Mac OSX Dashboard. Strictly speaking, any program could be a widget, provided you define it as such in the settings. However, only screenlets are designed to be displayed on the widget layer, and I ran into problems when I tried to use superkaramba widgets with it.

Install the Screenlets Engine

So, our first order of business is to install Screenlets. Open up your apt sources list as root:
kdesu kwrite /etc/apt/sources.list
Now add the following to it, save and close the file:
deb http://hendrik.kaju.pri.ee/ubuntu feisty screenlets
Next update your list and install the screenlets:
sudo aptitude update
sudo aptitude install screenlets python-gnome2-desktop
Now, open the compiz settings manager, and select the window rules plugin. Add "class=Screenlet.py" to the widget line. Your screenlets should be working now. Test them out by opening the screenlets manager. Simply select one of the default screenlets to run and click the Launch button to start them. The screenlets can then be seen by pressing F9.

Install individual screenlet widgets

Widgets can be downloaded from here. To install them, simply extract them and add them to the /home/[username]/.screenlets folder (if the folder doesn't exist just create it).

Autostarting Screenlets

In the screenlets manager there's an option for autostarting them, but it doesn't work on KDE without some work. First, make the folder /home/[username]/.config/autostart. Now, in the screenlets manager, select the screenlets you want to load and tick off "automatically start on login" (it's in the bottom left). For each one, a file ending in .desktop will be created in the autostart folder you just made. Move each one to KDE's autostart folder which is /home/[username]/.kde/Autostart.

Create a text file named "screenlets.sh" in KDE's autostart folder. Add the following to the file and then save:
#! /bin/bash
/usr/local/share/screenlets-manager/screenlets-daemon.py
Now right click the file, select properties, then click on the permissions tab. Set the file to executable, and hit ok. Finally, add the line "Type=Application" all the various .desktop files you've transfered over.

That's it! Now your screenlets will load automatically the next time you sign in.

Friday, September 7, 2007

Integrate Compiz Fusion with Kubuntu

I keep a private list of all the changes I make to my system, so that if I have to reinstall I can look at it and remember how I did things. It seems to me that it makes much more sense to keep this list online, so that maybe someone else can see it and benefit.

So, you've figured out that your graphics card can run compiz fusion (beyond the scope of this article), and you've got it installed (you can find a guide for that on Feisty here.) But when you run it on Kubuntu, the system automatically loads the default window manager, kwin. So when you start Compiz Fusion, there's a brief flash where the wallpaper goes black -- which is ugly. Besides, loading kwin when you don't intend to use it is a waste of resources and time. So let's get Kubuntu to load Fusion when you log in, instead of kwin.

First, open up a terminal and type:
kdesu kwrite /usr/bin/startcompiz.sh

Now, what you have to put in here will vary by your video card manufacturer. Choose the correct one, enter the following, and save:

Nvidia
#!/bin/bash
compiz --replace --indirect-rendering --sm-disable ccp &
sleep 5
emerald --replace &

ATI
#!/bin/bash
LIBGL_ALWAYS_INDIRECT=1 compiz --replace --indirect-rendering --sm-disable ccp &
sleep 5
emerald --replace &

Intel
#!/bin/bash
INTEL_BATCH=1 LIBGL_ALWAYS_INDIRECT=1 compiz --replace --indirect-rendering --force-aiglx --sm-disable ccp &
sleep 5
emerald --replace &

Now make it executable:
sudo chmod 755 /usr/bin/startcompiz.sh
Ok, now check to see that it works. At a terminal type:
./startcompiz.sh
And see if Fusion loads as you want it to. If it does, great, onto the next step. Open the file:
kdesu kwrite ~/.bashrc
Now add the line:
export KDEWM=startcompiz.sh
Save, and you're done! Log out and then back in, and Compiz Fusion should automatically be loaded as your window manager.