Files
sxmo-utils/scripts/core/sxmo_winit.sh
Maarten van Gompel ab56046aee Added support for wofi as a dmenu/bemenu alternative
I refactored some code to make exchanging menus a little bit easier
and I added wofi as new menu option.

The menu to use can be configured via the new environment variable
SXMO_MENU. Its value may be bemenu, dmenu, or wofi, *NOT* any arbitrary
binary. This variable will be automatically populated if not set, based on if
you're on wayland or Xorg.

setup_config_version.sh was extended to allow a configversion in CSS
comments (needed for wofi). I designed a theme that mimicks the default
style we have for bemenu/dmenu, with slightly more spacing perhaps.

Wofi can scan *.desktop files (drun mode), so I added an "All Apps" option that
makes use of that. Some further work is still required there however
to get wofi to properly launch terminal apps from there.

Wofi also has some issues positioning in landscape mode after the screen
was rotated, so my solution there is a bit hacky. May be an upstream
issue.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2024-10-15 13:21:28 +02:00

45 lines
936 B
Bash
Executable File

#!/bin/sh
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
envvars() {
export SXMO_WM=sway
export MOZ_ENABLE_WAYLAND=1
export SDL_VIDEODRIVER=wayland
export XDG_CURRENT_DESKTOP=sway
[ -z "$SXMO_MENU" ] && export SXMO_MENU=bemenu
# shellcheck disable=SC2086
command -v $SXMO_TERMINAL "" >/dev/null || export SXMO_TERMINAL="foot"
command -v "$KEYBOARD" >/dev/null || export KEYBOARD=wvkbd-mobintl
[ -z "$MOZ_USE_XINPUT2" ] && export MOZ_USE_XINPUT2=1
}
defaults() {
[ -e "$HOME"/.Xresources ] && xrdb -merge "$HOME"/.Xresources
}
with_dbus() {
echo "$DBUS_SESSION_BUS_ADDRESS" > "$XDG_RUNTIME_DIR"/dbus.bus
exec sway -c "$XDG_CONFIG_HOME/sxmo/sway"
}
cleanup() {
sxmo_jobs.sh stop all
case "$SXMO_MENU" in
bemenu)
pkill bemenu
;;
wofi)
pkill wofi
;;
dmenu)
pkill dmenu
;;
esac
pkill wvkbd
pkill superd
}
# shellcheck source=scripts/core/sxmo_init.sh
. sxmo_init.sh