Add screen to all images
authorHugo Villeneuve <hugo@hugovil.com>
Tue, 23 Sep 2025 19:01:31 +0000 (15:01 -0400)
committerHugo Villeneuve <hugo@hugovil.com>
Wed, 24 Sep 2025 14:17:43 +0000 (10:17 -0400)
Signed-off-by: Hugo Villeneuve <hugo@hugovil.com>
conf/distro/hvmpd.conf
recipes-core/images/include/image-hvmpd-common.inc
recipes-extended/screen/screen/user-screenrc [new file with mode: 0644]
recipes-extended/screen/screen_%.bbappend [new file with mode: 0644]

index 5f7d61c..9cee3eb 100644 (file)
@@ -38,6 +38,7 @@ SOUND_CARD ?= "default"
 SWU_PRESERVE_FILES ?= "\
     /root/.bash_history \
     /root/.hv-rsync.conf \
+    /root/.screenrc \
     /etc/hostname \
     /etc/localtime \
     /etc/ssh/ssh_host_ecdsa_key \
index acbe3c1..ba1da71 100644 (file)
@@ -18,6 +18,7 @@ IMAGE_INSTALL:append = " \
     ethtool \
     nfs-utils \
     rsync \
+    screen \
 "
 
 # Boot files:
diff --git a/recipes-extended/screen/screen/user-screenrc b/recipes-extended/screen/screen/user-screenrc
new file mode 100644 (file)
index 0000000..62848a0
--- /dev/null
@@ -0,0 +1,31 @@
+# Replace default CTRL+a with CTRL+j
+escape ^Jj
+
+# By default, the first screen window is 0.
+# Change it to be 1:
+bind c screen 1
+bind ^c screen 1
+bind 0 select 10
+screen 1
+
+# Bind F11 and F12 (NOT F1 and F2) to previous and next screen window
+bindkey -k F1 prev
+bindkey -k F2 next
+
+# Turn off the welcome message
+startup_message off
+
+# Disable visual bell
+vbell off
+
+# Set scrollback buffer to 10000
+defscrollback 10000
+
+# Customize the status line
+hardstatus alwayslastline
+hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %m-%d %{W}%c %{g}]'
+
+# Use X scrolling mechanism
+# The scroll buffer of GNU Screen can be accessed with Ctrl+a [. However, this
+# is very inconvenient. To use the scroll bar of e.g. xterm or Konsole:
+termcapinfo xterm* ti@:te@
diff --git a/recipes-extended/screen/screen_%.bbappend b/recipes-extended/screen/screen_%.bbappend
new file mode 100644 (file)
index 0000000..faa7d98
--- /dev/null
@@ -0,0 +1,14 @@
+FILESEXTRAPATHS:prepend:hvmpd := "${THISDIR}/${PN}:"
+
+SRC_URI:append:hvmpd = " \
+    file://user-screenrc \
+"
+
+do_install:append:hvmpd() {
+    install -d ${D}${ROOT_HOME}
+    install -m 644 ${WORKDIR}/user-screenrc ${D}${ROOT_HOME}/.screenrc
+}
+
+FILES:${PN}:append:hvmpd = "\
+    ${ROOT_HOME}/.screenrc \
+"