From d44736aec9d1164c94396700acc82a001b80b3ee Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Fri, 8 May 2026 21:01:42 -0700 Subject: [PATCH] Add tmcodex resume launcher binding --- docs/tiling-wm-experience.md | 3 ++- dotfiles/config/hypr/hyprland.lua | 1 + dotfiles/config/xmonad/xmonad.hs | 1 + dotfiles/lib/bin/rofi_tmcodex.sh | 5 +++-- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/tiling-wm-experience.md b/docs/tiling-wm-experience.md index 54369a71..12893695 100644 --- a/docs/tiling-wm-experience.md +++ b/docs/tiling-wm-experience.md @@ -411,7 +411,8 @@ Required behavior: - `Hyper+p` opens the password picker with `rofi-pass`. - `Hyper+h` opens the screenshot tool with the compositor/session-appropriate screenshot command. -- `Hyper+c` opens a shell command prompt with `shell_command.sh`. +- `Hyper+c` opens the Codex launcher with `rofi_tmcodex.sh`. +- `Hyper+Shift+c` opens the Codex launcher with `tmcodex resume`. - `Hyper+k` opens the process killer with `rofi_kill_process.sh`. - `Hyper+Shift+k` opens the kill-all/process-tree killer with `rofi_kill_all.sh`. diff --git a/dotfiles/config/hypr/hyprland.lua b/dotfiles/config/hypr/hyprland.lua index 95c170b4..d2887172 100644 --- a/dotfiles/config/hypr/hyprland.lua +++ b/dotfiles/config/hypr/hyprland.lua @@ -2327,6 +2327,7 @@ bind(hyper .. " + V", exec([[cliphist list | rofi -dmenu -p "Clipboard" | cliphi bind(hyper .. " + P", exec("rofi-pass")) bind(hyper .. " + H", exec([[grim -g "$(slurp)" - | swappy -f -]])) bind(hyper .. " + C", exec("rofi_tmcodex.sh")) +bind(hyper .. " + SHIFT + C", exec("rofi_tmcodex.sh resume")) bind(hyper .. " + SHIFT + L", exec("hyprlock")) bind(hyper .. " + L", exec("hypr_rofi_layout")) bind(hyper .. " + K", exec("rofi_kill_process.sh")) diff --git a/dotfiles/config/xmonad/xmonad.hs b/dotfiles/config/xmonad/xmonad.hs index 6fdfec20..497cf568 100644 --- a/dotfiles/config/xmonad/xmonad.hs +++ b/dotfiles/config/xmonad/xmonad.hs @@ -1071,6 +1071,7 @@ addKeys conf@XConfig { modMask = modm } = , ((hyper, xK_p), spawn "rofi-pass") , ((hyper, xK_h), spawn "rofi_shutter") , ((hyper, xK_c), spawn "rofi_tmcodex.sh") + , ((hyper .|. shiftMask, xK_c), spawn "rofi_tmcodex.sh resume") , ((hyper .|. shiftMask, xK_l), spawn "dm-tool lock") , ((hyper, xK_l), selectLayout) , ((hyper, xK_k), spawn "rofi_kill_process.sh") diff --git a/dotfiles/lib/bin/rofi_tmcodex.sh b/dotfiles/lib/bin/rofi_tmcodex.sh index 815756f8..f84850ae 100755 --- a/dotfiles/lib/bin/rofi_tmcodex.sh +++ b/dotfiles/lib/bin/rofi_tmcodex.sh @@ -11,6 +11,7 @@ history_file="$state_dir/dirs" codex_home="${CODEX_HOME:-$HOME/.codex}" terminal="${TMCODEX_TERMINAL:-${TERMINAL:-ghostty}}" debug_log="$state_dir/debug.log" +tmcodex_args=("$@") mkdir -p "$state_dir" touch "$history_file" @@ -91,7 +92,7 @@ if [[ "${1:-}" == "--print-candidates" ]]; then exit 0 fi -debug "script=$0 codex_home=$codex_home history_file=$history_file terminal=$terminal" +debug "script=$0 codex_home=$codex_home history_file=$history_file terminal=$terminal args=${tmcodex_args[*]}" selected_dir="$( emit_candidates | dedup | existing_dirs | rofi -dmenu -i -p 'tmcodex dir' || true )" @@ -133,4 +134,4 @@ if (( ${#terminal_argv[@]} == 0 )); then exit 1 fi -("${terminal_argv[@]}" -e zsh -lc 'cd -- "$1" && exec tmcodex' zsh "$selected_dir" >/dev/null 2>&1 &!) +("${terminal_argv[@]}" -e zsh -lc 'cd -- "$1" && shift && exec tmcodex "$@"' zsh "$selected_dir" "${tmcodex_args[@]}" >/dev/null 2>&1 &!)