feat(hyprland): session Hyprland en test à côté d'i3
- Hyprland via UWSM (comme Omarchy), à choisir à la connexion ; i3 reste la session par défaut - config Lua (format Hyprland >= 0.55) : raccourcis bépo d'i3, apparence Omarchy, Ghostty comme terminal - waybar, hyprlock, swaybg, grim/slurp, wl-clipboard, brightnessctl - workspace-run : support de hyprctl et des options en --opt= - stt-dictate : wtype sous Wayland au lieu de xdotool Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
ac6ae897f4
commit
967a31d574
+24
-6
@@ -3,22 +3,35 @@
|
||||
# Examples:
|
||||
# workspace-run.sh zeditor
|
||||
# workspace-run.sh sakura --working-directory
|
||||
# workspace-run.sh ghostty --working-directory= (un argument finissant par = est collé au dossier)
|
||||
cmd=${1:?usage: workspace-run.sh <command> [args...]}
|
||||
shift
|
||||
|
||||
workspace=$(i3-msg -t get_workspaces | jq -r '.[] | select(.focused) | .name')
|
||||
if [ -n "${HYPRLAND_INSTANCE_SIGNATURE:-}" ]; then
|
||||
workspace=$(hyprctl activeworkspace -j | jq -r '.name')
|
||||
else
|
||||
workspace=$(i3-msg -t get_workspaces | jq -r '.[] | select(.focused) | .name')
|
||||
fi
|
||||
|
||||
window_pids() {
|
||||
if [ -n "${HYPRLAND_INSTANCE_SIGNATURE:-}" ]; then
|
||||
hyprctl clients -j | jq -r --arg ws "$workspace" '.[] | select(.workspace.name == $ws) | .pid'
|
||||
return
|
||||
fi
|
||||
|
||||
terminal_cwd() {
|
||||
local wids
|
||||
wids=$(i3-msg -t get_tree | jq -r "
|
||||
.nodes[].nodes[].nodes[]
|
||||
| select(.name == \"$workspace\")
|
||||
| .. | objects | select(.window? != null) | .window
|
||||
")
|
||||
|
||||
for wid in $wids; do
|
||||
local pid
|
||||
pid=$(xdotool getwindowpid "$wid" 2>/dev/null) || continue
|
||||
xdotool getwindowpid "$wid" 2>/dev/null
|
||||
done
|
||||
}
|
||||
|
||||
terminal_cwd() {
|
||||
for pid in $(window_pids); do
|
||||
local shell_pid
|
||||
shell_pid=$(pgrep -P "$pid" -x zsh | head -1) || continue
|
||||
local cwd
|
||||
@@ -35,4 +48,9 @@ if [ -z "$dir" ]; then
|
||||
dir=$(grep "^${workspace}=" "$dir_file" 2>/dev/null | cut -d= -f2-)
|
||||
fi
|
||||
|
||||
exec "$cmd" "$@" "${dir:-$HOME}"
|
||||
dir=${dir:-$HOME}
|
||||
if [ $# -gt 0 ] && [[ "${!#}" == *= ]]; then
|
||||
set -- "${@:1:$#-1}" "${!#}$dir"
|
||||
exec "$cmd" "$@"
|
||||
fi
|
||||
exec "$cmd" "$@" "$dir"
|
||||
|
||||
Reference in New Issue
Block a user