OpenXTalk Linux Tools Library proposal

Organizing tasks to work on, New Features Ideas, Building LCS & LCB Libraries & Widgets, Redecorating and Modifying the IDE, Hacking / Editing Tools, Compiling the Engine from Source, etc.
User avatar
OpenXTalkPaul
Posts: 2633
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

OpenXTalk Linux Tools Library proposal

Post by OpenXTalkPaul »

I've started working on a Linux Tools library of sorts (currently just a regular non-library stack), that I would like to have functional parity to "OXT macOS Tools" as well as Linux specific functionality. Window Manager window manipulation is currently my main interest, and I have a few functions already that match some of that functionality, such as raising a specific window or minimizing ALL open windows (including windows opened by other apps), mostly using the wmctrl command (as opposed to xdtool) because I think wmctrl should be installed already with most Linux distros.

I've also added a few other things like 'dark mode' detection (appearance set to 'Prefer Dark"), theme name retrieval, get CPU and Kernel info.

I'm asking for contributions of any sort of command lines that could be generally useful for apps running on a Linux.

As we know the Linux ecosystem is very diverse and therefore difficult to support every possible Linux distribution or configuration, and so I would prefer to stick to command line tools that are generally available in most distributions.

Eventually I'll make this into a script-only library (extension) that includes syntax definitions for the dictionary, can be loaded at start up and easily included with standalone apps.

Here's my stack so far:
GeneralLinuxTools.oxtstack
(5.97 KiB) Downloaded 70 times
User avatar
OpenXTalkPaul
Posts: 2633
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: OpenXTalk Linux Tools Library proposal

Post by OpenXTalkPaul »

Thinking about the Window Management things, I think those could eventually be moved to a "Unified Window Management" library, combining all the different implementations of the same functionality on various platforms into a single library that would automatically use the appropriate implementation for the type of system it is running on.

So for example, instead of the command revealFileInFinder (which I've actually used quite a bit on macOS) this unifying library would have simply revealFile and if it were running on macOS that would call my revealFileInFinder command behind the scenes.
User avatar
richmond62
Posts: 4831
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: OpenXTalk Linux Tools Library proposal

Post by richmond62 »

This is presumably a proposal for the next version of OXT 'Heavy' that never arrives: so why should we actually be interested in anything that just comes across as talk with nothing concrete to work with?

Yeah: tough, but apparently true.
https://richmondmathewson.owlstown.net/
User avatar
tperry2x
Posts: 3209
Joined: Tue Dec 21, 2021 9:10 pm
Location: Somewhere in deepest darkest Norfolk, England
Contact:

Re: OpenXTalk Linux Tools Library proposal

Post by tperry2x »

OpenXTalkPaul wrote: Mon Nov 18, 2024 6:25 pm I've started working on a Linux Tools library of sorts...mostly using the wmctrl command (as opposed to xdtool) because I think wmctrl should be installed already with most Linux distros.
I'm also using "xwininfo -id " for linux window bits if that helps.
OpenXTalkPaul wrote: Mon Nov 18, 2024 6:25 pm I've also added a few other things like 'dark mode' detection (appearance set to 'Prefer Dark"), theme name retrieval, get CPU and Kernel info.
I have something similar, the tools palette chooses icons in OXT Lite depending if the user is in light or dark mode when the IDE loads.
It has a custom property: "cUsingTheme" which gets set to either "light" or "dark" as it detects how the system appearance is set.
The nice thing about that of course is you can just use:

Code: Select all

get the cUsingTheme of stack "revTools"
And do that from any stack in the ide to find out if it started in light or dark mode. What it doesn't do is provide dark or light mode detection for standalones, nor does it change if you change the system theme while the ide is open. The reason I'm not worried, is because changing the system theme while the ide is open will cause it to crash on Linux anyway, so...
OpenXTalkPaul wrote: Mon Nov 18, 2024 6:25 pm I'm asking for contributions of any sort of command lines that could be generally useful for apps running on a Linux.
As we know the Linux ecosystem is very diverse and therefore difficult to support every possible Linux distribution or configuration, and so I would prefer to stick to command line tools that are generally available in most distributions.
Yes, absolutely - I can't second this enough. We never know what someone may (or may not have) installed.
OpenXTalkPaul wrote: Mon Nov 18, 2024 6:25 pm Eventually I'll make this into a script-only library (extension) that includes syntax definitions for the dictionary, can be loaded at start up and easily included with standalone apps.
Thanks Paul. Very much appreciated and great work. It's good to see Linux getting some much needed attention.
User avatar
tperry2x
Posts: 3209
Joined: Tue Dec 21, 2021 9:10 pm
Location: Somewhere in deepest darkest Norfolk, England
Contact:

Re: OpenXTalk Linux Tools Library proposal

Post by tperry2x »

richmond62 wrote: Mon Nov 18, 2024 6:49 pm This is presumably a proposal for the next version of OXT 'Heavy' that never arrives: so why should we actually be interested in anything that just comes across as talk with nothing concrete to work with?
Your comments across multiple topics have been particularly ascerbic as of late. What's going on Richmond? Has someone rattled your cage or something. This evening you all but accused me of software piracy without finding out the facts first. Please don't take it out on us, whatever it is.

Equally, why would Paul be in any rush to release anything? He only has to look at how any release is scrutinised and instantly shot down with negative comments. I personally don't blame him in the slightest for releasing something when he (and only he) feels absolutely ready to do so.

We aren't getting paid, we are just doing this because we want an open source xTalk project to continue. So we equally shouldn't have to take any squit - we aren't on contract as developers - yet you seem to expect us to be as responsive like we've got some service agreement in place.

Ultimately, feel free to have a go yourself at developing your own version, otherwise just let us get on with trying to do what we can. When we can.
User avatar
richmond62
Posts: 4831
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: OpenXTalk Linux Tools Library proposal

Post by richmond62 »

I did NOT accuse you of software piracy.

What I did do is point out something you may have missed (being a bit younger than me).

When we moved to the University of Southern Illinois at Carbondale in 1993 we were told we had to present ALL academuc assignments printed out from a computer.

My wife knew I had done some computer programming, and, wrongly, assumed I would know what we needed.

On our doormat appeared one of those 'things' from a store called 'Montgomery Ward' in which there were fancy pictures and something called an 'IBM compatible' with something called 'Windows', and something else called a 'Macintosh': cripes; I hadn't a clue.

Anyway, as my maternal grandfather's name was McIntosh, and when I wear a kilt I wear Macintosh tartan: I went and bought a Mac L475.

Now, there was NO word-processing program on the thing, so spoke to a 'Prof' (they are all Profs over there), at which point I was told to pop down to the multimedia lab for a COPY of Clarisworks 2 (i.e. a pirate copy). So, I did.

Having merrily recorded everything onto cassette tapes in the late 1970s I never gave it a backward thought.

Only in the UAE (oddly enough) did I work out that I, and a lot of other people were pirating software.

When I moved to Scotland the attitude in the Uni' I worked in was just the same as in the USA.

When I moved to Bulgaria, needing to get PCs up and running cheaply and efficiently I turned to Linux. And just as I turned to Linux it stopped being 'something for nutters', and offered just what I needed.

That is when GIMP, Inkscape, OpenOffice, and so on became available and properly functional for Macintosh computers.

I would be extremely surprised if anyone between the ages of 50 and 75 has not used pirate software to a certsin extent.

So, obviously, having felt queasy about pirating software for quite some time, I rapidly moved over to using Open Source software.
https://richmondmathewson.owlstown.net/
User avatar
richmond62
Posts: 4831
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: OpenXTalk Linux Tools Library proposal

Post by richmond62 »

And, as to Paul and when he chooses to release anything: that is, of course, entirely up to him. But how he expects anyone else to get excited about all the clever things he says he making without being able to try them out escapes me completely.

As my old History teacher, John Julian Pyttches (been looking for a chance to immortalise him for years), said, "The proof of the pudding is in the eating."

AND as nobody has had a bite for more than 2 years . . . well, imagine a pudding that has been sitting in the larder for 2 years.
https://richmondmathewson.owlstown.net/
User avatar
OpenXTalkPaul
Posts: 2633
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: OpenXTalk Linux Tools Library proposal

Post by OpenXTalkPaul »

richmond62 wrote: Mon Nov 18, 2024 6:49 pm This is presumably a proposal for the next version of OXT 'Heavy' that never arrives: so why should we actually be interested in anything that just comes across as talk with nothing concrete to work with?

Yeah: tough, but apparently true.
Because:
1) You can use a library with OXT Lite, LC CE, LC Create Native (probably), or Richmond's Great IDE.
2) Being something that is using shell commands it could easily be ported to alternative engines (for example, I'm 100% sure I could get it working with OpenXION on basically any platform with a JavaVM).

Also, this is actually a direct result of me working on Linux, trying for another AppImage (or maybe other package format like FlatPack) build that (hopefully) won't have any focus issues with certain window managers.

But you certainly don't have to contribute to it or use it at all if you don't find any value to it, no skin off my back, and that is also the hard truth. I have a "day job" and I don't need to work on this at all, it's purely a labor of love 😘
User avatar
OpenXTalkPaul
Posts: 2633
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: OpenXTalk Linux Tools Library proposal

Post by OpenXTalkPaul »

richmond62 wrote: Mon Nov 18, 2024 7:59 pm But how he expects anyone else to get excited about all the clever things he says he making without being able to try them out escapes me completely.
I literally attached the stack so you could try it out, copy the scripts and do whatever you want with them. The few that are in that stack already work fine with the Linux distros I've tried them on.
User avatar
OpenXTalkPaul
Posts: 2633
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: OpenXTalk Linux Tools Library proposal

Post by OpenXTalkPaul »

tperry2x wrote: Mon Nov 18, 2024 7:03 pm
OpenXTalkPaul wrote: Mon Nov 18, 2024 6:25 pm I've started working on a Linux Tools library of sorts...mostly using the wmctrl command (as opposed to xdtool) because I think wmctrl should be installed already with most Linux distros.
I'm also using "xwininfo -id " for linux window bits if that helps.
...
Thanks Tom, I'll check out your scripts in OXT Lite, and try use the same revPref cProperty name.
Like you said an IDE pref is only good in the IDE nut not for including with standalone.
I was concerned about using any of X.org commands until I have a chance to check that they'll work with Wayland.
User avatar
tperry2x
Posts: 3209
Joined: Tue Dec 21, 2021 9:10 pm
Location: Somewhere in deepest darkest Norfolk, England
Contact:

Re: OpenXTalk Linux Tools Library proposal

Post by tperry2x »

OpenXTalkPaul wrote: Tue Nov 19, 2024 4:09 am I was concerned about using any of X.org commands until I have a chance to check that they'll work with Wayland.
That's a good point.
I've just checked using:

Code: Select all

echo $XDG_SESSION_TYPE
and MX is using the older X11, not Wayland.

However, I'm pretty sure when I was looking at the engine code for linux, it extensively uses the X11 window system. I don't think the engine currently utilises a wayland session in linux.
User avatar
OpenXTalkPaul
Posts: 2633
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: OpenXTalk Linux Tools Library proposal

Post by OpenXTalkPaul »

tperry2x wrote: Tue Nov 19, 2024 8:04 pm
OpenXTalkPaul wrote: Tue Nov 19, 2024 4:09 am I was concerned about using any of X.org commands until I have a chance to check that they'll work with Wayland.
That's a good point.
I've just checked using:

Code: Select all

echo $XDG_SESSION_TYPE
and MX is using the older X11, not Wayland.

However, I'm pretty sure when I was looking at the engine code for linux, it extensively uses the X11 window system. I don't think the engine currently utilises a wayland session in linux.
It seems that a lot of Linux software to still built on (40+year old) X11 even though (or perhaps because of) it's been in 'maintain-only' development for a long long time now, no new features are added to it. X11 has security weakness that Wayland doesn't have, however I've read a lot of people saying that Wayland still doesn't have feature parity to X11, so Wayland is not a 100% 1:1 replacement for X11 windowing yet, even after 15 years of development.
User avatar
OpenXTalkPaul
Posts: 2633
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: OpenXTalk Linux Tools Library proposal

Post by OpenXTalkPaul »

Freedesktop screen saver control useful for things like games or presentations:

Code: Select all

get shell("xdg-screensaver suspend" && the WindowID of this stack) -- Suspends Screensaver and Screen-Sleep as long as the stack window is still open or until resumed:
get shell("xdg-screensaver resume" && the WindowID of this stack)
get shell("xdg-screensaver activate") -- Runs screensaver immediately, may also lock the screen
get shell("xdg-screensaver lock") -- Lock the screen immediately.
get shell("xdg-screensaver reset") -- Turns screensaver off, If screen was locked it should ask to log back in.
get shell("xdg-screensaver status") -- returns screensaver info: auto-on inactivity time period or disabled.
Page with info on various methods and bindings for creating 'Notifications' (those 'Toaster"pop-up messages)
https://wiki.archlinux.org/title/Desktop_notifications
and doing that using DBus specifically https://specifications.freedesktop.org/ ... tocol.html
Your Linux must have a "Notifications Center" daemon for Pop-Up Notifications to work.

FD Specification for UI Icon names: https://specifications.freedesktop.org/ ... -spec/0.8/

A lot of links from www.freedesktop.org lead to '404' which seems odd to me considering so many elements of Linux environments are built upon the specifications that are supposed to be there.
https://www.freedesktop.org/wiki/Specifications/
User avatar
OpenXTalkPaul
Posts: 2633
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: OpenXTalk Linux Tools Library proposal

Post by OpenXTalkPaul »

I think I've posted this before, but here's some 'RevealFile" in File Manager methods for all three supported desktop platforms:

Windows:

Code: Select all

Explorer /select,[filepath]
Mac:

Code: Select all

open -R [filepath]
Linux (would prefer to stick to generic FreeDesktop methods and tools):

Code: Select all

dbus-send --print-reply --dest=org.freedesktop.FileManager1 /org/freedesktop/FileManager1 org.freedesktop.FileManager1.ShowItems array:string:"file:///path/to/file.ext" string:""
Most Linux file managers, such as Nautilus, it seems that if you know which one the distro is using, you can pass a file path to the File manager app and they will open a window of the directory of that file.
User avatar
OpenXTalkPaul
Posts: 2633
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: OpenXTalk Linux Tools Library proposal

Post by OpenXTalkPaul »

You might already know this, but I just thought I should point out that environmental variables are available in the Engine as globals, so you don't need to use shell ("echo $XDG_SESSION_TYPE"), you can use it directly in your scripts

Code: Select all

put $XDG_SESSION_TYPE
And see all available environmental variables from the globals tab of the message box stack.
User avatar
tperry2x
Posts: 3209
Joined: Tue Dec 21, 2021 9:10 pm
Location: Somewhere in deepest darkest Norfolk, England
Contact:

Re: OpenXTalk Linux Tools Library proposal

Post by tperry2x »

That's all great information, and will definitely go in my reference notes.
Some of it I knew about already (environment variables), as I use:

Code: Select all

if $DESKTOP_SESSION_WM or $DESKTOP_SESSION is among the items of tFixDistros then...
without having to run the shell commands.

Other bits you mention though, I didn't know about - so thanks for those. Much appreciated.
User avatar
OpenXTalkPaul
Posts: 2633
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: OpenXTalk Linux Tools Library proposal

Post by OpenXTalkPaul »

I've spent the weekend (mostly meeting up with old friends for sort of a wake, but in between) I installed a few different Desktop Environments in MX Linux and I now FINALLY know exactly which Window Manager does the crazy dual window problem with OXT 'widgets' (including 'classic' Player control in that) that have 'native' rendering (ie. a separate process that renders into an area in stack window). It's the custom version of Mutter that comes with Budgie that has this particular problem so I'm going to say that Mutter/Budgie desktop is not fully OXT compatible. It works so long as you don't use Browser Widget or Player Controls (but that's not very 'HyperMedia' is it?).
User avatar
OpenXTalkPaul
Posts: 2633
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: OpenXTalk Linux Tools Library proposal

Post by OpenXTalkPaul »

GNOME Metacity (Marco) and GNOME-Shell also do not work with 'Native' views (again that's fusing the rendering from an external process onto a card window, as the Player control and Browser widgets do), which exhibit behavior similar 'dual window' problem as with Mutter, except with Metacity getting the window list with the phantom window, using wmctrl -l yeilds an error:

Code: Select all

X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  20 (X_GetProperty)
  Resource id in failed request:  0x5e00007
  Serial number of failed request:  17
  Current serial number in output stream:  17
Somethings definitely broken with 'Native Layer' on Linux when using certain Window Managers, I intend to make a list of exactly which ones.

This stack is helping and I'm adding to it a little.
I've added handler to get the current default File Manager's name, (returns Nautilus,Dolphin,Caja,etc.)
User avatar
tperry2x
Posts: 3209
Joined: Tue Dec 21, 2021 9:10 pm
Location: Somewhere in deepest darkest Norfolk, England
Contact:

Re: OpenXTalk Linux Tools Library proposal

Post by tperry2x »

OpenXTalkPaul wrote: Mon Nov 25, 2024 6:50 pm ...which Window Manager does the crazy dual window problem with OXT 'widgets'... (ie. a separate process that renders into an area in stack window). It's the custom version of Mutter that comes with Budgie...so I'm going to say that Mutter/Budgie desktop is not fully OXT compatible. It works so long as you don't use Browser Widget or Player Controls (but that's not very 'HyperMedia' is it?).
That's some good detective work. Thanks Paul. I think the 'hyperMedia' thing might have been cast aside a long time ago (pretty much when Apple dropped Quicktime). It certainly made everything harder.
Would this also be the problem with Chromebooks spawning each window as a separate process I wonder?
User avatar
tperry2x
Posts: 3209
Joined: Tue Dec 21, 2021 9:10 pm
Location: Somewhere in deepest darkest Norfolk, England
Contact:

Re: OpenXTalk Linux Tools Library proposal

Post by tperry2x »

OpenXTalkPaul wrote: Tue Nov 26, 2024 5:11 am This stack is helping and I'm adding to it a little.
I've added handler to get the current default File Manager's name, (returns Nautilus,Dolphin,Caja,etc.)
Window manager:
"Name: Metacity (Marco)"
Seems to play nicely.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests