From f558e4ff10d19c70768428977277a56d4be110b0 Mon Sep 17 00:00:00 2001 From: Benjamin Palko Date: Fri, 11 Jul 2025 13:52:44 -0400 Subject: [PATCH] reorder hyprland configs and use var to store config dir path --- hypr/hyprland.conf | 26 ++++-------- hypr/hyprland/env.conf | 24 +++++++++++ hypr/hyprland/execs.conf | 21 ++++++++++ hypr/hyprland/keybinds.conf | 80 +++++++++++++++++++++++++++++++++++++ hypr/hyprland/rules.conf | 39 ++++++++++++++++++ 5 files changed, 171 insertions(+), 19 deletions(-) create mode 100644 hypr/hyprland/env.conf create mode 100644 hypr/hyprland/execs.conf create mode 100644 hypr/hyprland/keybinds.conf create mode 100644 hypr/hyprland/rules.conf diff --git a/hypr/hyprland.conf b/hypr/hyprland.conf index 0dbfa8e..5075ba6 100644 --- a/hypr/hyprland.conf +++ b/hypr/hyprland.conf @@ -1,16 +1,4 @@ - -# ####################################################################################### -# AUTOGENERATED HYPR CONFIG. -# PLEASE USE THE CONFIG PROVIDED IN THE GIT REPO /examples/hypr.conf AND EDIT IT, -# OR EDIT THIS ONE ACCORDING TO THE WIKI INSTRUCTIONS. -# ####################################################################################### - -# -# Please note not all available settings / options are set here. -# For a full list, see the wiki -# - -#autogenerated = 1 # remove this line to remove the warning +# See https://wiki.hyprland.org/Configuring/Keywords/ for more # See https://wiki.hyprland.org/Configuring/Monitors/ # PC @@ -19,11 +7,8 @@ monitor=DP-1,2560x1440@144,auto,auto # Laptop monitor=eDP-1,1920x1080@60,auto,1.20 -# See https://wiki.hyprland.org/Configuring/Keywords/ for more - # Execute your favorite apps at launch # exec-once = waybar & hyprpaper & firefox -source = ~/.config/hypr/config/startup.conf # PyWal Colors source = ~/.cache/wal/colors-hyprland.conf @@ -61,9 +46,12 @@ env = MONOSPACE_FONT_NAME,JetBrainsMono Nerd Font 5 env = FONT_ANTIALIASING,rgba env = FONT_HINTING,full -source = ~/.config/hypr/config/environments/nvidia.conf -source = ~/.config/hypr/config/keybinds.conf -source = ~/.config/hypr/config/rules.conf +$hypr = ~/.config/hypr/hyprland + +source = $hypr/env.conf +source = $hypr/execs.conf +source = $hypr/keybinds.conf +source = $hypr/rules.conf # For all categories, see https://wiki.hyprland.org/Configuring/Variables/ input { diff --git a/hypr/hyprland/env.conf b/hypr/hyprland/env.conf new file mode 100644 index 0000000..926b9e1 --- /dev/null +++ b/hypr/hyprland/env.conf @@ -0,0 +1,24 @@ +# ----------------------------------------------------- +# Environment Variables +# name: "Nvidia" +# ----------------------------------------------------- + +# https://wiki.hyprland.org/Nvidia/ + +env = LIBVA_DRIVER_NAME,nvidia +env = __GLX_VENDOR_LIBRARY_NAME,nvidia + +env = NVD_BACKEND,direct + +env = ELECTRON_OZONE_PLATFORM_HINT,auto + +env = XDG_SESSION_TYPE,wayland +env = GBM_BACKEND,nvidia-drm +cursor { + no_hardware_cursors = true +} +env = XCURSOR_SIZE,24 +env = QT_QPA_PLATFORM,wayland +env = WLR_NO_HARDWARE_CURSORS,1 +env = __GL_VRR_ALLOWED,1 +env = WLR_DRM_NO_ATOMIC,1 diff --git a/hypr/hyprland/execs.conf b/hypr/hyprland/execs.conf new file mode 100644 index 0000000..cf57e24 --- /dev/null +++ b/hypr/hyprland/execs.conf @@ -0,0 +1,21 @@ +# Notification Daemon +exec-once = bash ~/.config/hypr/scripts/start-swaync.sh +# Idle Daemon +exec-once = hypridle +# Status-bar +# exec-once = bash ~/.config/hypr/scripts/start-waybar.sh +exec-once = bash ~/dotfiles/hypr/scripts/run-ags.sh +# Emotes +exec-once = emote +# Wallpaper Daemon +exec-once = swww-daemon + +exec-once = [workspace 1 silent] thunderbird +exec-once = [workspace 1 silent] proton-mail --password-store="gnome-libsecret" +exec-once = [workspace 2 silent] discord --enable-features=UseOzonePlatform --ozone-platform=wayland +exec-once = [workspace 2 silent] signal-desktop --password-store="gnome-libsecret" +exec-once = [workspace 3 silent] zen-browser +exec-once = [workspace 4 silent] kitty +exec-once = [workspace special:terminal silent] kitty +exec-once = [workspace special:music silent] deezer --enable-features=UseOzonePlatform --ozone-platform=wayland + diff --git a/hypr/hyprland/keybinds.conf b/hypr/hyprland/keybinds.conf new file mode 100644 index 0000000..48fef57 --- /dev/null +++ b/hypr/hyprland/keybinds.conf @@ -0,0 +1,80 @@ + +# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more +bind = $mainMod, T, exec, $terminal +bind = $mainMod, X, killactive, +bind = $mainMod, ESCAPE, exec, $powerMenu +bind = $mainMod, E, exec, $fileManager +bind = $mainMod, F, togglefloating, +bind = $mainMod, R, exec, $menu +bind = $mainMod, P, pseudo, # dwindle +bind = $mainMod, V, togglesplit, # dwindle +bind = $mainMod, L, exec, $lockScreen # hyprlock +bind = $mainMod, period, exec, emote +bind = $mainMod, B, exec, zen-browser +bind = $mainMod CTRL, F, fullscreen +bind = , PRINT, exec, grim -g "$(slurp)" - | swappy -f - + +# Move focus with mainMod + arrow keys +bind = $mainMod, left, movefocus, l +bind = $mainMod, right, movefocus, r +bind = $mainMod, up, movefocus, u +bind = $mainMod, down, movefocus, d + +# Switch workspaces with mainMod + [0-9] +bind = $mainMod, 1, workspace, 1 +bind = $mainMod, 2, workspace, 2 +bind = $mainMod, 3, workspace, 3 +bind = $mainMod, 4, workspace, 4 +bind = $mainMod, 5, workspace, 5 +bind = $mainMod, 6, workspace, 6 +bind = $mainMod, 7, workspace, 7 +bind = $mainMod, 8, workspace, 8 +bind = $mainMod, 9, workspace, 9 +bind = $mainMod, 0, workspace, 10 + +# Move active window to a workspace with mainMod + SHIFT + [0-9] +bind = $mainMod SHIFT, 1, movetoworkspace, 1 +bind = $mainMod SHIFT, 2, movetoworkspace, 2 +bind = $mainMod SHIFT, 3, movetoworkspace, 3 +bind = $mainMod SHIFT, 4, movetoworkspace, 4 +bind = $mainMod SHIFT, 5, movetoworkspace, 5 +bind = $mainMod SHIFT, 6, movetoworkspace, 6 +bind = $mainMod SHIFT, 7, movetoworkspace, 7 +bind = $mainMod SHIFT, 8, movetoworkspace, 8 +bind = $mainMod SHIFT, 9, movetoworkspace, 9 +bind = $mainMod SHIFT, 0, movetoworkspace, 10 + +############################################################################### +# Special workspaces +############################################################################### +# Scratchpad +bind = CTRL SHIFT, S, togglespecialworkspace, magic +bind = CTRL $mainMod, S, movetoworkspace, special:magic + +# Terminal +bind = CTRL SHIFT, T, togglespecialworkspace, terminal + +# Music +bind = CTRL SHIFT, M, togglespecialworkspace, music + +# Scroll through existing workspaces with mainMod + scroll +bind = $mainMod, mouse_down, workspace, e+1 +bind = $mainMod, mouse_up, workspace, e-1 + +# Switch workspaces +bind = CTRL ALT, right, workspace, e+1 +bind = CTRL ALT, left, workspace, e-1 + +# Move/resize windows with mainMod + LMB/RMB and dragging +bindm = $mainMod, mouse:272, movewindow +bindm = $mainMod, mouse:273, resizewindow + +# Audio keybinds +bind = , XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%+ +bind = , XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%- +bind = , XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle +bind = , XF86AudioPlay, exec, playerctl play-pause +bind = , XF86AudioStop, exec, +bind = , XF86AudioPrev, exec, playerctl previous +bind = , XF86AudioNext, exec, playerctl next + diff --git a/hypr/hyprland/rules.conf b/hypr/hyprland/rules.conf new file mode 100644 index 0000000..a7c7c68 --- /dev/null +++ b/hypr/hyprland/rules.conf @@ -0,0 +1,39 @@ + +# Example windowrule v1 +# windowrule = float, ^(kitty)$ +# Example windowrule v2 +# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ +# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more +windowrulev2 = nomaxsize, class:.* # You'll probably like this. +# windowrulev2 = opacity 1 0.6, class:.* + + +# Apps + +windowrule = float, title:rofi + +# windowrule = workspace special:terminal, kitty +windowrule = workspace special:music, initialClass:Spotify +windowrule = opacity 0.85 0.8, initialClass:Spotify + +windowrule = workspace:1, class:thunderbird + +windowrule = workspace 2,class:(discord) + +windowrule = workspace 2,class:(signal) +windowrule = opacity:0.999, class:signal + +windowrule = workspace:3, class:firefox +windowrule = opacity:0.999, class:firefox + +windowrule = workspace 5,float,class:(steam) +windowrule = workspace 5, class:^(steam_app_*)$ + +windowrule = float, class:org.gnome.Calculator + +# Workspaces +workspace = 1, persistent:true +workspace = 2, persistent:true +workspace = 3, persistent:true +workspace = 4, persistent:true +