Basically it's BAR (Bar Ain't Recursive) by LemonBoy but using Node-Webkit.
It uses unix sockets to receive data in the same format as BAR.
- Don't need to run XQuartz
- Mouse support
- Style via CSS
- More memory usage
- Acts like a regular window
- Has a shadow
- Can be moved by window managers
- Rounded corners
1. Setting up
Download the latest version of node-webkit from https://s3.amazonaws.com/node-webkit/v0.8.2/node-webkit-v0.8.2-osx-ia32.zip
Extract the zip. You will have three files. The only one you need is
node-webkit.app. Move it into your
Using git, clone a copy of my repo with
git clone https://github.com/stayradiated/bar.git. This will create a folder called
bar, open it using
To start the application, run the command:
. at the end is important. Hopefully, this should display the bar (by default at the top of the screen). At the moment it will be blank, because nothing is sending data to it.
Basically a socket has been created at
/tmp/bar.sockand the application is listening to it waiting for instructions on what to print. Bar uses the same formatting as LemonBoys - https://github.com/LemonBoy/bar#text-formatting.
To close Bar, focus on it and press 'Cmd-Q', or select 'Quit bar' from the menu, or close it from the dock icon. DO NOT use ctrl-c to quit it from the terminal.
2. Using pipes
If you have used lemonboys bar, then you're probably used using pipes to write text to it.
Edit the configuration file at
app/js/config.js. Uncomment line 24 and edit the script path to match where you cloned the repo to.
You can also edit the height of the bar, and it's position on the screen in this file.
Then edit the file
bin/init_bar_script.sh. You will need to change the path on line 9:
cat $PANEL_FIFO | node ~/Projects/Bar/bin/printer.js &
Start the bar again using the same command from 1.4. This is where using a simple terminal alias
alias nw="/Applications/node-webkit.app/Contents/MacOS/node-webkit"comes in handy, as you can just run
nw .whenever you want to start the app.
If everything works, then the Bar should be displayed again and nothing should crash.
Any information piped to
/tmp/bar.fifowill be passed into
printer.js. This file will format the data, such as setting the position, adding background and foreground colors etc, and then pass it to Bar through unix sockets.
Try running the command
echo 'S i can print text- to the bar' > /tmp/bar.fifo. With any luck you should see the text appear in the bar. If you can't, try opening the dev panel by focusing on the bar and pressing ctrl-d and going to the console tab. You should see some text like this: http://i.imgur.com/yrmt9va.png.
3. Editing fonts and colours
Install SASS by following the instructions at http://sass-lang.com/install (bottom right section).
Colors, fonts and line height are defined in
To compile the SASS, use the command
npm run-script cssfrom the bar folder.
To refresh the styles that Bar is using, focus on it, and then press the
4. Daily routine
Once you have everything set up, you only need to do the following when you start your computer to get Bar running:
cd ~/Projects/Bar nw .
To close the app, simply focus on it, and press
Cmd + W. This will automatically shutdown the sockets server as well.
Settings are stored in
Edit colours and load themes in
source/main.scss. Recompile the styles by running
npm run-script css.
Hiding the menubar
I recommend you use a SIMBL plugin like Menufela.
To show on multiple desktops, right click the dock icon, and select Options > All Desktops.
If you use something like Zephyros, then you will be be annoyed when you accidentally move the Bar from it's position. To fix this I added a small
if statement in my scrip that would ignore windows with height of
< ~30 pixels.