Jump to content


Running AsusLauncher in Advanced mode


9 replies to this topic

#1 RogueStar

    Advanced Member

  • Members
  • PipPipPip
  • 93 posts

Posted 17 December 2007 - 05:20 AM

Okay, so I've found that you can actually start AsusLauncher in Advanced mode. It works with icewm, kde, and beryl. I'm not sure how well default customization apps will work, but here's what I did since I want to keep them in sync.

Steps using file manager
1. Create a folder in home called .AsusLauncher
2. Select simpleui.rc favorites.rc and launcherMode files in /home/user/.AsusLauncher
3. Paste them as links in the .AsusLauncher folder created in step one

The problem is that you can only successfully launch AsusLauncherby opening it from the file manager. I cannot figure out how this works. One thing I tried was create a shortcut (.desktop file) in the kde autostart folder similar to the beryl shortcut. The problem with doing that is it conflicts with KDE and gets stuck in an infinite loop starting window managers (had to delete it by booting into DSL Linux). The last thing I tried is to start AsusLauncher as an argument using the XandrosFileManager from a konsole, but this results in the same window manager infinite loop.

So my question for you whizzes out there is how can i duplicate the way that file manager executes AsusLauncher so that I can get AsusLauncher to startup with KDE?

BTW I think AsusLauncher + KDE + Beryl = gorgeous, though a bit slow

#2 alanbcohen

    Senior Member

  • Members
  • 505 posts
  • LocationBaltimore, MD, USA

Posted 17 December 2007 - 02:12 PM

Quote

Steps using file manager
1. Create a folder in home called .AsusLauncher
2. Select simpleui.rc favorites.rc and launcherMode files in /home/user/.AsusLauncher
3. Paste them as links in the .AsusLauncher folder created in step one
Quick questions:
I already have an .AsusLauncher folder with a launcherMode file (and a requireLogin file). I found the simpleui.rc file in /opt/xandros/share/AsusLauncher/ directory. Where does the favorites.rc files come from? Or, is this file created when you add favorites to the simple gui? Also, I'm guessing,the link you are referring to is a symbolic link found under the FileManager File menu.

One last question;
Where is the AsusLauncher executable?
All opinions, information etc in this forum post is copyrighted by me (alanbcohen) unless indicated otherwise.
You are free to reuse whatever you want to, provided that:
1) you give credit to me and eeeuser.com whenever you reuse anything for all things you reused.
2) you do not pretend or create the illusion that your modifications are mine. I'll be responsible for my junk, you for yours.

#3 RogueStar

    Advanced Member

  • Members
  • PipPipPip
  • 93 posts

Posted 17 December 2007 - 06:38 PM

The assumptions you made are correct. simpleui.rc is found in /opt/xandros/share/AsusLauncher if you haven't copied one over for editing in /home/user/.AsusLauncher. The favorites.rc file is created when you edit the favorites with the Customize application in the favorites tab. Yes I do mean symlinking, although when you drag the files with the right mouse button and drop it in the location it just refers to this as "link".

The AsusLauncher executable is found in /opt/xandros/bin . In file manager it says its an ELF 32-bit executable, not sure what that means, but it seems to up up as non-executable in a regular terminal.

EDIT:
okay, success! I figured this out what was going wrong

here's what you need to do to get it to start at startup
1. create a new startup shortcut with kwrite
sudo kwrite /home/user/.kde/AutoStart/AsusLauncher.desktop
2. use the following as contents
[Desktop Entry]
Exec=sudo /opt/xandros/bin/AsusLauncher
Name=AsusLauncher
StartupNotify=false
Terminal=0
Type=Application
X-KDE-SubstituteUID=false
looks like the only thing i missed when i first tried it was running it as sudo. if you do not run it as sudo the window manager keeps getting reset and you'll have to boot into another OS to fix the mistake (not fun!). other notes are i turn off startup notify as it's more of a distracting than useful.

Edited by RogueStar, 17 December 2007 - 11:22 PM.


#4 skaatz

    Member

  • Members
  • 21 posts

Posted 21 December 2007 - 03:16 AM

RogueStar

When I follow the directions in the wiki I get the following error when I try to save the file:

The document could not be saved, as it was not possible to write to file:///home/user/.kde/AutoStart/AsusLauncher.desktop.
Check that you have write access to this file or that enough disk space is available.

Any idea where I'm going wrong?

#5 RogueStar

    Advanced Member

  • Members
  • PipPipPip
  • 93 posts

Posted 21 December 2007 - 04:20 AM

my bad, i misread the case of the directory name when making the wiki
AutoStart should actually be Autostart
i'll fix it up in the wiki, thanks for pointing it out

#6 mart123

    Advanced Member

  • Members
  • PipPipPip
  • 36 posts

Posted 26 December 2007 - 05:35 PM

Guys,

Have followed the wiki instructions to launch the asus launcher on startup of the advanced mode, but it seems to be behaving strangely. It's almost as if the launcher thinks i'm logged in as a different user to which the KDE thinks I am.

For example... Open Office can't find My Documents when launched from the launcher, but has no problem when launched from the Xandros start menu. Also, the settings I choose in apps launched through the launcher (specifically Opera) aren't saved in instances launched from the main KDE and vica versa.

Looking at the processes of each of 2 instances of Write, one is indeed logged as 'root', the other as 'user'. I'm assuming that's the cause of the behaviour?? Now I know the launcher has to be launched as root, but is there any way to tell it to launch its apps as 'user'?? - I only started using linux as of yesterday when I got this thing, so am fairly green with how it handles users! :)

Would it work if I use the 'X-KDE-Username=' argument in '/home/user/.kde/Autostart/AsusLauncher.desktop' and put my user name of 'Mart' in there?? or 'user'?... don't want to blindly try it for fear of getting into the infinite loop descrbed in the wiki!

Many thanks in advance,
Martin.

#7 mart123

    Advanced Member

  • Members
  • PipPipPip
  • 36 posts

Posted 26 December 2007 - 06:31 PM

update: Tried both 'Mart' and 'user' in that argument but no change. Looks like I'm switching back to just using advanced mode without the prettiness unless anyone's got any bright ideas?

#8 RogueStar

    Advanced Member

  • Members
  • PipPipPip
  • 93 posts

Posted 26 December 2007 - 06:58 PM

i'll look into it for you, i haven't got it working 100% perfect, so you can expect some problems, but if you use the task bar icon you hide it when you don't need it or just use the start menu for things that are a bit buggy. for me enough things work okay that i just leave it on.

since you are running it as root you are in fact running it as a different user. this is why you have to copy over/link the simpleui.rc file etc. in the wiki. it looks like the solution is to go into /home/user find the .openoffice or whatever folder for the app that is misbehaving and then link it to /root (you'll have to delete the folder in /root if it already exists). i think i will write a script to automate this and then add it to the wiki

though that doesn't seem to fix everything, such as %home being /root instead of /home/user when you browse for files. i think the only thing you can do for now is change the %u argument in the .desktop files to /home/user which is probably more work than its worth, still i'll keep looking for better solutions. its either that or change %HOME from /root to /home/user, which is probably a very bad practice

Edited by RogueStar, 26 December 2007 - 08:39 PM.


#9 Onionald

    New member

  • Members
  • 3 posts

Posted 18 February 2008 - 12:04 AM

A partial fix and a question

As RogueStar noted in response to mart123's question, the problem is that the applications all run as root rather than as user. For some applications, this may be OK, but for others it's definitely not.

First, the partial fix: You can edit the simpleui.rc file to run each command explicitly as user rather than as root by adding kdesu -u user -c before each of the affected commands. If the command is followed by parameters that start with a hyphen (-), you have to precede them with two hyphens ( -- ) so that kdesu will pass them through.

For example:

/usr/bin/XandrosFileManager -maximized
becomes:
/usr/bin/kdesu -u user -c /usr/bin/XandrosFileManager -- -maximized
Now, when you click on the File Manager icon, XandrosFileManager should run as user in user's home directory.

A technical note: /usr/bin/sudo -u user -H doesn't work. The icons disappear if you do that. I assume what's happening is that AsusLauncher expects to see the command name immediately after sudo. I'm guessing that if it sees a parm like -u instead, it thinks the relevant command isn't installed, so it doesn't display the icon. There may be other ways to do the same thing, but I haven't tried them since kdesu seems to work just fine. (Some possible ideas: create a symlink to sudo that's named something other than sudo, or use a script to run sudo, or use a setuid script to run the underlying command.) Also note that su -l user -c doesn't work, for different reasons.

Finally, my question: Can anyone think of a way to make this work for entries of the form shortcut="/opt/firefox/firefox.desktop" other than editing each *.desktop file individually, and other than replacing all the .desktop references in simpleui.rc with calls to the underlying commands? For example, is there a command that can be invoked that will run a desktop entry file?

Edited by Onionald, 18 February 2008 - 03:57 AM.


#10 Onionald

    New member

  • Members
  • 3 posts

Posted 19 April 2008 - 04:39 AM

The problem with the method described in my last post is that if you switch back from advanced mode to simple mode, now all your applications run as root. The reason is that if you run kdesu -u user -c when you are already user, it will run your applications as root. Although sudo -u user doesn't have this problem, it fails to work correctly for the reasons described in my last post. So instead what I did was create a desktop shortcut (.profile) that will run sudo, and edited the simpleui.rc to run that shortcut rather than the programs directly.

It's not pretty. I've added instructions to the wiki.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users