yab | yet another Basic for HAIKU
yab one-liners - Printable Version

+- yab | yet another Basic for HAIKU (http://yab.orgfree.com/forum)
+-- Forum: Programming in yab (http://yab.orgfree.com/forum/forumdisplay.php?fid=1)
+--- Forum: Snippets (http://yab.orgfree.com/forum/forumdisplay.php?fid=3)
+--- Thread: yab one-liners (/showthread.php?tid=29)



yab one-liners - clasqm - 08-05-2015

OK, there are not nearly as many of these as the one-liners for sed or awk that you will find all over the web. Nevertheless, these yab one-liners can be used in Terminal or in shell scripts to find some interesting system data.

Get information on the state of your Haiku desktop

yab -execute "print peek(\"DesktopWidth\")"
This will give you the width of your current desktop, in pixels

yab -execute "print peek(\"DesktopHeight\")"
As above, but this time you get the height of your current desktop

yab -execute "print peek(\"Deskbarposition\")"
The Deskbar can be dragged around and place in six different places.
This command will give the current state of the deskbar
1=top-left
2=top
3=top-right (default)
4=bottom-right
5=bottom
6=bottom-left

Other system properties that can be revealed with yab's PEEK command include Deskbar-x, Deskbar-y, Deskbar-width, DeskbarHeight, Deskbarexpanded, MenuHeight, Scrollbarwidth and Tabheight. See the yab documentation for details.

yab -execute "print peek\$(\"os\")"
OK, not so helpful. You already knew you were on a Haiku system. But it may be useful in the future if someone decides to fork the Haiku codebase.

Get other information

yab -execute "print date\$"
Doesn't bash have a date command of its own? It does but yab gives the date in a different format, which you may like better.

What other yab one-liners are there?


Free Web Hosting