Trigger browser reload in Enlightenment

So Enlightenment has changed it's focus model recently which required me to modify my browser reload script... so I did. It now relies on "mouse over" focus to force the window to get focus and then reloads... in other words don't just mouse click focus.

To execute just run the following

$ browserReload yourbrowser


You can omit the yourbrowser argument in which case it'll use "Vivaldi"... to change that simply change the following line the script:

BROWSER="vivaldi"


If you want to trigger it from Vim you can add the following in your .vimrc:

function BrowserReload()
  exec "silent! !browserReload"
  redraw!
endfunction

map <F5> :call BrowserReload()<CR>

Opera is dead!

So the point of yesterday's little escapade was to get the new Opera 28 installed on Slackware so I could see for my self how "well" it worked. Now apparently they use the same sandbox as Chrome (which is no surprise since it basically is just that...) but forgot to SUID the file so the start up failed. Being the nice guy that I am, I'm willing to forgive such incompetence and move on (but not without pointing it out obviously). 

Simple, flexible and powerful

So it took Opera a while to finally release their browser on Linux, 11 major versions to be precise. Which, although disappointing, should mean you have a nice mature version. For me Opera always meant a simple intuitive browser that allows for lots of flexibility and grants you a lot of powerful features. Being a mature version I was expecting something along those lines. Well... it's simple.. and that's about it... They basically removed all the power features (except mouse gestures) and binned all flexibility... I couldn't even move my tab bar to the bottom of the screen or group tabs... better yet I couldn't remove/replace the google search bar from the speed dial. I could change my default search engine... but not on the speed dial. Speaking of which, obviously I want to get all default (facebook, amazone, etc) crap back on the speed dial after I removed it... bugs galore! Yes even youtube sound is out of sync... you're using blink for fuck sakes, not fucking touching it would have been a better job!

Anyway after some digging I found that it was actually possible to enable the "power" features...simply enter the konami code in the settings screen and you have "the power" (fucking hell guys) . I.e. it shows about 3 extra checkboxes on the settings screen: one to remove (but not replace) the speed dial search, some useless junk and one to permanently show the "power" features... riiiight :) And why would one want to be able to change the keyboard shortcuts... Chrome doesn't support it so nobody wants it!

Themes

Ok maybe not all feature have been removed, they still have "themes"... which are a fucking joke :) Back in the day you could basically rape any piece of the browser by installing a theme. It would literally be able to change every last button in Opera to look pretty. Nowadays however it just change the background picture of the speed dial... yes that's it... the fucking background picture. Just add a "set as speed dial background"option to the image context menu (yes exactly, like windows has!). 

Extensions

So any self-respecting browser has something called extensions these days. They're additional features that can be installed on the fly, written by "the community" because the browser doesn't support it out-of-the-box. In other words, Opera is to damn lazy to come up with cool stuff and leave it up to you and me to do it for them. And this is the company that invented: tabbed browsing, tab grouping, mouse gestures, hot click, paste & go, browser mask, turbo mode (yeah they made browsing possible on your old junk Nokia), speed dial, download manager, the magic wand and much more. The fun thing about Opera was that every new version would come with new and innovative feature that improved more or less everything you did on the web and now they're asking you to do it for them. 

Admittedly someone actually managed to do a very nice job of creating a drop-in RSS reader which looks remarkably like the old integrated reader. Unfortunately no-one attempted to do the same for the integrated email client that was in Opera (vesion 7 to 12)...

Conclusion

Yup it's dead... which is unfortunate since that means browser innovation has gone out the window with it. Don't get me wrong, there are plenty OKish browsers out there like Firefox and Chrome but they haven't really improved... since Opera 12. That said the new Opera isn't a crapheap.. it's just not worth my time... And seeing that I'm basically stuck with the "current" browsers I don't see why I should Opera instead of Chrome...

Vivaldi

But wait! we have a last minute entry: Vivaldi and there's a reason for that name... apparently the former CEO of Opera has decided to make a browser and I quote: "A browser that is fast, but also a browser that is rich in functionality, highly flexible and puts the user first". Well that sounds like the original Opera vision... let's see! 

Ok so only RPM and DEB downloads, oh well I can convert those.... installs nicely (no SUID issues :)) and starts within a second. So... mouse gestures work (without having to enable the first!)... ctrl+z reopens my last closed tab(s)... although it also does this when I'm editing this blog posted which is sorta annoying :) Aesthetics are rather pleasing... better yet: it's just looks really cool :) No need for themes for now! And this is where the first new neat feature comes in: it colors the active tab and title bar in accordance with the site you're looking at (seems to use the most prominent color in the favicon). Next new feature: speed dial uses your bookmarks... so instead of having to maintain 2 sets of bookmarks (like other browsers), it just uses your bookmarks... finally the speed dial becomes useful. 

It's still in beta (or alpha even) but the basics work really well. There's obviously tons of stuff missing but for a "tech preview 2" it feels really good (almost like that other browser I used to use...). It's generally stable (although I heard someone bitching about a segfault) and it does what it says on the tin: bookmarks (tho modifying is a bit buggy), speed dial, tabs (+grouping), changing the layout... even stuff like youtube and soundcloud work like a charm. 

So far so good, I'm really looking forward to the release that includes the email client so I can move away some completely from that other browser!

deb2tgz 1.0 XZ and slack-desc patch

So I was trying install the new Opera for Linux which unfortunately is offered in Debian package only... deb2tgz to the rescue! Well that failed miserably since the new .deb also allows for XZ data which isn't supported by deb2tgz. So after some scripting (i.e. more or less completely rewriting it) I managed to repackage Opera into .txz. 


Here's the patch for deb2tgz so it support XZ... it also completely repackages the data and adds a nice little slack-desc description file. It's been tested with Opera and Skype (...) and the initial results look promising... that said, let me know if you have any packages that break.


Fun fact: Opera doesn't really start...

Background images

It's been a while since I dropped anything here... so to keep you guys busy .


Belfast by night

Roland TD-15 MIDI read/write

It seems I had a request recently to improve my Roland TD-15 hack. And since I'm such a nice guy *cough* I figured I'll have a go at it... and behold the new version! It's pretty similar to the old one except that it now not only sends from the Roland to MIDI but also the other way around, i.e. it's "read / write".


Unfortunately the development didn't went as smooth as I hoped. Conceptually it was quite easy, just read from the MIDI device and pass that to USB via bulk data. The first annoying but was the fact that some programs send MIDI data in a somewhat shortened version which means you can't pass it directly but it needs some conversion. 


However that wasn't the bit I struggled with... reading from both MIDI and USB at the same time was. The first attempt was to fork the process and read USB in one process and MIDI in the other. While this worked in principle, it caused a weird issue, namely that the USB reading process would catch the result of the other process writing to the USB port. Which in turn locked up the device causing nothing to happen after that. What I don't get is that windows manages to send to the USB while listening to it uninterrupted. So probably the reading process is paused during the write... then again I haven't managed to convince LibUSB to do so...


Anyway as a result it's now a "polling" based driver which continuously checks the MIDI and the USB devices for new data and handles it accordingly. The obvious result is that it causes a somewhat heavy load and lags (a little)... then again I played around with Renoise and my TD-15 and I'm actually quite pleased with the results!


Enjoy, and keep the feedback coming!

Roland TD-15 and Linux

I upgraded my box recently which came with a nice new Linux kernel. And after a reboot (prolly 2 weeks later) all of a sudden this line showed up in lsusb:

Bus 004 Device 005: ID 0582:0150 Roland Corp. TD-15

Is it really so? Does Linux recognize my TD-15? Yup... unfortunately that's pretty much it, i.e. it doesn't actually support it. Which is obviously quite a pain in the arse. However with my recent USB reverse engineering experience I figured I can crack this puppy as well! So I did.


Now before you all get too excited, for now I've only been able to get the MIDI part to work. Which is the easy part but I consider this a step in the right direction. As a matter of fact I'm planning to go all the way (i.e. sound in+out) with this so the TD-15 can actually be fully supported by ALSA. But I will probably need "some" help with that since I've got no experience with ALSA (i.e. feel free to leave some comments!). 


Like the previous exercise, I used a windows VM with the driver and wireshark to see what windows was doing to that poor USB port. As it turns out, not that much, the initiation is fairly simple and after that it's just receiving bulk data. There are 2 additional "interfaces" available which presumably are the sound in+out but, as stated, I haven't figured those out for now. 

Using the hack

Getting this puppy up and running is similar as with the Cyborg volume bar, download the source, run "make" in the "roland-td15" directory and run the roland-td15 binary that's produced  (yes, you need root).


When started without any arguments it will try to connect to the TD-15 and if successful it will spit out the raw MIDI values. You can start it a MIDI device name (e.g. hw:3,0) which will cause it to write the MIDI command directly to that device. There is also and optional 2nd argument "skipOffs" which skips the "off" MIDI commands. To start, simply run the following (don't forget to modify /etc/sudoers!):

sudo /path/to/roland-td15 hw:3,0

So far I've had success with the ALSA Virtual Raw MIDI device:

$ amidi -l
Dir Device Name
IO hw:3,0 Virtual Raw MIDI (16 subdevices)
IO hw:3,1 Virtual Raw MIDI (16 subdevices)
IO hw:3,2 Virtual Raw MIDI (16 subdevices)
IO hw:3,3 Virtual Raw MIDI (16 subdevices)

If it doesn't show any Virtual device try loading the driver:

modprobe snd-virmidi

That's it for now, hopefully I got some more updates soon!

 

Cyborg V.7 volume bar on Linux

While playing with the Cyborg V.7 macro keys I though: how hard can it be to get the volume bar working on the keyboard as well? As it turns out, not too hard.


The big difference is that instead of reading what happens on USB, you'll actually need to write to USB to change the volume bar leds. So I started to play around with LibUSB, grabbed some scripts and monitored what windows did on my USB port when adjusting the volume bar via the "official" driver. 


The end result is a wee piece of C code that sends a signal to the relevant USB device (06a3:0728) and you're done. You can download the code here, untar it, go into the cyborg directory, run make and if all goes well you should have a binary called "cyborgLeds".


Just run this binary as root with a argument 0 to 20 and it'll change the volume bar on your keyboard: 

sudo /path/to/cyborgLeds 20

To run as root, add the following line to /etc/sudoers:

user ALL=NOPASSWD:/path/to/cyborgLeds [0-9]*


BTW, reverse engineering windows drivers actually became a lot easier with virtual machines. Get a windows VM up and running on a Linux box, attach the relevant USB device, start usbmon, use wireshark or just cat the usb device (cat /sys/kernel/debug/usb/usbmon/0u) to monitor what windows and the device are doing to each other.


Cyborg V.7 macro keys on Linux

I bumped into some scripts recently that nicely abuse usbmon to watch actions on USB devices and do stuff with it. And guess what, this works nicely to get the Cyborg V.7 macro keys to work under Linux! 


I wrote a little bash script (cyborgMacros.sh) which monitors all usb traffic for a certain pattern and if found sends out a Control+F1 to Control+F12 mapping to Xorg. Which allows you to map the macro keys in pretty much any application.


Unfortunately in order to actually monitor USB you'll need root access so you're probably best of to sudo the script on login. Just add the following line to /etc/sudoers:

user ALL=NOPASSWD:/path/to/cyborgMacros


Another shortcoming of the script is the fact that it monitors "usb device 0" which basically means all USB traffic is passed through this script (I'm guessing this could have quite a performance hit). This is just because I've been too lazy to add some keyboard detection in it... hopefully I'll get around to fix it sometime. 


Lastly it requires xdotool to be able to send the keyboard events to Xorg. I think it's included in most distro's but if not you might need to grab it yourself. 


Long story short, just start the script as root and off you go!

Cyborg V.7 and R.A.T. 7 on linux

So about a year ago I bought some new kit since my old keyboard and mouse were pretty much in the crapper. I'd been searching online for some cool, yet functional, stuff and ended up buying these little gems:


Both look pretty cool and work like a charm, or at least if you're running windows, install the drivers and dick around a bit. Linux however is, as usual, another story since it's apparently very hard for hardware vendors to write a driver for Linux. Having said that, it's not as bad as it seems, both are in the basics just normal input devices so they're support but with some limitations.


Let's start with the keyboard, obviously the normal keys work, and so do the special audio specific keys. As a matter of fact, because the cool stuff (aka game mode) is handled within the keyboard, this works perfectly as well. And the best feature of all is the fact that game mode disables the "Windows key"!


So what doesn't work then? Well you have 12 additional macro keys (C1 to C12) on the sides of the keyboard. Since Cyborg decided it was fun to require a driver for this, you're pretty much screwed under Linux (tho I did find a solution for this...). Then there is the cute volume bar on the keyboard which unfortunately also requires a driver to actually control this so, again you're fucked under Linux. However for normal usage this keyboard really works just fine under Linux, unless you want the macro keys and the volume bar to work. But again more on this later.


And what about the R.A.T. you ask? Well that works like a charm except for the fact that the (shitload of) extra buttons aren't mapped by default. Which is actually easily resolved by telling Xorg to map them. There's a bunch of instruction floating around on the Internet but obviously I chose to do my own mapping. 


Just open "/etc/X11/xorg.conf" and add the following section and off you go:

Section "InputClass"
   Identifier "R.A.T."
   MatchProduct "Saitek Cyborg R.A.T.7 Mouse"
   MatchDevicePath "/dev/input/event*"
   Option "Buttons" "17"
   Option "ButtonMapping" "1 2 3 4 5 6 7 8 9 10 11 12 0 0 0 16 17"
   Option "AutoReleaseButtons" "8 13 14 15"
   Option "ZAxisMapping" "4 5 10 11"
EndSection


Concluding this is cool stuff and if you're considering buying it, do it! And if you're on Linux and you can live without the specials (for now), it's also definitely worth it.


More to come!

Welcome to JuNe Rules!

Well it's been a while but we're back, although it seems doubtful on what the actual motives are this time. For instance, if BenV's blog is any indication of what's to come then I guess this site won't be for the faint-hearted. Then again that's probably what you're going to get anyway. 


My best guess is that we'll be putting some random picture on here and write some rants on various subjects that annoy the hell out of us. And for some reason some examples popup:


Oh well whatever we may end up bitching about it might be fun and at least it'll get the load of our chests.


XHTML 1.1 valid CSS 3.0 valid JavaScript 1.6 valid Vivaldi valid Os-linux valid Ws-apache valid Php valid Jas valid