♻️ refactor(hypr): whole binds config file

using mainmod variable instead of super, default apps file and some other misc changes
This commit is contained in:
Sergio Laín 2024-05-26 20:20:36 +02:00
parent 5ae2599bd7
commit 01ee540655
No known key found for this signature in database
GPG key ID: FB00AF7015FFE76B
3 changed files with 141 additions and 117 deletions

View file

@ -1,150 +1,151 @@
# Variables
source = ~/.config/hypr/configs/default_apps.conf
$mainMod = SUPER
$scripts = ~/.config/hypr/scripts
$custom_app_launch = $scripts/custom_app_launch
$hyprshot = $scripts/hyprshot -o ~/Imagenes/Capturas/PC -f captura-$(date +%Y-%m-%d-%s).png
$workspace = $scripts/awesome_workspaces
$rofi-scripts = ~/.config/rofi/scripts
# Mouse binds
bindm = SUPER, mouse:272, movewindow
bindm = SUPER, mouse:273, resizewindow
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow
# Basic keybinds
bind = SUPER, Q, killactive,
bind = SUPERCTRL, R, exec, pkill waybar || waybar
bind = SUPERCTRL, M, exit
bind = SUPER, A, exec, $scripts/toggle_floating
bind = SUPER, P, pseudo
bind = SUPER, F, fullscreen, 0
bind = SUPER, Z, exec, pypr zoom
bind = $mainMod, Q, killactive,
bind = $mainMod CTRL, R, exec, killall $bar; $bar
bind = $mainMod SHIFT, R, exec, swaync -R && swaync -rs
bind = $mainMod, A, exec, $scripts/toggle_floating
bind = $mainMod, P, pseudo
bind = $mainMod, F, fullscreen, 0
bind = $mainMod, Z, exec, pypr zoom
# Applications
bind = SUPER, W, exec, $custom_app_launch browser
bind = SUPER, O, exec, $custom_app_launch obsidian
bind = SUPERSHIFT, O, exec, $custom_app_launch office
bind = SUPERSHIFT, E,exec, $custom_app_launch nemo
bind = SUPER, RETURN, exec, kitty
bind = SUPERSHIFT, RETURN, exec, kitty --class=center-float-large
bind = SUPERALT, RETURN, exec, kitty --class=center-float
bind = SUPERCTRL, RETURN, exec, kitty --class=center-float-mini
bind = SUPER, BACKSPACE, exec, $custom_app_launch nvim
bind = SUPERSHIFT, BACKSPACE, exec, $custom_app_launch codium
bind = $mainMod, W, exec, $browser
bind = $mainMod, O, exec, $notetaking-app
bind = $mainMod SHIFT, O, exec, $office-suite
bind = $mainMod SHIFT, E,exec, $alter-file-manager
bind = $mainMod, RETURN, exec, $terminal
bind = $mainMod SHIFT, RETURN, exec, $terminal --class=center-float-large
bind = $mainMod ALT, RETURN, exec, $terminal --class=center-float
bind = $mainMod CTRL, RETURN, exec, $terminal --class=center-float-mini
bind = $mainMod, BACKSPACE, exec, $editor
bind = $mainMod SHIFT, BACKSPACE, exec, $alter-editor
# Pickers/Launchers
bind = SUPER, 23, exec, rofi -show drun # Tab
bind = SUPER, INSERT, exec, $scripts/color_picker
bind = SUPERSHIFT, W, exec, $scripts/wallpaper select
bind = SUPERCTRL, W, exec, pypr wall next
bind = SUPER, 61, exec, $scripts/rofi/keybindings # /
bind = SUPERSHIFT, G, exec, $scripts/rofi/game_launcher
bind = SUPER, Y, exec, cliphist list | rofi -dmenu | cliphist decode | wl-copy
bind = $mainMod, 23, exec, $launcher # Tab
bind = $mainMod, INSERT, exec, $scripts/color_picker
bind = $mainMod SHIFT, W, exec, $rofi-scripts/wallpaper/wallpaper
bind = $mainMod, 61, exec, $rofi-scripts/keybindings/keybindings # /
bind = $mainMod SHIFT, G, exec, rofi -modi games -show games -theme $rofi-scripts/game-launcher/style
bind = $mainMod, Y, exec, cliphist list | rofi -dmenu | cliphist decode | wl-copy
# Scratchpads
bind = SUPER, V, exec, pypr toggle volume
bind = SUPER, 51, exec, pypr toggle terminal # Backslash
bind = SUPER, B, exec, pypr toggle btop
bind = SUPERSHIFT, I, exec, pypr toggle gpt
bind = SUPERSHIFT, B, exec, pypr toggle bluetooth
bind = SUPER, E, exec, pypr toggle yazi
bind = SUPER, D, exec, pypr toggle dots
bind = SUPERSHIFT, C, exec, pypr toggle cava
bind = SUPER, U, exec, pypr toggle topgrade-system
bind = SUPERSHIFT, U, exec, pypr toggle topgrade-all
bind = $mainMod, V, exec, pypr toggle volume
bind = $mainMod, 51, exec, pypr toggle terminal # Backslash
bind = $mainMod, B, exec, pypr toggle btop
bind = $mainMod SHIFT, I, exec, pypr toggle gpt
bind = $mainMod SHIFT, B, exec, pypr toggle bluetooth
bind = $mainMod, E, exec, pypr toggle yazi
bind = $mainMod, D, exec, pypr toggle dots
bind = $mainMod SHIFT, C, exec, pypr toggle cava
bind = $mainMod, U, exec, pypr toggle topgrade-system
bind = $mainMod SHIFT, U, exec, pypr toggle topgrade-all
# Screenshot stuff
bind = SHIFT, INSERT, exec, $hyprshot -m output
bind = SUPERSHIFT, INSERT, exec, $hyprshot -m window
bind = CTRL, INSERT, exec, $hyprshot -m region
bind = ALT, INSERT, exec, $scripts/rofi/screenshots_selection
# Screenshots
bind = CTRL, ESCAPE, exec, $rofi-scripts/screenshot/screenshot
bind = SHIFT, ESCAPE, exec, $rofi-scripts/screenshot/screenshot --freeze
# Misc stuff
bind = $mainMod CTRL, W, exec, pypr wall next
# Notifications menu
bind = SUPER, N, exec, swaync-client -t
bind = $mainMod, N, exec, $notifications-menu
# Logout menu
bind = SUPER, ESCAPE, exec, wleave
bind = $mainMod, ESCAPE, exec, $rofi-scripts/powermenu/powermenu
# Windows
# Focusing on windows
bind = SUPER, LEFT, movefocus, l
bind = SUPER, RIGHT, movefocus, r
bind = SUPER, UP, movefocus, u
bind = SUPER, DOWN, movefocus, d
bind = $mainMod, LEFT, movefocus, l
bind = $mainMod, RIGHT, movefocus, r
bind = $mainMod, UP, movefocus, u
bind = $mainMod, DOWN, movefocus, d
# Vim-keybinds
bind = SUPER, H, movefocus, l
bind = SUPER, L, movefocus, r
bind = SUPER, K, movefocus, u
bind = SUPER, J, movefocus, d
bind = $mainMod, H, movefocus, l
bind = $mainMod, L, movefocus, r
bind = $mainMod, K, movefocus, u
bind = $mainMod, J, movefocus, d
# Moving windows
bind = SUPERSHIFT, LEFT, movewindow, l
bind = SUPERSHIFT, RIGHT, movewindow, r
bind = SUPERSHIFT, UP, movewindow, u
bind = SUPERSHIFT, DOWN, movewindow, d
bind = $mainMod SHIFT, LEFT, movewindow, l
bind = $mainMod SHIFT, RIGHT, movewindow, r
bind = $mainMod SHIFT, UP, movewindow, u
bind = $mainMod SHIFT, DOWN, movewindow, d
# Vim-keybinds
bind = SUPERSHIFT, H, movewindow, l
bind = SUPERSHIFT, L, movewindow, r
bind = SUPERSHIFT, K, movewindow, u
bind = SUPERSHIFT, J, movewindow, d
bind = SUPERSHIFT, 51, exec, $scripts/move_by_rules # Backslash
bind = $mainMod SHIFT, H, movewindow, l
bind = $mainMod SHIFT, L, movewindow, r
bind = $mainMod SHIFT, K, movewindow, u
bind = $mainMod SHIFT, J, movewindow, d
bind = $mainMod SHIFT, 51, exec, $scripts/move_by_rules # Backslash
# Center and split
bind = SUPER, S, togglesplit
bind = SUPER, C, exec, hyprctl dispatch centerwindow 1
bind = $mainMod, S, togglesplit
bind = $mainMod, C, exec, hyprctl dispatch centerwindow 1
# Workspaces
# Focusing other workspaces
bind = SUPER, 1, workspace, r~1
bind = SUPER, 2, workspace, r~2
bind = SUPER, 3, workspace, r~3
bind = SUPER, 4, workspace, r~4
bind = SUPER, 5, workspace, r~5
bind = SUPER, 6, workspace, r~6
bind = SUPER, 7, workspace, r~7
bind = SUPER, 8, workspace, r~8
bind = SUPER, 9, workspace, r~9
bind = $mainMod, 1, workspace, r~1
bind = $mainMod, 2, workspace, r~2
bind = $mainMod, 3, workspace, r~3
bind = $mainMod, 4, workspace, r~4
bind = $mainMod, 5, workspace, r~5
bind = $mainMod, 6, workspace, r~6
bind = $mainMod, 7, workspace, r~7
bind = $mainMod, 8, workspace, r~8
bind = $mainMod, 9, workspace, r~9
# Moving windows to other workspaces
bind = SUPERSHIFT, 1, movetoworkspace, r~1
bind = SUPERSHIFT, 2, movetoworkspace, r~2
bind = SUPERSHIFT, 3, movetoworkspace, r~3
bind = SUPERSHIFT, 4, movetoworkspace, r~4
bind = SUPERSHIFT, 5, movetoworkspace, r~5
bind = SUPERSHIFT, 6, movetoworkspace, r~6
bind = SUPERSHIFT, 7, movetoworkspace, r~7
bind = SUPERSHIFT, 8, movetoworkspace, r~8
bind = SUPERSHIFT, 9, movetoworkspace, r~9
bind = $mainMod SHIFT, 1, movetoworkspace, r~1
bind = $mainMod SHIFT, 2, movetoworkspace, r~2
bind = $mainMod SHIFT, 3, movetoworkspace, r~3
bind = $mainMod SHIFT, 4, movetoworkspace, r~4
bind = $mainMod SHIFT, 5, movetoworkspace, r~5
bind = $mainMod SHIFT, 6, movetoworkspace, r~6
bind = $mainMod SHIFT, 7, movetoworkspace, r~7
bind = $mainMod SHIFT, 8, movetoworkspace, r~8
bind = $mainMod SHIFT, 9, movetoworkspace, r~9
# Moving windows to other workspaces (silent)
bind = SUPERALT, 1, movetoworkspacesilent, r~1
bind = SUPERALT, 2, movetoworkspacesilent, r~2
bind = SUPERALT, 3, movetoworkspacesilent, r~3
bind = SUPERALT, 4, movetoworkspacesilent, r~4
bind = SUPERALT, 5, movetoworkspacesilent, r~5
bind = SUPERALT, 6, movetoworkspacesilent, r~6
bind = SUPERALT, 7, movetoworkspacesilent, r~7
bind = SUPERALT, 8, movetoworkspacesilent, r~8
bind = SUPERALT, 9, movetoworkspacesilent, r~9
bind = $mainMod ALT, 1, movetoworkspacesilent, r~1
bind = $mainMod ALT, 2, movetoworkspacesilent, r~2
bind = $mainMod ALT, 3, movetoworkspacesilent, r~3
bind = $mainMod ALT, 4, movetoworkspacesilent, r~4
bind = $mainMod ALT, 5, movetoworkspacesilent, r~5
bind = $mainMod ALT, 6, movetoworkspacesilent, r~6
bind = $mainMod ALT, 7, movetoworkspacesilent, r~7
bind = $mainMod ALT, 8, movetoworkspacesilent, r~8
bind = $mainMod ALT, 9, movetoworkspacesilent, r~9
# Moving to other workspace with mouse control
bind = SUPER, mouse_down, workspace, m-1
bind = SUPER, mouse_up, workspace, m+1
bind = $mainMod, mouse_down, workspace, m-1
bind = $mainMod, mouse_up, workspace, m+1
# Moving to other workspace with keyboard
bind = SUPERCTRL, LEFT, workspace, m-1
bind = SUPERCTRL, RIGHT, workspace, m+1
bind = $mainMod CTRL, LEFT, workspace, m-1
bind = $mainMod CTRL, RIGHT, workspace, m+1
bind = SUPERCTRL, H, workspace, m-1
bind = SUPERCTRL, L, workspace, m+1
bind = $mainMod CTRL, H, workspace, m-1
bind = $mainMod CTRL, L, workspace, m+1
# Moving to next and prev monitors
bind = SUPER, 59, focusmonitor, -1 # Comma
bind = SUPER, 60, focusmonitor, +1 # Period
bind = $mainMod, 59, focusmonitor, -1 # Comma
bind = $mainMod, 60, focusmonitor, +1 # Period
# Group control
bind = SUPER, G, togglegroup
bind = ALT, ESCAPE, changegroupactive
bind = $mainMod, G, togglegroup
bind = ALT, TAB, changegroupactive
# Submap for resizing windows
bind = SUPER, R, submap, resize
bind = $mainMod, R, submap, resize
submap = resize
binde = , RIGHT, resizeactive, 40 0
@ -162,36 +163,36 @@ bind = , ESCAPE, submap, reset
submap = reset
# Audio
bind = SUPERCTRL, V, exec, ~/.local/bin/restartAudio
bind = $mainMod CTRL, V, exec, ~/.local/bin/restartAudio
bindl = SUPERCTRL, mouse:280, exec, swayosd-client --output-volume mute-toggle # Extra Up Button
bindl = $mainMod CTRL, mouse:280, exec, swayosd-client --output-volume mute-toggle # Extra Up Button
bindl = , XF86AudioMute, exec, swayosd-client --output-volume mute-toggle
bindl = SUPERCTRL, mouse:281, exec, swayosd-client --input-volume mute-toggle # Extra Down Button
bindl = $mainMod CTRL, mouse:281, exec, swayosd-client --input-volume mute-toggle # Extra Down Button
bindl = , XF86AudioMicMute, exec, exec swayosd-client --input-volume mute-toggle
bindl = , XF86AudioPlay, exec, playerctl play-pause
bindl = SUPERCTRL, mouse:282, exec, playerctl play-pause # Extra Center Button
bindl = $mainMod CTRL, mouse:282, exec, playerctl play-pause # Extra Center Button
bindl = , XF86AudioPrev, exec, playerctl previous
bindl = SUPERCTRL, mouse:275, exec, playerctl previous # Extra Back Button
bindl = $mainMod CTRL, mouse:275, exec, playerctl previous # Extra Back Button
bindl = , XF86AudioNext, exec, playerctl next
bindl = SUPERCTRL, mouse:276, exec, playerctl next # Extra Forward Button
bindl = $mainMod CTRL, mouse:276, exec, playerctl next # Extra Forward Button
bindle = , XF86AudioRaiseVolume, exec, swayosd-client --output-volume raise
bindle = SUPERCTRL, 21, exec, swayosd-client --output-volume raise # Minus key
bindle = $mainMod CTRL, 21, exec, swayosd-client --output-volume raise # Minus key
bindle = , XF86AudioLowerVolume, exec, swayosd-client --output-volume lower
bindle = SUPERCTRL, 20, exec, swayosd-client --output-volume lower # Plus key
bindle = $mainMod CTRL, 20, exec, swayosd-client --output-volume lower # Plus key
bindle = , XF86InputRaiseVolume, exec, swayosd-client --input-volume raise
bindle = SUPERSHIFT, 21, exec, swayosd-client --input-volume raise # Minus key
bindle = $mainMod SHIFT, 21, exec, swayosd-client --input-volume raise # Minus key
bindle = , XF86InputLowerVolume, exec, swayosd-client --input-volume lower
bindle = SUPERSHIFT, 20, exec, swayosd-client --input-volume lower # Plus key
bindle = $mainMod SHIFT, 20, exec, swayosd-client --input-volume lower # Plus key
# Disable anim, blur, etc
bind = SUPER, F12, exec, $scripts/performance
bind = $mainMod, F12, exec, $scripts/performance
# Open Wiki
bind = SUPER, F1, exec, xdg-open https://wiki.hyprland.org/
bind = SUPERSHIFT, F1, exec, xdg-open https://github.com/Matt-FTW/dotfiles/wiki
bind = $mainMod, F1, exec, xdg-open https://wiki.hyprland.org/
bind = $mainMod SHIFT, F1, exec, xdg-open https://github.com/Matt-FTW/dotfiles/wiki
# Freeze active window
bind = SUPERSHIFT, ESCAPE, exec, $scripts/hyprfreeze -a
bind = $mainMod SHIFT, ESCAPE, exec, $scripts/hyprfreeze -a

View file

@ -0,0 +1,12 @@
# Define your programs
$bar = waybar
$launcher = rofi -show drun
$notifications-menu = swaync-client -t
$browser = floorp
$notetaking-app = obsidian
$terminal = kitty
$office-suite = libreoffice
$editor = nvim
$alter-editor = vscodium
$file-manager = yazi
$alter-file-manager = nemo

View file

@ -0,0 +1,11 @@
#!/usr/bin/bash
random=$(fd --base-directory "$HOME/.config/hypr/theme/walls/" --type f . | shuf -n 1)
wallpaper="$HOME/.config/hypr/theme/walls/$random"
swww img "$wallpaper" \
--transition-bezier 0.5,1.19,.8,.4 \
--transition-type wipe \
--transition-duration 2 \
--transition-fps 75 && notify-send "Wallpaper Changed" -i "$wallpaper"