-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenu-edit-config
More file actions
executable file
·62 lines (56 loc) · 2.11 KB
/
menu-edit-config
File metadata and controls
executable file
·62 lines (56 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/sh
# Adapted from https://www.gitlab.com/dwt1/dotfiles/-/blob/master/.dmenu/dmenu-edit-configs.sh
# Command line arguments
MENU_CMD=$1
EDITOR_CMD=$2
# Options to pass to the menu program (list of config file names)
options="alacritty
awesome
emacs
kitty
nvim/conf
nvim/init
nvim/keys
nvim/plug
nvim/ui
openbox/rc
openbox/autostart
picom
profile
qutebrowser
ranger
shell/interactive
shell/login
xmobar
xmonad
xresources
zathura
quit"
# Choose one of the files, using $MENU_CMD
choice=`echo "$options" | $MENU_CMD "Edit config file: "`
# Find the path to the chosen file
case "$choice" in
alacritty) file="$HOME/.config/alacritty/base.yml" ;;
awesome) file="$HOME/.config/awesome/rc.lua" ;;
emacs) file="$HOME/.config/emacs/README.org" ;;
kitty) file="$HOME/.config/kitty/kitty.conf" ;;
nvim/conf) file="$HOME/.config/nvim/conf.vim" ;;
nvim/init) file="$HOME/.config/nvim/init.vim" ;;
nvim/keys) file="$HOME/.config/nvim/keys.vim" ;;
nvim/plug) file="$HOME/.config/nvim/plug.vim" ;;
nvim/ui) file="$HOME/.config/nvim/ui.vim" ;;
openbox/rc) file="$HOME/.config/openbox/rc.xml" ;;
openbox/autostart) file="$HOME/.config/openbox/autostart" ;;
picom) file="$HOME/.config/picom/picom.conf" ;;
qutebrowser) file="$HOME/.config/qutebrowser/config.py" ;;
ranger) file="$HOME/.config/ranger/rc.conf" ;;
shell/interactive) file="$HOME/.config/shell/interactive" ;;
shell/login) file="$HOME/.config/shell/interactive" ;;
xmobar) file="$HOME/.config/xmobar/xmobarrc.hs" ;;
xmonad) file="$HOME/Projects/xmonad-quark/README.org" ;;
xresources) file="$HOME/.config/X11/Xresources" ;;
zathura) file="$HOME/.config/zathura/zathurarc" ;;
*) exit 1 ;;
esac
# Edit the chosen file, with the user-specified program
$EDITOR_CMD "$file"