Add tmcodex resume launcher binding
This commit is contained in:
@@ -411,7 +411,8 @@ Required behavior:
|
|||||||
- `Hyper+p` opens the password picker with `rofi-pass`.
|
- `Hyper+p` opens the password picker with `rofi-pass`.
|
||||||
- `Hyper+h` opens the screenshot tool with the compositor/session-appropriate
|
- `Hyper+h` opens the screenshot tool with the compositor/session-appropriate
|
||||||
screenshot command.
|
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+k` opens the process killer with `rofi_kill_process.sh`.
|
||||||
- `Hyper+Shift+k` opens the kill-all/process-tree killer with
|
- `Hyper+Shift+k` opens the kill-all/process-tree killer with
|
||||||
`rofi_kill_all.sh`.
|
`rofi_kill_all.sh`.
|
||||||
|
|||||||
@@ -2327,6 +2327,7 @@ bind(hyper .. " + V", exec([[cliphist list | rofi -dmenu -p "Clipboard" | cliphi
|
|||||||
bind(hyper .. " + P", exec("rofi-pass"))
|
bind(hyper .. " + P", exec("rofi-pass"))
|
||||||
bind(hyper .. " + H", exec([[grim -g "$(slurp)" - | swappy -f -]]))
|
bind(hyper .. " + H", exec([[grim -g "$(slurp)" - | swappy -f -]]))
|
||||||
bind(hyper .. " + C", exec("rofi_tmcodex.sh"))
|
bind(hyper .. " + C", exec("rofi_tmcodex.sh"))
|
||||||
|
bind(hyper .. " + SHIFT + C", exec("rofi_tmcodex.sh resume"))
|
||||||
bind(hyper .. " + SHIFT + L", exec("hyprlock"))
|
bind(hyper .. " + SHIFT + L", exec("hyprlock"))
|
||||||
bind(hyper .. " + L", exec("hypr_rofi_layout"))
|
bind(hyper .. " + L", exec("hypr_rofi_layout"))
|
||||||
bind(hyper .. " + K", exec("rofi_kill_process.sh"))
|
bind(hyper .. " + K", exec("rofi_kill_process.sh"))
|
||||||
|
|||||||
@@ -1071,6 +1071,7 @@ addKeys conf@XConfig { modMask = modm } =
|
|||||||
, ((hyper, xK_p), spawn "rofi-pass")
|
, ((hyper, xK_p), spawn "rofi-pass")
|
||||||
, ((hyper, xK_h), spawn "rofi_shutter")
|
, ((hyper, xK_h), spawn "rofi_shutter")
|
||||||
, ((hyper, xK_c), spawn "rofi_tmcodex.sh")
|
, ((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 .|. shiftMask, xK_l), spawn "dm-tool lock")
|
||||||
, ((hyper, xK_l), selectLayout)
|
, ((hyper, xK_l), selectLayout)
|
||||||
, ((hyper, xK_k), spawn "rofi_kill_process.sh")
|
, ((hyper, xK_k), spawn "rofi_kill_process.sh")
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ history_file="$state_dir/dirs"
|
|||||||
codex_home="${CODEX_HOME:-$HOME/.codex}"
|
codex_home="${CODEX_HOME:-$HOME/.codex}"
|
||||||
terminal="${TMCODEX_TERMINAL:-${TERMINAL:-ghostty}}"
|
terminal="${TMCODEX_TERMINAL:-${TERMINAL:-ghostty}}"
|
||||||
debug_log="$state_dir/debug.log"
|
debug_log="$state_dir/debug.log"
|
||||||
|
tmcodex_args=("$@")
|
||||||
mkdir -p "$state_dir"
|
mkdir -p "$state_dir"
|
||||||
touch "$history_file"
|
touch "$history_file"
|
||||||
|
|
||||||
@@ -91,7 +92,7 @@ if [[ "${1:-}" == "--print-candidates" ]]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
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="$(
|
selected_dir="$(
|
||||||
emit_candidates | dedup | existing_dirs | rofi -dmenu -i -p 'tmcodex dir' || true
|
emit_candidates | dedup | existing_dirs | rofi -dmenu -i -p 'tmcodex dir' || true
|
||||||
)"
|
)"
|
||||||
@@ -133,4 +134,4 @@ if (( ${#terminal_argv[@]} == 0 )); then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
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 &!)
|
||||||
|
|||||||
Reference in New Issue
Block a user