Haiku scripting

winpwnr.sh updated, it helps to make hey one-liners

usage: winpwnr.sh [-D] [-a value] [-dhl] [-s value] [-f] [-twLFGpPMAmHnr value]

        -D      automatically detects the current active window, obtaining the name of the application and the ID number

        -a      select the application by name
        -d      avoid DeskBar
        -h      print this help
        -l      list windows of the selected application
        -s      select application window via ID number or title
        -f      force fullscreen for the selected window
        -t      change the title of the selected window 
        -w      show the selected window on {x} workspace(s),
                        you can set multiple values separated by any character, like
                        "1,2,4,5" or "5.6.1", use "all" to show it in every workspace
        -L      change the LOOK of the selected window:
                        - b OR bordered
                        - n OR no-border
                        - t OR titled
                        - d OR document
                        - m OR modal
                        - f OR floating
        -F      change the FEEL of the selected window:
                        - n OR normal
                        - ms OR modal-subset
                        - mp OR modal-app
                        - ml OR modal-all
                        - fs OR floating-subset
                        - fp OR floating-app
                        - fl OR floating-all
        -G      change the FLAGS of the selected window, multiple values are accepted separated by commas
                        - nm OR not-movable
                        - nr OR not-resizable
                        - nh OR not-h-resizable
                        - nv OR not-v-resizable
                        - fs OR accept-first-click
                        - nc OR not-closable
                        - nz OR not-zoomable
                        - af OR avoid-front
                        - nw OR no-workspace-activation
                        - as OR avoid-focus
                        - nb OR not-minimizable
                        - na OR not_anchored
                        - sp OR same-position
                        - ce OR close-on-escape
                        - l OR lock (shortcut for nm,nc,nr,nb,nz)
                        - r     OR reset

        -p      move the selected window by [x,y] pixels (relative)
        -P      move the selected window to [x,y] (absolute) position
        -r      resize the frame of the selected window to [width, height], centering it with the original one and avoiding to exit the edges of the screen

                omit a value to preserve the current one (i.e. -r ,300; -r 300, ), use any letter to enlarge to max size (i.e. -r f,200; -r 200,f )
        -M      minimize the selected window [1|t|true|on|y|yes,0|f|false|off|n|no,toggle]
        -A      active the selected window [1|t|true|on|y|yes,0|f|false|off|n|no,toggle]
        -m      move the selected window against the edges and corners of the screen:
                7       8       9               ul      u       ur           up-left          up              up-right
                4       5       6       OR      l       c       r       OR   left             center          right
                1       2       3               dl      d       dr           down-left        down            down-right
                combine the option center + selected edge to move the selected window centered against the edge to a centered position (i.e. use -m 45, 54, cl, lc, center-left or left-center)
                ce or closest-edge moves the window against the closest edge
                cc or closest-corner moves the window against the closest corner
        -H      as the -m option but the selected window will be moved against the edges, resized to halves of the screen size, resized to quarters of the screen size to the corners
        -n      as the -m option but the selected window will be moved against the edges, resized to ninths of the screen size
                with this option it is possible to assign a group of adjacent ninths to the selected window using the digits (numpad)
                                β–‘ β–‘ β–‘
                                β–‘ β–‘ β–‘
                I.E.:   -n 12   β–ˆ β–ˆ β–‘
                                β–‘ β–ˆ β–ˆ
                                β–‘ β–ˆ β–ˆ
                        -n 59   β–‘ β–‘ β–‘
                                β–‘ β–ˆ β–‘
                                β–‘ β–ˆ β–‘
                        -n 28   β–‘ β–ˆ β–‘
                Insert the digits that match the screen portions you want to take care of the window, the script is not restrictive about the order of the digits, it reorders and discards what is not necessary, so it is possible to enter 12 or 21, 28,82,258,285,582,etc. or 59,95,9586,etc., just make sure only to select the ends of the desired area


in this example I put on UserBootScript

winpwnr.sh -a application/x-vnd.Be-WORK -s 0 -L n -F fl -G l -r 150,100 -m 3 &

Workspaces is set to
-L n LOOK : no border
-F fl FEEL : floating all
-G l FLAGS : locked (not movable, not resizable, not minimizable, not closable

-r size RESIZE : it resizes the window

-m 3 MOVE : moved to bottom right corner (3 is a shortcut in numpad)

A super bloated TuneVolume package with local support and a futile deskbar replicant
Bitmap Clip



a Shutdown script, it basically mimics the system Alert window, but it adds a deskbar replicant too, locale support
Bitmap Clip

Gantry, web search launcher, has been updated too
Bitmap Clip



This is awesome, but IMHO it should be a separate discussion topic with each script having its own thread - no?

1 Like

It would be nice to have these in an online git instance.

1 Like

Maybe these could be packaged so others can download them through pkgman/HaikuDepot?

1 Like

Hi, are you get this in github/other? Maybe you like to share the code! :wink:

1 Like

@nhtello @bitigchi you are right, I’ve already a GIT account but sometimes I’m too lazy even to save them on my NAS, some of these are on https://gist.github.com/zumikkebe


I started purging some old posts and leaving only the new ones, perhaps if I’m going to share something new I will open a different thread for each :wink:

1 Like

you are right too, I’m stuck with the old Be way of installing through sh scripts, an old dog hardly learns new tricks, can you point me some tutorial about that?


your call - just keep up the good work - I am all in after seeing desktop background trick

1 Like

Speaking as an old dog here :slight_smile: I’ve created packages for BeOS/ZETA and Haiku (first bep files then with the recipes), it isn’t that hard once you get a hang to it :slight_smile:


Yup, the HaikuPorts documentation should be really handy for this: https://github.com/haikuports/haikuports/wiki/A-Gentle-Introduction-to-HaikuPorter-%231


There’s haikuporter, HPKGcreator, package cmd … :wink:

I tried, I swear, I tried hard to figure how it works :slight_smile:

My current shell script installer does:
-Prompt the user if he wants to use the bare yab script or bind it to the yab interpret (not strictly required in this case, it’s a standard sh script I made for some other yab script I wrote and there are some benefits if they are bound)
-Move the scripts to bin/$appname folder (uninstall.sh is provided too, so it can be purged using package management)
-Move the settings (basically some images) to settings/$vendor/$appname folder
-prompt the user if it has to add symlinks to Desktop, bemenu and boot/launch

Can you give a suggestion how this can be done using package/haikuporter? Or this still requires a shell script?

1 Like

For a recipe:
Running the script should be possible in a recipe in BUILD() (there are already some recipes using autogen.sh for instance).
Without looking into the script I’m not sure, but I guess it provides some install part? If so it should be able to create the $appsDir to install the binary into.
For the settings you could use a postinstallscript?

EDIT Some examples for yab recipe currently in haikuports:

1 Like

Or take a look at the hpkgcreator software.


Regards lorglas

1 Like

Bitmap Clip
Im currently working on this, it shows system calendar events as a svg in Falcon browser, im trying to convert it to a full yab script with native graphics, but perhaps there are no chances I can make it look similar to this


It could be an idea of improvement for Calendar app to have such representation of today time line that could be dropped as repliquant on Desktop…