dotfiles/symlinks/bin/settings-selector

19 lines
412 B
Plaintext
Raw Normal View History

2021-01-07 08:09:41 +00:00
#!/bin/bash
2022-05-15 14:35:43 +00:00
SETTINGS_DIRECTORY=$HOME/.local/opt/script_utils/settings
2021-01-07 08:09:41 +00:00
function get_settings()
{
ls -l --time-style="long-iso" $SETTINGS_DIRECTORY | grep -v "~" | awk 'NR>1 {print $8}'
}
SETTING=$( (echo empty; get_settings) | wofi -dmenu -only-match -p "Select settings script:")
if [ x"empty" = x"${SETTING}" ]
then
echo "No operation."
elif [ -n "${SETTING}" ]
then
${SETTINGS_DIRECTORY}/${SETTING}
fi