yab one-liners
#1
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?
Reply


Messages In This Thread
yab one-liners - by clasqm - 08-04-2015, 02:24 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)
Free Web Hosting