Compare commits
No commits in common. "006e6e8302e8ec18dab2c519ecd55e6fd54e91e8" and "be20e34b0e654e39a0a4fad62aa501a209a40dba" have entirely different histories.
006e6e8302
...
be20e34b0e
|
|
@ -3,7 +3,6 @@ import app from "ags/gtk4/app";
|
||||||
import { createBinding, createState, For, With, Accessor } from "ags";
|
import { createBinding, createState, For, With, Accessor } from "ags";
|
||||||
import { createPoll } from "ags/time";
|
import { createPoll } from "ags/time";
|
||||||
import { subprocess, execAsync } from "ags/process";
|
import { subprocess, execAsync } from "ags/process";
|
||||||
import Pango from "gi://Pango";
|
|
||||||
import Tray from "gi://AstalTray";
|
import Tray from "gi://AstalTray";
|
||||||
import { getIconName } from "./utils";
|
import { getIconName } from "./utils";
|
||||||
import Wp from "gi://AstalWp";
|
import Wp from "gi://AstalWp";
|
||||||
|
|
@ -296,24 +295,8 @@ function Workspaces({ connector }: { connector: string }): JSX.Element {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const MAX_TOTAL_CHARS = 120;
|
function shorten(title: string) {
|
||||||
const MIN_TITLE_CHARS = 10;
|
return title.length > 40 ? title.slice(0, 20) + "..." : title;
|
||||||
const OVERHEAD_PER_WINDOW = 5; // icon + padding + margin in character-width equivalents
|
|
||||||
|
|
||||||
function computeTitleBudgets(wins: any[]): any[] {
|
|
||||||
const totalLength = wins.reduce((sum, w) => sum + (w.title || "").length, 0);
|
|
||||||
const count = wins.length;
|
|
||||||
const totalWithOverhead = totalLength + count * OVERHEAD_PER_WINDOW;
|
|
||||||
|
|
||||||
let maxChars: number;
|
|
||||||
if (count === 0 || totalWithOverhead <= MAX_TOTAL_CHARS) {
|
|
||||||
maxChars = -1;
|
|
||||||
} else {
|
|
||||||
const charsAvailable = MAX_TOTAL_CHARS - count * OVERHEAD_PER_WINDOW;
|
|
||||||
maxChars = Math.max(MIN_TITLE_CHARS, Math.floor(charsAvailable / count));
|
|
||||||
}
|
|
||||||
|
|
||||||
return wins.map(w => ({ ...w, maxChars }));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Clients({ connector }: { connector: string }): JSX.Element {
|
function Clients({ connector }: { connector: string }): JSX.Element {
|
||||||
|
|
@ -328,7 +311,6 @@ function Clients({ connector }: { connector: string }): JSX.Element {
|
||||||
<box>
|
<box>
|
||||||
{/* Generate a derived binding for windows, depending on the active workspace */}
|
{/* Generate a derived binding for windows, depending on the active workspace */}
|
||||||
<For each={windows((wins: any[]) =>
|
<For each={windows((wins: any[]) =>
|
||||||
computeTitleBudgets(
|
|
||||||
wins.filter((w: any) => !w.title?.includes("rofi"))
|
wins.filter((w: any) => !w.title?.includes("rofi"))
|
||||||
.filter((w: any) => w.workspace_id === active_ws_for_monitor)
|
.filter((w: any) => w.workspace_id === active_ws_for_monitor)
|
||||||
.sort((a: any, b: any) => {
|
.sort((a: any, b: any) => {
|
||||||
|
|
@ -336,16 +318,11 @@ function Clients({ connector }: { connector: string }): JSX.Element {
|
||||||
const posB = b.layout?.pos_in_scrolling_layout?.[0] ?? 0;
|
const posB = b.layout?.pos_in_scrolling_layout?.[0] ?? 0;
|
||||||
return posA - posB;
|
return posA - posB;
|
||||||
})
|
})
|
||||||
)
|
|
||||||
)}>
|
)}>
|
||||||
{(win: any) => (
|
{(win: any) => (
|
||||||
<box class={win.is_focused ? "focused" : "unfocused"}>
|
<box class={win.is_focused ? "focused" : "unfocused"}>
|
||||||
<image iconName={getIconName(win.app_id, win.title)} class="app-icon" />
|
<image iconName={getIconName(win.app_id, win.title)} class="app-icon" />
|
||||||
<label
|
<label label={shorten(win.title || "")} />
|
||||||
label={win.title || ""}
|
|
||||||
maxWidthChars={win.maxChars}
|
|
||||||
ellipsize={Pango.EllipsizeMode.END}
|
|
||||||
/>
|
|
||||||
</box>
|
</box>
|
||||||
)}
|
)}
|
||||||
</For>
|
</For>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{pkgs, config, ...}: let
|
{pkgs, ...}: let
|
||||||
lock-false = {
|
lock-false = {
|
||||||
Value = false;
|
Value = false;
|
||||||
Status = "locked";
|
Status = "locked";
|
||||||
|
|
@ -6,7 +6,6 @@
|
||||||
in {
|
in {
|
||||||
programs.firefox = {
|
programs.firefox = {
|
||||||
enable = true;
|
enable = true;
|
||||||
configPath = "${config.xdg.configHome}/mozilla/firefox";
|
|
||||||
package = pkgs.wrapFirefox pkgs.firefox-unwrapped {
|
package = pkgs.wrapFirefox pkgs.firefox-unwrapped {
|
||||||
pkcs11Modules = [
|
pkcs11Modules = [
|
||||||
pkgs.eid-mw
|
pkgs.eid-mw
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,9 @@
|
||||||
pname = "Helium";
|
pname = "Helium";
|
||||||
version = "0.4.7.1";
|
version = "0.4.7.1";
|
||||||
src = pkgs.fetchurl {
|
src = pkgs.fetchurl {
|
||||||
url = "https://github.com/imputnet/helium-linux/releases/download/0.11.7.1/helium-0.11.7.1-x86_64.AppImage";
|
url = "https://github.com/imputnet/helium-linux/releases/download/0.9.4.1/helium-0.9.4.1-x86_64.AppImage";
|
||||||
sha256 = "sha256-qzc135IP5F2btxtOMUGMz+0azJhYL9KI0lcPG2KjcxU=";
|
sha256 = "sha256-N5gdWuxOrIudJx/4nYo4/SKSxakpTFvL4zzByv6Cnug=";
|
||||||
};
|
};
|
||||||
extraPkgs = pkgs: [pkgs.tzdata];
|
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
xdg.desktopEntries = {
|
xdg.desktopEntries = {
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ end
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
'saghen/blink.compat',
|
'saghen/blink.compat',
|
||||||
branch = 'v1',
|
version = '*',
|
||||||
lazy = true,
|
lazy = true,
|
||||||
opts = {},
|
opts = {},
|
||||||
},
|
},
|
||||||
|
|
@ -22,8 +22,8 @@ return {
|
||||||
},
|
},
|
||||||
build = 'nix run --extra-experimental-features flakes --extra-experimental-features nix-command .#build-plugin',
|
build = 'nix run --extra-experimental-features flakes --extra-experimental-features nix-command .#build-plugin',
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader>n", function() vim.diagnostic.jump({ count = 1 }) end },
|
{ "<leader>n", vim.diagnostic.goto_next },
|
||||||
{ "<leader>p", function() vim.diagnostic.jump({ count = -1 }) end },
|
{ "<leader>p", vim.diagnostic.goto_prev },
|
||||||
{ "<leader>f", vim.lsp.buf.code_action },
|
{ "<leader>f", vim.lsp.buf.code_action },
|
||||||
{ "gd", vim.lsp.buf.definition },
|
{ "gd", vim.lsp.buf.definition },
|
||||||
{ "gi", vim.lsp.buf.implementation },
|
{ "gi", vim.lsp.buf.implementation },
|
||||||
|
|
|
||||||
|
|
@ -56,8 +56,7 @@
|
||||||
nixpkgs.config.packageOverrides = pkgs: {
|
nixpkgs.config.packageOverrides = pkgs: {
|
||||||
zfs = pkgs.zfs_unstable;
|
zfs = pkgs.zfs_unstable;
|
||||||
};
|
};
|
||||||
boot.kernelPackages = pkgs.linuxPackages;
|
boot.kernelPackages = pkgs.linuxPackages_6_19;
|
||||||
boot.zfs.forceImportRoot = false;
|
|
||||||
hardware.firmware = with pkgs; [
|
hardware.firmware = with pkgs; [
|
||||||
ipu6-camera-bins
|
ipu6-camera-bins
|
||||||
ivsc-firmware
|
ivsc-firmware
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue