device-nokia-n900: improve sxmo-dwm support (MR 5227)

(1) the deviceprofile differs from upstream 1.16.3 in the following respects:

  (a) -export SXMO_NO_KEYBOARD=1 - allow use of the virtual keyboard

  (b) +export SXMO_DMENU_LANDSCAPE_LINES="10"
      +export SXMO_DMENU_PORTRAIT_LINES="6" - these two adjust the size of the
         displayed dmenu menu.

    * NB: All foregoing changes are already merged in sxmo-utils master.

  (c) +export SXMO_TOUCHSCREEN_ID="TSC2005 touchscreen" - allows sxmo to
         reliably toggle touch screen's enabled status

    * The foregoing change is awaiting acceptance by upstream.

(2) The start hook differs from upstream 1.16.3 by the removal of the line that
      starts conky. That program pegs N900 CPU usage at 100% all the time. This
      change is not upstreamable, at least not for the time being
This commit is contained in:
Sicelo A. Mhlongo 2024-06-11 21:12:39 +02:00
parent c2f7be3cec
commit 933f2b5703
No known key found for this signature in database
GPG key ID: 7A342565FF635F79
3 changed files with 168 additions and 2 deletions

View file

@ -2,8 +2,8 @@
# Maintainer: Sicelo <absicsz@gmail.com>
# Co-Maintainer: Danct12 <danct12@disroot.org>
pkgname=device-nokia-n900
pkgver=24
pkgrel=1
pkgver=25
pkgrel=0
pkgdesc="Nokia N900"
url="https://postmarketos.org"
arch="armv7"
@ -27,6 +27,7 @@ subpackages="
$pkgname-x11
$pkgname-xkeyboard-config:xkeyboard_config
$pkgname-i3wm
$pkgname-sxmo
"
source="
10-initfs-keymap.files
@ -58,6 +59,8 @@ source="
modules.blocklist
pointercal
proxishot.sh
sxmo/deviceprofile.sh
sxmo/start_hook.sh
uboot-script.cmd
udev/10-nokia-modem.rules
udev/80-feedbackd-twl4030.rules
@ -181,6 +184,20 @@ i3wm() {
"$subpkgdir"/etc/skel/.Xdefaults
}
sxmo() {
install_if="$pkgname=$pkgver-r$pkgrel sxmo-utils"
replaces="sxmo-utils"
# Set !tracedeps, so abuild doesn't extend provides with e.g.:
# "cmd:sxmo_deviceprofile_nokia,omap3-n900.sh=1.16.3-r0"
# Otherwise this cannot be installed together with sxmo-utils:
# conflicts: sxmo-utils-1.16.3-r0[cmd:sxmo_deviceprofile_nokia,omap3-n900.sh=25-r0]
options="!tracedeps"
install -Dm755 "$srcdir"/deviceprofile.sh \
"$subpkgdir"/usr/bin/sxmo_deviceprofile_nokia,omap3-n900.sh
install -Dm755 "$srcdir"/start_hook.sh \
"$subpkgdir"/usr/share/sxmo/default_hooks/sxmo_hook_start.sh
}
upower() {
install_if="$pkgname=$pkgver-r$pkgrel upower"
replaces="upower"
@ -218,6 +235,8 @@ e440ed7a3070c17e003b86b72dbe6d8194d01b577ca8dd56dd066f216b6dda32bb965c780950f178
862ebc7cd2d7a1b3d41b10701b8418308c89eb0732eb99c42ec1091d48e08db9421727f67a3272b7309549798d59afb1b8d7d2fa48d1447b208fcb2329472d4d modules.blocklist
143c21f0b18a016d37cb44178e9daea09f128a90769b48353c03c3f245cb9b1f7e773b9ccee084973fc78ddd7a18c2642e54888a85bda7c7daecddc9a8c62eff pointercal
134f51d20decc0c63ab08010931a0b410b70d2f85bf6899f2ff137b1680f59f706a6287d01f5fbb41fa5309125df75a430d0783149bd1a6a1bca07d22f4f6a21 proxishot.sh
fc21e3b7e045055c080a7f7ffb0cd4140b63a02690e92c8370dbccbef506fe271ee9584ac9f14725b8bc9fd6e74e7fafde589d2360f44491c614837472d8ad53 deviceprofile.sh
c067c9ff982f9405ec8acac764ed900261a96b1039d6a7e1f85bbcf1c69e130f5764b571fbec8c4652a67fc3878071c421b400752bd0c3dd869284f1d992c5b0 start_hook.sh
239a54ae5c5effb53ccf4d658652c0462da57604b16b77a63627a17caa171caf82e3d1769f9c5afea8756415acbbf3b73db9b57715fce6c70ea3f29e5c6ac84a uboot-script.cmd
9e72035c88632d12895534e5aa5746f2c130c7dcdafa8702748d62b71ed0e1b5911b6e1f07f9b9e39b6072bbb662f66aead585baa1dcacb7d8c8953ca89b6762 10-nokia-modem.rules
03079030237440080e833dbfeff80327c1ad6a8129c6c730b401a3052cd00a986783ec3473a526b14ae73ba1f20653b4c7b2a6590839bfe6cc156bbbc3b7bb74 80-feedbackd-twl4030.rules

View file

@ -0,0 +1,20 @@
#!/bin/sh
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
export WLR_RENDERER=pixman
export SXMO_LYSTI_LEDS=1
export SXMO_POWER_BUTTON="0:0:twl_pwrbutton"
export SXMO_TOUCHSCREEN_ID="TSC2005 touchscreen"
export SXMO_SWAY_SCALE="1.5"
#on N900 these two are swaped
export SXMO_BEMENU_LANDSCAPE_LINES="10"
export SXMO_BEMENU_PORTRAIT_LINES="8"
export SXMO_DMENU_LANDSCAPE_LINES="10"
export SXMO_DMENU_PORTRAIT_LINES="6"
export SXMO_ROTATE_DIRECTION="left"
export SXMO_KEYBOARD_SLIDER_EVENT_DEVICE="/dev/input/by-path/platform-gpio_keys-event"
export SXMO_KEYBOARD_SLIDER_CLOSE_EVENT="*code 10 (SW_KEYPAD_SLIDE), value 0*"
export SXMO_KEYBOARD_SLIDER_OPEN_EVENT="*code 10 (SW_KEYPAD_SLIDE), value 1*"
# modem is only supported via ofono, not modemmanager
export SXMO_NO_MODEM=1

View file

@ -0,0 +1,127 @@
#!/bin/sh
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# include common definitions
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
# Create xdg user directories, such as ~/Pictures
xdg-user-dirs-update
sxmo_jobs.sh start daemon_manager superd
# let time to superd to start correctly
while ! superctl status > /dev/null 2>&1; do
sleep 0.5
done
# Not dangerous if "locker" isn't an available state
sxmo_state.sh set locker
if [ -n "$SXMO_ROTATE_START" ]; then
sxmo_rotate.sh
fi
# Load our sound daemons
if [ -z "$SXMO_NO_AUDIO" ]; then
if [ "$(command -v pulseaudio)" ]; then
superctl start pulseaudio
elif [ "$(command -v pipewire)" ]; then
# pipewire-pulse will start pipewire
superctl start pipewire-pulse
superctl start wireplumber
fi
# monitor for headphone for statusbar
superctl start sxmo_soundmonitor
fi
# Periodically update some status bar components
sxmo_hook_statusbar.sh all
sxmo_jobs.sh start statusbar_periodics sxmo_run_aligned.sh 60 \
sxmo_hook_statusbar.sh periodics
# mako/dunst are required for warnings.
# load some other little things here too.
case "$SXMO_WM" in
sway)
superctl start mako
superctl start sxmo_wob
superctl start sxmo_menumode_toggler
superctl start bonsaid
swaymsg output '*' bg "$SXMO_BG_IMG" fill
;;
dwm)
superctl start dunst
superctl start sxmo_xob
# Auto hide cursor with touchscreen, Show it with a mouse
if command -v "unclutter-xfixes" > /dev/null; then
set -- unclutter-xfixes
else
set -- unclutter
fi
superctl start "$1"
superctl start autocutsel
superctl start autocutsel-primary
superctl start sxmo-x11-status
superctl start bonsaid
[ -n "$SXMO_MONITOR" ] && xrandr --output "$SXMO_MONITOR" --primary
feh --bg-fill "$SXMO_BG_IMG"
;;
esac
# Turn on auto-suspend
if sxmo_wakelock.sh isenabled; then
sxmo_wakelock.sh lock sxmo_not_suspendable infinite
superctl start sxmo_autosuspend
fi
# Turn on lisgd
if [ ! -e "$XDG_CACHE_HOME"/sxmo/sxmo.nogesture ]; then
superctl start sxmo_hook_lisgd
fi
if [ -z "$SXMO_NO_MODEM" ] && command -v ModemManager > /dev/null; then
# Turn on the dbus-monitors for modem-related tasks
superctl start sxmo_modemmonitor
# place a wakelock for 120s to allow the modem to fully warm up (eg25 +
# elogind/systemd would do this for us, but we don't use those.)
sxmo_wakelock.sh lock sxmo_modem_warming_up 120s
fi
# Monitor the battery
superctl start sxmo_battery_monitor
# It watch network changes and update the status bar icon by example
superctl start sxmo_networkmonitor
# The daemon that display notifications popup messages
superctl start sxmo_notificationmonitor
# Play a funky startup tune if you want (disabled by default)
#mpv --quiet --no-video ~/welcome.ogg &
# mmsd and vvmd
if [ -z "$SXMO_NO_MODEM" ]; then
if [ -f "${SXMO_MMS_BASE_DIR:-"$HOME"/.mms/modemmanager}/mms" ]; then
superctl start mmsd-tng
fi
if [ -f "${SXMO_VVM_BASE_DIR:-"$HOME"/.vvm/modemmanager}/vvm" ]; then
superctl start vvmd
fi
fi
# add some warnings if things are not setup correctly
if ! command -v "sxmo_deviceprofile_$SXMO_DEVICE_NAME.sh"; then
sxmo_notify_user.sh --urgency=critical \
"No deviceprofile found $SXMO_DEVICE_NAME. See: https://sxmo.org/deviceprofile"
fi
sxmo_migrate.sh state || sxmo_notify_user.sh --urgency=critical \
"Config needs migration" "$? file(s) in your sxmo configuration are out of date and disabled - using defaults until you migrate (run sxmo_migrate.sh)"