Language Selection

English French German Italian Portuguese Spanish

Site Map

Blogs

Community blog and recent blog authors at Tux Machines.

Forum

forums

content

blog

More in Tux Machines

Sunsetting XRandR Brightness

One of the first features I added back then was smooth brightness changes. PowerDevil supports three ways of changing screen brightness: through XRandR configuration, through DDC (display data channel, for desktop monitors, experimental and not built by default), and by writing to sysfs (/sys/class/backlight or /sys/class/leds). Since the latter requires privileges and uses a helper binary through KDE’s KAuth framework, I only implemented the animation for the XRandR code path, which was executed in the same process. Obviously, XRandR doesn’t work on Wayland, and it seems that modern graphics drivers don’t support changing brightness through it anymore either. I recently sat down and wrote a patch to have the helper binary execute a similar animation. KAuth works quite magically by exposing methods defined in an .actions file through DBus and then calling them as slots through Qt’s meta object. Unfortunately, the way it is designed doesn’t allow for delayed replies, which I wanted to use so the job only finished once the animation was completed in order to keep PowerDevil’s state consistent. I then found that KAuth randomly keeps its helper running for 10 seconds, more than enough for a 250ms animation. Read more

Python Programming

  • Reporting Exceptions in Python Scripts with Sentry

    Python scripts are the glue that keep many applications and their infrastructure running, but when one of your scripts throws an exception you may not know about it immediately unless you have a central place to aggregate the errors. That's where adding Sentry can solved this distributed error logging problem. In this tutorial, we'll see how to quickly add Sentry to a new or existing Python script to report errors into a centralized location for further debugging.

  • Luke Plant: Keyword-only arguments in Python

    Keyword-only arguments are a feature that has been around since Python 3.0. But I’ve seen and used them much less use that I could have. They are described in PEP 3102, which is pretty readable, but I think they could benefit from more exposure with examples and rationale.

  • Creating and Modifying PDF Files in Python

    The PDF, or Portable Document Format, is one of the most common formats for sharing documents over the Internet. PDFs can contain text, images, tables, forms, and rich media like videos and animations, all in a single file. This abundance of content types can make working with PDFs difficult. There are a lot of different kinds of data to decode when opening a PDF file! Fortunately, the Python ecosystem has some great packages for reading, manipulating, and creating PDF files.

  • Will McGugan: Rich gets Richer

    Since my last post on Rich there have been a number of improvements. [...] Coverage has reached 97% which is not bad at all. To be honest though it is the use of type annotations throughout which gives me the most confidence.

Linux 5.8 Kernel: Qualcomm Adreno, MacBooks and AMD

  • Qualcomm Adreno 650 + 640 GPUs To Be Supported By Mainline Linux 5.8 Kernel

    The crew working on the MSM DRM driver from Freedreno / Google / Code Aurora (Qualcomm) have an interesting batch of changes for this open-source GPU driver for Qualcomm Adreno hardware come Linux 5.8. New hardware to be supported by this open-source MSM driver in Linux 5.8 include Qualcomm's Adreno 405, 640, and 650 series. The Adreno 405 is an old, low-end part from the 400 series and used by the Snapdragon 415/615/616/617 SoCs. The Adreno 405 support isn't particularly exciting but it's there for those interested along with the relevant MSM8x36 changes to the MDP5 code.

  • Linux 5.8 Picking Up A Quirk For Being Able To Reboot The 2009 MacBook Without Hangs

    With the upcoming Linux 5.8 cycle a quirk is being added to be able to reboot the 2009 era Apple MacBook without needing to boot with any special flags. Up to now the 2009 Apple MacBook (Macbook6,1) required a reboot=pci boot parameter added to the kernel otherwise when rebooting the system there would be a hang. This late 2009 MacBook (MC207LL/A) with Core 2 Duo CPU is very slow by today's standards and hopefully many of you still aren't using it in production, but should you be doing so and running new kernel releases, with Linux 5.8 the kernel can reboot without hanging or needing to manually add the flag.

  • AMD Energy Driver Queued Ahead Of Linux 5.8 For Core/Package Power Sensors

    Landing this weekend in hwmon-next ahead of the upcoming Linux 5.8 kernel cycle is the recently reported on "amd_energy" driver for supporting AMD Zen/Zen2 core and package energy sensors. This is the recently reported on work of a Google engineer allowing AMD Zen CPUs to expose power usage on Linux via the Runtime Average Power Limiting (RAPL) framework. The amd_energy driver is making it to the Linux 5.8 kernel by way of the hardware monitoring "hwmon" subsystem thanks to this Google open-source contribution.

today's howtos