Desktop-ish

So you have written that new, must have program. Let us see it here.
Post Reply
User avatar
BruceSteers
Posts: 1523
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Desktop-ish

Post by BruceSteers »

I've been working on my Desktop-ish launcher.
It's probably got a bug or 2 but has been through many changes fixes/

What is it?
Essentially a launcher application designed to show folders containing mostly .desktop icons.

Why was it made?
I didn't like some of the desktops like a gnome variant i used that did not have/support the Desktop folder so it initially was made to just show the items in the Desktop folder.

What does it do now?
It's had many mods, it's all a bit WIP still but some of the features are..

* Shows either or both a Desktop style panel (double click icons that have text) and a panel style panel (single click items without text)
(see the clip below, Desktop-ish is running on the lower part of the screen)

* Directories for both panels can be manually set
* many color customisations for your best look.
* has a fairly crude hand made start menu.
* settings are save individually for different desktop types like MATE, Gnome, etc
* Edits to .desktop Actions take effect right away.

Special features for gambas coders...
* A Gambas IDE icon will show the recent projects list and also offer to load the ide with any toolkit.
* A gambas IDE icon gets a "Copy system info to clipboard" option for the BugTracker.
* ALL launchers for gambas programs that reside in their project folders have an option to open in the IDE

Other Features.
* All icons have "Run as root" option
* has a built in .desktop file editor that edits Actions too. (right click icon options)
* .desktop file editor can auto-add Actions to run executable with alternative toolkits and to open project in the IDE

Latest cool feature is allowing icons to have a "Recent" list to open recently opened files.
Recents are added manually by reading the programs recent data and turning it into a list of paths.
The recent data file scanned can be used directly or converted using a script.

See this clip to see how the recents function is working for my text editor ScriptEd and for FireFox and for my GitMan program
ScriptEd stores it's recent list as a file containing just a list of file paths so i use "Direct" mode on the file that simply reads it.
FireFox saves history in a sqlite file so i use a gambas script to run sqlite3 command and process the output into a list of url's.
GitMan saves in a gambas config file so i use a script to extract the data.



(this was version 1, scroll down to find latest version 3)
If at first you don't succeed , try doing something differently.
BruceS
User avatar
BruceSteers
Posts: 1523
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Desktop-ish

Post by BruceSteers »

I thought i should mention some of the useful custom classes i've made and included in this application...
If the classes themselves are not useful to you then maybe some of the code is :)

You can find thing like....

* MyDesktop, MyDesktopFile/MyDektopMime/MyDesktopActions , gb.desktop clone with added Action manager via MyDesktopFile.DesktopActions.class

* Choice.class , a Message clone with added options : Choice.Custom((Message) As String, Optional Buttons As String[], Type As String = "question", SeparateCancel As Boolean, (AutoResize) As Boolean)
ANY gambas stock image name can be used for the message picture in the Type arg, ANY number of buttons can be used not just 3, SeperateCancel puts a space between the cancel (far right) button and the others. AutoResize will make all the buttons shrink to their text size unlike the default behaviour that is to make all the buttons the same size as the largest one.

* Settings.class, has an added UseDesktopType property that if set true will save the programs settings file with the desktop name as a suffix like MyApp-MATE.cfg , MyApp-GNOME.cfg , MyApp-KDE5.cfg and so on. this allows a program to have different settings depending on the loaded desktop.

* Form.class , adds 2 main features to ANY form run by your application, Borderless resizing and StickyForms/StickyModals
-- With Form.StickyModals / StickyForms / StickToMouse / StickToWindow window positioning is enforced. all normal and Modal Forms can have some placement control , StickToMouse make all windows center on wherver the mouse is, StickToWindows makes new forms center on a chosen window. This will work for Modal windows too (like any Message call)

-- With the Borderless property your form can have no border/titlebar but still be movable/resizable.

* BFrame.class , This inherits Frame.class but adds an option to have an icon in the top corner that can work like a button raising a Click event or like a MenuButton popping open a menu. (this is a cleaner version of my ButtonFrame.class)

* NCheckBox, fairly customisable CheckBox allowing various alignment options and custom check images.

* RunFree.class, A way to run a function via a Timer event, This runs a function but allows the program to continue running. Ideal for if you are inside an event handler but want to be free of it.
Instead of runnng, for example..
MyClass.MyFunction(Arg1, Arg2) ' the code will be here till MyFunction has finished
You can use...
RunFree(MyClass,"MyFunction", [Arg1, Arg2]) ' The code continues as MyFunction is run via a background task.

* X11LargeDesktop, fixes gb.desktop.x11 Workspace issues when using a VirtualRoot style desktop like Compiz. Currently gb.desktop.x11 only shows 1 workspace and things like X11.CurrentDesktop = 2 will not work. this fixes those issues.

* IconEd, this folder was a separate standalone program for editing .desktop files and their actions that has been integrated into the program and could easily be exported into one of yours.

various other Easter eggs for ya :)

I've just enhanced the recent file lister and updated the options form so have updated the archive above..
* you can now change the text of the "Recent" menu for the icon
* all "recents" configurations can now be edited/added/removed via the options form.

Enjoy
If at first you don't succeed , try doing something differently.
BruceS
User avatar
BruceSteers
Posts: 1523
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Desktop-ish

Post by BruceSteers »

I've upgraded the recent lister. (archive updated above)
The scripts can now be used to give the path , the menu text and a menu icon.
Use 2 | chars to separate Path||Text||Icon


Here's some sample scripts..

For Firefox. gets URLs and page titles for text for the menus (bash)
#!/usr/bin/env bash
eval $(cat ~/.mozilla/firefox/installs.ini|grep --color=no Default)
if [ -e "/tmp/ff.sqlite" ]; then rm -f /tmp/ff.sqlite; fi
cp ~/.mozilla/firefox/$Default/places.sqlite /tmp/ff.sqlite
RES=$(sqlite3 -separator '||' /tmp/ff.sqlite "SELECT datetime(moz_historyvisits.visit_date/1000000,'unixepoch'), moz_places.url, moz_places.title FROM moz_places, moz_historyvisits WHERE moz_places.id = moz_historyvisits.place_id"|sort -r)
IFS=$'\n'
CNT=0; for s in $RES; do echo "${s#*||}"; ((CNT++)); if [ $CNT -eq 100 ]; then break; fi; done
rm -f /tmp/ff.sqlite



For Gambas 3 , gets path , displays folder name and project icons (gbs3)
(this isn't needed as the gambas3 icon already shows recent list but was a good exercise and i could remove all the code for the current gambas recent listing and let this routine do it instead)
#!/usr/bin/env gbs3
Use "gb.settings"
Dim st As New Settings(User.Home &/ ".config/gambas3/gambas3.recent.conf")
Dim iCount As Integer = CInt(st["Recent/Count"])
Dim sRet As String
For c As Integer = 1 To iCount
Dim sFile As String = st["Recent/File[" & c & "]"]
Shell "s='" & sFile & "'; eval $(cat \"$s/.project\" |grep Icon=)\nif [ -z \"$Icon\" ]; then Icon=\".icon.png\"; fi; echo -n \"$Icon\"" To sRet
  Print sFile & "||" & File.Name(st["Recent/File[" & c & "]"]) & " " & Split(st["Recent/Date[" & c & "]"], ".")[0] & if(sRet, "||" & sFile &/ sRet,"")
Next



I've also added a recent documents list to the start menu that reads $HOME/.local/share/recently-used.xbel (that looks a bit rubbish at mo though)
If at first you don't succeed , try doing something differently.
BruceS
User avatar
BruceSteers
Posts: 1523
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Desktop-ish

Post by BruceSteers »

Desktop-ish is currently being rebuilt from the ground up and is almost ready.

New features....

* Now "Any" number of folders can be added and their type can be Desktop or Panel type. Unlike the previous version that just had a single Desktop and/or Panel view.

* View background can now be a solid colour, a gradient, or an image. (alpha transparency can be used for colours)

* And the biggest update feature of use i think.. Custom menus.

Custom menus can now be created for file types (if the object is a .desktop file the Exec parameter is examined to use that not the.desktop file)
This could potentially be very useful.

Menus can be manually added or a script can create the menu list for you.
Menu items can be any command/script you choose allowing you to do almost anything.

My theory has been rather than making a launcher application like the previous version that does various things I have made a launcher application than "Can do" anything you like.

This could potentially be bad for the program as initially it does not do much till you have created some funky menus, this could deter people.
It currently sets a default custom menu for gambas program links, i will probably make a more advanced template menu.

--

The whole application has been completely re-written from scratch, just borrowing a few previously made functions,
as my gambas knowledge is much better now and I was not really happy with the previous build.

As it is a complete re-write it is not really finished as yet and still in beta stage.

I have attached it for anyone who wants to see a preview.
Attachments
Desktop-ish-3.0.tar.gz
(204.12 KiB) Downloaded 125 times
Untitled.png
Untitled.png (703.76 KiB) Viewed 3197 times
If at first you don't succeed , try doing something differently.
BruceS
Post Reply