Qball's Weblog

Beati pauperes spiritu

Rofi - Updates

| Comments

Although Rofi is in a good place and is mostly feature complete, I did manage to fix several small annoyances and added several new features. I will list the most important ones below. I hope to make a new release in the coming weeks. It would be nice if I could promote Rofi a bit more. If you have ideas for this, please let me know.

Pasting support

You can now paste the current clipboard (both primary as secondary) to the search entry box.

  • Insert or Ctrl-v: Pastes the primary clipboard.

  • Shift-Insert or Ctrl-Shift-v: Pastes the secondary clipboard.

Disabling History

On request it is now possible to disable the history function. People who use Rofi to enter a lot of manual commands might find this useful.

Levenshtein Distance Sorting

When you start typing to filter the list, initially the results where sorted alphabetically. I have added an option that allows you to sort it by Levenshtein distance. This should allow you to find your desired option more quickly.

Many small fixes

Several small sizing and drawing bugs have been fixed, making things look just that little bit better.

Screenshot

Every blog post needs atleast one image, so here we go.

Screenshot rofi popup mode

Ducky 2108 Under Linux

| Comments

Ducky DK2108 (Image from Mechanical Keyboards Holland)

I know I haven't blogged in a long time, yet I probably have enough things to talk about that
others might find interesting. Like Rofi search updates, notes.sh rewrite in C++, etc.
I will try to catch-up in the coming months. But for now my latest GmG.

After many years of typing on crappy keyboards and wearing them out in no-time at all, I decided to get a real keyboard again. I used to be a big fan of the old IBM Model-M keyboards and still mourn the day my stash got lost (they where nice ones with detachable cables and all). So I got a mechanical keyboard, the Ducky DK2108 with Blue Switches and the only thing I can say is: I should have done this years ago! The feel is lovely, the sound is heavenly and the overall typing experience is paradise.

However paradise never lasts, I noticed that when typing command lines I often noticed I wound up with this: some command |\ grep <keyword>.

This happens when I press shift \ and release the shift earlier then the \ key (for my feeling I release them at exactly the same time). After some fiddling around, I noticed that it only happens with N-Key Rollover enabled. After firing up xev and taking a closer look this is what I saw:

  • KeyPress: Shift
  • KeyPress: | (keycode 51)
  • KeyRelease | (keycode 51)
  • KeyRelease Shift
  • KeyPress: \ (keycode 51)
  • KeyRelease \ (keycode 51)

While I get without NKRO or old keyboard and would expect the following:

  • KeyPress: Shift
  • KeyPress: | (keycode 51)
  • KeyRelease Shift
  • KeyRelease \ (keycode 51)

First thinking my keyboard might be buggy, or there being a problem with NKRO anyway, I decided to try it on a windows box. Here it works as expected………

The whole problem is mostly academic, I really do not need N-Key Rollover, I do not play games, so it is very doubtful I will press more then 6 keys at the time. If (and that is a big if) I would play a game where I have to press more then 6 keys, I can enable NKRO without issues given it only goes wrong with the \. I would be very pleased if I could fix the issue, so if anybody has a clue on how to do this? Please let me know.

While typing this I got an E-mail from MKH with a firmware update (but no guarantees that it fixes it). So far the service of the shop has been very good, they where quick with sending the keyboard, it was well packaged (the original box in a 2nd box with wrapping) and there support response time is impressing (even in the weekend).

Rofi Now Has a Website

| Comments

Rofi now has an official website, this is a first step towards making a release.

Currently the following is left to do:

  • Extend command-line options to cover all options.
  • Update documentation.
  • Provide some configuration examples on the website.

The second point will take the most time, help is always welcome.

Some recent tweaks to Rofi include:

  • Abstract out history code that was duplicate between ssh/run dialog. This fixes a bug with loosing history.
  • Allow more fine-grain tweaking of window position, allowing it to behave like a dropdown.
  • Fix small font rendering issue.
  • When no result is matched, double-tab will switch to next dialog. Allowing for a more fluent work-flow.

The rofi website is made using Jekyll, and I do like it. It did not take a lot of effort to tweak the theme so it did what I wanted. It seems octopress is kinda dead (no release for years now), so maybe someday I will try to strip off the octopress part and just use jekyll directly.

Gnome 3 Application Under Not Gnome

| Comments

I do not use gnome anymore, haven’t for a reasonable time. I do however use some of the gnome 3 applications from time to time. These are mostly gedit for quick editing or as clipboard and evince. For some reason though, it seems to be harder and harder to run these applications without issues under !gnome3.

Today I opened up gedit, to quickly paste a small piece of text and this is how it looked:

Gedit under I3

First thought was ‘nice shadow’ how they do that, but when I looked closer it turned out I am getting a nice window in window. Below you see the red circle contains the window border, the green is the background with the shadow.

Gedit zoom

This is pretty ugly. I do not understand why both gnome 3 team and canonical thinks we no longer want window decorations or menu bars (GIVE ME BACK MY KEYBOARD (mnemonic ed) FRIENDLY MENU BARS), but ok, fine then not. At least try to make it work as expected outside of it and not these weird borders with shadow, this wastes space to give a shadow….

But this is not the worst screw up, in Evince they are doing the opposite and they ’re-use’ pixels. If I put evince full screen the top-bar and the search bar start overlapping.

Normal screen:

Gedit Normal

Fullscreen:

Gedit fullscreen

During daily use this is very frustrating.

Bonus Question

Find the bug in the pasted code in gedit. This is what GCC generates. Extra bonus point if you can spot the architecture.

Programmable DC Power Supply

| Comments

I recently bought another Digital Power supply, going for a more professional model this time. The biggest advantage is this one does not have a fan.

EA-PS 2042-06 B

So I decided to adjust my existing program HCS to also support this power supply. I tried to make a cleaner implementation then last time. It is not as good as I want it to be, but a start. So do you have a Elektro Automatik PS 2042-06 B or a Voltcraft PPS-11360 you can control them using this tool.

Usage

Set output voltage

1
$ HCS_DEVICE=/dev/ttyACM0 ./build/hcs eaps voltage 6 

Read output volage

1
2
$ HCS_DEVICE=/dev/ttyACM0 ./build/hcs eaps voltage 
> 5.94

Read output current

1
2
$ HCS_DEVICE=/dev/ttyACM0 ./build/hcs eaps current 
> 1.03

Read device status

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$ HCS_DEVICE=/dev/ttyACM0 ./build/hcs eaps status 
    Device information:
     Device Type:               PS 2042-06B
     Manufacturer:                       EA
     Article No. :                 39200112
     Serial Num.:                3937461928
     Software Version:   V4.02 05.12.2012»

    Device specifications:
     Nominal voltage:                 42.00
     Nominal current:                  6.00
     Nominal power:                  100.00
     Set voltage:                     12.00
     Set current:                      0.95
     Current voltage:                  0.00
     Current current:                  0.00

There is also an interactive mode.

TODO

  • Update the documentation soon, currently it is lacking.
  • Make a more consistent output.
  • Fix command line parsing, so commands can be concatenated.

Links

Updates

| Comments

A small post with some updates. I know I have been very bad at blogging lately, luckily nobody reads this anyway.

RIP SimpleSwitcher, long live Rofi

To avoid confusion with the original simpleswitcher I decided to rename it. After getting no useful suggestions and forgetting even more. I decided on ‘Rofi’, it is Icelandic for ‘switch’ or ‘switcher’. Mostly it is nice, short and unused.

Changes

Not a lot changed since the last blog post, given it is already perfect(ish):

  • Support for configuring rofi using X server resources.
  • Displaying UTF-8 strings.

UDOO Quad, second attempt at low power always on desktop.

Hearing that the Freescale i.MX6 are well supported and have well working X drivers (Vivante), I decided to get one. There are many interesting on the market, but this one is combined with a Arduino DUE allowing for some creative projects.

Specifications:

  1. Freescale i.MX 6 ARM Cortex-A9 CPU Quad core 1GHz
  2. Integrated graphics, each processor provides 3 separated accelerators for 2D, OpenGL® ES2.0 3D and OpenVG™
  3. Atmel SAM3X8E ARM Cortex-M3 CPU (same as Arduino Due)
  4. RAM DDR3 1GB
  5. 76 fully available GPIO
  6. Arduino-compatible R3 1.0 pinout
  7. HDMI and LVDS + Touch (I2C signals)
  8. Ethernet RJ45 (10/100/1000 MBit)
  9. WiFi Module
  10. Mini USB and Mini USB OTG
  11. USB type A (x2) and USB connector (requires a specific wire)
  12. Analog Audio and Mic
  13. SATA (Only Quad-Core version)
  14. Camera connection
  15. Micro SD (boot device)
  16. Power Supply 12V and External Battery connector

The choice of hooking up the GPIO pins of the Cortex-M3 and the Freescale to the same output pins without any protection is a bit odd. While it probably makes things a lot easier, it does require to take extra care, so you do not connect two outputs.

Distribution:

So far things are working well, still playing to find the most useful distribution to run on it. The Ubuntu 12.04 it ships with is decent enough, but has a few annoying kernel bugs, on Archlinux I got stuck with X11. Now I am currently using a community debian image, with self-compiled u-boot and kernel. I gave the board a 120GB samsung EVO SSD that is connected up via SATA. This is a welcome performance boost I was always missing on other boards, combine this with gigabit Ethernet it is a speedy little machine.

Currently I have it runnig idle at 3.5W power consumption, this is not bad but I am sure I can probably get it down to 2.5-3W (from the Wall socket). This should be low enough to keep it running, given it is powered by 12V I can have it running from the 5V/12V power line I have that feeds more arm boards, powered USB hubs and dimmable LED strips. This should be even more efficient.

Other stuff:

I will reserve the rest for more blog posts.

SimpleSwitcher - Needs a New Name

| Comments

The last week, in some spare minutes, I have been working some more on simpleswitcher. It is now not only a window switcher, also a launcher and allows you to easily switch between the two.

So no longer you can watch switch between windows, with a tokenized search:

Classic simpleswitcher

You can now also search on window role:

Pimped simpleswitcher

When the program is not found, press ‘?’ to switch to the launcher: Run dialog simpleswitcher

Everything uses tokenized search. So you can type in your command in any order. Its mean features are:

General:

* Tokenized search.
* Very small (1000+ lines of code).
* Little dependencies. (xft, libx11)
* Fast
* Customizable (color, transparency, etc.).

Window switcher:

* I3 support.
* Search on Window class, title, name and role

Run dialog:

* Very very fast. ( < 5ms to generate executable list)
* Run in terminal support.
* Last 25 choices are picked first. (sorted on top)

But, it needs a new name, simpleswitcher does not cut it anymore.

So any suggestions, please comment. The first release will be named after the person providing the winning name!

First Blog of 2014

| Comments

It has been to long since I last blogged. Life keeps getting in the way. Recently I have been working on some off my small ‘helper’ tools. I just do not have the time to take on something big. This is very frustrating, but little I can do about it.

So tools I recently wrote, modified or extended are:

SimpleSwitcher

A popup window switcher roughly based on superswitcher, requiring only xlib and xft. I modified the great work from Sean Pringle. All credit for this great tool should go to him. I previously made the following changes:

  • Tokenized filtering. This allows for even faster selecting of the right window. e.g. typing ‘UR pan’ selects the URxvt terminal logged into the box called panda.
  • Transparency. For the people that like simple bling.
  • Hacked in i3 support.

Recently I have made the following updates:

  • Native i3 support.
    • Autodetect I3 running via I3_SOCKET_PATH property on the root X window.
    • IPC with i3 to focus window.
  • Small fixes and cleanups.

Website: here

BPM

Small command-line tool to store data from Beurer BM58 Blood Pressure Monitor. The BPM program retrieves, stores and outputs blood pressure measurements from a Beurer BM56 Blood Pressure Monitor. (Any device based on Andon Blood Pressure Meter KD001 should work).

By default these devices can only store up to 60 data points. This tool is written to extend that and allow the data to be used by 3rd party programs like gnuplot. It outputs the stored points in different formats like txt and csv, and if requested, filter multiple measurements taken at the same time. Optional it can call gnuplot to generate a graph of the measurements.

Website: here

HCS

Small command-line tool to control a Voltcraft PPS-11360 Programmable DC Power Supply The tool allows you to retrieve status from the power supply, set voltage, current and output state. It is written so it can easily be used in scripts.

Website: here

Others

Further more I have updated (mostly small build fixes) sshconf, escalc, out2html, YouLessEP and more. These can all be found on my github page.

Canonical at It (Again?)

| Comments

I guess this says it all:

https://micahflee.com/2013/11/canonical-shouldnt-abuse-trademark-law-to-silence-critics-of-its-privacy-decisions/

I like Jono’s reply, trying to move blame. This probably is going to make things worse. Personally if I get a ‘legal’ notice, I will have a ‘legal person’ look at it, esp. something as dodgy like this.

This is one of the reasons I left ubuntu for private use, now I am going to spend some extra effort trying to get people to move away at work.

I have to admit I been very bad at blogging lately, I will try to improve this. (again)

Gpx-Viewer FIT Support

| Comments

I got a forerunner 210 watch about a week ago and have been slowly adding support for heart-rate to gpx-viewer. Today I started adding support for parsing the FIT files directly.

Please play with the developer version and report bugs!.