2 Commits

Author SHA1 Message Date
b64bb5874c Drop codex desktop local library patch 2026-04-28 15:56:05 -07:00
6c48073e36 Keep pending scratchpads on invoking workspace 2026-04-28 15:51:51 -07:00
2 changed files with 9 additions and 102 deletions

View File

@@ -751,9 +751,9 @@ local function adopt_matching_scratchpad_window(window)
for name, def in pairs(scratchpads) do for name, def in pairs(scratchpads) do
if scratchpad_window_matches(window, def) then if scratchpad_window_matches(window, def) then
if scratchpad_pending[name] then if scratchpad_pending[name] then
local target_monitor = scratchpad_pending[name] local pending = scratchpad_pending[name]
scratchpad_pending[name] = nil scratchpad_pending[name] = nil
show_scratchpad_window(name, window, nil, target_monitor) show_scratchpad_window(name, window, pending.workspace or active_workspace(), pending.monitor or hl.get_active_monitor())
elseif scratchpad_is_visible(window) then elseif scratchpad_is_visible(window) then
schedule_scratchpad_geometry(name, window, hl.get_active_monitor()) schedule_scratchpad_geometry(name, window, hl.get_active_monitor())
end end
@@ -1074,7 +1074,10 @@ local function toggle_scratchpad(name)
local windows = matching_scratchpad_windows(name) local windows = matching_scratchpad_windows(name)
if #windows == 0 then if #windows == 0 then
scratchpad_pending[name] = hl.get_active_monitor() scratchpad_pending[name] = {
monitor = hl.get_active_monitor(),
workspace = active_workspace(),
}
hl.exec_cmd(def.command) hl.exec_cmd(def.command)
return return
end end

View File

@@ -109,105 +109,9 @@
(import ./emacs-overlay.nix) (import ./emacs-overlay.nix)
(import ../nix-shared/overlays) (import ../nix-shared/overlays)
# Use codex and claude-code from dedicated flakes with cachix # Use codex and claude-code from dedicated flakes with cachix
(final: prev: let (final: prev: {
system = prev.stdenv.hostPlatform.system; codex = inputs.codex-cli-nix.packages.${prev.stdenv.hostPlatform.system}.default;
codexDmg = final.fetchurl { codex-desktop-installer = inputs.codex-desktop-linux.packages.${prev.stdenv.hostPlatform.system}.default;
url = "https://persistent.oaistatic.com/codex-app-prod/Codex.dmg";
hash = "sha256-hxuafsEAmx1OQvjh8riI7Y4QxvZXemBrjpRHT8Bh034=";
};
codexDesktopLibPath = final.lib.makeLibraryPath (with final; [
alsa-lib
atk
at-spi2-atk
at-spi2-core
cairo
cups
dbus
expat
gdk-pixbuf
glib
gtk3
libdrm
libgbm
libglvnd
libX11
libxcb
libXcomposite
libxcursor
libXdamage
libXext
libXfixes
libxi
libxkbcommon
libXrandr
libxscrnsaver
libxtst
mesa
nspr
nss
pango
systemd
wayland
]);
codexDesktopInstaller = final.writeShellApplication {
name = "codex-desktop-installer";
runtimeInputs = with final; [
bash
curl
gcc
gnumake
nodejs
p7zip
patchelf
python3
unzip
];
text = ''
set -euo pipefail
root_dir="$(pwd)"
workdir="$(mktemp -d)"
source_dir="$workdir/source"
cleanup() {
rm -rf "$workdir"
}
trap cleanup EXIT
mkdir -p "$source_dir"
cp -R ${inputs.codex-desktop-linux.outPath}/. "$source_dir"
chmod -R u+w "$source_dir"
cp ${codexDmg} "$source_dir/Codex.dmg"
chmod +x "$source_dir/install.sh"
cd "$source_dir"
export CODEX_INSTALL_DIR="''${CODEX_INSTALL_DIR:-$root_dir/codex-app}"
bash "$source_dir/install.sh" "$source_dir/Codex.dmg" "$@"
install_dir="''${CODEX_INSTALL_DIR:-$root_dir/codex-app}"
if [ -f "$install_dir/electron" ]; then
patchelf --set-interpreter "$(cat ${final.stdenv.cc}/nix-support/dynamic-linker)" \
--set-rpath "$install_dir:${codexDesktopLibPath}" \
"$install_dir/electron"
if [ -f "$install_dir/chrome_crashpad_handler" ]; then
patchelf --set-interpreter "$(cat ${final.stdenv.cc}/nix-support/dynamic-linker)" \
"$install_dir/chrome_crashpad_handler" || true
fi
if [ -f "$install_dir/chrome-sandbox" ]; then
patchelf --set-interpreter "$(cat ${final.stdenv.cc}/nix-support/dynamic-linker)" \
"$install_dir/chrome-sandbox" || true
fi
find "$install_dir" -maxdepth 1 -name "*.so*" -type f | while read -r so; do
patchelf --set-rpath "${codexDesktopLibPath}" "$so" 2>/dev/null || true
done
fi
'';
};
in {
codex = inputs.codex-cli-nix.packages.${system}.default;
codex-desktop-installer = codexDesktopInstaller;
codex-desktop = final.writeShellApplication { codex-desktop = final.writeShellApplication {
name = "codex-desktop"; name = "codex-desktop";
runtimeInputs = [ runtimeInputs = [