Vftdan Channel
25 subscribers
110 photos
2 videos
9 files
178 links
author: @vft_dan
Download Telegram
Forwarded from Constantine
tion percolala
Photo
Опа, это че
Forwarded from NearestᅠᅠᅠᅠᅠᅠNeighbours
Constantine
Опа, это че
For years have I been struggling with non-functional tooltips (<abbr title>) in mobile browsers.

And I've fixed it with a simple #Stylus global style:

[title]:hover::after {
display: inline;
position: absolute;
background: #ffd4c9;
color: black;
border: 1px solid black;
padding: 1px;
border-radius: 2px;
content: attr(title);
}


#css #html #firefox #mobile
Goodbye, 131-day uptime
😢1
Vftdan Channel
++age;
++age; actually
Forgot that I have a channel or something 💀
4🎉1
Cool channel

https://www.youtube.com/@TodePond/

Chill videos, mostly about a cellular automaton -based falling-sand game, but sometimes about other nerdy stuff.

#links #youtube
2
  if ($request_method = BREW) {
return 418;
}
😁2
How to fix Haskell code full of errors like Couldn't match type ‘f1’ with ‘f’:

Add {-# LANGUAGE ScopedTypeVariables #-}
(and probably {-# LANGUAGE InstanceSigs #-} if the problem is with typeclass instance implementation)
and add the minimal relevant forall for every type declaration.

This should help to find the exact problem source.
xkb to xkm compilation:

In a type block inside the xkb_types section expects shift level on the left-hand-side (as an index) of map entries and on the right-hand-side of level_name entries.

Shift level is an integer. There can be up to 63 shift levels:
#define  XkbMaxShiftLevel  63

(source: /usr/include/X11/extensions/XKB.h line 560)

Shift level inside xkb file is parsed as an integer:
    if (!ExprResolveInteger(arrayNdx, &rtrn, SimpleLookup, (XPointer) lnames))
return ReportTypeBadType(type, "level name", "integer");

(source: https://gitlab.freedesktop.org/xorg/app/xkbcomp/-/blob/master/keytypes.c#L815 )

Integers will most likely (for this exact purpose) be written a value token (ExprValue) of integer type (TypeInt); (source: https://gitlab.freedesktop.org/xorg/app/xkbcomp/-/blob/master/expr.c#L599 )

or as an identifier token (ExprIdent), in this case it's numeric value is looked up with a given function in given object. (source: https://gitlab.freedesktop.org/xorg/app/xkbcomp/-/blob/master/expr.c#L628 )

In the case of shift levels it's a simple lookup (apparently, it's case-insensitive) inside a LookupEntry array named lnames. This array has entries for levels from 1 to 8, and correspond to a string "level" prepended to their decimal representation:
static LookupEntry lnames[] = {
{"level1", 1},

...
    {"level8", 8},
{NULL, 0}
};

(source: https://gitlab.freedesktop.org/xorg/app/xkbcomp/-/blob/master/keytypes.c#L638 )

Instead of a magic number (something like level_name[8] = "Shift Level3+Alt";) xkb files will most likely have identifier names (level_name[Level8] = "Shift Level3+Alt";) (probably for human-readability reasons).
But levels 9–63 don't have corresponding identifiers, so they must be written as numeric literals.



xkb from xkm decompilation:

Just printf's lines for map and level_name entries while adding "Level" to the decimal representation of the shift level numeric value:
                fprintf(file, "        level_name[Level%d]= \"%s\";\n", n + 1,
XkbAtomText(dpy, *name, XkbXKBFile));

(source: https://gitlab.freedesktop.org/xorg/lib/libxkbfile/-/blob/master/src/xkbout.c#L239 )

This creates invalid xkb files, if there are shift levels 9–63 used inside at least one of the key types of the keymap.

--------

My keymap has additional key types, one of them has 16 shift levels.
Apparently, Xorg xserver decompiles the keymap that the user has loaded inside it and recompiles it again and, at least on failures, tries to compile it again (like every second or every key press).
This floods my Xorg log with this message about failed invocation of the compiler:
(EE) Error compiling keymap (server-0) executing '"/usr/bin/xkbcomp" -w 1 "-R/usr/share/X11/xkb" -xkm "-" -em1 "The XKEYBOARD keymap compiler (xkbcomp) reports:" -emp "> " -eml "Errors from xkbcomp are not fatal to the X server" "/var/lib/xkb/server-0.xkm"'
(EE) XKB: Couldn't compile keymap
And my display manager log — with compiler error messages:
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Error: Identifier "Level9" of type int is unknown
> Error: Level specifications in a key type must be integer
> Ignoring malformed level specification
...
> Error:            Identifier "Level16" of type int is unknown
> Error: The key type level name field must be a integer
> Ignoring illegal assignment in PC_LEVEL3_ALT_CONTROL_16LEVELS
Errors from xkbcomp are not fatal to the X server
POSIX shell encourages to write pure functions, because they can be called from subshells.
2🤔1
I'm a calendar, again

Link to post
2
Vftdan Channel
Goodbye, 131-day uptime
And also goodbye 574-day phone uptime. Ran out of charge yesterday evening while working as a hotspot in a meter from me. Apparently, KDE Connect hasn't established connection to notify me that the phone was low.
😢2
Forwarded from 0xFABC0FFEEBADC0DE
My dudes, I might have solved the yesterday vs. today problem. Caution: shameless word coinage incoming!

Introducing: "yestoday" — the last day that technically already passed, but it still doesn't feel like the following day has started (e.g. one hasn't been to bed yet).

Usage example: "I'm afraid I can't complete this task yestoday."
2
Forwarded from Vft Dan 💉💉
And make the clock go from 6:00 to 29:59 every day
👍1