From 2688e2c4883b73b36698b8e3f4ecb176a35c7c20 Mon Sep 17 00:00:00 2001 From: sudacode Date: Tue, 21 Oct 2025 23:46:16 -0700 Subject: [PATCH] add rofi-docs --- .config/rofi/scripts/rofi-docs.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 .config/rofi/scripts/rofi-docs.sh diff --git a/.config/rofi/scripts/rofi-docs.sh b/.config/rofi/scripts/rofi-docs.sh new file mode 100755 index 0000000..34aae83 --- /dev/null +++ b/.config/rofi/scripts/rofi-docs.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +BROWSER=/usr/bin/zen-browser +URLS=( + "Archlinux Wiki|https://wiki.archlinux.org/title/Main_page" + "Hyprland Docs|https://wiki.hypr.land/" + "Hyprland Window Rules|https://wiki.hypr.land/Configuring/Window-Rules/" +) + +DISPLAY_URLS=() +declare -A URL_MAP +for url in "${URLS[@]}"; do + DISPLAY_URLS+=("${url%%|*}") + label="${url%%|*}" + URL_MAP["$label"]="${url##*|}" +done + +SELECTION="$(printf "%s\n" "${DISPLAY_URLS[@]}" | rofi -theme-str 'window {width: 25%;} listview {columns: 1; lines: 10;}' -theme ~/.config/rofi/launchers/type-2/style-2.rasi -dmenu -l 5 -i -p "Select Documentation")" +URL="${URL_MAP[$SELECTION]}" +$BROWSER "$URL" &>/dev/null &