Monday, July 13, 2015

Installing Adeskbar on FreeBSD

Why?

On not so powerful hardware, squeezing every last ounce of juice from your limited resources are vital especially when you're a developer. Time is very important, and so waiting for a program to compile or watching your IDE slow to a crawl just trying to auto-complete the name of a function, or even watching your mouse cursor that you're used to blinking be a constant pixel on your screen, makes your soul scream as precious seconds waste away before your eyes.

So when I got a chance to finally install FreeBSD on my own hardware, I jumped on it. Unfortunately, said hardware isn't as powerful as I want it to be right now for my daily development, it's an Acer E 15 Start [1], but it's mine. So as much as I could, my X environment has to be as minimal as possible.

I know there are tons of Desktop Environments (DE) and Window Managers (WM) to choose from, I thought XFCE4 was lighweight enough as I had installed that on a previous PC-BSD setup I had, but that was on much better hardware, so it was blazingly fast, but on my current hardware, the Application Launcher menu took ~3 seconds to load on average [2], yes, the menu to launch my applications took a while to appear before I could launch my applications. Now what's the big deal with 3 seconds? I'm dual booting with Windows 8.1 [3] and Windows 8.1 on the same hardware is surpisingly and pleasantly responsive, enviously so, and I can't have my main OS FreeBSD be shown up like that. So I did a lot of reading and did a lot of testing and although I thought LXDE would have been faster, and at least not let me feel bad about jumping from XFCE4, which honestly, I do enjoy and would install it on anyones computer, LXDE for some reason just wasn't the same. BUT it was faster, and making this possible was OpenBox. OpenBox? What is that, I've never heard of it before...I did more reading and realized something. What if I just ran OpenBox by itself, how much more responsive could my desktop be? 

# cd /usr/ports/x11/lxde-meta && make rmconfig-recursive deinstall
# cd /usr/ports/x11-wm/openbox && make config-recursive install clean

I now had OpenBox and a gray background...Simple, minimal, divine. In the first time using an OS, I realised, everything else was unneccessary. However, after shaking myself out of it, I soon realised, there were somethings that were necessary for me to be and feel productive, especially if I wanted to replace Windows 8.1 and get over the feeling of missing the MacBook Pro I had been using for over three (3) years. So I moved on to see what others were doing with their FreeBSD + OpenBox setup and stumbled across this forum explaining how to have a minimal FreeBSD desktop. How I wish I saw this first, and how much more I wanted to do a full reinstall of FreeBSD, but after 2 weeks of struggling, and not wanting to waste any more time, I decided to make the best of it, so I opted for Tint2 and Wbar.

Wbar - minimal, lightwieght, easy to configure. I quickly found out it's limitation, and it was the one thing I needed, it doesn't support SVG, and doesn't plan to anytime soon, unless imlib2 decides to. I found this out from here.

I thought cairo-dock aka GLX-dock would have been the answer, and would give me that OS X feel, but after # make config-recursive install clean I realized how wrong I was. One hour of installation, and to top it off, my hardware doesn't support OpenGL, which means space on my HDD is being taken up for eye-candy that I can't see or utilize. I tried making the best of it and it worked after a fashion, but the bulkiness and underutilizatoin of it was getting to me. So back to google. I found this wonderful article which confirmed a lot for me and also introduced me to Adeskbar, which was created by David Art. The caveat, Adeskbar isn't ported to FreeBSD, which means a manual install. Google turned up nothing helpful on how to get it done, so I went through the README and following are my steps to get Adeskbar up and running in my environment, I had to have it.

What?

These are the steps I had initially taken.

1. Downloaded adeskbar tar.bz2 from official site
2. $ tar yxf adeskbar-0.4.3.tar.bz2
3. $ mv adeskbar-0.4.3 ~/adeskbar-0.4.3 && cd adeskbar-0.4.3
4. $ sudo ./install.sh
5. $ adeskbar
6. annnddd...Nothing.
7. $ cat install.sh (Reveals where the files were moved, and adeskbar.desktop was renamed to applications...hmm, ok)
8. $ sudo mv /usr/share/applications /usr/local/share/applications/adeskbar.desktop
9. $ sudo ln -s /usr/local/share/applications/adeskbar.desktop /usr/share/applications
10. copied default.conf to ~/.config/adeskbar/
11. $ adeskbar default …. repeat step 6
12. $ cat ~/.config/adeskbar/output.log
> /usr/bin/adeskbar: /usr/share/adeskbar/main.py: not found
13. $ ls /usr/bin/adeskbar
> main.py (listed) ??? I found this article Still Stupid (http://stillstup.blogspot.com/2013/03/new-adeskbarinstall.html)
14. $ whereis python : /usr/local/bin/python
15. $ sudo emacs main.py (updated path based on whereis: #!/usr/local/bin/python)
16. Repeat step 5, 6 and 11.
17. This time /usr/share/adeskbar/ui.py complains about not finding gmenu. I have gnome-menus installed.

After all of that, I realised I would never get gmenu installed. Soo, I found and downloaded adeskbar-5.0, changed all the paths in install.sh, adeskbar.sh and uninstall.sh to reflect /usr/local/share instead of /usr/share.

Then:
1. $ adeskbar &
2. and …. IT'S ALIVE
3. edited ~/.config/openbox/autostart to include (sleep 4 && adeskbar) &

Tweaks...

Okay, it works but not quite. I had to do a few more things. First I followed the advice in the comments section and did
$ ln -s /usr/local/etc/xdg/menus/gnome-applications.menu /usr/local/etc/xdg/menus/applications.menu
I also installed py27-dbus, not sure if I needed to or not.

You can use ~/.config/adeskbar/output.log to guide you, but based on my errors, this is what I did.

1. NameError: name 'pyinotify' is not defined.
  • Pyinotify is listed as optional, and I couldn't find it in the pkg or ports repos, so
  • Go to /usr/local/share/adeskbar/plugins/menu.py or wherever you installed it on your system and comment the entire class definition for class EventHandler(pyinotify.ProcessEvent)
  • Restart adeskbar, for me I right-clicked adeskbar, chose quit and ran $ adeskbar default &
2. IOError: [Errno 2] No such file or directory /etc/xdg/menus/applications.menu
  • Easy fix, based on output.log, control left adeskar at this point: File "/usr/local/share/adeskbar/adesk/core.py", line 216
  • Go to line 216 and update the path to the symbolic link created earlier /usr/local/etc/xdg/menus/
3. File "/usr/local/share/adeskbar/adesk/check.py", line 76, in check_modules
check['VTE'][0] = False
  • Line 76 isn't the problem, it's actually at line 19. if you look closely you'll see 'VTE ', notice the extra space. Edit the line to remove the space so it looks like 'VTE'.
  • Restart Adeskbar, right-click and choose Preferences and it should finally appear

1. Intel Celeron Processor N2840 @ 2.14GHz / Intel HD Graphics / 4 GB RAM / 223Gb Storage
2. I counted in my head 1-1000-2-1000-3-1000, not scientific but I didn't care enough to really measure it down to the milliseconds
3. It took me longer than 3 days to figure out how to dual boot Windows 8.1 / FreeBSD on a GPT + UEFI setup and I still don't know how to

No comments:

Post a Comment