a Gambas recent files Lister (TrayIcon)

So you have written that new, must have program. Let us see it here.
User avatar
BruceSteers
Posts: 652
Joined: Thursday 23rd July 2020 5:20pm

a Gambas recent files Lister (TrayIcon)

Post by BruceSteers » Friday 23rd July 2021 8:42am

Here's something i just made.
I call it GLaunch

I have put in in my startup applications so it starts with my desktop. (Note: i HAD to put a 2 second delay)

It makes a tray icon and populates a list by reading the gambas recent files save file.

It gets the icons (for the projects) and displays them in either the right click popup menu or the left click gridview Form.

Click an item and it loads the IDE with the project.

(updated version below)
Attachments
Screenshot at 2021-07-23 09-40-17.png
Screenshot at 2021-07-23 09-40-17.png (717.5 KiB) Viewed 547 times
Last edited by BruceSteers on Saturday 24th July 2021 4:33pm, edited 4 times in total.
Wishing well
Bruce

If at first you don't succeed , try it differently.

User avatar
PJBlack
Posts: 159
Joined: Tuesday 09th June 2020 10:26pm
Location: Florstadt, Hessen, Germany

Re: a Gambas recent files Lister (TrayIcon

Post by PJBlack » Friday 23rd July 2021 9:26am

my built-in mr monk is rotating right now ...
the arrangement of your desktop icons is ... "$%§&$/(&)/=(?)(TURESRXGCHJV

ok just took my psychotropic drugs ... now he is quiet :-)

again a very nice idea from you

User avatar
PJBlack
Posts: 159
Joined: Tuesday 09th June 2020 10:26pm
Location: Florstadt, Hessen, Germany

Re: a Gambas recent files Lister (TrayIcon

Post by PJBlack » Friday 23rd July 2021 9:37am

right click --> make launcher --> desktop or menu --> File or directory does not exist MakeIcon.MakeMe.21

MakeIcon 15
u = IIf(UseRoot, User.Name, Me.UserName())
u = User.Name
MakeIcon 36
dtf = "/home/" & u & "/Desktop/" & n & ".desktop"
dtf = "/home/" & u & "/Schreibtisch/" & n & ".desktop"

User avatar
BruceSteers
Posts: 652
Joined: Thursday 23rd July 2020 5:20pm

Re: a Gambas recent files Lister (TrayIcon

Post by BruceSteers » Friday 23rd July 2021 1:35pm

Oops sorry. Its because the Form has no icon yet...
The make launcher command is looking for FMain.Icon.
Easily fixed.

Thanks Mike 😎

And that there Is what we call the desktop of a developer 😉🤣

Makeicon 15,
Why did you remove that line?
My command will use your user name even if run as root if asked to..
You broke it 😲

Re. Desktop...
Darn it why can't you Germans just speak English? 🤣🤣
I'll use the gb.desktop command instead.

Cheers again
Wishing well
Bruce

If at first you don't succeed , try it differently.

User avatar
PJBlack
Posts: 159
Joined: Tuesday 09th June 2020 10:26pm
Location: Florstadt, Hessen, Germany

Re: a Gambas recent files Lister (TrayIcon

Post by PJBlack » Friday 23rd July 2021 6:04pm

BruceSteers wrote:
Friday 23rd July 2021 1:35pm
Thanks Mike 😎
micha or pj would be quite sufficient ... but mike is still ok
BruceSteers wrote:
Friday 23rd July 2021 1:35pm
Makeicon 15,
Why did you remove that line?
My command will use your user name even if run as root if asked to..
You broke it 😲
yeah ... thats what i can do best ... did you tried with a username longer than eight chars?
BruceSteers wrote:
Friday 23rd July 2021 1:35pm
Darn it why can't you Germans just speak English? 🤣🤣
i do speak english but it seems that xfce like german more :P 🤣

User avatar
BruceSteers
Posts: 652
Joined: Thursday 23rd July 2020 5:20pm

Re: a Gambas recent files Lister (TrayIcon

Post by BruceSteers » Friday 23rd July 2021 7:48pm

PJBlack wrote:
Friday 23rd July 2021 9:37am

MakeIcon 36
dtf = "/home/" & u & "/Desktop/" & n & ".desktop"
dtf = "/home/" & u & "/Schreibtisch/" & n & ".desktop"
You (or rather "I") should use this.. (as it has the gb.desktop component)
dtf = Desktop.Path &/ n & ".desktop"
I've updated the above archive :) cheers again Micha :)

About the username with more than 8 chars..
Here is the function that gets the name.. i cannot see how a difference in number of chars will affect anything?
Public Sub UserName() As String

  Dim u As String

  Shell "w -h|awk '{print $1}'" Wait To u
  If InStr(u, "\n") Then u = Split(u, "\n")[0]  ' if more than one result get the first one.
   Return Trim(u)

End
Wishing well
Bruce

If at first you don't succeed , try it differently.

User avatar
PJBlack
Posts: 159
Joined: Tuesday 09th June 2020 10:26pm
Location: Florstadt, Hessen, Germany

Re: a Gambas recent files Lister (TrayIcon

Post by PJBlack » Saturday 24th July 2021 5:45am

BruceSteers wrote:
Friday 23rd July 2021 7:48pm
About the username with more than 8 chars..
Here is the function that gets the name.. i cannot see how a difference in number of chars will affect anything?

User.Name = "mnaltrogge"
Me.UserName = "mnaltrog" because

Code: Select all

w -h
gives:

Code: Select all

mnaltrog tty7      07:29   11:40  36.84 s  0.99 s xfce4-session
mnaltrog pts/0     07:40    0.00 s  0.06 s  0.00 s w -h

User avatar
BruceSteers
Posts: 652
Joined: Thursday 23rd July 2020 5:20pm

Re: a Gambas recent files Lister (TrayIcon)

Post by BruceSteers » Saturday 24th July 2021 2:53pm

Micha do you know how to translate a string to the current locale ?

I'm stuck.
turns out Desktop.Path returns null if you are root :-\

but if i know the username all i need is to translate the word Desktop
but i do not know how i'd do that.
Wishing well
Bruce

If at first you don't succeed , try it differently.

User avatar
BruceSteers
Posts: 652
Joined: Thursday 23rd July 2020 5:20pm

Re: a Gambas recent files Lister (TrayIcon)

Post by BruceSteers » Saturday 24th July 2021 4:32pm

I think i figured it out with xdg (hopefully)

I'm hoping this fixes the Desktop name issue...
' 
  Shell "DIR=$(cat /home" &/ u &/ "/.config/user-dirs.dirs|grep DESKTOP); echo ${DIR##*/}" To dtop
  dtop = Left(dtop, -2)
'
that gets the correct name for the desktop folder

then "/home" &/ u &/ dtop "should" be desktop folder.
Attachments
glaunch.zip
(42.36 KiB) Downloaded 19 times
Wishing well
Bruce

If at first you don't succeed , try it differently.

User avatar
BruceSteers
Posts: 652
Joined: Thursday 23rd July 2020 5:20pm

Re: a Gambas recent files Lister (TrayIcon)

Post by BruceSteers » Sunday 25th July 2021 8:55pm

It's on gitlab now
https://gitlab.com/bsteers4/glaunch
a few improvements
changes will be logged in the commit messages

fedora is being a pain.
have added detection so stop window auto closing when losing focus on Fedora.
For some reason just clicking the already activated window triggers the DeActivated() and LostFocus() events :( seems okay on other systems .
Wishing well
Bruce

If at first you don't succeed , try it differently.

Post Reply