summaryrefslogtreecommitdiff
path: root/dotfiles/hyprland/.config/hypr/hyprland.conf
blob: 1ab1a846c1d60b4eb7bf2e6d13917bfa30526a54 (plain)
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
# Hyprland Configuration
# Translated from DWM config.def.h and sxhkdrc
# Craig Jennings <c@cjennings.net>

# ============================================================================
# Monitor Configuration
# ============================================================================
monitor=,preferred,auto,auto

# ============================================================================
# Startup Applications
# ============================================================================
exec-once = hyprpm reload
exec-once = waybar
exec-once = swww-daemon && sleep 1 && swww img ~/pictures/wallpaper/dark-lion.jpg
exec-once = dunst
exec-once = hypridle
exec-once = gammastep
exec-once = blueman-applet
exec-once = /usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh
exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
exec-once = mpd
exec-once = signal-desktop --start-in-tray --ozone-platform=wayland
exec-once = protonmail-bridge --no-window
exec-once = insync start

# ============================================================================
# Environment Variables
# ============================================================================
env = XCURSOR_SIZE,24
env = XDG_CURRENT_DESKTOP,Hyprland
env = XDG_SESSION_TYPE,wayland
env = XDG_SESSION_DESKTOP,Hyprland
env = _JAVA_AWT_WM_NONREPARENTING,1

# ============================================================================
# Appearance (matching DWM colors)
# ============================================================================
# DWM colors: gray1=#222222, gray2=#444444, gray3=#bbbbbb, gray4=#eeeeee, cyan=#daa520

general {
    gaps_in = 25
    gaps_out = 30
    border_size = 3
    col.active_border = rgba(daa520ff)
    col.inactive_border = rgba(444444ff)
    layout = master
    resize_on_border = true
}

decoration {
    rounding = 10
    blur {
        enabled = false
    }
    shadow {
        enabled = false
    }
}

animations {
    enabled = true
    bezier = myBezier, 0.05, 0.9, 0.1, 1.05
    animation = windows, 1, 3, myBezier
    animation = windowsOut, 1, 3, default, popin 80%
    animation = fade, 1, 3, default
    animation = workspaces, 1, 3, default
    animation = specialWorkspace, 1, 3, default, slidevert
}

# ============================================================================
# Layout (master-stack like DWM tile)
# ============================================================================
master {
    new_status = slave
    mfact = 0.55
}

dwindle {
    pseudotile = true
    preserve_split = true
}

# ============================================================================
# Input
# ============================================================================
input {
    kb_layout = us
    kb_options = ctrl:nocaps
    follow_mouse = 0
    touchpad {
        natural_scroll = true
    }
}

# ============================================================================
# Misc
# ============================================================================
misc {
    force_default_wallpaper = 0
    disable_hyprland_logo = true
}

# ============================================================================
# XWayland
# ============================================================================
xwayland {
    force_zero_scaling = true
}

# ============================================================================
# Window Rules (Hyprland 0.53+ syntax: match:CONDITION, RULE)
# ============================================================================
# Floating windows (from DWM rules)
windowrule = match:class ^(Gimp)$, float on
windowrule = match:class ^(caffeine)$, float on
windowrule = match:class ^(blueman-services)$, float on
windowrule = match:class ^(Blueman-manager)$, float on
windowrule = match:class ^(qalculate-gtk)$, float on
windowrule = match:title ^(Event Tester)$, float on

# ============================================================================
# Key Bindings
# ============================================================================
$mod = SUPER

# Terminal and core apps (from DWM)
bind = $mod, T, exec, foot
bind = $mod, E, exec, emacsclient -c -a "" || emacs
bind = $mod, W, exec, $BROWSER
bind = $mod, P, exec, fuzzel

# From sxhkdrc
bind = $mod, SPACE, exec, fuzzel
bind = $mod SHIFT, W, exec, $ALTBROWSER
bind = CTRL ALT, W, exec, tor-browser
bind = CTRL ALT, F, exec, thunar
bind = $mod, V, exec, virtualbox
bind = $mod SHIFT, L, exec, calibre
bind = $mod SHIFT, R, exec, shortwave
bind = $mod SHIFT, P, exec, waypaper

# Window management (from DWM)
# Layout-aware navigation (works across master, scrolling, hy3)
bind = $mod, J, exec, layout-navigate next
bind = $mod, K, exec, layout-navigate prev
bind = $mod SHIFT, J, exec, layout-navigate next move
bind = $mod SHIFT, K, exec, layout-navigate prev move
bind = $mod, H, splitratio, -0.05
bind = $mod, L, splitratio, +0.05
bind = $mod, RETURN, layoutmsg, swapwithmaster master
bind = $mod, G, centerwindow
bind = $mod, TAB, workspace, previous
bind = $mod SHIFT, C, killactive

# Layouts: master -> tab group (monocle) -> scrolling -> floating
# Click waybar layout icon to cycle, or use direct keybindings:
bind = $mod SHIFT, T, exec, hyprctl keyword general:layout master && hyprctl keyword master:orientation left
bind = $mod SHIFT, M, exec, hyprctl keyword general:layout hy3 && hyprctl dispatch hy3:changegroup tab
bind = $mod SHIFT, S, exec, hyprctl keyword general:layout scrolling
bind = $mod SHIFT, F, togglefloating
bind = $mod SHIFT, SPACE, togglefloating

# Master layout adjustments
bind = $mod, I, layoutmsg, addmaster
bind = $mod, D, layoutmsg, removemaster

# Focus mode (xtra-dispatchers plugin)
# O = "Only this window" / "bring back Others" / "close Others"
bind = $mod, O, exec, hyprctl dispatch plugin:xtd:throwunfocused 10
bind = $mod SHIFT, O, exec, hyprctl dispatch plugin:xtd:bringallfrom 10
bind = $mod CTRL, O, exec, hyprctl dispatch plugin:xtd:closeunfocused

# Gaps (from DWM)
bind = $mod, MINUS, exec, hyprctl keyword general:gaps_out $(( $(hyprctl getoption general:gaps_out -j | jq -r '.custom' | cut -d' ' -f1) - 5 )) && hyprctl keyword general:gaps_in $(( $(hyprctl getoption general:gaps_in -j | jq -r '.custom' | cut -d' ' -f1) - 5 ))
bind = $mod, EQUAL, exec, hyprctl keyword general:gaps_out $(( $(hyprctl getoption general:gaps_out -j | jq -r '.custom' | cut -d' ' -f1) + 5 )) && hyprctl keyword general:gaps_in $(( $(hyprctl getoption general:gaps_in -j | jq -r '.custom' | cut -d' ' -f1) + 5 ))
bind = $mod SHIFT, EQUAL, exec, hyprctl keyword general:gaps_out 30 && hyprctl keyword general:gaps_in 25
bind = $mod SHIFT, MINUS, exec, hyprctl keyword general:gaps_out 0 && hyprctl keyword general:gaps_in 0

# Toggle bar
bind = $mod, B, exec, killall -SIGUSR1 waybar

# Fullscreen
bind = $mod, F11, fullscreen, 0

# Workspaces 1-9 (from DWM TAGKEYS)
bind = $mod, 1, workspace, 1
bind = $mod, 2, workspace, 2
bind = $mod, 3, workspace, 3
bind = $mod, 4, workspace, 4
bind = $mod, 5, workspace, 5
bind = $mod, 6, workspace, 6
bind = $mod, 7, workspace, 7
bind = $mod, 8, workspace, 8
bind = $mod, 9, workspace, 9
bind = $mod, 0, workspace, 10

# Move window to workspace (from DWM tag)
bind = $mod SHIFT, 1, movetoworkspacesilent, 1
bind = $mod SHIFT, 2, movetoworkspacesilent, 2
bind = $mod SHIFT, 3, movetoworkspacesilent, 3
bind = $mod SHIFT, 4, movetoworkspacesilent, 4
bind = $mod SHIFT, 5, movetoworkspacesilent, 5
bind = $mod SHIFT, 6, movetoworkspacesilent, 6
bind = $mod SHIFT, 7, movetoworkspacesilent, 7
bind = $mod SHIFT, 8, movetoworkspacesilent, 8
bind = $mod SHIFT, 9, movetoworkspacesilent, 9
bind = $mod SHIFT, 0, movetoworkspacesilent, 10

# Monitor focus (from DWM focusmon)
bind = $mod, COMMA, focusmonitor, -1
bind = $mod, PERIOD, focusmonitor, +1
bind = $mod SHIFT, COMMA, movewindow, mon:-1
bind = $mod SHIFT, PERIOD, movewindow, mon:+1

# ============================================================================
# Scratchpads (from DWM togglescratch)
# ============================================================================
# Using on-created-empty workspace rules - app launches on first toggle,
# subsequent toggles just show/hide the workspace

# Workspace rules (auto-launch apps when workspace first accessed)
workspace = special:term, on-created-empty:foot --app-id foot-term tmux
workspace = special:audio, on-created-empty:foot --app-id foot-audio pulsemixer
workspace = special:monitor, on-created-empty:foot --app-id foot-monitor gotop
workspace = special:music, on-created-empty:foot --app-id foot-music ncmpcpp
workspace = special:files, on-created-empty:foot --app-id foot-files ranger
workspace = special:htop, on-created-empty:foot --app-id foot-htop htop
workspace = special:network, on-created-empty:foot --app-id foot-network nmtui

# Keybindings (single bind per scratchpad - just toggle visibility)
bind = $mod SHIFT, RETURN, togglespecialworkspace, term
bind = $mod, A, togglespecialworkspace, audio
bind = $mod, M, togglespecialworkspace, monitor
bind = $mod, SLASH, togglespecialworkspace, music
bind = $mod, F, togglespecialworkspace, files
bind = $mod SHIFT, H, togglespecialworkspace, htop

# Window rules (using app-id/class matching, Hyprland 0.53+ syntax)
# Terminal scratchpad
windowrule = match:class ^(foot-term)$, float on
windowrule = match:class ^(foot-term)$, size (monitor_w*0.6) (monitor_h*0.6)
windowrule = match:class ^(foot-term)$, center on

# Audio mixer
windowrule = match:class ^(foot-audio)$, float on
windowrule = match:class ^(foot-audio)$, size (monitor_w*0.6) (monitor_h*0.6)
windowrule = match:class ^(foot-audio)$, center on

# System monitor
windowrule = match:class ^(foot-monitor)$, float on
windowrule = match:class ^(foot-monitor)$, size (monitor_w*0.6) (monitor_h*0.6)
windowrule = match:class ^(foot-monitor)$, center on

# Music player
windowrule = match:class ^(foot-music)$, float on
windowrule = match:class ^(foot-music)$, size (monitor_w*0.6) (monitor_h*0.6)
windowrule = match:class ^(foot-music)$, center on

# File manager
windowrule = match:class ^(foot-files)$, float on
windowrule = match:class ^(foot-files)$, size (monitor_w*0.6) (monitor_h*0.6)
windowrule = match:class ^(foot-files)$, center on

# Htop
windowrule = match:class ^(foot-htop)$, float on
windowrule = match:class ^(foot-htop)$, size (monitor_w*0.6) (monitor_h*0.6)
windowrule = match:class ^(foot-htop)$, center on

# Network manager
windowrule = match:class ^(foot-network)$, float on
windowrule = match:class ^(foot-network)$, size (monitor_w*0.6) (monitor_h*0.6)
windowrule = match:class ^(foot-network)$, center on

# Calculator (not a scratchpad, just launches app)
bind = $mod, X, exec, qalculate-gtk
bind = $mod, C, exec, qalculate-gtk

# Media/hardware keys
bindel = , XF86AudioRaiseVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ +5%
bindel = , XF86AudioLowerVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ -5%
bindl = , XF86AudioMute, exec, pactl set-sink-mute @DEFAULT_SINK@ toggle
bindel = , XF86MonBrightnessUp, exec, brightnessctl s +10%
bindel = , XF86MonBrightnessDown, exec, brightnessctl s 10%-

# Microphone toggle (from sxhkdrc)
bind = CTRL ALT, SPACE, exec, amixer set Capture toggle && amixer get Capture | grep '\[off\]' && notify-send "Microphone" "Muted" || notify-send "Microphone" "On"

# Bluetooth (from DWM and sxhkdrc)
bind = $mod SHIFT, B, exec, blueman-manager

# Screenshots (Wayland: grim + slurp instead of maim)
bind = $mod, S, exec, grim -g "$(slurp)" ~/pictures/screenshots/$(date +%Y.%m.%d-%H%M%S).png && notify-send "Screenshot" "Saved to ~/pictures/screenshots/"
bind = , Print, exec, grim ~/pictures/screenshots/$(date +%Y.%m.%d-%H%M%S).png && notify-send "Screenshot" "Full screen saved"

# Color picker (Wayland: hyprpicker instead of xcolor)
# bind = $mod, C, exec, hyprpicker -a  # conflicts with calculator, uncomment if needed

# Lock screen (from sxhkdrc: super+Escape)
bind = $mod, ESCAPE, exec, hyprlock

# Touchpad toggle
bind = $mod, F9, exec, toggle-touchpad

# Exit/session (from DWM)
bind = $mod SHIFT, Q, exec, printf "Exit\nCancel" | fuzzel --dmenu --prompt "Exit Hyprland? " | grep -q "Exit" && hyprctl dispatch exit
bind = $mod SHIFT, BACKSPACE, exit
bind = $mod SHIFT, ESCAPE, exec, hyprctl reload

# Mouse bindings (from DWM buttons)
bindm = $mod, mouse:272, movewindow
bindm = $mod, mouse:273, resizewindow
bindm = $mod SHIFT, mouse:272, resizewindow