tenseleyflow/ndotfiles / f20affe

Browse files

bind adjustments

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
f20affea4dbd6e43c7ad1a21b9c0d5b3a4535ead
Parents
c4e1acc
Tree
51b1c7a

3 changed files

StatusFile+-
M hypr/config/keybinds.conf 17 14
A hypr/scripts/jetbrains_menu.sh 77 0
M tmux/.tmux.d/20-keys.conf 34 28
hypr/config/keybinds.confmodified
@@ -6,19 +6,22 @@
66
 source = ~/.config/hypr/config/defaults.conf
77
 
88
 # https://wiki.hyprland.org/Configuring/Binds/
9
-bindd = $mainMod, Q, 		Closes (not kill) current window, 						  killactive,
10
-bindd = $mainMod, Y, 		Pin current window (shows on all workspaces), 			  pin
11
-bindd = $mainMod, F, 		Toggles current window fullscreen mode, 				  fullscreen
12
-bindd = $mainMod, SPACE, 	Runs your application launcher, 						  exec, $applauncher
13
-bindd = $mainMod, J, 		Toggles current window split mode, 						  togglesplit, # dwindle
14
-bindd = $mainMod, RETURN, 	Opens your preferred terminal emulator ($terminal), 	  exec, $terminal
15
-bindd = $mainMod SHIFT, RETURN, Open terminal & attach/create tmux:main, 			  exec, $terminal -e bash -lc 'tmux new -As main'
16
-bindd = $mainMod, E, 		Opens your preferred filemanager ($filemanager), 		  exec, $filemanager
17
-bindd = $mainMod, V, 		Switches current window between floating and tiling mode, togglefloating,
18
-bindd = $mainMod SHIFT, V, 	Open Clipboard manager,									  exec, cliphist list | wofi --dmenu | cliphist decode | wl-copy
19
-bindd = $mainMod SHIFT, M, 	Exits Hyprland by terminating the user sessions, 		  exec, loginctl terminate-user ""
20
-
21
-bindd = $mainMod, X, 	Toggles flow (disables flashy animations), 	exec, ~/.config/hypr/scripts/toggle-flow.sh
9
+bindd = $mainMod SHIFT, V, 		Open Clipboard manager,									  	exec, cliphist list | wofi --dmenu | cliphist decode | wl-copy
10
+bindd = $mainMod SHIFT, M, 		Exits Hyprland by terminating the user sessions, 		  	exec, loginctl terminate-user ""
11
+bindd = $mainMod SHIFT, RETURN, Open terminal & attach/create tmux:main, 			  		exec, $terminal -e bash -lc 'tmux new -As main'
12
+
13
+bindd = $mainMod, SPACE, 		Runs your application launcher, 						  	exec, $applauncher
14
+bindd = $mainMod, slash, 		Toggles current window split mode, 						  	togglesplit, # dwindle
15
+bindd = $mainMod, RETURN, 		Opens your preferred terminal emulator ($terminal), 	  	exec, $terminal
16
+
17
+bindd = $mainMod, Q, 			Closes (not kill) current window, 						  	killactive,
18
+bindd = $mainMod, Y, 			Pin current window (shows on all workspaces), 			  	pin
19
+bindd = $mainMod, F, 			Toggles current window fullscreen mode, 				  	fullscreen
20
+bindd = $mainMod, E, 			Opens your preferred filemanager ($filemanager), 		  	exec, $filemanager
21
+bindd = $mainMod, V, 			Switches current window between floating and tiling mode, 	togglefloating,
22
+bindd = $mainMod, C, 			Open new VSCode instance,								  	exec, code --new-window
23
+bindd = $mainMod, J, 			Launch Jetbrains wofi picker,								exec, ~/.config/hypr/scripts/jetbrains_menu.sh
24
+bindd = $mainMod, X, 			Toggles flow (disables flashy animations), 	exec, ~/.config/hypr/scripts/toggle-flow.sh
2225
 
2326
 ## Layouts
2427
 bindd = $mainMod, F10, Toggle master layout,	exec, hyprctl keyword general:layout masterq
@@ -165,7 +168,7 @@ bindd = $mainMod, COMMA, Scroll through workspaces decrementally, workspace, e-
165168
 bindd = $mainMod, PERIOD, Scroll through workspaces incrementally, workspace, e+1
166169
 
167170
 # With $mainMod + scroll
168
-bindd = $mainMod, slash, 		Switch to the previous workspace, workspace, previous
171
+# bindd = $mainMod, slash, 		Switch to the previous workspace, workspace, previous
169172
 bindd = $mainMod, mouse_up, 	Scroll through workspaces decrementally, workspace, e-1
170173
 bindd = $mainMod, mouse_down, 	Scroll through workspaces incrementally, workspace, e+1
171174
 
hypr/scripts/jetbrains_menu.shadded
@@ -0,0 +1,77 @@
1
+#!/usr/bin/env bash
2
+# JetBrains menu for Waybar
3
+# Left click shows IDEs from .desktop files (Toolbox, Flatpak, distro installs)
4
+# Right click (configured in Waybar) opens jetbrains-toolbox
5
+
6
+set -euo pipefail
7
+
8
+# Pick a menu program
9
+if command -v wofi >/dev/null 2>&1; then
10
+  MENU_CMD=(wofi --dmenu -i -p "JetBrains")
11
+elif command -v rofi >/dev/null 2>&1; then
12
+  MENU_CMD=(rofi -dmenu -i -p "JetBrains")
13
+else
14
+  command -v notify-send >/dev/null 2>&1 && notify-send "JetBrains" "Install wofi or rofi for the menu."
15
+  exit 1
16
+fi
17
+
18
+# Directories where .desktop files commonly live
19
+dirs=(
20
+  "$HOME/.local/share/applications"
21
+  "$HOME/.local/share/flatpak/exports/share/applications"
22
+  "/var/lib/flatpak/exports/share/applications"
23
+  "/usr/share/applications"
24
+)
25
+
26
+# Gather JetBrains desktop entries (Toolbox uses jetbrains-*.desktop, Flatpak uses com.jetbrains.*)
27
+mapfile -t files < <(
28
+  for d in "${dirs[@]}"; do
29
+    [[ -d "$d" ]] || continue
30
+    find "$d" -maxdepth 1 -type f \( -name 'jetbrains-*.desktop' -o -name 'com.jetbrains*.desktop' \) -print
31
+  done | awk '!seen[$0]++'
32
+)
33
+
34
+if (( ${#files[@]} == 0 )); then
35
+  if command -v jetbrains-toolbox >/dev/null 2>&1; then
36
+    command -v notify-send >/dev/null 2>&1 && notify-send "JetBrains" "No IDE entries found. Opening Toolbox…"
37
+    nohup jetbrains-toolbox >/dev/null 2>&1 &
38
+    exit 0
39
+  else
40
+    command -v notify-send >/dev/null 2>&1 && notify-send "JetBrains" "No JetBrains IDEs detected."
41
+    exit 0
42
+  fi
43
+fi
44
+
45
+# Build "Name|||desktop-id" lines so we can sort but keep mapping
46
+mapfile -t lines < <(
47
+  for f in "${files[@]}"; do
48
+    id="$(basename "$f" .desktop)"
49
+    name="$(grep -m1 '^Name=' "$f" | cut -d= -f2-)"
50
+    [[ -n "$name" ]] || name="$id"
51
+    printf '%s|||%s\n' "$name" "$id"
52
+  done | sort -f
53
+)
54
+
55
+# Show menu of just the names
56
+selection="$(printf '%s\n' "${lines[@]}" | sed 's/|||.*//' | "${MENU_CMD[@]}")"
57
+[[ -n "$selection" ]] || exit 0
58
+
59
+id="$(printf '%s\n' "${lines[@]}" | awk -F'\|\|\|' -v sel="$selection" '$1==sel{print $2; exit}')"
60
+
61
+# Launch via gtk-launch (preferred), else fall back to Exec= line
62
+if command -v gtk-launch >/dev/null 2>&1; then
63
+  setsid gtk-launch "$id" >/dev/null 2>&1 &
64
+  exit 0
65
+fi
66
+
67
+# Fallback: run the Exec= command from the .desktop file
68
+desktop_file=""
69
+for d in "${dirs[@]}"; do
70
+  [[ -f "$d/$id.desktop" ]] && desktop_file="$d/$id.desktop" && break
71
+done
72
+[[ -z "$desktop_file" ]] && exit 1
73
+
74
+exec_line="$(grep -m1 '^Exec=' "$desktop_file" | cut -d= -f2-)"
75
+# Strip desktop placeholders like %f %u etc.
76
+exec_line="${exec_line//%[fFuUdDnNickvm]/}"
77
+nohup bash -lc "$exec_line" >/dev/null 2>&1 &
tmux/.tmux.d/20-keys.confmodified
@@ -52,52 +52,58 @@ bind -n "M-|" if-shell -F '#{==:#{@ui_binds},on}' \
5252
   "split-window -v" \
5353
   "send-keys M-\|"
5454
 
55
-# Close pane (confirm)
56
-unbind -n C-S-x
57
-bind   -n C-S-x if-shell -F '#{==:#{@ui_binds},on}' \
55
+# Kill pane with Alt+Shift+W (guarded; passes through when binds OFF)
56
+unbind -n M-W
57
+bind   -n M-W if-shell -F '#{==:#{@ui_binds},on}' \
5858
   "confirm-before -p 'Kill pane #P? (y/n)' kill-pane" \
59
-  "send-keys C-x"   # tmux can’t reliably synthesize C-S-x; pass through C-x
59
+  "send-keys M-W"
60
+
61
+# Backup: Ctrl+Alt+w also kills the pane (guarded)
62
+unbind -n C-M-w
63
+bind   -n C-M-w if-shell -F '#{==:#{@ui_binds},on}' \
64
+  "confirm-before -p 'Kill pane #P? (y/n)' kill-pane" \
65
+  "send-keys C-M-w"
6066
 
6167
 ##### Pane focus #####
6268
 
63
-unbind -n C-M-S-Left
64
-bind   -n C-M-S-Left if-shell -F '#{==:#{@ui_binds},on}' \
69
+unbind -n C-M-Left
70
+bind   -n C-M-Left if-shell -F '#{==:#{@ui_binds},on}' \
6571
   "select-pane -L" \
66
-  "send-keys C-M-S-Left"
72
+  "send-keys C-M-Left"
6773
 
68
-unbind -n C-M-S-Right
69
-bind   -n C-M-S-Right if-shell -F '#{==:#{@ui_binds},on}' \
74
+unbind -n C-M-Right
75
+bind   -n C-M-Right if-shell -F '#{==:#{@ui_binds},on}' \
7076
   "select-pane -R" \
71
-  "send-keys C-M-S-Right"
77
+  "send-keys C-M-Right"
7278
 
73
-unbind -n C-M-S-Up
74
-bind   -n C-M-S-Up if-shell -F '#{==:#{@ui_binds},on}' \
79
+unbind -n C-M-Up
80
+bind   -n C-M-Up if-shell -F '#{==:#{@ui_binds},on}' \
7581
   "select-pane -U" \
76
-  "send-keys C-M-S-Up"
82
+  "send-keys C-M-Up"
7783
 
78
-unbind -n C-M-S-Down
79
-bind   -n C-M-S-Down if-shell -F '#{==:#{@ui_binds},on}' \
84
+unbind -n C-M-Down
85
+bind   -n C-M-Down if-shell -F '#{==:#{@ui_binds},on}' \
8086
   "select-pane -D" \
81
-  "send-keys C-M-S-Down"
87
+  "send-keys C-M-Down"
8288
 
8389
 ##### Pane resize #####
8490
 
85
-unbind -n M-S-Left
86
-bind   -n M-S-Left if-shell -F '#{==:#{@ui_binds},on}' \
91
+unbind -n C-M-S-Left
92
+bind   -n C-M-S-Left if-shell -F '#{==:#{@ui_binds},on}' \
8793
   "resize-pane -L 5" \
88
-  "send-keys M-S-Left"
94
+  "send-keys C-M-S-Left"
8995
 
90
-unbind -n M-S-Right
91
-bind   -n M-S-Right if-shell -F '#{==:#{@ui_binds},on}' \
96
+unbind -n C-M-S-Right
97
+bind   -n C-M-S-Right if-shell -F '#{==:#{@ui_binds},on}' \
9298
   "resize-pane -R 5" \
93
-  "send-keys M-S-Right"
99
+  "send-keys C-M-S-Right"
94100
 
95
-unbind -n M-S-Up
96
-bind   -n M-S-Up if-shell -F '#{==:#{@ui_binds},on}' \
101
+unbind -n C-M-S-Up
102
+bind   -n C-M-S-Up if-shell -F '#{==:#{@ui_binds},on}' \
97103
   "resize-pane -U 2" \
98
-  "send-keys M-S-Up"
104
+  "send-keys C-M-S-Up"
99105
 
100
-unbind -n M-S-Down
101
-bind   -n M-S-Down if-shell -F '#{==:#{@ui_binds},on}' \
106
+unbind -n C-M-S-Down
107
+bind   -n C-M-S-Down if-shell -F '#{==:#{@ui_binds},on}' \
102108
   "resize-pane -D 2" \
103
-  "send-keys M-S-Down"
109
+  "send-keys C-M-S-Down"