📜 ⬆️ ⬇️

GUI for rfkill on python using Qt

image For the fourth month since I am the owner of the beautiful Lenovo S10-3t netbook with built-in WiMAX. And for just over a month, there is firewood in the Linux kernel for Intel Corporation WiMAX / WiFi Link 6050 Series. Installing firewood and finding how to properly connect from the console is also not a problem. And so you want blackjack and I send beautiful ryushechek and simple control.

Many people probably saw the interface from Yota where you can choose what to use now: WiMAX or Wi-Fi. image Simple and convenient. There are few works on the subject of Linux on this topic. In wicd they say about release 2.0 with support for WiMAX and plug-ins, NetworkMenager lives more actively, even the plug-in should be. And since the last manager didn’t have a friendship with me and I recently finished reading a book on Python, I asked for the answer myself - a bicycle.

So, I present my creation to your court, minimalist, but what I needed is rfkill-qt-gui deciding .

Project structure:

So what to eat.

The library is responsible for fussing with devices via D-Bus, catching all sorts of useful events and notifying their superior ones. You can add there different classes of devices. I was only interested in Killswitch.


Wrapper DeviceManager for device management. Divides the device into three groups of Bluetooth, Wi-Fi, WiMAX, and the rest unidentified. Laid on several devices in the group. But since the whistle from Yota is not set up for me and I cannot receive several WiMAX / Wi-Fi devices, everything works with the first device in the group.


The main program. This creates the system tray icon and its context menu. Only three points. image Also here is implemented the logic for running scripts to initialize the WiMAX network. I was looking for how to manage settings from userspace, but I didn't plan to write my own wicd. Therefore, the scripts and kdesu to run them under the root.

Using it is simple - it starts up and switches what you need. You can disable the launch of scripts ( --no-script ) and enable the simultaneous operation of WiMAX and Wi-Fi ( --all ) parameters. The choice of the WiMAX network is prescribed in the scripts.

I will accept your constructive criticism. Do not kick the icon :) I wanted to combine all three parameters with the one about activity on one.
The thought was vital for 4 months, it was framed for a day. Possible bugs and inaccuracies.

Source files are available here.
Or archive here


qdbusviewer is a simple Q-th browser D-Bus
gimp - graphic editor

Different manuals

HAL 0.5.8 Specification
dbus-python tutorial
Qt 4.5 Doc

Here were found and used pieces of code

stoqlib (D-Bus)
Systray icon
Python: working with the tray icon in PyQt4 ( via abbreviation )
Writing a useful program for KDE4 on python in two hours

Source: https://habr.com/ru/post/105048/

All Articles