Compare commits
2 Commits
cce3c78ae5
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
e79146364c
|
|||
|
a93ff98461
|
@@ -80,13 +80,19 @@
|
|||||||
{
|
{
|
||||||
xdg.configFile."hypr/hyprland-local.lua" = {
|
xdg.configFile."hypr/hyprland-local.lua" = {
|
||||||
text = ''
|
text = ''
|
||||||
exec-once = hyprctl dispatch workspace 2 # shit solution to get quickshell on the right monitor
|
-- Host overrides (desktop): pin workspaces to monitors.
|
||||||
workspace = name:2, monitor:DP-2
|
-- HDMI-A-1 (left) shows workspace 1, DP-2 (right) shows workspace 2.
|
||||||
input {
|
hl.workspace_rule({ workspace = "name:1", monitor = "HDMI-A-1" })
|
||||||
kb_layout = "gb"
|
hl.workspace_rule({ workspace = "name:2", monitor = "DP-2" })
|
||||||
follow_mouse = 2
|
|
||||||
sensitivity = -0.5
|
-- Autostart (workspace placement applies only to these spawned windows)
|
||||||
}
|
hl.on("hyprland.start", function()
|
||||||
|
hl.exec_cmd("steam", { workspace = "6 silent" })
|
||||||
|
hl.exec_cmd("telegram-desktop", { workspace = "8 silent" })
|
||||||
|
hl.exec_cmd("equibop", { workspace = "8 silent" })
|
||||||
|
hl.exec_cmd("spotify", { workspace = "9 silent" })
|
||||||
|
hl.exec_cmd("obs", { workspace = "10 silent" })
|
||||||
|
end)
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
|
|||||||
@@ -39,16 +39,10 @@
|
|||||||
{
|
{
|
||||||
xdg.configFile."hypr/hyprland-local.lua" = {
|
xdg.configFile."hypr/hyprland-local.lua" = {
|
||||||
text = ''
|
text = ''
|
||||||
decoration {
|
-- Host overrides (laptop)
|
||||||
blur {
|
hl.config({ ["decoration.blur.enabled"] = false })
|
||||||
enabled = false
|
hl.config({ ["input.sensitivity"] = 0 })
|
||||||
}
|
hl.device({ name = "default", sensitivity = 0 })
|
||||||
}
|
|
||||||
input {
|
|
||||||
kb_layout = "gb"
|
|
||||||
follow_mouse = 2
|
|
||||||
sensitivity = 0
|
|
||||||
}
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
|
|||||||
@@ -0,0 +1,61 @@
|
|||||||
|
/**
|
||||||
|
* Model cost display extension - shows cost info in status bar.
|
||||||
|
*
|
||||||
|
* Format: "$X.XX (Y.YY) in" where Y.YY is cache write cost if present.
|
||||||
|
*
|
||||||
|
* Usage: pi -e ./model-cost.ts
|
||||||
|
*/
|
||||||
|
|
||||||
|
import type {
|
||||||
|
ExtensionAPI,
|
||||||
|
ModelSelectEvent,
|
||||||
|
UIContext,
|
||||||
|
} from "@earendil-works/pi-coding-agent";
|
||||||
|
|
||||||
|
export default function (pi: ExtensionAPI) {
|
||||||
|
const modelSelectHandler = async (
|
||||||
|
event: ModelSelectEvent,
|
||||||
|
ctx: UIContext,
|
||||||
|
) => {
|
||||||
|
const { model } = event;
|
||||||
|
|
||||||
|
// Get cost data from model config
|
||||||
|
const cost = getModelCost(model);
|
||||||
|
|
||||||
|
if (cost) {
|
||||||
|
ctx.ui.setStatus("model", cost);
|
||||||
|
} else {
|
||||||
|
ctx.ui.setStatus("model", "");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
pi.on("model_select", modelSelectHandler);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getModelCost(model: any): string {
|
||||||
|
if (!model?.cost) return "";
|
||||||
|
|
||||||
|
const { input, output, cacheRead, cacheWrite } = model.cost;
|
||||||
|
|
||||||
|
// Only show if there's actual cost data
|
||||||
|
const hasCost =
|
||||||
|
input !== 0 || output !== 0 || cacheRead !== 0 || cacheWrite !== 0;
|
||||||
|
if (!hasCost) return "";
|
||||||
|
|
||||||
|
// Format: "$X.XX (Y.YY) in"
|
||||||
|
const parts: string[] = [];
|
||||||
|
|
||||||
|
if (input !== 0) {
|
||||||
|
const cachePrefix = cacheRead > 0 ? ` (↙${cacheRead}) ` : "";
|
||||||
|
parts.push(`$${input}${cachePrefix}in`);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (output !== 0) {
|
||||||
|
const cachePrefix = cacheWrite > 0 ? ` (↗${cacheWrite}) ` : "";
|
||||||
|
parts.push(`$${output}${cachePrefix}out`);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (parts.length === 0) return "";
|
||||||
|
|
||||||
|
return parts.join(" / ");
|
||||||
|
}
|
||||||
@@ -56,7 +56,7 @@
|
|||||||
# "npm:@vanillagreen/pi-qol"
|
# "npm:@vanillagreen/pi-qol"
|
||||||
"npm:pi-vitals"
|
"npm:pi-vitals"
|
||||||
"npm:pi-spark"
|
"npm:pi-spark"
|
||||||
"npm:pi-caveman"
|
# "npm:pi-caveman"
|
||||||
"npm:@tmustier/pi-usage-extension"
|
"npm:@tmustier/pi-usage-extension"
|
||||||
"npm:@heyhuynhgiabuu/pi-pretty"
|
"npm:@heyhuynhgiabuu/pi-pretty"
|
||||||
"npm:pi-lens"
|
"npm:pi-lens"
|
||||||
@@ -64,6 +64,8 @@
|
|||||||
# "npm:@rohaquinlop/pi-deepseek-cache"
|
# "npm:@rohaquinlop/pi-deepseek-cache"
|
||||||
"npm:pi-cache-optimizer"
|
"npm:pi-cache-optimizer"
|
||||||
"npm:pi-opencode-go-cache"
|
"npm:pi-opencode-go-cache"
|
||||||
|
"npm:@pi-vault/pi-dcp"
|
||||||
|
"git:github.com/DietrichGebert/ponytail"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
context = ''
|
context = ''
|
||||||
@@ -108,6 +110,7 @@
|
|||||||
rightSegments = [
|
rightSegments = [
|
||||||
"separator"
|
"separator"
|
||||||
"cost"
|
"cost"
|
||||||
|
"model_cost"
|
||||||
"context_pct"
|
"context_pct"
|
||||||
];
|
];
|
||||||
icons = {
|
icons = {
|
||||||
@@ -124,6 +127,7 @@
|
|||||||
cacheWrite = "↗";
|
cacheWrite = "↗";
|
||||||
contextPct = "◫";
|
contextPct = "◫";
|
||||||
cost = "$";
|
cost = "$";
|
||||||
|
modelCost = "(in/out)";
|
||||||
separator = "│";
|
separator = "│";
|
||||||
};
|
};
|
||||||
colors = {
|
colors = {
|
||||||
@@ -138,6 +142,7 @@
|
|||||||
contextWarn = "warning";
|
contextWarn = "warning";
|
||||||
contextError = "error";
|
contextError = "error";
|
||||||
cost = "text";
|
cost = "text";
|
||||||
|
modelCost = "text";
|
||||||
tokens = "muted";
|
tokens = "muted";
|
||||||
separator = "dim";
|
separator = "dim";
|
||||||
};
|
};
|
||||||
@@ -189,6 +194,11 @@
|
|||||||
source = ./model-filter.ts;
|
source = ./model-filter.ts;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Show model cost in status bar
|
||||||
|
home.file.".pi/agent/extensions/model-cost.ts" = {
|
||||||
|
source = ./model-cost.ts;
|
||||||
|
};
|
||||||
|
|
||||||
# Model filter config: per-provider filters applied by model-filter.ts
|
# Model filter config: per-provider filters applied by model-filter.ts
|
||||||
home.file.".pi/agent/model-filters.json" = {
|
home.file.".pi/agent/model-filters.json" = {
|
||||||
text = builtins.toJSON {
|
text = builtins.toJSON {
|
||||||
|
|||||||
@@ -54,10 +54,14 @@
|
|||||||
xdg.configFile."net.imput.helium/WidevineCdm/latest-component-updated-widevine-cdm" = {
|
xdg.configFile."net.imput.helium/WidevineCdm/latest-component-updated-widevine-cdm" = {
|
||||||
text = ''{"Path":"${pkgs.widevine-cdm}/share/google/chrome/WidevineCdm"}'';
|
text = ''{"Path":"${pkgs.widevine-cdm}/share/google/chrome/WidevineCdm"}'';
|
||||||
};
|
};
|
||||||
wayland.windowManager.hyprland.settings = lib.mkIf settings.default {
|
wayland.windowManager.hyprland.extraLuaFiles = lib.mkIf settings.default {
|
||||||
binds = [
|
"helium-bind.lua" = {
|
||||||
"$mainMod, E, exec, helium"
|
autoLoad = true;
|
||||||
];
|
content = ''
|
||||||
|
-- Helium launcher bind (lua config: settings.bind cannot express dispatchers)
|
||||||
|
hl.bind("SUPER + E", hl.dsp.exec_cmd("helium"))
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -173,24 +173,21 @@
|
|||||||
"-- Window rules"
|
"-- Window rules"
|
||||||
"hl.window_rule({ suppress_event = \"maximize\" })"
|
"hl.window_rule({ suppress_event = \"maximize\" })"
|
||||||
"hl.window_rule({ match = { class = \"gamescope\" }, workspace = \"5\", immediate = true, confine_pointer = true })"
|
"hl.window_rule({ match = { class = \"gamescope\" }, workspace = \"5\", immediate = true, confine_pointer = true })"
|
||||||
"hl.window_rule({ match = { class = \"steam\" }, workspace = \"6 silent\" })"
|
|
||||||
"hl.window_rule({ match = { class = \"vesktop\" }, workspace = \"8 silent\" })"
|
|
||||||
"hl.window_rule({ match = { class = \"org.telegram.desktop\" }, workspace = \"8 silent\" })"
|
|
||||||
"hl.window_rule({ match = { class = \"com.obsproject.Studio\" }, workspace = \"10 silent\" })"
|
|
||||||
"hl.window_rule({ match = { initial_title = \"OBS Studio Crash Detected\" }, pin = true })"
|
"hl.window_rule({ match = { initial_title = \"OBS Studio Crash Detected\" }, pin = true })"
|
||||||
"hl.window_rule({ match = { initial_title = \"Discord Popout\" }, workspace = \"1 silent\" })"
|
"hl.window_rule({ match = { initial_title = \"Discord Popout\" }, workspace = \"1 silent\" })"
|
||||||
""
|
""
|
||||||
"-- Layer rules"
|
"-- Layer rules"
|
||||||
"hl.layer_rule({ match = { namespace = \"notifications\" }, no_screen_share = true })"
|
"hl.layer_rule({ match = { namespace = \"notifications\" }, no_screen_share = true })"
|
||||||
""
|
""
|
||||||
"-- Host-specific overrides"
|
"-- Host-specific overrides: load ~/.config/hypr/hyprland-local.lua if present (must be valid Lua)"
|
||||||
"local home = os.getenv(\"HOME\")"
|
"local home = os.getenv(\"HOME\")"
|
||||||
"if home then"
|
"if home then"
|
||||||
" local f = io.open(home .. '/.config/hypr/hyprland-local.lua', 'r')"
|
" local localPath = home .. '/.config/hypr/hyprland-local.lua'"
|
||||||
|
" local f = io.open(localPath, 'r')"
|
||||||
" if f then"
|
" if f then"
|
||||||
" _ = f:close()"
|
" f:close()"
|
||||||
" local config = loadfile(home .. '/.config/hypr/hyprland-local.lua')"
|
" local chunk, err = loadfile(localPath)"
|
||||||
" if config then config() end"
|
" if chunk then chunk() else io.stderr:write('hyprland-local.lua error: ' .. err .. '\\n') end"
|
||||||
" end"
|
" end"
|
||||||
"end"
|
"end"
|
||||||
]
|
]
|
||||||
@@ -232,8 +229,13 @@
|
|||||||
# partOf = [ "hyprland-session.target" ];
|
# partOf = [ "hyprland-session.target" ];
|
||||||
# after = [ "hyprland-session.target" ];
|
# after = [ "hyprland-session.target" ];
|
||||||
# };
|
# };
|
||||||
xdg.configFile."hypr/hyprland.lua" = {
|
# Hand-written config as extraLuaFile so Home Manager still
|
||||||
source = pkgs.writeText "hyprland.lua" hlBindCode;
|
# generates hypr/hyprland.lua itself, including the systemd
|
||||||
|
# session activation hooks (hyprland-session.target start/stop
|
||||||
|
# + dbus-update-activation-environment --systemd --all).
|
||||||
|
wayland.windowManager.hyprland.extraLuaFiles."hl-main.lua" = {
|
||||||
|
autoLoad = true;
|
||||||
|
content = hlBindCode;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -42,10 +42,14 @@
|
|||||||
];
|
];
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
wayland.windowManager.hyprland.settings = lib.mkIf settings.default {
|
wayland.windowManager.hyprland.extraLuaFiles = lib.mkIf settings.default {
|
||||||
bind = [
|
"zen-browser-bind.lua" = {
|
||||||
"$mainMod, E, exec, zen"
|
autoLoad = true;
|
||||||
];
|
content = ''
|
||||||
|
-- Zen launcher bind (lua config: settings.bind cannot express dispatchers)
|
||||||
|
hl.bind("SUPER + E", hl.dsp.exec_cmd("zen"))
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
home.packages = [
|
home.packages = [
|
||||||
(pkgs.wrapFirefox
|
(pkgs.wrapFirefox
|
||||||
|
|||||||
Reference in New Issue
Block a user