dm-edit-configs.sh 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. #!/usr/bin/env bash
  2. # Dmenu script for editing some of my more frequently edited config files.
  3. # declare options=("alacritty
  4. options=(
  5. "alacritty - $HOME/.config/alacritty/alacritty.toml"
  6. "awesome - $HOME/.config/awesome/rc.lua"
  7. "awesome - $HOME/.config/awesome/themes/mymaterial/theme.lua"
  8. "awesome - $HOME/.config/awesome/themes/myeverforest/theme.lua"
  9. "bash - $HOME/.bashrc"
  10. "bat - $HOME/.config/bat/config"
  11. "bspwm - $HOME/.config/bspwm/bspwmrc"
  12. "conky - $HOME/.myScripts/conky/conkyrc"
  13. "conky (bspwm) - $HOME/.myScripts/conky/bspwm_conkyrc"
  14. "compton - $HOME/.config/compton.conf"
  15. "dm-change-alacritty-colors - $HOME/.myScripts/dmscripts/dm-change-alacritty-colors.sh"
  16. "dm-edit-configs - $HOME/.myScripts/dmscripts/dm-edit-configs.sh"
  17. "dm-GoogleDrive - $HOME/.myScripts/dmscripts/dm-GoogleDrive.sh"
  18. "dm-kill - $HOME/.myScripts/dmscripts/dm-kill.sh"
  19. "dm-mountUnmountWinDisks - $HOME/.myScripts/dmscripts/dm-mountUnmountWinDisks.sh"
  20. "dm-passmenu - $HOME/.myScripts/dmscripts/dm-passmenu.sh"
  21. "dm-passmenu-name - $HOME/.myScripts/dmscripts/dm-passmenu-name.sh"
  22. "dm-passmenu-url - $HOME/.myScripts/dmscripts/dm-passmenu-url.sh"
  23. "dm-run-programs - $HOME/.myScripts/dmscripts/dm-run-programs.sh"
  24. "dm-run-scripts - $HOME/.myScripts/dmscripts/dm-run-scripts.sh"
  25. "dm-search - $HOME/.myScripts/dmscripts/dm-search.sh"
  26. "dm-system-exit - $HOME/.myScripts/dmscripts/dm-system-exit.sh"
  27. "dm-unicode - $HOME/.myScripts/dmscripts/dm-unicode.sh"
  28. "dwm - $HOME/Programs/DWM/config.h"
  29. "dwmblocks - $HOME/Programs/DWM/dwmblocks/blocks.h"
  30. "dwmpatches - $HOME/Programs/DWM/patches.h"
  31. "fish - $HOME/.config/fish/config.fish"
  32. "fonts.conf - $HOME/.config/fontconfig/fonts.conf"
  33. "helix - $HOME/.config/helix/config.toml"
  34. "homepage - $HOME/.surf/homepage.html"
  35. "i3 - $HOME/.config/i3/config"
  36. "i3blocks - $HOME/.config/i3blocks/config"
  37. "i3status - $HOME/.config/i3status/config"
  38. "i3pystatus - $HOME/.config/i3pystatus/config.py"
  39. "kitty - $HOME/.config/kitty/kitty.conf"
  40. "nvim - $HOME/.config/nvim/init.vim"
  41. "gvim - $HOME/.config/nvim/ginit.vim"
  42. "picom - $HOME/.config/picom/picom.conf"
  43. "polybar config - $HOME/.config/polybar/config.ini"
  44. "polybar modules - $HOME/.config/polybar/modules.ini"
  45. "polybar colors - $HOME/.config/polybar/colors.ini"
  46. "polybar launch - $HOME/.config/polybar/launch.sh"
  47. "profile - $HOME/.profile"
  48. "qtile - $HOME/.config/qtile/config.py"
  49. "qtile - $HOME/.config/qtile/scripts/autostart.sh"
  50. "qtile - $HOME/.config/qtile/modules/colors.py"
  51. "qtile - $HOME/.local/share/qtile/qtile.log"
  52. "Qtile_My_Keys - $HOME/.config/qtile/Qtile_My_Keys.txt"
  53. "qutebrowser - $HOME/.config/qutebrowser/config.py"
  54. "ranger_rc.conf - $HOME/.config/ranger/rc.conf"
  55. "ranger_rifle.conf - $HOME/.config/ranger/rifle.conf"
  56. "ranger_commands.py - $HOME/.config/ranger/commands.py"
  57. "redshift - $HOME/.config/redshift/redshift.conf"
  58. "rofi - $HOME/.config/rofi/config.rasi"
  59. "sxhkd - $HOME/.config/bspwm/sxhkd/sxhkdrc"
  60. "terminator - $HOME/.config/terminator/config"
  61. "udiskie - $HOME/.config/udiskie/config.yml"
  62. "vifm - $HOME/.config/vifm/vifmrc"
  63. "vim - $HOME/.vimrc"
  64. "xterm - $HOME/.XTerm"
  65. "xresources - $HOME/.Xresources"
  66. "xsession-errors - $HOME/.xsession-errors"
  67. "yazi keymap - $HOME/.config/yazi/keymap.toml"
  68. "yazi theme - $HOME/.config/yazi/theme.toml"
  69. "yazi - $HOME/.config/yazi/yazi.toml"
  70. "zsh - $HOME/.zshrc"
  71. "Quit")
  72. # Colors:
  73. # # Materia Manjaro
  74. # nf='#09dbc9'
  75. # nb='#222b2e'
  76. # sf='#dbdcd5'
  77. # sb='#009185'
  78. # Everforest
  79. nf='#d3c6aa'
  80. nb='#2d353b'
  81. sf='#a7c080'
  82. sb='#475258'
  83. fn='Iosevka-18:normal'
  84. # fn='Ubuntu-16:normal'
  85. # Gruvbox
  86. # nf='#fea63c'
  87. # nb='#282828'
  88. # # sf='#dbdcd5'
  89. # sb='#d79921'
  90. # fn='Sarasa Mono SC Nerd-17:normal'
  91. # DMENU="rofi -dmenu -theme-str 'window {width: 80%;}' -p"
  92. DMENU="dmenu -i -l 10 -nf ${nf} -nb ${nb} -sf ${sf} -sb ${sb} -fn ${fn} -p"
  93. terminal="alacritty"
  94. # editor="hx"
  95. editor="vim"
  96. # terminal="xfce4-terminal"
  97. # names=$(printf '%s\n' "${options[@]}" | awk '{print $1}')
  98. # choice=$(printf '%s\n' "${names}" | dmenu -l 10 -nf '#09dbc9' -nb '#222b2e' -sf '#dbdcd5' -sb '#009185' -fn 'Ubuntu-16:normal' -p 'Edit config file:')
  99. # choice=$(printf '%s\n' "${options[@]}" | dmenu -i -l 10 -nf ${nf} -nb ${nb} -sf ${sf} -sb ${sb} -fn ${fn} -p 'Edit config file:')
  100. choice=$(printf '%s\n' "${options[@]}" | ${DMENU} 'Edit config file:')
  101. if [[ "$choice" == "quit" ]]; then
  102. echo "Program terminated." && exit 1
  103. elif [[ "$choice" ]]; then
  104. conf=$(printf '%s\n' "${choice}" | awk '{print $NF}')
  105. gvim $conf # gvim is either a link to neovim-qt or just gvim
  106. # # $terminal -e $SHELL -c "vim $conf"
  107. # # alacritty -e $SHELL -c "vim $conf"
  108. # # $terminal -e "$SHELL -c 'vim $conf'"
  109. # $terminal -e $editor $conf
  110. # # alacritty -e vim "$conf"
  111. # # terminator -e "vim $conf"
  112. else
  113. echo "Program terminated." && exit 1
  114. fi