#!/bin/sh profiles="$(find "${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/" -name 'urls-*' -exec sh -c 'basename "$1" | sed "s/^urls-//"' /bin/sh {} \;)" if [ -z "$profiles" ]; then # shellcheck disable=SC2086 setsid -f $TERMINAL -e newsboat exit 0 fi choice="$(printf "Default\n%s" "$profiles" | dmenu -i -p "Profile")" if [ -z "$choice" ]; then exit 0 elif [ "$choice" = "Default" ]; then # shellcheck disable=SC2086 setsid -f $TERMINAL -e newsboat else # shellcheck disable=SC2086 setsid -f $TERMINAL -e newsboat -u "${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/urls-${choice}" -c "${XDG_DATA_HOME:-$HOME/.local/share}/newsboat/cache-${choice}.db" fi