dm-run-programs.sh 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/usr/bin/env bash
  2. # Dmenu script for running some of my more frequently used utils.
  3. options=(
  4. "Kvantum - kvantummanager"
  5. "Appearance - lxappearance"
  6. "Display - lxrandr"
  7. "Sound - pavucontrol"
  8. "Sound - pavucontrol-qt"
  9. "Qt5 - qt5ct"
  10. "Qt6 - qt6ct"
  11. "Quit")
  12. # Colors:
  13. # # Materia Manjaro
  14. # nf='#09dbc9'
  15. # nb='#222b2e'
  16. # sf='#dbdcd5'
  17. # sb='#009185'
  18. # Everforest
  19. nf='#d3c6aa'
  20. nb='#2d353b'
  21. sf='#a7c080'
  22. sb='#475258'
  23. fn='Iosevka-18:normal'
  24. # fn='Ubuntu-16:normal'
  25. # Gruvbox
  26. # nf='#fea63c'
  27. # nb='#282828'
  28. # # sf='#dbdcd5'
  29. # sb='#d79921'
  30. # fn='Sarasa Mono SC Nerd-17:normal'
  31. DMENU="dmenu -i -l 10 -nf ${nf} -nb ${nb} -sf ${sf} -sb ${sb} -fn ${fn} -p"
  32. # choice=$(printf '%s\n' "${options[@]}" | dmenu -i -l 10 -nf ${nf} -nb ${nb} -sf ${sf} -sb ${sb} -fn ${fn} -p 'Run program:')
  33. choice=$(printf '%s\n' "${options[@]}" | ${DMENU} 'Run program:')
  34. if [[ "$choice" == "quit" ]]; then
  35. echo "Program terminated." && exit 1
  36. elif [[ "$choice" ]]; then
  37. program=$(printf '%s\n' "${choice}" | awk '{print $NF}')
  38. $program
  39. else
  40. echo "Program terminated." && exit 1
  41. fi