dmenu-scripts/dmenu-configs

47 lines
1.2 KiB
Plaintext
Raw Normal View History

2022-04-05 16:59:04 +02:00
#!/bin/env bash
# a script to quickly open up one of my many configs
2023-01-05 20:03:28 +01:00
editor="$TERMINAL -e $EDITOR"
2022-04-05 16:59:04 +02:00
declare -a configs=(
2023-11-04 22:03:43 +01:00
"Quit"
"dk - $HOME/.config/dk/dkrc"
"dk sxhkdrc - $HOME/.config/dk/sxhkdrc"
"dk autorun - $HOME/.config/dk/autorun.sh"
"dunst - $HOME/.config/wal/templates/colors.dunstrc"
"game-run - $HOME/.config/game-run/config.ini"
"kitty - $HOME/.config/kitty/kitty.conf"
"lf - $HOME/.config/lf/lfrc"
"neovim - $HOME/.config/nvim/init.lua"
"newsboat config - $HOME/.config/newsboat/config"
"newsboat urls - $HOME/.config/newsboat/urls"
"picom - $HOME/.config/picom/picom.conf"
"ryzenset - $HOME/.local/share/ryzen-set/profiles.ini"
"polybar - $HOME/.config/polybar/config.ini"
"zathura - $HOME/.config/wal/templates/colors.zathurarc"
"zsh aliases - $HOME/.config/zsh/aliasrc"
"zprofile - $HOME/.config/zsh/.zprofile"
"zshenv - $HOME/.zshenv"
"zshrc - $HOME/.config/zsh/.zshrc"
"xinitrc - $HOME/.config/X11/xinitrc"
2022-04-05 16:59:04 +02:00
)
2023-11-04 22:03:43 +01:00
load_config() {
source $HOME/.config/dmenu/config
}
2023-11-04 22:03:43 +01:00
main() {
load_config
2023-11-04 22:03:43 +01:00
choice=$(printf '%s\n' "${configs[@]}" | $DMENU -l 10 -p 'Edit config:')
2023-11-04 22:03:43 +01:00
[ -z "$choice" ] && exit
2022-04-05 16:59:04 +02:00
2023-11-04 22:03:43 +01:00
[ "$choice" = "Quit" ] && exit
2022-04-05 16:59:04 +02:00
2023-11-04 22:03:43 +01:00
cfg=$(printf '%s\n' "${choice}" | awk '{print $NF}')
$editor "$cfg"
}
2022-04-05 16:59:04 +02:00
main $@