New project, a .desktop launcher editor

Post

Posted
Rating:
#1 (In Topic #707)
Banned
This is the latest thing i've been playing with.

It has potential i think

No docs yet but if you understand how .desktop files work this will be straight forward enough.

it's a launcher editor but unlike the rest you can also edit the alternative Actions

for those who do not know "Actions" are other ways to run the program you can set and can be selected by right clicking the launcher when it is in certain places (like a panel)
Like for example how you can right click the Gambas3 launcher icon in a panel and run it with gtk3 or qt

Here's a couple of screenshots of how the gambas launcher icon looks in this application…
The main page..

(attachment removed)

The Actions page…

(attachment removed)

As you can see i also have my gambas set so from the panel icon i can also copy the System Information (needed on the bugtracker) and run it as root.

this app works but has the following issues…

launchers (in panels and other areas do not update till next boot)
there may be a way to make the launchers update right away but i do not know how.
I have the launchers on my desktop and i edit those files. when changed i then remover the panel launcher and drag the desktop one over again to make anew.

It's gtk only as you can drag launchers onto the app to load them but with qt the drop data does not include the paths on some files.

i will further develop this a bit and add more features/handling.

Maybe others will find it useful as an app to use or a starting base for their own version?
i've had to import and monkey about with the DesktopFile.class to get the Actions able to save.

Seems to work okay now :)  (except the icons not instantly updating)

Enjoy
Online now: No Back to the top

Post

Posted
Rating:
#2
Banned
This is how my gambas launcher looks when i right click it…
(attachment removed)
Online now: No Back to the top

Post

Posted
Rating:
#3
Banned
here's how to install it..

An example of how to get the application installed.
Simply run the gambas application from your desired location and select "create launcher" from the menu.
A desktop launcher or menu item can be created.
That launcher can then be simply dragged onto your panel (as shown in this clip…)
<VIDEO content="http://bws.org.uk/images/screenrecord-2021-07-18_20.59.56.mp4">[video]
[/video]</VIDEO>

Now your desktop launcher icons can be dragged onto this applications icon and it will load the .desktop file for editing.
Online now: No Back to the top

Post

Posted
Rating:
#4
Banned
Re: the Copy System information bit.

If I am on the Bugtracker webpage and gambas is closed i had to do the following to get the system info Ben wants…
Load gambas..
Load a project..
Select the system information menu to open the info page..
Press "Copy" to copy to clipboard..
Then paste into the web page but do not close gambas or the clipboard clears.

Now i have done this.
I installed clipit
sudo apt-get install clipit

clipit is a global clipboard utility that allows clips to survive when an app is closed (plus other features)

Now if i am on the Bugtracker i just right click my gambas panel launcher icon and hit "Copy system info" then paste in the bugtracker.

the launcher executes the file /usr/bin/g3toclip …
it looks like this..

Code

#!/usr/bin/env bash

gambas3 --system-information|clipit

I could not get the clipboard info to survive without making a seperate bash script and running it, using the command directly did not work.
But that did.
Maybe it's useful for you?  :)
Online now: No Back to the top

Post

Posted
Rating:
#5
Avatar
Enthusiast
PJBlack is in the usergroup ‘Enthusiast’
after a first quick look i've changed a few things:

changed project/properties/components/gb.gtk3 → gb.gui (afaik everything works)

Startup:

Code (gambas)

  1. Public Sub Main()
  2.  
  3.   FMain.GridView1.Columns.Count = 3
  4.  

Code (gambas)

  1. Public Sub Main()
  2.  
  3.   Application.Theme = "gambas-mono"
  4.  
  5.   FMain.GridView1.Columns.Count = 3
  6.  
nothing essential only my taste …
when starting a program from a module at least the setting application.theme works so why not …



FMain:

Code (gambas)

  1. Public Sub Form_Open()
  2.   ' get a couple of settings , the last used file chooder path and the icon size
  3.  
  4.  

Code (gambas)

  1. Public Sub Form_Open()
  2.   ' get a couple of settings , the last used file chooder path and the icon size
  3.  
  4.   btnSave.Picture = Picture.Load("icon:/16/save")
  5.   btnSaveAs.Picture = Picture.Load("icon:/16/save-as")
  6.   Button_Quit.Picture = Picture.Load("icon:/16/quit")
  7.   Me.Center
  8.  
  9.  
again … nothing essential only my taste …
me.center fix the diffent opening behaviour between gtk and qt



Code (gambas)

  1. Public Sub OpenFile(Optional FileName As String) As Boolean
  2.  
  3.   If Not FileName Then
  4.     Dialog.Path = User.Home &/ "Desktop/.desktop"
  5.  

Code (gambas)

  1. Public Sub OpenFile(Optional FileName As String) As Boolean
  2.  
  3.   If Not FileName Then
  4.     Dialog.Path = User.Home &/ "Schreibtisch/.desktop"
  5.  
yes yes … the stupid germans again …
<COLOR color="#BF0000">error if path does not exist</COLOR>


Code (gambas)

  1. Private Sub Icon2Button()
  2.  
  3.   Dim p As Picture = Picture.Load(ds.Icon)
  4.  
  5.   btnIcon.Picture = p.Image.Stretch(96, 96).Picture
  6.   btnIcon.Tag = ds.Icon
  7.  
  8.  

Code (gambas)

  1. Private Sub Icon2Button()
  2.  
  3.  
  4.   Try p = Picture.Load(ds.Icon)
  5.  
  6.     btnIcon.Picture = p.Image.Stretch(96, 96).Picture
  7.     btnIcon.Tag = ds.Icon
  8.  
  9.  
<COLOR color="#BF0000">error if icon does not exist</COLOR>


as usual i am running on majaro with xfce

good work and as always a nice idea !
Online now: No Back to the top

Post

Posted
Rating:
#6
Banned

PJBlack said

after a first quick look i've changed a few things:

changed project/properties/components/gb.gtk3 → gb.gui (afaik everything works)

good work and as always a nice idea !

dragging files on to the app does not work with QT , QT is buggy.
that's why i used gtk
(i thought i'd explained that lol)
check out this clip of me dragging icons onto the app with QT and the debugger printing the paths…


I only started writing this a couple of days ago.  it's probably got some creases to iron out ;)
Online now: No Back to the top

Post

Posted
Rating:
#7
Banned
I fixed the Desktop path error.  i added gb.desktop and used Desktop.Path instead.

Updated version on git…
Bruce Steers / DesktopIconEd · GitLab
Online now: No Back to the top
1 guest and 0 members have just viewed this.