rofi/launcher/rofi.sh

30 lines
681 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
ROFI_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/rofi"
THEME="${1:-small-transparent}" # first arg
MODE="${2:-drun}" # second arg
THEME_FILE="${ROFI_DIR}/themes/${THEME}.rasi"
CONFIG_FILE="${ROFI_DIR}/config/config.rasi"
# Optional: allow extra rofi args after mode/theme
shift $(( $# > 0 ? 1 : 0 )) || true
shift $(( $# > 0 ? 1 : 0 )) || true
if [[ "$MODE" == "dmenu" ]] ; then
exec rofi \
-config "${CONFIG_FILE}" \
-theme "${THEME_FILE}" \
-dmenu \
"$@"
else
exec rofi \
-config "${CONFIG_FILE}" \
-theme "${THEME_FILE}" \
-show "${MODE}" \
"$@"
fi