1
1
#! /bin/bash
2
- # Rofi menu for Quick Edit / View of Settings (SUPER E)
2
+ # Rofi menu for Quick Edit/ View of Settings (SUPER E)
3
3
4
- # define your preferred text editor and terminal to use
5
- editor =${EDITOR:- nano}
4
+ # Define preferred text editor and terminal
5
+ edit =${EDITOR:- nano}
6
6
tty=kitty
7
7
8
+ # Paths to configuration directories
8
9
configs=" $HOME /.config/hypr/configs"
9
10
UserConfigs=" $HOME /.config/hypr/UserConfigs"
10
11
11
- menu (){
12
- printf " 1. edit Env-variables\n"
13
- printf " 2. edit Window-Rules\n"
14
- printf " 3. edit Startup_Apps\n"
15
- printf " 4. edit User-Keybinds\n"
16
- printf " 5. edit Monitors\n"
17
- printf " 6. edit Laptop-Keybinds\n"
18
- printf " 7. edit User-Settings\n"
19
- printf " 8. edit Decorations & Animations\n"
20
- printf " 9. edit Workspace-Rules\n"
21
- printf " 10. edit Default-Settings\n"
22
- printf " 11. edit Default-Keybinds\n"
12
+ # Function to display the menu options
13
+ menu () {
14
+ cat << EOF
15
+ 1. Edit Env-variables
16
+ 2. Edit Window-Rules
17
+ 3. Edit Startup_Apps
18
+ 4. Edit User-Keybinds
19
+ 5. Edit Monitors
20
+ 6. Edit Laptop-Keybinds
21
+ 7. Edit User-Settings
22
+ 8. Edit Decorations & Animations
23
+ 9. Edit Workspace-Rules
24
+ 10. Edit Default-Settings
25
+ 11. Edit Default-Keybinds
26
+ EOF
23
27
}
24
28
29
+ # Main function to handle menu selection
25
30
main () {
26
31
choice=$( menu | rofi -i -dmenu -config ~ /.config/rofi/config-compact.rasi | cut -d. -f1)
32
+
33
+ # Map choices to corresponding files
27
34
case $choice in
28
- 1)
29
- $tty $editor " $UserConfigs /ENVariables.conf"
30
- ;;
31
- 2)
32
- $tty $editor " $UserConfigs /WindowRules.conf"
33
- ;;
34
- 3)
35
- $tty $editor " $UserConfigs /Startup_Apps.conf"
36
- ;;
37
- 4)
38
- $tty $editor " $UserConfigs /UserKeybinds.conf"
39
- ;;
40
- 5)
41
- $tty $editor " $UserConfigs /Monitors.conf"
42
- ;;
43
- 6)
44
- $tty $editor " $UserConfigs /Laptops.conf"
45
- ;;
46
- 7)
47
- $tty $editor " $UserConfigs /UserSettings.conf"
48
- ;;
49
- 8)
50
- $tty $editor " $UserConfigs /UserDecorAnimations.conf"
51
- ;;
52
- 9)
53
- $tty $editor " $UserConfigs /WorkspaceRules.conf"
54
- ;;
55
- 10)
56
- $tty $editor " $configs /Settings.conf"
57
- ;;
58
- 11)
59
- $tty $editor " $configs /Keybinds.conf"
60
- ;;
61
- * )
62
- ;;
35
+ 1) file=" $UserConfigs /ENVariables.conf" ;;
36
+ 2) file=" $UserConfigs /WindowRules.conf" ;;
37
+ 3) file=" $UserConfigs /Startup_Apps.conf" ;;
38
+ 4) file=" $UserConfigs /UserKeybinds.conf" ;;
39
+ 5) file=" $UserConfigs /Monitors.conf" ;;
40
+ 6) file=" $UserConfigs /Laptops.conf" ;;
41
+ 7) file=" $UserConfigs /UserSettings.conf" ;;
42
+ 8) file=" $UserConfigs /UserDecorAnimations.conf" ;;
43
+ 9) file=" $UserConfigs /WorkspaceRules.conf" ;;
44
+ 10) file=" $configs /Settings.conf" ;;
45
+ 11) file=" $configs /Keybinds.conf" ;;
46
+ * ) return ;; # Do nothing for invalid choices
63
47
esac
48
+
49
+ # Open the selected file in the terminal with the text editor
50
+ $tty -e $edit " $file "
64
51
}
65
52
66
- main
53
+ main
0 commit comments