dots

Mika's dotfiles
git clone git://popovic.xyz/dots.git/
Log | Files | Refs | README

commit d34c64e4bce1d1096d0ea68f5306f10d73ed1b69
parent 8e9e195a6cf15039c5fcef5d8af7d3b94ed36d5c
Author: Milutin Popovic <milutin@popovic.xyz>
Date:   Fri, 27 Mar 2026 11:21:58 +0000

extend dmenu-wl functionality

Diffstat:
M.local/bin/scripts/background | 7++++++-
M.local/bin/scripts/dmenu-bluetooth | 10++++++++++
M.local/bin/scripts/passmenu-otp | 7++++++-
3 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/.local/bin/scripts/background b/.local/bin/scripts/background @@ -3,4 +3,9 @@ WALLDIR="${XDG_DATA_HOME}/wallpaper" WALLPAPER=$(ls -1 $WALLDIR | sort -R | tail -1) -feh --no-fehbg --bg-scale "$WALLDIR/${WALLPAPER}" + +if [[ -n ${WAYLAND_DISPLAY:-} ]] || [[ ${XDG_SESSION_TYPE:-} == "wayland" ]]; then + swaybg -i "$WALLDIR/${WALLPAPER}" -m fill +else + feh --no-fehbg --bg-scale "$WALLDIR/${WALLPAPER}" +fi diff --git a/.local/bin/scripts/dmenu-bluetooth b/.local/bin/scripts/dmenu-bluetooth @@ -327,6 +327,11 @@ show_menu() { # dmenu command to pipe into. Extra arguments to dmenu-bluetooth are passed through to dmenu. This # allows the user to set fonts, sizes, colours, etc. DMENU_BLUETOOTH_LAUNCHER="${DMENU_BLUETOOTH_LAUNCHER:-dmenu}" + +is_wayland() { + [[ -n "${WAYLAND_DISPLAY:-}" ]] || [[ "${XDG_SESSION_TYPE:-}" == "wayland" ]] +} + run_dmenu() { case "$DMENU_BLUETOOTH_LAUNCHER" in rofi) @@ -335,6 +340,11 @@ run_dmenu() { fuzzel) DMENU_BLUETOOTH_LAUNCHER="fuzzel --dmenu" ;; + dmenu) + if is_wayland && command -v dmenu-wl >/dev/null 2>&1; then + DMENU_BLUETOOTH_LAUNCHER="dmenu-wl" + fi + ;; esac $DMENU_BLUETOOTH_LAUNCHER -i -p "$DMENU_BLUETOOTH_PROMPT" "${dmenu_args[@]}" } diff --git a/.local/bin/scripts/passmenu-otp b/.local/bin/scripts/passmenu-otp @@ -13,7 +13,12 @@ password_files=( "$prefix"/**/*.gpg ) password_files=( "${password_files[@]#"$prefix"/}" ) password_files=( "${password_files[@]%.gpg}" ) -password=$(printf '%s\n' "${password_files[@]}" | dmenu -l 15 "$@") +dmenu_cmd=(dmenu -l 15) +if [[ -n ${WAYLAND_DISPLAY:-} ]] || [[ ${XDG_SESSION_TYPE:-} == "wayland" ]]; then + dmenu_cmd=(dmenu-wl -l 15) +fi + +password=$(printf '%s\n' "${password_files[@]}" | "${dmenu_cmd[@]}" "$@") [[ -n $password ]] || exit