Skip to content

Commit

Permalink
Apply selected rice in rofi rice selector script
Browse files Browse the repository at this point in the history
  • Loading branch information
ulises-jeremias committed Apr 7, 2024
1 parent 57a0e42 commit 6b0bb90
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion home/dot_local/bin/executable_dots-rofi-rice-selector
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ done
# Show the rofi selection menu with the starting point set to the current rice and store the result in a variable.
selected=$(printf "%s\n" "${options[@]}" | while read -r A; do echo -en "$A\x00icon\x1f${PREVIEWS_DIR}$A/preview.png\n"; done | $ROFI_COMMAND -theme-str "$rofi_override" -selected-row "$selected_index")

# If a valid option was selected, write the value to the configuration file and restart BSPWM.
# If a valid option was selected, write the value to the configuration file and apply the rice.
[[ -n "$selected" && "$selected" != "$current_rice" ]] || exit 1
echo "$selected" >"$CURRENT_RICE_FILE"

# Apply the selected rice
if [[ -x "${RICES_DIR}"/"$selected"/apply.sh ]]; then
"${RICES_DIR}"/"$selected"/apply.sh
exit 0
fi

0 comments on commit 6b0bb90

Please sign in to comment.