Searching txt.sour.is

Twts matching #1.
Sort by: Newest, Oldest, Most Relevant
In-reply-to » I was drafting support for showing “application icons” in my window manager, i.e. the Firefox icon in the titlebar:

@movq@www.uninformativ.de According to this screenshot, KDE still shows good old application icons: https://upload.wikimedia.org/wikipedia/commons/9/94/KDE_Plasma_5.21_Breeze_Twilight_screenshot.png

And GNOME used to have them, too: https://upload.wikimedia.org/wikipedia/commons/9/9f/Gnome-2-22_%284%29.png

I like the looks of your window manager. That’s using Wayland, right? The only thing on this screenshot to critique is all that wasted space of the windows not making use of the full screen!!!1 At least the file browser. 8-)

This drives me nuts when my workmates share their screens. I really don’t get it how people can work like that. You can’t even read the whole line in the IDE or log viewer with all the expanded side bars. And then there’s 200 pixels on the left and another 300 pixels on the right where the desktop wallpaper shows. Gnaa! There’s the other extreme end when somebody shares their ultra wide screen and I just have a “regularish” 16:10 monitor and don’t see shit, because it’s resized way too tiny to fit my width. Good times. :-D

Sorry for going off on a tangent here. :-) Back to your WM: It has the right mix of being subtle and still similar to motif. Probably close to the older Windowses. My memory doesn’t serve me well, but I think they actually got it fairly good in my opinion. Your purple active window title looks killer. It just fits so well. This brown one (https://www.uninformativ.de/blog/postings/2025-07-22/0/leafpads.png) gives me also classic vibes. Awww. We ran some similar brownish color scheme (don’t recall its name) on Win95 or Win98 for some time on the family computer. I remember other people visting us not liking these colors. :-D

⤋ Read More

Here’s an example of X11/Xlib being old and archaic.

X11 knows the data type “cardinal”. For example, the window property _NET_WM_ICON (which holds image data for icons) is an array of “cardinal”. I am already not really familiar with that word and I’m assuming that it comes from mathematics:

https://en.wikipedia.org/wiki/Cardinal_number

(It could also be a bird, but probably not: https://en.wikipedia.org/wiki/Cardinalidae)

We would probably call this an “integer” today.

EWMH says that icons are arrays of cardinals and that they’re 32-bit numbers:

https://specifications.freedesktop.org/wm-spec/latest-single/#id-1.6.13

So it’s something like 0x11223344 with 0x11 being the alpha channel, 0x22 is red, and so on.

You would assume that, when you retrieve such an array from the X11 server, you’d get an array of uint32_t, right?

Nope.

Xlib is so old, they use char for 8-bit stuff, short int for 16-bit, and long int for 32-bit:

https://x.org/releases/current/doc/libX11/libX11/libX11.html#Obtaining_and_Changing_Window_Properties

That is congruent with the general C data types, so it does make sense:

https://en.wikipedia.org/wiki/C_data_types

Now the funny thing is, on modern x86_64, the type long int is actually 64 bits wide.

The result is that every pixel in a Pixmap, for example, is twice as large in memory as it would need to be. Just because Xlib uses long int, because uint32_t didn’t exist, yet.

And this is something that I wouldn’t know how to fix without breaking clients.

⤋ Read More

@lyse@lyse.isobeef.org They are optional dependencies and listed as such:

$ pacman -Qi pinentry
Name            : pinentry
Version         : 1.3.1-5
Description     : Collection of simple PIN or passphrase entry dialogs which
                  utilize the Assuan protocol
Optional Deps   : gcr: GNOME backend [installed]
                  gtk3: GTK backend [installed]
                  qt5-x11extras: Qt5 backend [installed]
                  kwayland5: Qt5 backend
                  kguiaddons: Qt6 backend
                  kwindowsystem: Qt6 backend

And it’s probably a good thing that they’re optional. I wouldn’t want to have all that installed all the time.

⤋ Read More
In-reply-to » Xfce does one thing very right: It stores its settings in plain-text XML files. This allows me to easily read, track, and maybe even distribute these settings to other machines.

@lyse@lyse.isobeef.org @kat@yarn.girlonthemoon.xyz I spent so much time in the past figuring out if something is a dict or a list in YAML, for example.

What are the types in this example?

items:
- part_no:   A4786
  descrip:   Water Bucket (Filled)
  price:     1.47
  quantity:  4
- part_no:   E1628
  descrip:   High Heeled "Ruby" Slippers
  size:      8
  price:     133.7
  quantity:  1

items is a dict containing … a list of two other dicts? Right?

It is quite hard for me to grasp the structure of YAML docs. 😢

The big advantage of YAML (and JSON and TOML) is that it’s much easier to write code for those formats, than it is with XML. json.loads() and you’re done.

⤋ Read More

Only figured this out yesterday:

pinentry, which is used to safely enter a password on Linux, has several frontends. There’s a GTK one, a Qt one, even an ncurses one, and so on.

GnuPG also uses pinentry. And you can configure your frontend of choice here in gpg-agent.conf.

But what happens when you don’t configure it? What’s the default?

Turns out, pinentry is a shellscript wrapper and it’s not even that long. Here it is in full:

#!/bin/bash

# Run user-defined and site-defined pre-exec hooks.
[[ -r "${XDG_CONFIG_HOME:-$HOME/.config}"/pinentry/preexec ]] && \
        . "${XDG_CONFIG_HOME:-$HOME/.config}"/pinentry/preexec
[[ -r /etc/pinentry/preexec ]] && . /etc/pinentry/preexec

# Guess preferred backend based on environment.
backends=(curses tty)
if [[ -n "$DISPLAY" || -n "$WAYLAND_DISPLAY" ]]; then
        case "$XDG_CURRENT_DESKTOP" in
        KDE|LXQT|LXQt)
                backends=(qt qt5 gnome3 gtk curses tty)
                ;;
        *)
                backends=(gnome3 gtk qt qt5 curses tty)
                ;;
        esac
fi

for backend in "${backends[@]}"
do
        lddout=$(ldd "/usr/bin/pinentry-$backend" 2>/dev/null) || continue
        [[ "$lddout" == *'not found'* ]] && continue
        exec "/usr/bin/pinentry-$backend" "$@"
done

exit 1

Preexec, okay, then some auto-detection to use a toolkit matching your desktop environment …

… and then it invokes ldd? To find out if all the required libraries are installed for the auto-detected frontend?

Oof. I was sitting here wondering why it would use pinentry-gtk on one machine and pinentry-gnome3 on another, when both machines had the exact same configs. Yeah, but different libraries were installed. One machine was missing gcr, which is needed for pinentry-gnome3, so that machine (and that one alone) spawned pinentry-gtk

⤋ Read More
In-reply-to » @arne Au, Zelturlaub klingt klasse! Bei mir ist es auch bald so weit, freu mich schon. Dank der Ausrüstungsüberprüfung im Materiallager haben wir demletzt festgestellt, dass gleich zwei Spinnen (so Metallketten, an denen die Jurtendächer hochgezogen werden) fehlen. Ein Probeaufbau – und sei es nur unter Laborbedingungen – lohnt sich in jedem Fall. Improvisieren zu können ist zwar von Vorteil, aber wenn es sich vermeiden lässt, fängt der Urlaub gleich ein wenig entspannter an. :-)

@lyse@lyse.isobeef.org Ja, eine kleine Inventur vorab kann auch nicht schaden. Der Bestand an Erdankern, Heringen und Gaskartuschen ist durch mich die Tage schon wieder aufgestockt worden.
Wo das Gas bleibt weiß ich. Warum die Befestigungen immer weniger werden, obwohl wir durchzählen (!), ist mir unbekannt. Vielleicht sind wir im Zahlenraum von 1 bis 20 einfach nur noch sehr unsicher. 🤓

⤋ Read More

The WM_CLASS Property is used on X11 to assign rules to certain windows, e.g. “this is a GIMP window, it should appear on workspace number 16.” It consists of two fields, name and class.

Wayland (or rather, the XDG shell protocol – core Wayland knows nothing about this) only has a single field called app_id.

When you run X11 programs under Wayland, you use XWayland, which is baked into most compositors. Then you have to deal with all three fields.

Some compositors map name to app_id, others map class to app_id, and even others directly expose the original name and class.

Apparently, there is no consensus.

⤋ Read More
In-reply-to » This aggressive auto-logout on my bank’s website …

@movq@www.uninformativ.de Yeah, it’s a shitshow. MS overconfirms all my prejudices constantly.

Ignoring e-mail after lunch works great, though. :-)

Our timetracking is offline for over a week because of reasons. The responsible bunglers are falling by the skin of their teeth: https://lyse.isobeef.org/tmp/timetracking.png

  1. The error message neither includes the timeframe nor a link to an announcement article.
  2. The HTML page needs to download JS in order to display the fucking error message.
  3. Proper HTTP status codes are clearly only for big losers.
  4. Despite being down, heaps of resources are still fetched.

I find it really fascinating how one can screw up on so many levels. This is developed inhouse, I’m just so glad that we’re not a software engineering company. Oh wait. How embarrassing.

⤋ Read More

Sem palavras pra descrever esta baixeza de artigo:

https://www.publico.pt/2025/07/04/impar/opiniao/banir-smartphones-escolas-impacto-bemestar-2138957?cx=ultimas_1

  1. é citado um único estudo baseado em testemunhos de alunos (ficam de fora pais e profs), um estudo qualitativo por isso não generalizável. Mm assim, os autores do artigo copiam as conclusões do estudo, e o Público tb parece estar ok com artigos decalcados

  2. os autores do artigo são consultores que dão formação a pais e educadores sobre problemas do digital nas crianças, por isso basear opinião apenas num estudo q os ignora é ainda mais wtf

  3. argumento de q crianças têm acesso a dispositivos fora da escola é parvo - tb têm acesso a tabaco e álcool, por isso tb os devemos permitir na escola? come on

  4. e é muito conveniente clamar pela regulamentação das redes sociais sem especificar a forma (proibir anúncios? introduzir idades mínimas? não sabemos).

No final é o costume, os pais e profs que se desenmerdem, a responsabilidade é deles e não das empresas que criam mecanismos de viciação, claro

#SmartphonesNasEscolas

⤋ Read More

Metas Europeias: “Os países da UE têm de poupar, em média, 1,5% por ano. A poupança de energia deve começar com 1,3% por ano até ao final de 2025”

Portugal: “Consumo de eletricidade em Portugal atingiu máximo histórico no primeiro semestre [de 2025]”

Fontes:

https://www.europarl.europa.eu/topics/pt/article/20221128STO58002/poupar-energia-acao-da-ue-para-reduzir-o-consumo-energetico

https://expresso.pt/economia/economia_energia/2025-07-01-consumo-de-eletricidade-em-portugal-atingiu-maximo-historico-no-primeiro-semestre-5f9ed595

#criseclimática

⤋ Read More

Francisco Ferreira da #ZERO:

“A União Europeia (UE) está a dizer adeus à ambição climática. Esta semana, em contraste com sinais evidentes de um clima em alteração com temperaturas recordes em toda a Europa, a Comissão Europeia apresentou, com meses de atraso, a meta climática para 2040, propondo uma redução de pelo menos 90% das emissões face a 1990. No entanto, esta meta inclui mecanismos de flexibilidade, como créditos de carbono internacionais e compensações intersectoriais, que enfraquecem a ambição necessária num momento crítico de agravamento da crise climática.

Este atraso compromete também as metais europeias para 2035 a aprovar na COP30 no Brasil no final deste ano e enfraquece a liderança global da UE ao sinalizar falta de determinação política. Estas flexibilidades inaceitáveis, pois permitem desresponsabilizar setores emissores e adiar a transição, ignorando recomendações científicas que apontavam para reduções entre 90% e 95% sem tais mecanismos. A proposta surge num contexto político adverso após as eleições europeias de 2024, com um recuo climático generalizado, tendo a Comissão optado por um compromisso frágil para evitar confrontos com governos menos ambiciosos, como os da Polónia e Hungria. Esta é uma oportunidade perdida de promover a liderança climática europeia.”

½

#criseclimática

⤋ Read More

I did a “lecture”/“workshop” about this at work today. 16-bit DOS, real mode. 💾 Pretty cool and the audience (devs and sysadmins) seemed quite interested. 🥳

  • People used the Intel docs to figure out the instruction encodings.
  • Then they wrote a little DOS program that exits with a return code and they used uhex in DOSBox to do that. Yes, we wrote a COM file manually, no Assembler involved. (Many of them had never used DOS before.)
  • DEBUG from FreeDOS was used to single-step through the program, showing what it does.
  • This gets tedious rather quickly, so we switched to SVED from SvarDOS for writing the rest of the program in Assembly language. nasm worked great for us.
  • At the end, we switched to BIOS calls instead of DOS syscalls to demonstrate that the same binary COM file works on another OS. Also a good opportunity to talk about bootloaders a little bit.
  • (I think they even understood the basics of segmentation in the end.)

The 8086 / 16-bit real-mode DOS is a great platform to explain a lot of the fundamentals without having to deal with OS semantics or executable file formats.

Now that was a lot of fun. 🥳 It’s very rare that we do something like this, sadly. I love doing this kind of low-level stuff.

⤋ Read More

Exigimos ao governo de Portugal o mínimo. Que:

  1. Condene a agressão ilegal ao Irão por parte de Israel e dos Estados Unidos da América;

  2. Proíba o uso de infraestruturas e do espaço aéreo português para qualquer tipo de apoio aos ataques;

  3. Aplique sanções ao Estado de Israel pelas suas consecutivas violações do Direito Internacional e pelo genocídio em curso na Palestina;

  4. Reconheça de imediato o Estado da Palestina.

Assina-se aqui: https://actionnetwork.org/forms/parar-a-guerra/

#Portugal #Israel #petição

⤋ Read More

Saw this on Mastodon:

https://racingbunny.com/@mookie/114718466149264471

18 rules of Software Engineering

  1. You will regret complexity when on-call
  2. Stop falling in love with your own code
  3. Everything is a trade-off. There’s no “best” 3. Every line of code you write is a liability 4. Document your decisions and designs
  4. Everyone hates code they didn’t write
  5. Don’t use unnecessary dependencies
  6. Coding standards prevent arguments
  7. Write meaningful commit messages
  8. Don’t ever stop learning new things
  9. Code reviews spread knowledge
  10. Always build for maintainability
  11. Ask for help when you’re stuck
  12. Fix root causes, not symptoms
  13. Software is never completed
  14. Estimates are not promises
  15. Ship early, iterate often
  16. Keep. It. Simple.

Solid list, even though 14 is up for debate in my opinion: Software can be completed. You have a use case / problem, you solve that problem, done. Your software is completed now. There might still be bugs and they should be fixed – but this doesn’t “add” to the program. Don’t use “software is never done” as an excuse to keep adding and adding stuff to your code.

⤋ Read More
In-reply-to » Just discovered how easy it is to recall my last arg in shell and my brain went 🤯 How come I've never learned about this before!? I wonder how many other QOL shortcuts I'm missing on 🥲

@aelaraji@aelaraji.com I use Alt+. all the time, it’s great. 👌

FWIW, another thing I often use is !! to recall the entire previous command line:

$ find -iname '*foo*'
./This is a foo file.txt

$ cat "$(!!)"
cat "$(find -iname '*foo*')"
This is just a test.

Yep!

Or:

$ ls -al subdir
ls: cannot open directory 'subdir': Permission denied

$ sudo !!
sudo ls -al subdir
total 0
drwx------ 2 root root  60 Jun 20 19:39 .
drwx------ 7 jess jess 360 Jun 20 19:39 ..
-rw-r--r-- 1 root root   0 Jun 20 19:39 nothing-to-see

⤋ Read More
In-reply-to » Fuck me sideways, Rust is so hard. Will we ever be friends?

@prologic@twtxt.net I’m trying to call some libc functions (because the Rust stdlib does not have an equivalent for getpeername(), for example, so I don’t have a choice), so I have to do some FFI stuff and deal with raw pointers and all that, which is very gnarly in Rust – because you’re not supposed to do this. Things like that are trivial in C or even Assembler, but I have not yet understood what Rust does under the hood. How and when does it allocate or free memory … is the pointer that I get even still valid by the time I do the libc call? Stuff like that.

I hope that I eventually learn this over time … but I get slapped in the face at every step. It’s very frustrating and I’m always this 🤏 close to giving up (only to try again a year later).

Oh, yeah, yeah, I guess I could “just” use some 3rd party library for this. socket2 gets mentioned a lot in this context. But I don’t want to. I literally need one getpeername() call during the lifetime of my program, I don’t even do the socket(), bind(), listen(), accept() dance, I already have a fully functional file descriptor. Using a library for that is total overkill and I’d rather do it myself. (And look at the version number: 0.5.10. The library is 6 years old but they’re still saying: “Nah, we’re not 1.0 yet, we reserve the right to make breaking changes with every new release.” So many Rust libs are still unstable …)

… and I could go on and on and on … 🤣

⤋ Read More

So I was using this function in Rust:

https://doc.rust-lang.org/std/path/struct.Path.html#method.display

Note the little 1.0.0 in the top right corner, which means that this function has been “stable since Rust version 1.0.0”. We’re at 1.87 now, so we’re good.

Then I compiled my program on OpenBSD with Rust 1.86, i.e. just one version behind, but well ahead of 1.0.0.

The compiler said that I was using an unstable library feature.

Turns out, that function internally uses this:

https://doc.rust-lang.org/std/ffi/struct.OsStr.html#method.display

And that is only available since Rust 1.87.

How was I supposed to know this? 🤨🫩

⤋ Read More

Transcrição:

O resultado das últimas eleições legislativas veio moralizar um sector da população que passou a diabolizar a “esquerda” sem quaisquer tipos de restrições de linguagem, “crucificando” pessoas pelas suas posições humanistas e antifascistas, e vangloriando, abertamente e sem pudor, por exemplo, o antigo regime. Nesse particular, tem-se destacado Gabriel Mithá Ribeiro, deputado do Chega eleito por Leiria que, nas redes sociais e em artigos publicados no Observador, nos tem mostrado ser uma figura controversa e polarizadora, não apenas pelas suas opiniões, mas pela forma como as expressa: provocadoras, desdenhosas e, por vezes, perigosamente revisionistas.

1/n

⤋ Read More

[$] An end to uniprocessor configurations
The Linux kernel famously scales from the smallest of systems to massive
servers with thousands of CPUs. It was not always that way, though; the
initial version of the kernel could only manage a single processor. That
limitation was lifted, obviously, but single-processor machines have always
been treated specially in the scheduler. That longstanding situation may
soon come to an end, though, if this patch\
series from Ingo M … ⌘ Read more

⤋ Read More