mirror of
https://github.com/ksyasuda/dotfiles.git
synced 2025-12-05 02:53:38 -08:00
add rofi-docs
This commit is contained in:
20
.config/rofi/scripts/rofi-docs.sh
Executable file
20
.config/rofi/scripts/rofi-docs.sh
Executable file
@@ -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 &
|
||||
Reference in New Issue
Block a user