Haiku scripting

Backgrounds expects the entry_ref of the image file as part of the BMessage you send to it with hey. But that’s not possible, so your best bet is Lrrr’s little tool.

1 Like

It may not be so out of reach. Try this instead of your ‘scpl’ message:

hey application/x-vnd.Haiku-Backgrounds Do MenuItem 'Scale to fit' of View 0 of View 'placement' of Window 0

Other views in Window 0 that may be of your interest are image and workspaceMenuField.

1 Like

I’ve just finished adding the ability to modify placement mode, text outline, and offset, to my bgswitch app. Don’t hesitate to let me know if you encounter any “unexpected features” (otherwise known as bugs)

3 Likes

@Lrrr would you consider trying to add those command line options to the Background prefs? A nice addition IMO…

2 Likes

I have added it to my to-do list but I don’t know if it will get done any time soon.

Script updated with @augiedoggie 's bgswitch, and hey scripting, with the hints by @madmax

Or

https://0x0.st/Xr0a.sh.zip

3 Likes

Hi, it’s me again.
I recently started writing a yab script that is meant to be a replica/replacement of an old BeOS application, its name was DogWhistle (it opened folders using a tree view).
Currently yab is unable to represent the file system with a complete tree structure (at least I haven’t figured out how :sweat_smile:), so I switched to a filtered listbox which is enough for my purpose.
Currently I open a new tracker window with the desired path by drawing it into the script window, and close the previous one using its title (so I have to enable tracker in showing the full path in the title tab), is it possible to script Tracker to open a path in a given window instead?

Just for clarity on how the script behaves now

5 Likes

That looks awesome.

1 Like

Yeah, and I like the icon :slight_smile:

Anyway, here’s a nice list of commands for tracker: Commands.h « tracker « kits « src - haiku - Haiku's main repository. kSwitchDirectory ('Tswd') looks promising.

2 Likes

Wow! Gret tool! I always wanted something like that, but for query and launch Webopostive bookmarks.

1 Like

Looking good!

To get a treeview of the directories you will have to make a sys call to the tree command, which is not installed by default. HaikuPorts is offline right now, but you can download it directly from https://depot.haiku-os.org.

for example

Screenshot 2024-08-12 at 09.41.12

It should be possible to redirect that into a file, parse the file and feed the results into a yab treeview.

1 Like

Hi, this is my current hobby, involving an input_filter, shortcuts and a bash script

In yab I can get the tab height value, while in bash I haven’t figured out how to do it yet, so I had to declare it as a constant, any guesses or suggestions?
Thanks in advance

5 Likes

You could get the tab frame with a scripting query and then calculate the height from that. hey MyApp get TabFrame of Window 0

1 Like

Will this work without mouse then?
Moving a window without mouse input?

I mean the title tab, but I’ll try this anyway, perhaps it could return something useful, thanks

The input filter translates a gesture to an unmapped key, that shortcut could use to send a command, in this case my script with options and arguments, so this is a long way to say yes, it could

1 Like

I guess I don’t understand what you mean then. The TabFrame is what holds the title tab.

Im sorry, i misunderstood what you meant (I thought you were talking about a tabbed view, my fault), I can confirm you are totally right, I have just to subtract this from the window’s frame brect, thanks a lot

Harder question: how to get deskbar’s “IsExpanded” using hey? -Not from its settings file, so it can’t be parsed from there using ‘message’-

EDIT: I’m sorry to bother you with these posts, but, yes, it can, it’s in the not so obvious boolean ‘state’ value, along with ‘vertical’,‘left’ and ‘top’ values that could be parsed to get deskbar’s position, I leave it here for posperity