Auteur Sujet: Lxshortcut to create your own launchers  (Lu 17801 fois)

0 Membres et 1 Invité sur ce sujet

Hors ligne melodie

  • Administrateur
  • Membre Héroïque
  • *****
  • Messages: 1774
    • Citrotux
Lxshortcut to create your own launchers
« le: 18 mars 2013 à 14:40:16 »
Hi,

Lxshortcut allows creating easily a new launcher for the desktop (or to put into the menus if you want to edit what it produces). I want to have a launcher in the menus for it, so I figured out I could use it to make a launcher for itself, then pick a pair of icons in two icon themes : that makes 4! ^^ then gather them in one new icon, with Gimp.

Here is the result for now:
http://meets.free.fr/debian/configurations/Lxshortcut

Citer
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Type=Application
Name=Lxshortcut
Name[fr_FR]=Lxshortcut
Icon=lxshortcut48.png
Exec=lxshortcut -o %U
Comment=Create your own application launchers
Comment[fr_FR]=Créez vos propres lanceurs d'applications
NotShowIn=GNOME;XFCE;
Categories=Settings;DesktopSettings;GTK;
StartupNotify=true
Terminal=false

and the icon:


but this doesn't work, because there is something which might be missing above the little lxshortcut gui : some instructions to provide a choice of action.

Here is the --help-all content for lxshortcut:

Citer
Usage:
  lxshortcut [OPTION...]

Help Options:
  -h, --help                              Show help options
  --help-all                              Show all help options
  --help-gtk                              Show GTK+ Options

GTK+ Options
  --class=CLASS                           Program class as used by the window manager
  --name=NAME                             Program name as used by the window manager
  --screen=SCREEN                         X screen to use
  --sync                                  Make X calls synchronous
  --gtk-module=MODULES                    Load additional GTK+ modules
  --g-fatal-warnings                      Make all warnings fatal

Application Options:
  -n, --no-display                       
  -i, --input=file name or desktop id     input file
  -o, --output                            file name
  --display=DISPLAY                       X display to use


I have tried the Exec= commands "lxshortcut", asks for options, tried lxshortcut -o, lxshortcut -o %f, lxshortcut -o %F and also %U. (random trials... )

Here is the official page http://wiki.lxde.org/en/LXShortCut
with a pic of the program in action:


the launchpad page: https://launchpad.net/ubuntu/+source/lxshortcut/0.1.2-3

and sourceforges: http://sourceforge.net/projects/lxde/files/LXShortcut%20(edit%20app%20shortcut)/


I have looked into the sources, it is written in C.

Is someone interested to have a look at it to make it possible to start from menus ?
« Modifié: 18 mars 2013 à 14:42:45 par mélodie »
Good leaders being scarce, following yourself is allowed.

konaexpress

  • Invité
Re : Lxshortcut to create your own launchers
« Réponse #1 le: 18 mars 2013 à 15:33:03 »
That looks like a cool little app, think I will use it. Save time from making .desktop files.

Hors ligne melodie

  • Administrateur
  • Membre Héroïque
  • *****
  • Messages: 1774
    • Citrotux
Re : Lxshortcut to create your own launchers
« Réponse #2 le: 18 mars 2013 à 15:38:42 »
Yes it is cool, but you must not forget you have installed it at some time, because it's not in the menus. ^^

This is a bit annoying, when you think most console apps can have a launcher in the menus, but not this one, which is not even a console application. :)

Good leaders being scarce, following yourself is allowed.

djohnston

  • Invité
Re : Lxshortcut to create your own launchers
« Réponse #3 le: 18 mars 2013 à 22:21:45 »
Is pcmanfm managing your desktop?

Citer
darrel@OBubuntu:~$ cat /usr/share/doc/lxshortcut/README.Debian
                          lxshortcut README.Debian
           ---------------------


lxshortcut package provides a way of customize menu entry and easy to
make shortcut to launcher application on desktop.

Customize menu entry
--------------------
It will be launched when you right click on lxpanel menu entry and
lxlauncher menu icon.

Make shortcut on desktop
------------------------
You need to have a desktop managed by pcmanfm.
You can enable it manually by:
Edit => Preferences => Desktop => check "Manage the desktop and show file
icons".
darrel@OBubuntu:~$

Hors ligne melodie

  • Administrateur
  • Membre Héroïque
  • *****
  • Messages: 1774
    • Citrotux
Re : Lxshortcut to create your own launchers
« Réponse #4 le: 19 mars 2013 à 00:08:38 »
djohnston, thanks, but the 3 are unrelated.

lxshortcut is a gui application, which does not have a gui to start it ! I must be started manually from console with at least one option and with an argument.

I asked on a chan where some buddies code, and one of them offered to work on it. He has already submitted to me a first version written in Qt and he continues to work on it next to improve it. Would you want to test as well ?
Good leaders being scarce, following yourself is allowed.

djohnston

  • Invité
Re : Re : Lxshortcut to create your own launchers
« Réponse #5 le: 19 mars 2013 à 07:18:53 »
Sure, I'll test it. But, I have no idea what you mean by

djohnston, thanks, but the 3 are unrelated.

I know what lxshortcut is. I installed the package on OBubuntu and installed your .desktop file and icon. I got nowhere with it from CLI, either.

djohnston

  • Invité
Re : Lxshortcut to create your own launchers
« Réponse #6 le: 19 mars 2013 à 19:03:24 »
Okay, I've discovered lxshortcut will run on other desktops, including Openbox. The problem with an lxshortcut.desktop file is that the executable needs arguments given which cannot be provided by a standard desktop file. Perhaps with a bash or python script using dialog which accepts user input. There are two other shortcomings with the executable itself. (1) It will not accept a path for the desktop file it creates. (2) If the desktop file to be created is not an actual link (shortcut), there is no Categories= line created.

Here I tried to give an absolute path to create a desktop file.



It was not created at all.



Next, I gave it no absolute or relative path. The desktop file was created and placed in my home directory.



However, the desktop file has no Categories= line.




I realize the intended use is for creating shortcuts (soft links), not desktop files. For that purpose, no Categories= line is required. The inability to specify a path, or directory, in which to place the shortcut is a shortcoming, in my opinion.

I cannot find any activity for lxshortcut in the LXDE wiki since 2011, and nothing on the LXDE blog since 2008. A rewrite, as you have suggested, is probably the best way forward. The application was written by the PCManFM author.

EDIT: Well, I can't seem to get this right. lxshortcut will accept an output path. I specified /home/darrel/Downloads/test.desktop, and the file was created.
« Modifié: 19 mars 2013 à 19:46:37 par djohnston »

Hors ligne melodie

  • Administrateur
  • Membre Héroïque
  • *****
  • Messages: 1774
    • Citrotux
Re : Re : Lxshortcut to create your own launchers
« Réponse #7 le: 20 mars 2013 à 01:23:59 »
The problem with an lxshortcut.desktop file is that the executable needs arguments given which cannot be provided by a standard desktop file. Perhaps with a bash or python script using dialog which accepts user input. There are two other shortcomings with the executable itself. (1) It will not accept a path for the desktop file it creates. (2) If the desktop file to be created is not an actual link (shortcut), there is no Categories= line created.

Hi,

This is what I figured out, and which caymus from the http://www.coyotus.com forum is being working on, with a Qt additional app. He might provide two new scripts to test tomorrow.

The options allow doing a file towards a path. Choose once "-o", and the other time "-i" and make tests : you will see one works for both : current directory and absolute path to elsewhere, and the other only for ? (I don't remember now... I use "-o" only since a few days)

Good leaders being scarce, following yourself is allowed.

Hors ligne caymus

  • Néophyte
  • *
  • Messages: 13
Re : Lxshortcut to create your own launchers
« Réponse #8 le: 21 mars 2013 à 16:22:53 »
Hi,
firstly, sorry for my poor English.

Qt-lxshortcut Assistant 0.2

some explanation before:

On Unity, Gnome-shell, cinnamon, gnome2, xfce:

There is a folder for user to add shortcuts and find then automatically in menus sections.
This is /home/$user/.local/share/applications

When you install an application, it requests an root access and files are in
/usr/share/applications

The mechanism of automatically adding icons in menus sections, is managed by /etc/xdg and probably bamf daemon.

For custom made OS this is another story because /home/$user/.local/share/applications is not all time referenced into /etc/xdg config files.

here 2 links :

http://forum.kde.org/viewtopic.php?f=17&t=87957

http://markmail.org/message/3tdve37nbeacvcny
(If the mechanisme is well configured and  /home/$user/.local/share/applications dont do is job, after  the .desktop creation,sometime, just logout, login again and bamf make is job.)

Additional research may be useful, about bamf and xdg.


Now the Qt-lxshortcut Assistant mechanism itself:

1* Search after the folder /home_path/.local/share/applications/, if does not exist create it.

2* Run the command lxshortcut + parameters when the "start" button is pressed. (Parameters is combobox folder location + name of .desktop).

3* Waiting lxshortcut is stopped, to edit the .desktop, and insert "Categories= + comboBox2 choice" at the end of file.

4* If target is /home/$user/Desktop, set execute permission on .desktop file created.

This is just a little hack in gui, over lxshortcut, if you have ideas for change or improvement, thank you for giving them.

I have sent the sources and compiling in 32 and 64 bit to mélodie.

This is made with Qt 4.8.3 gcc 4.7.2







« Modifié: 21 mars 2013 à 16:38:46 par caymus »

djohnston

  • Invité
Re : Lxshortcut to create your own launchers
« Réponse #9 le: 21 mars 2013 à 17:18:47 »
Thanks, caymus. I look forward to testing. Your English is fine.

EDIT:
http://markmail.org/message/3tdve37nbeacvcny
(If the mechanisme is well configured and  /home/$user/.local/share/applications dont do is job, after  the .desktop creation,sometime, just logout, login again and bamf make is job.)

Additional research may be useful, about bamf and xdg.
The "it's impossible to directly copy any - .desktop file from /usr/share/applications to a local folder to - customize it, without removing the above flag, and this is wrong" thing must be unique to Ubuntu/Unity. I've never encountered it.
« Modifié: 21 mars 2013 à 17:31:42 par djohnston »

Hors ligne caymus

  • Néophyte
  • *
  • Messages: 13
Re : Lxshortcut to create your own launchers
« Réponse #10 le: 21 mars 2013 à 18:23:48 »
Yes, probably.

That I met during rapid test on a fresh installation of Ubuntu unity 12.04 32bit and 12.10 32bit

No /home/$user/.local/share/applications (the folder is created automatically when you make a connection file to open with such typical application) (mimeapps.list)
Citer
BAMF doesn't consider any .desktop file saved in ~/.local/share/applications
Restart bamfdaemon and unity (or just log-out and log-in again)

Has solved my problem. (it was just a parenthesis in case this would happen to someone one)

For archlinux with cinnamon, or ubuntu 12.04 64 bit  i dunno, because this wasnt a fresh install, and everything worked as expected.

For KDE i need to dig a little in my spare time, because it has its own system for managing shortcuts.
For Openbox, I have not had time to look at how it works, in addition, there obmenu and I didn 't have time to test /etc/xdg + bamf on it

Therefore, any feedback on your window manager with xdg / bamf, are welcome, because I have not the time to test them all from scratch.

http://standards.freedesktop.org/desktop-entry-spec/latest/index.html
http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s05.html
http://standards.freedesktop.org/menu-spec/menu-spec-1.0.html#category-registry
« Modifié: 21 mars 2013 à 18:39:59 par caymus »

Hors ligne melodie

  • Administrateur
  • Membre Héroïque
  • *****
  • Messages: 1774
    • Citrotux
Re : Lxshortcut to create your own launchers
« Réponse #11 le: 21 mars 2013 à 20:23:38 »
Hi, the files are available at the usual place where I throw all files which are not ISOs.

http://meets.free.fr/debian/code/

caymus, let me send big thanks to you for joining us and helping with your coding knowledge! \o/ !

... and testing the settings for the very new captcha as well!  ;D



« Modifié: 21 mars 2013 à 20:25:14 par mélodie »
Good leaders being scarce, following yourself is allowed.

Hors ligne melodie

  • Administrateur
  • Membre Héroïque
  • *****
  • Messages: 1774
    • Citrotux
Re : Re : Lxshortcut to create your own launchers
« Réponse #12 le: 21 mars 2013 à 20:31:28 »
The "it's impossible to directly copy any - .desktop file from /usr/share/applications to a local folder to - customize it, without removing the above flag, and this is wrong" thing must be unique to Ubuntu/Unity. I've never encountered it.

Working only on Openbox installs I have probably met it without paying attention, because when some lines in desktop files don't allow the entry to appear in the menus I just change it to something more agnostic.

Gnome xyz, Unity wx... same result, same punition : erase. I admit I should also be reporting bugs for each of them... maybe one day I will dedicate a whole year just to report the small annoying bugs. :)

Good leaders being scarce, following yourself is allowed.

djohnston

  • Invité
Re : Lxshortcut to create your own launchers
« Réponse #13 le: 21 mars 2013 à 21:38:36 »
@melodie,

Either I'm reading the bug report wrong, or the description is wrong. It says:

Citer
it's impossible to directly copy any - .desktop file from /usr/share/applications to a local folder to - customize it
I take that to mean that a .desktop file cannot be copied from /usr/share/applications/ to ~/.local/share/applications/ while the bamfdaemon is running. I could be wrong, but that's the way the description reads. I have encountered the problem with OnlyShowIn=ThisDE or NotShowIn=ThatDE. In those instances, I do the copy from the system directory to my home directory, make necessary changes, and the DE menu reflects those changes. The bug report description also says that after copying a desktop file to ~/.local/share/applications/, making changes, then restarting bamfdaemon, after having stopped it for the filecopy, the Unity menus are not updated appropriately.

@caymus,

I've looked at the following Ubuntu precise based distros:
Bodhi - e17
OBubuntu - Openbox
Katana - RazorQt

None have the bamfdaemon installed or running.

In addition, I've looked at the following Debian based distros:
Wheezy 64bit - XFCE
Wheezy 32bit - Openbox, LXDE, RazorQt and e17

None have the bamfdaemon installed or running. The package is available in both Ubuntu precise repos and in Debian Wheezy repos. However, I see no reason to tempt fate by installing the package, as the /etc/xdg/ configurations are doing their job well without the need for the bamfdaemon.

djohnston

  • Invité
Re : Re : Lxshortcut to create your own launchers
« Réponse #14 le: 21 mars 2013 à 21:48:11 »
Hi, the files are available at the usual place where I throw all files which are not ISOs.

http://meets.free.fr/debian/code/
You have two directories, one 20-Mar-2013 01:28 and the other 20-Mar-2013 23:28. Are they both the same, or is the later one the right one? There's also a blank frame on all your pages, for some odd reason.