# Application bindings
$terminal = uwsm-app -- $TERMINAL
$browser = omarchy-launch-browser

# key |    super    |   +shift   |   +alt     |
# ====|=============|============|============|
# Ret | Terminal    |            |            |
#  a  | ChatGPT     |            | ProtonAuth |
#  b  | Browser     | +incognito | BlueSky    |
#  c  |             |            |            |
#  d  |             |            |            |
#  e  |             |            | ProtonMail |
#  f  | Files       |            |            |
#  g  |             |            | GitHub     |
#  h  |             |            |            |
#  i  |             |            |            |
#  j  | TOG.SPLIT   |            |            |
#  k  | KEYBINDS    |            |            |
#  l  |             |            |            |
#  m  |             |            |            |
#  n  | Nvim        |            |            |
#  o  | Obsidian    |            |            |
#  p  | PSEUDO WIN. |            | ProtonPass |
#  q  |             |            |            |
#  r  |             |            |            |
#  s  |             |            | Slack      |
#  t  | Activity    |            | Messages   |
#  u  |             |            |            |
#  v  | FLOAT       |            |            |
#  w  | EXIT        |            | WhatsApp   |
#  x  |             |            |            |
#  y  |             |            | YouTube    |
#  z  |             |            |            |

bindd = SUPER, return, Terminal, exec, bash -c 'dir="$(omarchy-cmd-terminal-cwd)"; $terminal --working-directory="$dir"'
bindd = SUPER, F, File manager, exec, uwsm-app -- nautilus --new-window
bindd = SUPER, B, Browser, exec, $browser
bindd = SUPER SHIFT, B, Browser (private), exec, $browser --private
bindd = SUPER, N, Editor, exec, omarchy-launch-editor
bindd = SUPER, T, Activity, exec, $terminal -e btop
bindd = SUPER, O, Obsidian, exec, omarchy-launch-or-focus obsidian "uwsm-app -- obsidian -disable-gpu --enable-wayland-ime"

# If your web app url contains #, type it as ## to prevent hyperland treat it as comments
bindd = SUPER, A, ChatGPT, exec, omarchy-launch-webapp "https://chatgpt.com"
bindd = SUPER ALT, D, Discord, exec, omarchy-launch-or-focus vesktop
bindd = SUPER ALT, M, Music, exec, omarchy-launch-or-focus-webapp "Music" "https://music.youtube.com"
bindd = SUPER ALT, Y, YouTube, exec, omarchy-launch-or-focus-webapp "YouTube" "https://youtube.com/"
bindd = SUPER ALT, B, BlueSky, exec, omarchy-launch-or-focus-webapp "bsky" "https://bsky.app/"
bindd = SUPER ALT, G, GitHub, exec, omarchy-launch-or-focus-webapp "Github" "https://github.com"
bindd = SUPER ALT, W, WhatsApp, exec, omarchy-launch-or-focus-webapp "WhatsApp" "https://web.whatsapp.com/"
bindd = SUPER ALT, T, Google Messages, exec, omarchy-launch-or-focus-webapp "Messages" "https://messages.google.com/web/conversations"
bindd = SUPER ALT, E, Email, exec, omarchy-launch-or-focus proton-mail
bindd = SUPER ALT, A, Authenticator, exec, omarchy-launch-or-focus proton-authenticator
bindd = SUPER ALT, P, Password Manager, exec, omarchy-launch-or-focus proton-pass
bindd = SUPER ALT, S, Slack, exec, omarchy-launch-or-focus slack
# Only display the OSD on the currently focused monitor
$osdclient = swayosd-client --monitor "$(hyprctl monitors -j | jq -r '.[] | select(.focused == true).name')"

# Laptop multimedia keys for volume and LCD brightness (with OSD)
bindeld = ,XF86AudioRaiseVolume, Volume up, exec, $osdclient --output-volume raise
bindeld = ,XF86AudioLowerVolume, Volume down, exec, $osdclient --output-volume lower
bindeld = ,XF86AudioMute, Mute, exec, $osdclient --output-volume mute-toggle
bindeld = ,XF86AudioMicMute, Mute microphone, exec, $osdclient --input-volume mute-toggle
bindeld = ,XF86MonBrightnessUp, Brightness up, exec, $osdclient --brightness raise
bindeld = ,XF86MonBrightnessDown, Brightness down, exec, $osdclient --brightness lower

# Precise 1% multimedia adjustments with Alt modifier
bindeld = ALT, XF86AudioRaiseVolume, Volume up precise, exec, $osdclient --output-volume +1
bindeld = ALT, XF86AudioLowerVolume, Volume down precise, exec, $osdclient --output-volume -1
bindeld = ALT, XF86MonBrightnessUp, Brightness up precise, exec, $osdclient --brightness +1
bindeld = ALT, XF86MonBrightnessDown, Brightness down precise, exec, $osdclient --brightness -1

# Requires playerctl
bindld = , XF86AudioNext, Next track, exec, $osdclient --playerctl next
bindld = , XF86AudioPause, Pause, exec, $osdclient --playerctl play-pause
bindld = , XF86AudioPlay, Play, exec, $osdclient --playerctl play-pause
bindld = , XF86AudioPrev, Previous track, exec, $osdclient --playerctl previous

# Switch audio output with Super + Mute
bindld = SUPER, XF86AudioMute, Switch audio output, exec, omarchy-cmd-audio-switch

# Close windows
bindd = SUPER, W, Close active window, killactive,
bindd = CTRL ALT, DELETE, Close all Windows, exec, omarchy-cmd-close-all-windows

# Control tiling
bindd = SUPER, J, Toggle split, togglesplit, # dwindle
bindd = SUPER, P, Pseudo window, pseudo, # dwindle
bindd = SUPER SHIFT, V, Toggle floating, togglefloating,
bindd = SHIFT, F11, Force full screen, fullscreen, 0
bindd = SUPER, Z, Full width, fullscreen, 1
# Move focus with SUPER + arrow keys
bindd = SUPER, left, Move focus left, movefocus, l
bindd = SUPER, right, Move focus right, movefocus, r
bindd = SUPER, up, Move focus up, movefocus, u
bindd = SUPER, down, Move focus down, movefocus, d

# Switch workspaces with SUPER + [0-9]
bindd = SUPER, code:10, Switch to workspace 1, workspace, 1
bindd = SUPER, code:11, Switch to workspace 2, workspace, 2
bindd = SUPER, code:12, Switch to workspace 3, workspace, 3
bindd = SUPER, code:13, Switch to workspace 4, workspace, 4
bindd = SUPER, code:14, Switch to workspace 5, workspace, 5
bindd = SUPER, code:15, Switch to workspace 6, workspace, 6
bindd = SUPER, code:16, Switch to workspace 7, workspace, 7
bindd = SUPER, code:17, Switch to workspace 8, workspace, 8
bindd = SUPER, code:18, Switch to workspace 9, workspace, 9

# Move active window to a workspace with SUPER + SHIFT + [0-9]
bindd = SUPER SHIFT, code:10, Move window to workspace 1, movetoworkspace, 1
bindd = SUPER SHIFT, code:11, Move window to workspace 2, movetoworkspace, 2
bindd = SUPER SHIFT, code:12, Move window to workspace 3, movetoworkspace, 3
bindd = SUPER SHIFT, code:13, Move window to workspace 4, movetoworkspace, 4
bindd = SUPER SHIFT, code:14, Move window to workspace 5, movetoworkspace, 5
bindd = SUPER SHIFT, code:15, Move window to workspace 6, movetoworkspace, 6
bindd = SUPER SHIFT, code:16, Move window to workspace 7, movetoworkspace, 7
bindd = SUPER SHIFT, code:17, Move window to workspace 8, movetoworkspace, 8
bindd = SUPER SHIFT, code:18, Move window to workspace 9, movetoworkspace, 9

# Tab between workspaces
bindd = SUPER, TAB, Next workspace, workspace, e+1
bindd = SUPER SHIFT, TAB, Previous workspace, workspace, e-1
bindd = SUPER CTRL, TAB, Former workspace, workspace, previous

# Swap active window with the one next to it with SUPER + SHIFT + arrow keys
bindd = SUPER SHIFT, left, Swap window to the left, swapwindow, l
bindd = SUPER SHIFT, right, Swap window to the right, swapwindow, r
bindd = SUPER SHIFT, up, Swap window up, swapwindow, u
bindd = SUPER SHIFT, down, Swap window down, swapwindow, d

# Cycle through applications on active workspace
bindd = ALT, Tab, Cycle to next window, cyclenext
bindd = ALT SHIFT, Tab, Cycle to prev window, cyclenext, prev
bindd = ALT, Tab, Reveal active window on top, bringactivetotop
bindd = ALT SHIFT, Tab, Reveal active window on top, bringactivetotop

# Resize active window
bindd = SUPER CTRL, left, Expand window left, resizeactive, -100 0 
bindd = SUPER CTRL, right, Shrink window left, resizeactive, 100 0
bindd = SUPER CTRL, up, Expand window vertical, resizeactive, 0 100
bindd = SUPER CTRL, down, Shrink window vertical, resizeactive, 0 -100

# Scroll through existing workspaces with SUPER + scroll
bindd = SUPER, mouse_down, Scroll active workspace forward, workspace, e+1
bindd = SUPER, mouse_up, Scroll active workspace backward, workspace, e-1

# Move/resize windows with mainMod + LMB/RMB and dragging
bindmd = SUPER, mouse:272, Move window, movewindow
bindmd = SUPER, mouse:273, Resize window, resizewindow
# Menus
bindd = SUPER, SPACE, Launch apps, exec, walker -p "Start…"
bindd = SUPER CTRL, E, Emoji picker, exec, walker -m Emojis
bindd = SUPER CTRL, V, Clipboard, exec, walker -m clipboard
bindd = SUPER ALT, SPACE, Omarchy menu, exec, omarchy-menu
bindd = SUPER, ESCAPE, Power menu, exec, omarchy-menu system
bindld = , XF86PowerOff, Power menu, exec, omarchy-menu system
bindd = SUPER, K, Show key bindings, exec, omarchy-menu-keybindings
bindd = , XF86Calculator, Calculator, exec, gnome-calculator

# Aesthetics
bindd = SUPER SHIFT, SPACE, Toggle top bar, exec, omarchy-toggle-waybar
bindd = SUPER CTRL, SPACE, Next background in theme, exec, omarchy-theme-bg-next
bindd = SUPER SHIFT CTRL, SPACE, Pick new theme, exec, omarchy-menu theme
bindd = SUPER, BACKSPACE, Toggle window transparency, exec, hyprctl dispatch setprop "address:$(hyprctl activewindow -j | jq -r '.address')" opaque toggle

# Notifications
bindd = SUPER, SEMICOLON, Dismiss last notification, exec, makoctl dismiss
bindd = SUPER SHIFT, SEMICOLON, Dismiss all notifications, exec, makoctl dismiss --all
bindd = SUPER CTRL, SEMICOLON, Toggle silencing notifications, exec, makoctl mode -t do-not-disturb && makoctl mode | grep -q 'do-not-disturb' && notify-send "Silenced notifications" || notify-send "Enabled notifications" && pkill -RTMIN+9 waybar

# Toggle idling
bindd = SUPER CTRL, I, Toggle locking on idle, exec, omarchy-toggle-idle

# Toggle nightlight
bindd = SUPER CTRL, N, Toggle nightlight, exec, omarchy-toggle-nightlight

# Screenshots
bindd = , PRINT, Screenshot of region, exec, omarchy-cmd-screenshot
bindd = SHIFT, PRINT, Screenshot of window, exec, omarchy-cmd-screenshot window
bindd = CTRL, PRINT, Screenshot of display, exec, omarchy-cmd-screenshot output

# Screen recordings
bindd = ALT, PRINT, Screen record menu, exec, omarchy-menu screenrecord

# Color picker
bindd = SUPER, PRINT, Color picker, exec, pkill hyprpicker || hyprpicker -a

# File sharing
bindd = CTRL SUPER, S, Share, exec, omarchy-menu share

# Utilities
bind = SUPER, C, sendshortcut, CTRL, Insert,
bind = SUPER, V, sendshortcut, SHIFT, Insert,
