Tuesday, February 27, 2018

Falkon 3.0.0 released!

First release of Falkon is finally out!


Falkon is a new KDE web browser, previously known as QupZilla. Following this release, there will only be one last final QupZilla release.

If you were previously using QupZilla, you can manually migrate your profiles to Falkon by moving the config directory (usually in ~/.config/qupzilla/).
There is no automatic migration.

Apart from some under the hood changes, like changing build system from qmake to CMake or using XDG paths, there aren't many differencies from QupZilla.
There is a new extension - Vertical Tabs, but it will also be available later this week in last QupZilla release.

It is possible to write Falkon extensions in Python, but since the bindings are generated using PySide2 which is not yet released and thus not packaged by distributions, it won't be currently available for users.

Windows and macOS support is not yet finished, it will be available later.

Download: falkon-3.0.0.tar.xz (sig signed with EBC3FC294452C6D8)

Friday, April 15, 2016

Audio Volume improvements in Plasma 5.7

Plasma 5.4 introduced plasma-pa (new audio volume applet and KCM) to replace KMix, however it was missing few important features in the initial release. Unfortunately, there was no progress after that.
I myself have been using KMix instead, because changing application volumes from applet is a must have for me. But KMix system tray popup doesn't really integrate nicely into Plasma, so I finally decided to switch to plasma-pa and implement those missing features.

My goal is to achieve feature parity with KMix, so that I and all Plasma users can switch to plasma-pa without missing anything.

What's new?
First and most important thing for me is the ability to change application volumes from applet. That's actually the main thing I expect to be able to do from the applet as I manage volume of my sound card with global shortcuts.
There are now two tabs in applet, one for managing volume of devices and one for applications. Application streams will also display icons for easier navigation.


Another useful feature if you have multiple sound cards is to move streams to different devices. In the first draft it was possible to do so in both applet and KCM, but it was then decided to have this functionality only in KCM to keep the applet simple.
You can now also choose your default device which will be used for applet icon and global shortcuts.


Some laptops have microphone mute button, it will now be possible to assign this button to mute microphone global shortcut. Ideally it should work without any settings (if the button sends XF86AudioMicMute key event) and is the case on my laptop. Global shortcuts for changing microphone volume will also be available.

Microphone volume OSD (icon is not final)

And finally, you will also be able to change volume of notification sounds from KCM. There is a lot of changes that will make the audio management in Plasma better.

What's next?
One thing that users are requesting is volume overdrive - ability to increase volume over 100%. That's something I'd like to eventually have, but I'm not sure if it makes it into the new release.

That's it, I hope you'll like all the new features (and also fixes) that are coming with Plasma 5.7!

Sunday, October 18, 2015

My contribution to Plasma 5.5

In this post, I'd like to quickly present everything I've been working on for the upcoming Plasma 5.5.

Quicklaunch applet is back
One applet I missed the most from KDE4 Plasma times was Quicklaunch applet. I use vertical panel and adding multiple launchers to vertical panel is not really convenient because they are placed bellow each other, and in result occupy a lot of vertical space. That's why I was using Quicklaunch that let's you have (in my case) 4 applets that occupy the same space as one big launcher.

For Plasma 5.5, I have reimplemented the old Quicklaunch in QML. It offers all features that the old applet had, except auto-columns/rows functionality, so you now need to manually specify the number you prefer to have. I had some issues implementing it, so I just decided to remove this functionality. I hope it won't be missed :)

If you can't wait and want to try it right now, you can build it yourself from scratch/drosca/quicklaunch-qml.git. It works with Plasma 5.4 and probably also with older versions.

Quicklaunch in vertical panel and on desktop

New Bluetooth Devices KCM
In Bluedevil, apart from some fixes, I've been working on new Bluetooth Devices KCM. It now shows devices from all Bluetooth adapters, looks better and also is able to setup DUN/PAN network for devices that supports it.

Bluetooth Devices KCM

There are bug reports about Bluedevil not being usable in Plasma 5, not starting automatically etc. on Kubuntu. This is because Kubuntu is still using old BlueZ 4 with very old KDE4 Bluedevil. Fortunately, this will all be fixed in Kubuntu 15.10 that finally switched to BlueZ 5 and is going to be released soon.
This is also a remainder not to report bugs for these old Bluedevil versions. They are no longer maintained, so your bug reports will simply be closed.

Keyboard layouts
I've been also trying to fix some keyboard layouts bugs, including sometimes forgetting the layouts setup in settings. From my investigation, it seems that the main issue is that the code that listens for device hotplug events only works on systems with xcb-xinput (not available in Debian and other distros), so my idea is to use udev when xcb-xinput is not available. It is still in review, but it should be ready in time for Plasma 5.5.

Thursday, March 19, 2015

Bluedevil 2.1.1 released

I am happy to announce a new Bluedevil release.

This is mainly a bugfix release with two minor new features. The first one is a new page in a pairing wizard. Instead of closing the wizard when it finishes, a success page is now shown to the user to indicate device setup was completed.
The other addition is a new warning message in KCM. Instead of "No Bluetooth adapters have been found." you will now see "Your Bluetooth adapter is powered off." when you actually have a Bluetooth adapter, but it is powered off.

This is also a last release of kdelibs4 Bluedevil.

What's next?
Bluedevil is now released as part of Plasma 5.
If everything goes by the plan, there will be bigger changes for Plasma 5.3 release. Bluedevil will use a new BluezQt library instead of libbluedevil. As BluezQt offers a QML API, I have also been working on a new Bluetooth plasmoid. The plasmoid's code is based on a network management plasmoid. It will probably need some new icons, but otherwise I think it looks quite good.

Here are some screenshots:

Expanded device details with action buttons
Connected devices are displayed in own section

Bugs fixed in 2.1.1:
  • don't try to infinitely kill monolithic when it fails #343682
  • fix directly opening files from obexftp (eg. images in gwenview)
  • fix one crash in kded module #342581
  • fix obexftp browse files on old S60 devices #342259

Download:
bluedevil: bluedevil-2.1.1.tar.xz

Tuesday, December 23, 2014

Bluedevil 2.1 released

I am happy to announce that new version of Bluedevil is out!

On 3rd December, I have released Bluedevil 2.0. It was a first stable release that supported Bluez 5 and it contained mainly crash fixes over 2.0-rc1. Unfortunately, there was also a big regression.
Libbluedevil was automatically enabling (power on) all adapters that have been found. However, this behavior was causing issues that even if the user disabled Bluetooth, it was enabled again after reboot. So the libbluedevil was adjusted not to automatically change powered state of any adapters. The problem is that Bluez is not enabling adapters at startup, so as a result, Bluetooth was now always disabled on startup.

In the new 2.1 release, powered state of all adapters is saved and restored in Bluedevil daemon. Another change is that the alias of adapter will be used in every place where name of adapter is displayed. It was always possible to change alias of adapter in KCM, but it wasn't actually used anywhere.

There is also one small improvement in kio_obexftp. It will show icons of storage types in root folder of obexftp filesystem. It should work correctly with Nokia (S40, Symbian) and Android (KitKat, Lollipop) devices. If you find any issue with the icons, please let me know.

Storage icons on Android phone

Bugs fixed in 2.1:
  • remember powered state of all adapters #337193
  • monolithic (Bluetooth icon) will now be correctly hidden in system tray when all adapters are powered off #341768
  • monolithic will now be removed from system tray when there are no adapters
  • action to send files over Bluetooth will now be shown only for file that can actually be sent (only local files)
  • PIN in pairing wizard will now be accepted only after clicking "Matches" button
  • kio_obexftp should now better handle errors and correctly reconnect after losing connection #321560
  • kio_bluetooth will not crash when trying to access invalid device

Download:
bluedevil: bluedevil-2.1.tar.xz
libbluedevil: libbluedevil-2.1.tar.xz

Thursday, May 23, 2013

VA API backend for VDPAU

Video acceleration on Linux

There are multiple hardware video acceleration API's available in Linux world. VDPAU by NVIDIA is the most popular (at least by the number of projects using it). VDPAU is available on all modern NVIDIA graphics with proprietary blob driver. Intel has developed its own VA API. Currently, VDPAU is available on NVIDIA and some AMD graphics, while VA API on Intel.

The great thing about those two is that they are not hardware bound and can support multiple drivers. For a long time, there have been a VDPAU backend for VA API. But only recently, the same have been implemented in opposite direction.

VA API in applications

VA API is available in number of video applications (VLC, XBMC, MythTV, GStreamer-vaapi, mplayer-vaapi, ...), but its concrete usage in some of them is far from ideal.
Enabling hw acceleration in VLC leads to even more CPU usage than with mplayer with software video decoding.
mplayer-vaapi is not officially part of mplayer and also have its pitfalls. It cannot scale ssa/ass subtitles with video, subtitles are "embedded" in video, leaving them in the same resolution as video (this means ugly subtitles for SD videos). It isn't also available for mplayer2, which contains some improvements over mplayer.

Video acceleration in Flash

Situation in Adobe's Flash is very simple. Only VDPAU is, and ever be supported. There is only one solution, actually use VDPAU even on Intel cards.

libvdpau-va-gl

This quite new project finally provides VA API backend for VDPAU. I have discovered it only recently, but so far everything works just fine.
You may find it in your distribution's repository (eg. Arch users). If you don't, follow this simple howto.

Building from source

The code is available on github (i-rinat/libvdpau-va-gl), so let's clone the repo first:
git clone git://github.com/i-rinat/libvdpau-va-gl.git
Now install build dependencies (command is for Debian based distributions):
sudo apt-get install libvdpau-dev libva-dev libglib2.0-dev libswscale-dev libgl1-mesa-dev libglu1-mesa-dev
And start compiling:
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/  ..
make
sudo make install
You can of course skip make install and create a package instead.

Post-build configuration

You now have the library installed, let's use it! You need to specify which VDPAU backend should be used, it is done with VDPAU_DRIVER variable.
Put this into your .profile (or .zprofile if you are using zsh :)
export VDPAU_DRIVER=va_gl
There are also some tweaks for this backend, but you can find it in the README file at git (and they are not needed for Intel cards).

Configure applications

I myself am using mplayer as my preferred media player.
mplayer -vo vdpau -vc ffh264vdpau,ffmpeg12vdpau,ffvc1vdpau, ...
# That comma at the end of -vc list is important. It tells mplayer to fallback 
# to other video codecs if those cannot play the video

# Those are all codecs that VA API supports, however your card may 
# not support them all. Tune the list according to output of `vainfo`
And also a little tweak to force Flash to accelerate video decoding:
echo "echo EnableLinuxHWVideoDecode=1 > /etc/adobe/mms.cfg" | sudo sh
# Little trick to run the whole command as root ;)
You should now see "accelerated video rendering, accelerated video decoding" after right click -> show video info on a video at YouTube.

Accelerated YouTube Flash video on Sandy Bridge HD 3000

Saturday, February 16, 2013

Useful Git commands

In this post, I want to show some very useful Git commands for everyday use.

Show diff of single commit

git diff ^<commit>

git diff ^HEAD # Show diff of last commit

Generate git patch from single commit

git format-patch -1 <commit>

git format-patch -1 HEAD # Generate patch from last commit

Show history of a file

git log -p -- path/to/file

Commit as a different author

git commit --author <e-mail>

Edit last commit (not yet pushed)

git commit --amend

Remove last commit (not yet pushed)

Very useful for cases when someone pushed and you commited and didn't pull.
git reset --soft HEAD~1 # HEAD~2 for 2 commits, etc

Stash only some files

To stash files not staged for commit, as seen in picture:
git stash --keep-index

Delete untracked files

git clean -f

Monday, September 3, 2012

Qt: How to install Oxygen theme without KDE

In this quick post I'll show you an easy way how to install Oxygen them without need to install a lot of unnecessary KDE libraries.

If you are using GTK-based desktop environment (eg. XFCE, Gnome, Unity, ...) and are using some Qt applications, you may want to see how this Qt application looks in "native" widget style. Or you are just developing Qt applications and need to test its appereance in KDE's default style = Oxygen.

I am using Debian, so this how to will be focused on it, but you may use it with little changes for other distrubition too.

Download kde-style-oxygen package

First, you need to just download package with oxygen style. For Debian, please use this link.

Check its dependencies

If you try to install this package, apt-get will ask you to install a lot of KDE packages that you don't actually need. So instead of installing it, just unpack it.
Now you can check which libraries are missing on your system, just run ldd on every library from the package.

Install dependencies

For me, it was libkdecore5, libkdeui5 and libkio5. I just installed the first two with apt-get without any big issues, however, the libkio5 tried to install a lot of packages.

So I just repeated the same steps as for oxygen package: downloaded it from debian.packages.org and checked the dependencies.
It turned out that I need to install libnepomuk4, libstreamanalyzer0 and libsolid4. And that was it, I had now all I need to run oxygen theme.

Create new package

I created new package that contains oxygen and libkio and also creates symlink in /usr/lib/qt4/ so you can use oxygen in all Qt apps.

If you are interested, you can download it here (amd64).

Friday, August 24, 2012

Linux on X220: Getting microphone mute button to work

As I promised in last blog post, I am going to write about my experiences using Debian on Lenovo Thinkpad X220 laptop.
This post is not exclusively for X220, it should work on all Thinkpads with microphone mute key.

Thinkpad laptops are known for very good support in Linux, so there is only few things that doesn't work out of the box (if you are using recent enough kernel). In today's post, I'll try to show you how to get microphone mute button (next to volume up/down buttons) to work including its LED.

Microphone mute button is by default mapped to Linux keycode that is out of range. This means you probably won't get any output from xev command when pressing this button.
If you are lucky enough, you will get an ACPI event with acpi_listen and then you can follow this how-to (askubuntu.com).

If you don't get any output neither from xev nor from acpi_listen as me, please follow these steps:

Change udev keymaps for your keyboard:

We will modify udev rules:
mkdir /etc/udev/keymaps
cp /lib/udev/keymaps/module-lenovo /etc/udev/keymaps
Now edit this newly created file and change key name at 0x1A line from micmute to prog2:
0x17 prog1 # ThinkPad/ThinkVantage button (high keycode: "vendor")
0x1A prog2 # Microphone mute
You may also change 0x13 zoom to search if you want to use Fn + Space shortcut. Now you need to reload udev rules, try:
udevadm control --reload-rules
You should now see XF86Launch2 key press in xev. If it doesn't work, just reboot.
You can now assign a keyboard shortcut to this key.

Getting LED to work

Recompile kernel

Unfortunately, you'll need to recompile a kernel to light up this diod. I won't show you how to compile a kernel, please search it somewhere else. You need to enable controlling of unsafe LEDs.
Device Drivers  --->
 [*] X86 Platform Specific Device Drivers  --->
   <M>  ThinkPad ACPI Laptop Extras
        [ ]   Maintainer debug facilities
        [ ]   Verbose debug mode
        [*]   Allow control of important LEDs (unsafe)
        [*]   Video output control support
        [*]   Support NVRAM polling for hot keys

CONFIG_THINKPAD_ACPI_UNSAFE_LEDS=y
After recompiling your kernel you are ready to light up the LED.

Writing script for turning the LED on/off

Lets write a script that will turn it on/off according to first argument and save it as led-micmute.sh:
#!/bin/bash
#
# led-micmute.sh [on|off]
#
if [ "$1" = "on" ]; then 
    echo "Turning on...";
    echo "14 on" > /proc/acpi/ibm/led
elif [ "$1" = "off" ]; then
    echo "Turning off...";
    echo "14 off" > /proc/acpi/ibm/led
else
    echo "Invalid option!"
fi;
However, there is one little issue: you need to run it as a root. It does not really fit our needs to use it from script that will run with user privileges. You can edit sudoers file so you will be able to run a script with sudo without typing password.
Note: I don't know how secure it is, but it works. So please think before copying next lines :-)

Create new file eg. /etc/sudoers.d/tp-scripts with following contents:
# needed to turn on micmute led
your_user_name ALL=NOPASSWD: /full/path/to/led-micmute.sh
You should now run sudo led-micmute.sh without need to type a password.

Create a script for muting microphone

And finally, we will create a script that will mute/unmute microphone.
#!/bin/bash
status=$( amixer sget Capture | grep '\[on\]' )

if [ "$status" = "" ]; then 
    echo "Turning on...";
    amixer sset Capture cap
    notify-send -i microphone-sensitivity-high-symbolic "Microphone" "Microphone is now <b>ON</b>";
    sudo /path/to/led-micmute.sh off
else
    echo "Turning off...";
    amixer sset Capture nocap
    notify-send -i microphone-sensitivity-muted-symbolic "Microphone" "Microphone is now <b>MUTED</b>";
    sudo /path/to/led-micmute.sh on
fi;
There is only one thing left how you can improve this script. If you press microphone mute key repeatedly, you will get multiple notifications on screen informing you about microphone state.
To use single notification that will be updated, please take a look at my notify-desktop app.


Wednesday, August 22, 2012

Sending desktop notifications from scripts

Every now and then, you may find a need for sending a notification from your script.
Recently I wrote some scripts for my Thinkpad X220 (which I am going to write about too) and I needed to show notification about microphone state (enabled/disabled).

Almost every linux DE has its own notification daemon that shows notifications over DBus using org.freedesktop.Notifications (spec).

Without knowing how it works, you can use notify-send command from libnotify-bin package. Its usage is pretty straightforward:
notify-send -i "icon-file/name" -a "application_name" "Summary" "Body of message"
For almost all cases, it can serve very well. However, there is one thing that notify-send doesn't support whilst DBus specification does. 
replaces_id UINT32 The optional notification ID that this notification replaces. The server must atomically (ie with no flicker or other visual cues) replace the given notification with this one. This allows clients to effectively modify the notification while it's active.
Without it, if you call your script more than once in a short period, you'll end up with a lot of notifications on your screen. It doesn't look very good.

That means notify-send is not good enough for my needs. Little searching on google reveals that dbus-send command can be used for sending any DBus call directly. Another searching got me to ubuntuforums where one user wrote an example usage of dbus-send for sending notifications.

However, it doesn't work: dbus-send does not supports sending a{sv} type. It is DICT containing string:variant pairs.
org.freedesktop.Notifications.Notify has susssasa{sv}i signature and dbus-send can only support susssasa{ss}i.

So dbus-send wasn't an answer too. I saw a patch for notify-send on launchpad that adds support for replaces_id, but instead of using it, I decided to write my own clone of notify-send.
I could have written it using a higher-level bindings (eg. in Qt), but I wanted it to be as small as possible without unnecessary external dependencies.

notify-desktop

Because of the requirement to make it as small as possible, language of the choice was C. It makes it possible to use direct DBus API without any additional layer.

I tried to retain arguments compatibility between notify-send and notify-desktop. The only thing that notify-desktop doesn't support is option to pass additional hints. I never used it and also don't find it useful, so I didn't bother implementing it.

The main difference is of course slightly different name and -r / --replaces-id=ID option. It does exactly what it says.

You can find it at github. Build instructions are in README.
There are also example bash functions to use in your scripts (look at doc/ directory)