1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-29 21:44:24 +03:00

Add open-wezterm-here script

The .deb package registers that script as the alternative for
a terminal emulator in the hope that various "open terminal here..."
functions in other tools will use that to detect wezterm and run
thing in the cwd.

refs: https://github.com/wez/wezterm/issues/2103
This commit is contained in:
Wez Furlong 2022-07-21 22:34:54 -07:00
parent 743ab695e8
commit 60d7d214c1
2 changed files with 12 additions and 2 deletions

5
assets/open-wezterm-here Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
# This script is a helper that starts a new terminal window
# in the cwd of the calling process, rather than using the
# default cwd which is usually the home directory.
wezterm start --cwd $PWD -- "$@"

View File

@ -159,6 +159,7 @@ echo "Doing the build bit here"
set -x set -x
cd ${HERE} cd ${HERE}
mkdir -p %{buildroot}/usr/bin %{buildroot}/etc/profile.d mkdir -p %{buildroot}/usr/bin %{buildroot}/etc/profile.d
install -Dsm755 assets/open-wezterm-here -t %{buildroot}/usr/bin
install -Dsm755 target/release/wezterm -t %{buildroot}/usr/bin install -Dsm755 target/release/wezterm -t %{buildroot}/usr/bin
install -Dsm755 target/release/wezterm-mux-server -t %{buildroot}/usr/bin install -Dsm755 target/release/wezterm-mux-server -t %{buildroot}/usr/bin
install -Dsm755 target/release/wezterm-gui -t %{buildroot}/usr/bin install -Dsm755 target/release/wezterm-gui -t %{buildroot}/usr/bin
@ -172,6 +173,7 @@ install -Dm644 assets/wezterm.appdata.xml %{buildroot}/usr/share/metainfo/org.we
install -Dm644 assets/wezterm-nautilus.py %{buildroot}/usr/share/nautilus-python/extensions/wezterm-nautilus.py install -Dm644 assets/wezterm-nautilus.py %{buildroot}/usr/share/nautilus-python/extensions/wezterm-nautilus.py
%files %files
/usr/bin/open-wezterm-here
/usr/bin/wezterm /usr/bin/wezterm
/usr/bin/wezterm-gui /usr/bin/wezterm-gui
/usr/bin/wezterm-mux-server /usr/bin/wezterm-mux-server
@ -211,7 +213,7 @@ EOF
#!/bin/sh #!/bin/sh
set -e set -e
if [ "\$1" = "configure" ] ; then if [ "\$1" = "configure" ] ; then
update-alternatives --install /usr/bin/x-terminal-emulator x-terminal-emulator /usr/bin/wezterm 20 update-alternatives --install /usr/bin/x-terminal-emulator x-terminal-emulator /usr/bin/open-wezterm-here 20
fi fi
EOF EOF
@ -219,13 +221,14 @@ EOF
#!/bin/sh #!/bin/sh
set -e set -e
if [ "\$1" = "remove" ]; then if [ "\$1" = "remove" ]; then
update-alternatives --remove x-terminal-emulator /usr/bin/wezterm update-alternatives --remove x-terminal-emulator /usr/bin/open-wezterm-here
fi fi
EOF EOF
install -Dsm755 -t pkg/debian/usr/bin target/release/wezterm-mux-server install -Dsm755 -t pkg/debian/usr/bin target/release/wezterm-mux-server
install -Dsm755 -t pkg/debian/usr/bin target/release/wezterm-gui install -Dsm755 -t pkg/debian/usr/bin target/release/wezterm-gui
install -Dsm755 -t pkg/debian/usr/bin target/release/wezterm install -Dsm755 -t pkg/debian/usr/bin target/release/wezterm
install -Dsm755 -t pkg/debian/usr/bin assets/open-wezterm-here
install -Dsm755 -t pkg/debian/usr/bin target/release/strip-ansi-escapes install -Dsm755 -t pkg/debian/usr/bin target/release/strip-ansi-escapes
deps=$(cd pkg && dpkg-shlibdeps -O -e debian/usr/bin/*) deps=$(cd pkg && dpkg-shlibdeps -O -e debian/usr/bin/*)
@ -283,6 +286,7 @@ source="
target/release/wezterm target/release/wezterm
target/release/wezterm-gui target/release/wezterm-gui
target/release/wezterm-mux-server target/release/wezterm-mux-server
assets/open-wezterm-here
assets/wezterm.desktop assets/wezterm.desktop
assets/wezterm.appdata.xml assets/wezterm.appdata.xml
assets/icon/terminal.png assets/icon/terminal.png
@ -296,6 +300,7 @@ build() {
} }
package() { package() {
install -Dm755 -t "\$pkgdir"/usr/bin "\$srcdir"/open-wezterm-here
install -Dm755 -t "\$pkgdir"/usr/bin "\$srcdir"/wezterm install -Dm755 -t "\$pkgdir"/usr/bin "\$srcdir"/wezterm
install -Dm755 -t "\$pkgdir"/usr/bin "\$srcdir"/wezterm-gui install -Dm755 -t "\$pkgdir"/usr/bin "\$srcdir"/wezterm-gui
install -Dm755 -t "\$pkgdir"/usr/bin "\$srcdir"/wezterm-mux-server install -Dm755 -t "\$pkgdir"/usr/bin "\$srcdir"/wezterm-mux-server