Documentation

Scripts Directory

CmdBar looks in the $HOME/.cmdbar directory for scripts to execute. Scripts have to follow these naming conventions: name.time.extension and name.time; for example, transmission.2s.sh is a shell script named transmission that is scheduled to execute every two seconds, and main.2m is an executable named main that is scheduled to execute every two minutes. The interval should use “s” for seconds, “m” for minutes, “h” for hours, and “d” for days. However, using days for execution interval is uesless since CmdBar reloads scripts whenever MacOS wakes up from sleep (this might change in the future). The current implementation could be useful to those machines that never go into sleep mode.

If you wish to store your scripts directory in any other place, you can create a symbolic link, but otherwise $HOME/.cmdbar is the only location CmdBar looks in.

// example
ln -s $HOME/.config/.cmdbar $HOME/.cmdbar

Reload Scripts

The blue button can be clicked to reload the current script. Clicking the blue button whilst holding shift will reload all scripts; this might be useful whenever you add or remove scripts from .cmdbar directory.

Launch At Login

The orange button can be clicked to toggle 'launch at login'.

Writing Scripts

CmdBar has no restirctions on the type of executable a user uses, as long as the script or executable writes to standard output.

Note

A script or an executable must have execution premission.

chmod +x script.2s.sh 

The first line of the output will be used to display the title of a status bar button, and the rest will go into the body of the popover.

#!/bin/sh

echo "👋"              # button title
echo "Hello, world!"   # body
echo "Hello, seaman!"

The above script will output:

👋
Hello, world!
Hello, seaman!

Warning

Most likely a user will launch CmdBar through Finder, as a result CmdBar will not borrow the environment properties that user's Terminal has set; for this reason, all shell scripts must use absolute paths to programs (e.g. not brew outdated, but /opt/homebrew/bin/brew outdated). Basically, everything that is not in /usr/bin, /bin, /usr/sbin, or /sbin should have an absolute path. which command can be used to find an absolute path of a program (e.g. which brew).