dm-run-programs.sh 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. "Qt5 - qt5ct"
  9. "Qt6 - qt6ct"
  10. "Quit")
  11. # Colors:
  12. # # Materia Manjaro
  13. # nf='#09dbc9'
  14. # nb='#222b2e'
  15. # sf='#dbdcd5'
  16. # sb='#009185'
  17. # Everforest
  18. nf='#d3c6aa'
  19. nb='#2d353b'
  20. sf='#a7c080'
  21. sb='#475258'
  22. fn='Iosevka-18:normal'
  23. # fn='Ubuntu-16:normal'
  24. # Gruvbox
  25. # nf='#fea63c'
  26. # nb='#282828'
  27. # # sf='#dbdcd5'
  28. # sb='#d79921'
  29. # fn='Sarasa Mono SC Nerd-17:normal'
  30. DMENU="dmenu -i -l 10 -nf ${nf} -nb ${nb} -sf ${sf} -sb ${sb} -fn ${fn} -p"
  31. # choice=$(printf '%s\n' "${options[@]}" | dmenu -i -l 10 -nf ${nf} -nb ${nb} -sf ${sf} -sb ${sb} -fn ${fn} -p 'Run program:')
  32. choice=$(printf '%s\n' "${options[@]}" | ${DMENU} 'Run program:')
  33. if [[ "$choice" == "quit" ]]; then
  34. echo "Program terminated." && exit 1
  35. elif [[ "$choice" ]]; then
  36. program=$(printf '%s\n' "${choice}" | awk '{print $NF}')
  37. $program
  38. else
  39. echo "Program terminated." && exit 1
  40. fi