Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Konqueror fast startup trick.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
sindre
Guru
Guru


Joined: 01 Nov 2002
Posts: 315
Location: Norway

PostPosted: Sun Apr 11, 2004 12:08 pm    Post subject: Konqueror fast startup trick. Reply with quote

While using my worn out old 350mhz system, I noticed how my konqueror-related shortcuts often start a new instance of konqueror, rather than creating a new window from the currently running one, which should be faster and conserve memory. Therefore I made this script which ensures that if there is an instance of konqueror already running, it will make a new window from that, rather than starting a new konqueror-process. In some cases kde already does this, mainly it doesn't when using different konqueror-profiles at the same time. The main drawback of this script is that if konqueror should happen to crash, you'll lose all your konqueror windows, which might be why this isn't the default behaviour. I've found this to work very well combined with the setting in the performance-tab of konquerors preferences which preloads konqueror after startup and keeps it in memory.

Startup notification doesn't work (any help on how to fix this would be appreciated), so shortcuts to these script should have that disabled. It shouldn't matter much though as konqueror should start almost instantly. I chose to save the scripts to /usr/bin and make my usual shortcuts execute them rather than the default. It should be easy to edit the scripts to open different directories etc.

Script for opening home dir:
Code:
#!/bin/bash
a=$(dcop | grep -m1 konqueror)
if [ "$a" != "" ]
then
  dcop $a KonquerorIface createNewWindow "$HOME" ""
  exit 0
else
  kfmclient openProfile filemanagement
  exit 0
fi

Script for opening konqueror web-browser:
Code:
#!/bin/bash
a=$(dcop | grep -m1 konqueror)
if [ "$a" != "" ]
then
  dcop $a KonquerorIface createNewWindow "about:konqueror" ""
  exit 0
else
  kfmclient openProfile webbrowsing
  exit 0
fi

Example script for opening devices:/
Code:
#!/bin/bash
a=$(dcop | grep -m1 konqueror)
if [ "$a" != "" ]
then
  dcop $a KonquerorIface createNewWindow "devices:/" ""
  exit 0
else
  kfmclient openProfile filemanagement devices:/
  exit 0
fi


Remember to make the scripts executable (chmod +x <script>).

If you wonder how fast this trick is, try pressing ctrl+N in a konqueror window, that's how fast konqueror will start using these scripts.


Last edited by sindre on Sun Apr 11, 2004 5:00 pm; edited 1 time in total
Back to top
View user's profile Send private message
Elm0
Apprentice
Apprentice


Joined: 24 Nov 2002
Posts: 281
Location: UK

PostPosted: Sun Apr 11, 2004 3:29 pm    Post subject: Reply with quote

Cool, nice tip :)
Back to top
View user's profile Send private message
gearmonk
n00b
n00b


Joined: 30 Oct 2003
Posts: 43

PostPosted: Sun Apr 11, 2004 6:44 pm    Post subject: Reply with quote

Actually, I think that the reason Konqueror tends to start new processes when loading local folders vs opening web pages is the setting in the performance tab labelled "Minimize Memory Usage" If it is set to "None", Konqueror creates a new process for every window opened. "File Browsing Only" will use the same process for local folders, but web pages will use a separate process. "Always" should make Konqi create new windows from the same process every time, but if one has a problem and crashes, they all die. Setting it to always should give the same net effect as your script, but with less work. Hope that helps
Back to top
View user's profile Send private message
sindre
Guru
Guru


Joined: 01 Nov 2002
Posts: 315
Location: Norway

PostPosted: Sun Apr 11, 2004 8:01 pm    Post subject: Reply with quote

Really? That's great! Indeed it seemed strange that there was no preference for this. I'll be testing it now. If this is the case, then I've somehow misunderstood the description of the memory-usage option. I thought it was related to caching of pages/locations/images/previews etc.

Edit: I just tested it, and read the help which states it's supposed to do the same as my scripts archieves. Still it seems the 'always' option doesn't work at all and even results in every konq-window being a seperate process. However the file-browsing option works, which is why I got the impression of konqueror sometimes making new processes and other times not, earlier. I guess this option is bugged in konqueror-3.2.1, and I still have to use the scripts to get the desired effect. Feel free to try for yourself, I'm testing this on a debian box afterall.
Back to top
View user's profile Send private message
sindre
Guru
Guru


Joined: 01 Nov 2002
Posts: 315
Location: Norway

PostPosted: Thu Apr 15, 2004 7:51 am    Post subject: Reply with quote

The memory settings doesn't make a difference at all on my gentoo-box.
Back to top
View user's profile Send private message
Pádraig
n00b
n00b


Joined: 20 Apr 2004
Posts: 2

PostPosted: Tue Apr 20, 2004 6:22 pm    Post subject: Reply with quote

Re the memory setting.

Ive noticed the same thing. It saves minimal memory usage, and speed aint much greater. Only purpose really is when it comes to a crash, you only loose one window.
Memorys gona be chewed up anyway, once you start opening a few pages. Flash brings it to a grinding crawl. Flash is much faster under Mozilla
Back to top
View user's profile Send private message
sindre
Guru
Guru


Joined: 01 Nov 2002
Posts: 315
Location: Norway

PostPosted: Tue Apr 20, 2004 8:23 pm    Post subject: Reply with quote

I'm not sure what you're saying here. The "minimize memory" options on the performance tab of the konqueror-settings doesn't make any difference at all on my gentoo-box with kde.3.2.2.

The startup-time and memory-saving archieved by the scripts posted are quite significant on an older computer. They result in konqueror always loading within 0,5 sec rather than using like 3-4 secs (on my old 350mhz comp) unless it was the first konqueror process, which would be preloaded anyway.
Back to top
View user's profile Send private message
sindre
Guru
Guru


Joined: 01 Nov 2002
Posts: 315
Location: Norway

PostPosted: Sat Jun 12, 2004 3:47 pm    Post subject: Reply with quote

After I submitted a bug report, this has been fixed in kde-3.2.3, so choosing "always preserve memory" in konqueror's performance settings will give the same result as these scripts.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum