aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Beich <jbeich@FreeBSD.org>2019-01-15 20:42:13 +0000
committerJan Beich <jbeich@FreeBSD.org>2019-01-15 20:42:13 +0000
commit50513942752232b248b2394f2ecda58ea565b83b (patch)
treeb76ec56f1d54ae25f2026681fcd6daafc62e6b20
parent1763ef103341156c1658e83f0b8d4a48e12f1442 (diff)
downloadports-50513942752232b248b2394f2ecda58ea565b83b.tar.gz
ports-50513942752232b248b2394f2ecda58ea565b83b.zip
x11-wm/sway: improve default config
- Don't hardcode urxvt - Make Windows key work
Notes
Notes: svn path=/head/; revision=490400
-rw-r--r--x11-wm/sway/Makefile10
-rw-r--r--x11-wm/sway/files/swayterm50
-rw-r--r--x11-wm/sway/pkg-plist2
3 files changed, 62 insertions, 0 deletions
diff --git a/x11-wm/sway/Makefile b/x11-wm/sway/Makefile
index 0d87f2ea541f..dd75d4ea3885 100644
--- a/x11-wm/sway/Makefile
+++ b/x11-wm/sway/Makefile
@@ -3,6 +3,7 @@
PORTNAME= sway
DISTVERSION= 1.0-beta.2-189
DISTVERSIONSUFFIX= -g2573606b
+PORTREVISION= 1
CATEGORIES= x11-wm
MAINTAINER= jbeich@FreeBSD.org
@@ -46,8 +47,17 @@ post-patch:
# Let @sample handle default files under etc/
@${REINPLACE_CMD} -e '/config\.in/{ N; s/@BASENAME@/&.sample/; }' \
${WRKSRC}/meson.build
+# Let terminal chooser pick default
+ @${REINPLACE_CMD} -e 's/urxvt/swayterm/' \
+ ${WRKSRC}/config.in
post-patch-MANPAGES-off:
@${REINPLACE_CMD} -i '' "s/'scdoc/&-disabled/" ${WRKSRC}/meson.build
+post-install:
+ ${INSTALL_SCRIPT} ${FILESDIR}/swayterm ${STAGEDIR}${PREFIX}/bin
+ ${MKDIR} ${STAGEDIR}${ETCDIR}/config.d
+# x11/libxkbcommon has --with-default-rules="xorg" but x11/libinput expects "evdev"
+ ${ECHO_CMD} 'input * xkb_rules evdev' >${STAGEDIR}${ETCDIR}/config.d/evdev
+
.include <bsd.port.mk>
diff --git a/x11-wm/sway/files/swayterm b/x11-wm/sway/files/swayterm
new file mode 100644
index 000000000000..1a550fb14e18
--- /dev/null
+++ b/x11-wm/sway/files/swayterm
@@ -0,0 +1,50 @@
+#!/bin/sh
+#
+# This file is in the public domain. It is based on i3-sensible-terminal.
+#
+# Find a terminal emulator among the list of known ones. Prefer user
+# default ($TERMINAL), system default (x-terminal-emulator on Debian)
+# then Wayland-native with few dependencies.
+#
+# See also https://lists.freedesktop.org/archives/xdg/2015-October/013583.html
+
+KNOWN_TERMINALS='
+ alacritty
+ sakura
+ termite
+ termit
+ tilix
+ kitty
+ cool-retro-term
+ qterminal
+ roxterm
+ xfce4-terminal
+ pantheon-terminal
+ terminology
+ gnome-terminal
+ mate-terminal
+ konsole
+ aminal
+ evilvte
+ mlterm
+ lxterminal
+ lilyterm
+ terminator
+ hyper
+ mrxvt
+ urxvt
+ xterm
+ st
+ Eterm
+ rxvt
+ aterm
+'
+
+for command in "$TERMINAL" x-terminal-emulator $KNOWN_TERMINALS; do
+ if hash "$command" 2>/dev/null; then
+ exec "$command" "$@"
+ fi
+done
+
+swaynag -m "${0##*/} could not find a terminal emulator. Please, \
+either install one, define \$TERMINAL or adjust Sway config."
diff --git a/x11-wm/sway/pkg-plist b/x11-wm/sway/pkg-plist
index 6c05cb981dc8..d91f83c87602 100644
--- a/x11-wm/sway/pkg-plist
+++ b/x11-wm/sway/pkg-plist
@@ -3,6 +3,8 @@ bin/swaybar
bin/swaybg
bin/swaymsg
bin/swaynag
+bin/swayterm
+%%ETCDIR%%/config.d/evdev
@sample %%ETCDIR%%/config.sample
%%ETCDIR%%/security.d/10-freebsd
%%MANPAGES%%man/man1/sway.1.gz