dotfiles/symlinks/bin/settings-selector

19 lines
412 B
Text
Raw Normal View History

2021-01-07 09:09:41 +01:00
#!/bin/bash
2022-05-15 16:35:43 +02:00
SETTINGS_DIRECTORY=$HOME/.local/opt/script_utils/settings
2021-01-07 09:09:41 +01: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