From 8698cf504885d131d729f362eae14accc5bb373d Mon Sep 17 00:00:00 2001 From: zegonix Date: Sun, 13 Jul 2025 23:30:49 +0200 Subject: [PATCH] (hyprland) added config for hyprland, adjust waybar config for use with hyprland --- .../.config/hypr/hyprpaper.conf | 4 + hypr-monitors-home/.config/hypr/monitors.conf | 5 + hypr/.config/hypr/hypridle.conf | 27 ++ hypr/.config/hypr/hyprland.conf | 246 ++++++++++++++++++ hypr/.config/hypr/hyprlock.conf | 27 ++ waybar/.config/waybar/config | 12 +- waybar/.config/waybar/style.css | 4 +- 7 files changed, 317 insertions(+), 8 deletions(-) create mode 100644 hypr-monitors-home/.config/hypr/hyprpaper.conf create mode 100644 hypr-monitors-home/.config/hypr/monitors.conf create mode 100644 hypr/.config/hypr/hypridle.conf create mode 100644 hypr/.config/hypr/hyprland.conf create mode 100644 hypr/.config/hypr/hyprlock.conf diff --git a/hypr-monitors-home/.config/hypr/hyprpaper.conf b/hypr-monitors-home/.config/hypr/hyprpaper.conf new file mode 100644 index 0000000..06609d2 --- /dev/null +++ b/hypr-monitors-home/.config/hypr/hyprpaper.conf @@ -0,0 +1,4 @@ +$image = ~/dotfiles/images/dungeon_forest.jpg + +preload = $image +wallpaper = , $image diff --git a/hypr-monitors-home/.config/hypr/monitors.conf b/hypr-monitors-home/.config/hypr/monitors.conf new file mode 100644 index 0000000..a737561 --- /dev/null +++ b/hypr-monitors-home/.config/hypr/monitors.conf @@ -0,0 +1,5 @@ +$main_display = DP-2 +$secondary_display = DP-3 + +monitor = $main_display, 1920x1080@144, 0x0, 1 +monitor = $secondary_display, 1920x1080@60, 1920x0, 1 diff --git a/hypr/.config/hypr/hypridle.conf b/hypr/.config/hypr/hypridle.conf new file mode 100644 index 0000000..02f752e --- /dev/null +++ b/hypr/.config/hypr/hypridle.conf @@ -0,0 +1,27 @@ +general { + lock_cmd = pidof hyprlock || hyprlock + before_sleep_cmd = loginctl lock-session + after_sleep_cmd = hyprctl dispatch dpms on +} + +listener { + timeout = 120 + on-timeout = loginctl lock-session +} + +listener { + timeout = 150 + on-timeout = hyprctl dispatch dpms off + on-resume = hyprctl dispatch dpms on +} + +listener { + timeout = 3600 + on-timeout = systemctl suspend +} + +listener { + timeout = 30 + on-timeout = pidof hyprlock && hyprctl dispatch dpms off + on-resume = hyprctl dispatch dpms on +} diff --git a/hypr/.config/hypr/hyprland.conf b/hypr/.config/hypr/hyprland.conf new file mode 100644 index 0000000..7d9538f --- /dev/null +++ b/hypr/.config/hypr/hyprland.conf @@ -0,0 +1,246 @@ + +################################## +# zegonix hyprland configuration # +################################## + + +# monitors setup +## this is separated into its own file in order to +## be able to maintain multiple configurations +source = ~/.config/hypr/monitors.conf + + +# programs +$screenlocker = hyprlock +$terminal = foot +$menu = fuzzel + + +# setup environment +env = XCURSOR_SIZE,24 +env = HYPRCURSOR_SIZE,24 + +exec-once = tmux setenv -g HYPRLAND_INSTANCE_SIGNATURE "$HYPRLAND_INSTANCE_SIGNATURE" +exec-once = hyprpaper +exec-once = hypridle +exec-once = waybar + + +# keybindings +$Mod = SUPER +bind = $Mod, Escape, exec, $screenlocker +bind = $Mod, Return, exec, $terminal +bind = $Mod, d, exec, $menu +bind = $Mod, q, killactive, +bind = $Mod SHIFT, q, forcekillactive +bind = $Mod, a, exec, audio-sink-switcher.sh +bind = $Mod SHIFT, m, exec, hyprctl switchxkblayout all next + +## move focus +bind = $Mod, h, movefocus, l +bind = $Mod, j, movefocus, d +bind = $Mod, k, movefocus, u +bind = $Mod, l, movefocus, r +bind = $Mod, left, movefocus, l +bind = $Mod, down, movefocus, d +bind = $Mod, up, movefocus, u +bind = $Mod, right, movefocus, r + +## move focused window +bind = $Mod SHIFT, h, movewindow, l +bind = $Mod SHIFT, j, movewindow, d +bind = $Mod SHIFT, k, movewindow, u +bind = $Mod SHIFT, l, movewindow, r +bind = $Mod SHIFT, left, movewindow, l +bind = $Mod SHIFT, down, movewindow, d +bind = $Mod SHIFT, up, movewindow, u +bind = $Mod SHIFT, right, movewindow, r + +## switch to numbered workspace +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 active window to numbered workspace +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 + +## move active window and switch to workspace +bind = $Mod ALT, 1, movetoworkspace, 1 +bind = $Mod ALT, 2, movetoworkspace, 2 +bind = $Mod ALT, 3, movetoworkspace, 3 +bind = $Mod ALT, 4, movetoworkspace, 4 +bind = $Mod ALT, 5, movetoworkspace, 5 +bind = $Mod ALT, 6, movetoworkspace, 6 +bind = $Mod ALT, 7, movetoworkspace, 7 +bind = $Mod ALT, 8, movetoworkspace, 8 +bind = $Mod ALT, 9, movetoworkspace, 9 +bind = $Mod ALT, 0, movetoworkspace, 10 + +# .. alt + tab .. +bind = ALT SHIFT, Tab, workspace, e-1 +bind = ALT, Tab, workspace, e+1 + +# move focused workspace to output +bind = $Mod, u, movecurrentworkspacetomonitor, l +bind = $Mod, i, movecurrentworkspacetomonitor, d +bind = $Mod, o, movecurrentworkspacetomonitor, u +bind = $Mod, p, movecurrentworkspacetomonitor, r + +## make window fullscreen +bind = $Mod, f, fullscreen + +## mouse integration for moving and resizing windows +bindm = $Mod, mouse:272, movewindow +bindm = $Mod, mouse:273, resizewindow + +## volume control +bindel = ,XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+ +bindel = ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- +bindel = ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle +bindel = ,XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle + +## play/pause events +bindl = , XF86AudioNext, exec, playerctl next +bindl = , XF86AudioPause, exec, playerctl play-pause +bindl = , XF86AudioPlay, exec, playerctl play-pause +bindl = , XF86AudioPrev, exec, playerctl previous + +# screenshot utility +$screenshot_directory = $HOME/Pictures/screenshots/ +exec = mkdir -p $screenshot_directory +bind = $Mod, s, exec, slurp | grim -g - - | wl-copy +bind = $Mod SHIFT, s, exec, slurp | grim -g - "$screenshot_directory/$(date '+%Y%m%d_%H%M%S')_screenshot.png" + +#FIX:############ +### AUTOSTART ### +################# + +# Autostart necessary processes (like notifications daemons, status bars, etc.) +# Or execute your favorite apps at launch like this: + +# exec-once = $terminal +# exec-once = nm-applet & +# exec-once = waybar & hyprpaper & firefox + + +################### +### PERMISSIONS ### +################### + +# See https://wiki.hyprland.org/Configuring/Permissions/ +# Please note permission changes here require a Hyprland restart and are not applied on-the-fly +# for security reasons + +# ecosystem { +# enforce_permissions = 1 +# } + +# permission = /usr/(bin|local/bin)/grim, screencopy, allow +# permission = /usr/(lib|libexec|lib64)/xdg-desktop-portal-hyprland, screencopy, allow +# permission = /usr/(bin|local/bin)/hyprpm, plugin, allow + +input { + # keyboard + kb_layout = us, us + kb_variant = basic, intl + + # mouse + sensitivity = 0.5 + accel_profile = flat + + # cursor + follow_mouse = 2 +} + +# general settings +general { + # layout + layout = master + + # borders + border_size = 1 + no_border_on_floating = false + gaps_in = 6 + gaps_out = 12 + col.inactive_border = rgba(00000000) + col.active_border = rgba(15D7E5FF) + col.nogroup_border = rgba(00000000) + col.nogroup_border_active = rgba(15D7E5FF) + + # behaviour + no_focus_fallback = false + resize_on_border = true + extend_border_grab_area = 8 + hover_icon_on_border = true + resize_corner = 0 + + # tearing + # potentially exclude games from buffering? + allow_tearing = false +} + +# layout settings +master { + mfact = 0.5 + new_status = slave + new_on_active = after + orientation = left +} + +# visual settings +decoration { + # corners + rounding = 0 + rounding_power = 2 + + # transparency + active_opacity = 1.0 + inactive_opacity = 1.0 + fullscreen_opacity = 1.0 + + # misc + dim_inactive = false + border_part_of_window = true + shadow:enabled = false + blur:enabled = false +} + +# this and that +misc { + disable_hyprland_logo = true + font_family = JetBrainsMonoNerdFont + splash_font_family = JetBrainsMonoNerdFont + mouse_move_enables_dpms = false + key_press_enables_dpms = true + focus_on_activate = false + allow_session_lock_restore = true + background_color = rgba(202020FF) + new_window_takes_over_fullscreen = 2 + middle_click_paste = false +} + +# bääh +animations:enabled = false + +# window rules +windowrule = idleinhibit always, class:steam_app.* + +windowrule = opacity 0.9, class:foot +windowrule = opacity 0.93, class:SpeedCrunch + diff --git a/hypr/.config/hypr/hyprlock.conf b/hypr/.config/hypr/hyprlock.conf new file mode 100644 index 0000000..152e6d0 --- /dev/null +++ b/hypr/.config/hypr/hyprlock.conf @@ -0,0 +1,27 @@ +# hyprlock configuration +general { + hide_cursor = true + ignore_empty_input = true + fail_timeout = 2000 +} + +background { + path = $HOME/dotfiles/images/sand_city.png + color = rgba(181C28FF) +} + +input-field { + size = 30%,8% + outline_thickness = 3 + dots_center = true + outer_color = rgba(BC7F15FF) + inner_color = rgba(E9C586FF) + font_family = JetBrainsMonoNerdFont + fade_on_empty = false + placeholder_text = \(^o^)/ + rounding = 4 + check_color = rgba(0066FFFF) + fail_color = rgba(FF8800FF) + halign = center + valign = center +} diff --git a/waybar/.config/waybar/config b/waybar/.config/waybar/config index d33be8b..47a37ef 100644 --- a/waybar/.config/waybar/config +++ b/waybar/.config/waybar/config @@ -2,15 +2,15 @@ "name": "foobar", "layer": "top", "position": "top", - "height": 36, + "height": 30, "mode": "dock", "exclusive": true, "spacing": 16, "reload_style_on_change": true, - "modules-left": ["sway/workspaces", "sway/window"], - "modules-right": ["sway/language", "cpu", "pulseaudio", "clock#date", "clock#time"], + "modules-left": ["hyprland/workspaces", "hyprland/window"], + "modules-right": ["hyprland/language", "cpu", "pulseaudio", "clock#date", "clock#time"], - "sway/workspaces": { + "hyprland/workspaces": { "format": "{name}", "on-click": "activate", "all-output": true, @@ -19,11 +19,11 @@ "sort-by-name": false, "sort-by-coordinates": true }, - "sway/window": { + "hyprland/window": { "max-length": 50 }, - "sway/language": { + "hyprland/language": { "format": " {short} {variant}", "tooltip": true }, diff --git a/waybar/.config/waybar/style.css b/waybar/.config/waybar/style.css index 0ff7c95..3ae5867 100644 --- a/waybar/.config/waybar/style.css +++ b/waybar/.config/waybar/style.css @@ -12,7 +12,7 @@ window#waybar { font-family: JetBrainsMonoNerdFont; font-weight: bold; - font-size: 18px; + font-size: 16px; background: @--black; color: @--white; } @@ -37,7 +37,7 @@ window#waybar { color: @--cyan; } -#workspaces button.focused { +#workspaces button.active { background: @--dark-grey; border-bottom: 2px solid @--cyan; }