dot

vizie's NixOS desktop: Hyprland, CachyOS kernel and gaming tweaks

81 lines2462 bytesNix
1# Standalone build of KDE's xembedsniproxy, which nixpkgs only ships inside
2# plasma-workspace (and so drags in most of Plasma). It bridges legacy XEmbed tray
3# icons (Wine/Proton apps such as Battle.net) to StatusNotifierItem so they show up
4# in Waybar's tray instead of as a stray floating window.
5#
6# Builds just the xembed-sni-proxy directory of the official plasma-workspace
7# tarball with our own CMakeLists.txt. The tarball is pinned to the release the
8# patches were written against.
9{
10 lib,
11 stdenv,
12 fetchurl,
13 cmake,
14 pkg-config,
15 qt6,
16 kdePackages,
17 libx11,
18 libxtst,
19 libxcb,
20 libxcb-util,
21 libxcb-image,
22 libxcb-wm,
23}:
24
25stdenv.mkDerivation (finalAttrs: {
26 pname = "xembedsniproxy";
27 version = "6.7.5";
28
29 src = fetchurl {
30 url = "https://download.kde.org/stable/plasma/${finalAttrs.version}/plasma-workspace-${finalAttrs.version}.tar.xz";
31 sha256 = "94ab21e2243b7876f65c315f1e545081c6437f5bd0a041ca4fb6c2533ae874c9";
32 };
33
34 patches = [
35 # Crop the transparent margin Wine leaves around its icons, so they aren't shown
36 # smaller than the other tray icons.
37 ./trim-icon-margin.patch
38 # Give icons without a window title (Wine again) their window class as ID instead
39 # of a window number that changes every launch, so Waybar's "icons" can match them.
40 ./window-class-id.patch
41 # Translate click positions from Hyprland's monitor layout to Xwayland's, and move
42 # them just outside the bar, so the menu a Wine app opens appears next to the tray
43 # icon rather than offset by the layout difference or overlapping the bar.
44 ./hyprland-layout-coords.patch
45 ];
46
47 postPatch = ''
48 cp ${./CMakeLists.txt} xembed-sni-proxy/CMakeLists.txt
49 '';
50
51 cmakeDir = "../xembed-sni-proxy";
52 cmakeFlags = [ "-DWORKSPACE_VERSION=${finalAttrs.version}" ];
53
54 nativeBuildInputs = [
55 cmake
56 pkg-config
57 qt6.wrapQtAppsHook
58 ];
59
60 buildInputs = [
61 qt6.qtbase
62 kdePackages.kcoreaddons
63 kdePackages.kcrash
64 kdePackages.kdbusaddons
65 kdePackages.kwindowsystem
66 libx11
67 libxtst
68 libxcb
69 libxcb-util
70 libxcb-image
71 libxcb-wm
72 ];
73
74 meta = {
75 description = "Show legacy XEmbed tray icons in StatusNotifierItem trays (standalone build from plasma-workspace)";
76 homepage = "https://invent.kde.org/plasma/plasma-workspace/-/tree/master/xembed-sni-proxy";
77 license = lib.licenses.lgpl21Plus;
78 mainProgram = "xembedsniproxy";
79 platforms = lib.platforms.linux;
80 };
81})