dots-of-war/files/scripts/rofi-open.sh
2020-08-05 15:22:13 +02:00

14 lines
689 B
Bash
Executable file

#!/bin/bash
groups="$(ls "$HOME/scripts/bookmarks")\nauswahl"
group_selection=$(echo -e "$groups" | rofi -i -matching fuzzy -p open -dmenu -no-custom -theme /home/leon/scripts/rofi/default_theme.rasi )
if [ "$group_selection" = "auswahl" ]; then
auswahl "$(auswahl --list | rofi -dmenu -theme /home/leon/scripts/rofi/default_theme.rasi -i -no-custom)"
else
selection=$( cat "$HOME/scripts/bookmarks/$group_selection" | sed -r 's/^([^ ]*) .*$/\1/' | rofi -p open -matching fuzzy -dmenu -i -no-custom -theme /home/leon/scripts/rofi/default_theme.rasi )
[ -z "$selection" ] && exit 1
cat "$HOME/scripts/bookmarks/$group_selection" | sed -n -r "s/^$selection (.*)$/\1/p" | bash
fi