From e6f26581bf22e266c5056eddfb264eca2efb6ef4 Mon Sep 17 00:00:00 2001 From: Timo Wilken Date: Thu, 11 Jul 2024 17:11:25 +0200 Subject: Wayland-based desktop support Add a separate home service to configure a Wayland-based desktop instead of an X11 one. Screensharing in Zoom doesn't work unfortunately, but it worked (at least for a while) through OBS. Waybar might need some work to bring it in line with the previous polybar configuration, especially in terms of aesthetics. --- tw/home/files/zshrc | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'tw/home/files/zshrc') diff --git a/tw/home/files/zshrc b/tw/home/files/zshrc index ca4481e2..8a658173 100644 --- a/tw/home/files/zshrc +++ b/tw/home/files/zshrc @@ -189,3 +189,27 @@ fi load_plugin fast-syntax-highlighting || load_plugin zsh-syntax-highlighting + +## Terminal integration with foot +# https://codeberg.org/dnkl/foot/wiki#shell-integration +if [ "$TERM" = foot ]; then + function foot-osc7-pwd () { + (( ZSH_SUBSHELL )) && return 0 + emulate -L zsh # also sets localoptions for us + setopt extendedglob + local LC_ALL=C + printf '\e]7;file://%s%s\e\' "$HOST" "${PWD//(#m)([^@-Za-z&-;_~])/%${(l:2::0:)$(([##16]#MATCH))}}" + } + function foot-precmd () { + print -Pn '\e]133;A\e\' + if ! builtin zle; then + print -n '\e]133;D\e\' + fi + } + function foot-preexec () { + print -n '\e]133;C\e\' + } + add-zsh-hook -Uz chpwd foot-osc7-pwd + add-zsh-hook -Uz precmd foot-precmd + add-zsh-hook -Uz preexec foot-preexec +fi -- cgit v1.2.3