123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- #!/usr/bin/env bash
- # Colors:
- # # Materia Manjaro
- # nf='#09dbc9'
- # nb='#222b2e'
- # sf='#dbdcd5'
- # sb='#009185'
- # Everforest
- nf='#d3c6aa'
- nb='#2d353b'
- sf='#a7c080'
- sb='#475258'
- fn='Iosevka-18:normal'
- # fn='Ubuntu-16:normal'
- # Gruvbox
- # nf='#fea63c'
- # nb='#282828'
- # # sf='#dbdcd5'
- # sb='#d79921'
- # fn='Sarasa Mono SC Nerd-17:normal'
- # shopt -s nullglob globstar
- if [[ -n "$WAYLAND_DISPLAY" ]]; then
- DMENU=dmenu-wl
- xdotool="ydotool type --file -"
- elif [[ -n "$DISPLAY" ]]; then
- DMENU="dmenu -i -l 10 -nf ${nf} -nb ${nb} -sf ${sf} -sb ${sb} -fn ${fn} -p"
- xdotool="xdotool type --clearmodifiers --file -"
- else
- echo "Error: No Wayland or X11 display detected" >&2
- exit 1
- fi
- prefix=${SCRIPTS_STORE_DIR-~/.myScripts/dmscripts}
- script_files=( "$prefix"/*.sh )
- script_files=( "${script_files[@]#"$prefix"/}" )
- # script_files=( "${script_files[@]%.sh}" )
- # password=$(printf '%s\n' "${password_files[@]}" | "$dmenu" "$@")
- script_name=$(printf '%s\n' "${script_files[@]}" | ${DMENU} 'Run script:')
- # script_name=$(printf '%s\n' "${script_files[@]}" | "$dmenu" -i -l 10 -nf ${nf} -nb ${nb} -sf ${sf} -sb ${sb} -fn ${fn} -p 'Run script:')
- [[ -n "$script_name" ]] || exit
- # Run chosen script
- $prefix/$script_name
|