This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Mount Drives before widgets start / Early autostart

Tags: None
(comma "," separated)
aqualoom
Registered Member
Posts
2
Karma
0
Hi,
I want to mount some user specific network drives after login but before the plasma-widgets are started. The reason is, that I have some "View folder widgets" which display only a "Folder not available"-information because they are started before the network drives are mounted.

My system used to use CIFS mounted using pam-mount and this worked well, but unfortunately CIFS does not work reliable in my setup. Therefore, I had to switch to smbnetfs. Because SMBnetfs does not integrate into pam I now simply run the "mount-smbnetfs" script on startup. Unfortunately, the widgets seem to be started before I can start the script.
I have tried different approaches:
  • start the script from .config/Autostart
  • start the script from .kde/share/autostart with a a desktop file containing "X-KDE-autostart-phase=1" (this does start before the session is restored, but unfortunately, widgets seem to be started even earlier)
  • put the script in $HOME/.xsession - the script was not executed at all by kde

I would be grateful for any further ideas (I would also be ok with an approach like delaying start of the plasma-widgets or mounting the drives in another way, e.g. from kdm, but I need this to be user specific).

Best regards

Aqualoom
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Try placing a script in ~/.kde4/env/ which performs this. The scripts in that directory are sourced *extremely* early in KDE workspace startup process, before the splash screen or other components are started. Please note that you might want to place time limits on the mounting, otherwise you will be unable to login, as KDE will not proceed further until the scripts in that directory have been successfully sourced.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
aqualoom
Registered Member
Posts
2
Karma
0
Thank's a lot for the tip - it works fine for me.

bcooksley wrote:Please note that you might want to place time limits on the mounting, otherwise you will be unable to login, as KDE will not proceed further until the scripts in that directory have been successfully sourced.

Smbnetfs is actually quite forgiving and seems not to block, it just starts in the background and mounts the drives. Nevertheless it is fast enough, that the folders are already available when the widgets are started (folder content is shown).


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], kde-naveen, Sogou [Bot], Yahoo [Bot]