From 187c0f3b8e904fce9a7b7f473599c0d26ecc500f Mon Sep 17 00:00:00 2001 From: Ahurac Date: Sun, 7 Jan 2024 15:41:20 +0100 Subject: [PATCH] =?UTF-8?q?Hyprland=20:=20remaniement=20de=20la=20configur?= =?UTF-8?q?ation,=20premi=C3=A8re=20partie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/hypr/hyprland.conf | 135 +++---------------- config/hypr/hyprland.conf.d/bindings.conf | 130 ------------------ config/hypr/hyprland.conf.d/environment.conf | 25 ---- config/hypr/hyprland.conf.d/startup.conf | 5 - config/hypr/hyprland.conf.d/windowrules.conf | 15 --- config/hypr/hyprland.d/animations.conf | 5 + config/hypr/hyprland.d/bindings.conf | 69 ++++++++++ config/hypr/hyprland.d/binds.conf | 14 ++ config/hypr/hyprland.d/decoration.conf | 23 ++++ config/hypr/hyprland.d/environment.conf | 20 +++ config/hypr/hyprland.d/general.conf | 25 ++++ config/hypr/hyprland.d/input.conf | 12 ++ config/hypr/hyprland.d/misc.conf | 30 +++++ config/hypr/hyprland.d/monitors.conf | 2 + config/hypr/hyprland.d/plugin.conf | 10 ++ config/hypr/hyprland.d/startup.conf | 3 + config/hypr/hyprland.d/windowrules.conf | 5 + config/hypr/hyprland.d/xwayland.conf | 4 + config/hypr/hyprpaper.conf | 6 +- 19 files changed, 247 insertions(+), 291 deletions(-) delete mode 100644 config/hypr/hyprland.conf.d/bindings.conf delete mode 100644 config/hypr/hyprland.conf.d/environment.conf delete mode 100644 config/hypr/hyprland.conf.d/startup.conf delete mode 100644 config/hypr/hyprland.conf.d/windowrules.conf create mode 100644 config/hypr/hyprland.d/animations.conf create mode 100644 config/hypr/hyprland.d/bindings.conf create mode 100644 config/hypr/hyprland.d/binds.conf create mode 100644 config/hypr/hyprland.d/decoration.conf create mode 100644 config/hypr/hyprland.d/environment.conf create mode 100644 config/hypr/hyprland.d/general.conf create mode 100644 config/hypr/hyprland.d/input.conf create mode 100644 config/hypr/hyprland.d/misc.conf create mode 100644 config/hypr/hyprland.d/monitors.conf create mode 100644 config/hypr/hyprland.d/plugin.conf create mode 100644 config/hypr/hyprland.d/startup.conf create mode 100644 config/hypr/hyprland.d/windowrules.conf create mode 100644 config/hypr/hyprland.d/xwayland.conf diff --git a/config/hypr/hyprland.conf b/config/hypr/hyprland.conf index 2364c92..e6aee74 100644 --- a/config/hypr/hyprland.conf +++ b/config/hypr/hyprland.conf @@ -1,115 +1,24 @@ -# Monitor -monitor = , highrr, 1920x0, 1 -monitor = HEADLESS-2, 1920x1080@74.97300, 0x0, 1 - -# Input -input { - kb_layout = fr - kb_variant = - kb_model = - kb_options = compose:rwin - kb_rules = - - follow_mouse = 1 - - touchpad { - natural_scroll = no - } - - sensitivity = 0 # -1.0 - 1.0, 0 means no modification. - - numlock_by_default = yes - repeat_rate = 40 - repeat_delay = 300 - accel_profile = flat -} - -# General -general { - gaps_in = 5 - gaps_out = 10 - border_size = 2 - col.active_border = rgba(df80ffff) rgba(cc33ffff) 90deg - col.inactive_border = rgba(886c9322) - layout = dwindle -} - -group { - col.border_inactive = rgba(f2f2f280) - col.border_active = rgb(3366ff) rgb(33ccff) -} - -# Decoration -decoration { - rounding = 5 - - drop_shadow = yes - shadow_range = 4 - shadow_render_power = 3 - col.shadow = rgba(1a1a1aee) - - inactive_opacity = 0.9 - - blur { - enabled = yes - size = 3 - passes = 1 - #new_optimizations = on - } -} - -# Animations -$animSpeed = 3 -animations { - enabled = yes - - bezier = myBezier, 0.05, 0.9, 0.1, 1.05 - - animation = windows, 1, $animSpeed, myBezier - animation = windowsOut, 1, $animSpeed, default, popin 80% - animation = border, 1, $animSpeed, default - animation = fade, 1, $animSpeed, default - animation = workspaces, 1, $animSpeed, default -} - -# Dwindle -dwindle { - pseudotile = yes - preserve_split = yes -} - -# Master -master { - new_is_master = true -} - -# Gestures -gestures { - workspace_swipe = off -} - -# Per-device config -device:epic mouse V1 { - sensitivity = -0.5 -} - -# Xwayland -xwayland { - force_zero_scaling = true -} - -# Variables -$browser = librewolf +# Defaults $terminal = alacritty -$discord = webcord -$deezer = deezer -$bitwarden = bitwarden-desktop -$joplin = joplin-desktop -$matrix = element-desktop +$browser = librewolf +$locker = swaylock -# Modular sourcing -$confDir = ~/.config/hypr/hyprland.conf.d -source = $confDir/bindings.conf -source = $confDir/windowrules.conf -source = $confDir/startup.conf -source = $confDir/environment.conf +# Applications +$joplin = joplin-desktop +$bitwarden = bitwarden-desktop +$element = element-desktop +$discord = webcord +$deezer = deezer --enable-features=UseOzonePlatform --ozone-platform=wayland + +# Classes +$terminal_class = Alacritty +$joplin_class = @joplin/app-desktop +$bitwarden_class = Bitwarden +$element_class = Element +$discord_class = WebCord + +# Plugins +plugin = /usr/lib/libhy3.so + +# Configuration modules +source = hyprland.d/*.conf diff --git a/config/hypr/hyprland.conf.d/bindings.conf b/config/hypr/hyprland.conf.d/bindings.conf deleted file mode 100644 index 0cf11d1..0000000 --- a/config/hypr/hyprland.conf.d/bindings.conf +++ /dev/null @@ -1,130 +0,0 @@ -# Bindings -# Main mod -$mainMod = SUPER - -# Hyprland control -bind = $mainMod SHIFT, Q, killactive, -bind = $mainMod SHIFT, E, exit, - -# Windows controls -# Layout -bind = $mainMod, C, togglefloating, -bind = $mainMod, P, pseudo, -bind = $mainMod, E, togglesplit, - -# Groups -bind = $mainMod, S, togglegroup, -bind = $mainMod, Prior, changegroupactive, b -bind = $mainMod, Next, changegroupactive, f -bind = $mainMod SHIFT, Prior, movegroupwindow, b -bind = $mainMod SHIFT, Next, movegroupwindow, f -bind = $mainMod SHIFT, h, moveoutofgroup, -bind = $mainMod SHIFT, j, moveoutofgroup, -bind = $mainMod SHIFT, k, moveoutofgroup, -bind = $mainMod SHIFT, l, moveoutofgroup, -bind = $mainMod SHIFT, left, moveoutofgroup, -bind = $mainMod SHIFT, down, moveoutofgroup, -bind = $mainMod SHIFT, up, moveoutofgroup, -bind = $mainMod SHIFT, right, moveoutofgroup, -bind = $mainMod SHIFT, h, moveintogroup, l -bind = $mainMod SHIFT, j, moveintogroup, d -bind = $mainMod SHIFT, k, moveintogroup, u -bind = $mainMod SHIFT, l, moveintogroup, r -bind = $mainMod SHIFT, Left, moveintogroup, l -bind = $mainMod SHIFT, Down, moveintogroup, d -bind = $mainMod SHIFT, Up, moveintogroup, u -bind = $mainMod SHIFT, Right, moveintogroup, r - -# Focus -bind = $mainMod, left, movefocus, l -bind = $mainMod, right, movefocus, r -bind = $mainMod, up, movefocus, u -bind = $mainMod, down, movefocus, d -bind = $mainMod, H, movefocus, l -bind = $mainMod, L, movefocus, r -bind = $mainMod, K, movefocus, u -bind = $mainMod, J, movefocus, d - -# Moving -bind = $mainMod SHIFT, left, movewindow, l -bind = $mainMod SHIFT, right, movewindow, r -bind = $mainMod SHIFT, up, movewindow, u -bind = $mainMod SHIFT, down, movewindow, d -bind = $mainMod SHIFT, H, movewindow, l -bind = $mainMod SHIFT, L, movewindow, r -bind = $mainMod SHIFT, K, movewindow, u -bind = $mainMod SHIFT, J, movewindow, d - -# Workspaces -bind = $mainMod, 10, workspace, 1 -bind = $mainMod, 11, workspace, 2 -bind = $mainMod, 12, workspace, 3 -bind = $mainMod, 13, workspace, 4 -bind = $mainMod, 14, workspace, 5 -bind = $mainMod, 15, workspace, 6 -bind = $mainMod, 16, workspace, 7 -bind = $mainMod, 17, workspace, 8 -bind = $mainMod, 18, workspace, 9 -bind = $mainMod, 19, workspace, 10 - -# Moving to workspaces -bind = $mainMod SHIFT, 10, movetoworkspacesilent, 1 -bind = $mainMod SHIFT, 11, movetoworkspacesilent, 2 -bind = $mainMod SHIFT, 12, movetoworkspacesilent, 3 -bind = $mainMod SHIFT, 13, movetoworkspacesilent, 4 -bind = $mainMod SHIFT, 14, movetoworkspacesilent, 5 -bind = $mainMod SHIFT, 15, movetoworkspacesilent, 6 -bind = $mainMod SHIFT, 16, movetoworkspacesilent, 7 -bind = $mainMod SHIFT, 17, movetoworkspacesilent, 8 -bind = $mainMod SHIFT, 18, movetoworkspacesilent, 9 -bind = $mainMod SHIFT, 19, movetoworkspacesilent, 10 - -# Scrolling through workspaces -bind = $mainMod, mouse_down, workspace, e-1 -bind = $mainMod, mouse_up, workspace, e+1 - -# Moving and resizing windows with mouse -bindm = $mainMod, mouse:272, movewindow -bindm = $mainMod, mouse:273, resizewindow - -# Screenshots -bind = , Print, exec, glurp full clip -bind = SHIFT, Print, exec, glurp area clip -bind = ALT, Print, exec, glurp full file -bind = SHIFT ALT, Print, exec, glurp area file - -# Launchers -bind = $mainMod, D, exec, rofi -show drun -bind = $mainMod, 36, exec, $terminal -bind = $mainMod, F1, exec, $browser -bind = $mainMod, F2, exec, $joplin -bind = $mainMod, F3, exec, $bitwarden -bind = $mainMod, F4, exec, $matrix -bind = $mainMod, F5, exec, $discord -bind = $mainMod, F6, exec, $deezer -bind = $mainMod ALT, L, exec, swaylock - -# Resize mode -bind = $mainMod, R, submap, resize - -submap = resize - -binde = , right, resizeactive, 50 0 -binde = , left, resizeactive, -50 0 -binde = , up, resizeactive, 0 -50 -binde = , down, resizeactive, 0 50 -binde = , H, resizeactive, -50 0 -binde = , J, resizeactive, 0 50 -binde = , K, resizeactive, 0 -50 -binde = , L, resizeactive, 50 0 - -bind= , escape, submap, reset -bind= $mainMod, r, submap, reset - -submap = reset - -# Fullscreen -bind = $mainMod, F, fullscreen - -# Swap workspaces -bind = $mainMod ALT, Space, exec, hyprland-swap_workspaces diff --git a/config/hypr/hyprland.conf.d/environment.conf b/config/hypr/hyprland.conf.d/environment.conf deleted file mode 100644 index b42c931..0000000 --- a/config/hypr/hyprland.conf.d/environment.conf +++ /dev/null @@ -1,25 +0,0 @@ -# Backend -env = GDK_BACKEND, wayland,x11 -env = SDL_VIDEODRIVER, wayland -env = CLUTTER_BACKEND, wayland -env = _JAVA_AWT_WM_NONREPARENTING=1 - -# XDG -env = XDG_CURRENT_DESKTOP, Hyprland -env = XDG_SESSION_TYPE, wayland -env = XDG_SESSION_DESKTOP, Hyprland - -# Qt -env = QT_AUTO_SCREEN_SCALE_FACTOR, 1 -env = QT_QPA_PLATFORM, wayland;xcb -env = QT_WAYLAND_DISABLE_WINDOWDECORATION, 1 -env = QT_QPA_PLATFORMTHEME, qt6ct - -# Theming -env = GTK_THEME, Dracula -env = XCURSOR_THEME, Afterglow-cursors -env = XCURSOR_SIZE, 24 - -# Applications -env = BROWSER, librewolf - diff --git a/config/hypr/hyprland.conf.d/startup.conf b/config/hypr/hyprland.conf.d/startup.conf deleted file mode 100644 index 9004280..0000000 --- a/config/hypr/hyprland.conf.d/startup.conf +++ /dev/null @@ -1,5 +0,0 @@ -# Startup -exec-once = hyprpaper -exec-once = swayosd-server -exec-once = $terminal & $terminal -e sudo -i -exec-once = xdg-session-start diff --git a/config/hypr/hyprland.conf.d/windowrules.conf b/config/hypr/hyprland.conf.d/windowrules.conf deleted file mode 100644 index ac65cdd..0000000 --- a/config/hypr/hyprland.conf.d/windowrules.conf +++ /dev/null @@ -1,15 +0,0 @@ -# Window rules - -# Workspace 4 -windowrule = workspace 4 silent, ^(WebCord)$ -windowrule = workspace 4 silent, ^(@joplin/app-desktop)$ -windowrule = workspace 4 silent, ^(Bitwarden)$ -windowrule = workspace 4 silent, ^(Deezer)$ -windowrule = workspace 4 silent, ^(Element)$ - -# Floating windows -windowrule = float, ^(pavucontrol)$ - -# REAPER -windowrulev2 = move cursor 0 -50%, class:^(REAPER)$, title:^(Routing|Controls)( for track )([1-9][0-9]*)(.*)$ - diff --git a/config/hypr/hyprland.d/animations.conf b/config/hypr/hyprland.d/animations.conf new file mode 100644 index 0000000..c68f3f5 --- /dev/null +++ b/config/hypr/hyprland.d/animations.conf @@ -0,0 +1,5 @@ +# Animations +animations { + # Save battery + #enabled = false +} diff --git a/config/hypr/hyprland.d/bindings.conf b/config/hypr/hyprland.d/bindings.conf new file mode 100644 index 0000000..c0bbf2f --- /dev/null +++ b/config/hypr/hyprland.d/bindings.conf @@ -0,0 +1,69 @@ +# Open terminal +bind = SUPER, Return, exec, $terminal + +# Workspaces +#bind = SUPER, equal, movetoworkspace, special +bind = SUPER, 10, workspace, 1 +bind = SUPER, 11, workspace, 2 +bind = SUPER, 12, workspace, 3 +bind = SUPER, 13, workspace, 4 +bind = SUPER, R, workspace, 5 +bind = SUPER, F, workspace, 6 +bind = SUPER, V, workspace, 7 +bind = SUPER, C, workspace, 8 +bind = SUPER, X, workspace, 9 +bind = SUPER, W, workspace, 10 +bind = SUPER, mouse_down, workspace, e-1 +bind = SUPER, mouse_up, workspace, e+1 + +# Windows +bind = SUPER SHIFT, Q, killactive +bind = SUPER SHIFT, F, fullscreen +bind = SUPER SHIFT Alt_L, F, fakefullscreen +bindm = SUPER, mouse:272, movewindow +bindm = SUPER, mouse:273, resizewindow +bind = SUPER SHIFT, 10, movetoworkspacesilent, 1 +bind = SUPER SHIFT, 11, movetoworkspacesilent, 2 +bind = SUPER SHIFT, 12, movetoworkspacesilent, 3 +bind = SUPER SHIFT, 13, movetoworkspacesilent, 4 +bind = SUPER SHIFT, R, movetoworkspacesilent, 5 +bind = SUPER SHIFT, F, movetoworkspacesilent, 6 +bind = SUPER SHIFT, V, movetoworkspacesilent, 7 +bind = SUPER SHIFT, C, movetoworkspacesilent, 8 +bind = SUPER SHIFT, X, movetoworkspacesilent, 9 +bind = SUPER SHIFT, W, movetoworkspacesilent, 10 +bind = SUPER Alt_L, space, togglefloating +bind = SUPER SHIFT, space, pin, active + +# Focus +bind = SUPER, A, hy3:movefocus, l +bind = SUPER, Z, hy3:movefocus, u +bind = SUPER, S, hy3:movefocus, d +bind = SUPER, D, hy3:movefocus, r + +# Groups +bind = SUPER, Q, hy3:makegroup, h +bind = SUPER, E, hy3:changegroup, opposite + +# Global +bind = SUPER SHIFT, BackSpace, exit + +# Launchers +bind = SUPER, F1, exec, $browser +bind = SUPER, F2, exec, $joplin +bind = SUPER, F3, exec, $bitwarden +bind = SUPER, F4, exec, $element +bind = SUPER, F5, exec, $discord +bind = SUPER, F6, exec, $deezer + +# Screenshots +bind = , Print, exec, glurp full clip +bind = Alt_L, Print, exec, glurp full file +bind = SHIFT, Print, exec, glurp area clip +bind = SHIFT Alt_L, Print, exec, glurp area file + +# Lock screen +bind = SUPER, L, exec, $locker + +# Sound +# TODO diff --git a/config/hypr/hyprland.d/binds.conf b/config/hypr/hyprland.d/binds.conf new file mode 100644 index 0000000..e7cf409 --- /dev/null +++ b/config/hypr/hyprland.d/binds.conf @@ -0,0 +1,14 @@ +# Binds +binds { + # Scrolling + scroll_event_delay = 0 + + # Workspaces + workspace_back_and_forth = false + allow_workspace_cycles = false + workspace_center_on = 1 + + # Focus + focus_preferred_method = 1 + movefocus_cycles_fullscreen = false +} diff --git a/config/hypr/hyprland.d/decoration.conf b/config/hypr/hyprland.d/decoration.conf new file mode 100644 index 0000000..e261fc9 --- /dev/null +++ b/config/hypr/hyprland.d/decoration.conf @@ -0,0 +1,23 @@ +# Decoration +decoration { + # Corners + rounding = 10 + + # Opacity + active_opacity = 1.0 + inactive_opacity = 0.9 + fullscreen_opacity = 1.0 + + # Shadows + drop_shadow = false + + # Dimming + dim_inactive = false + + # Blur + blur { + enabled = true + ignore_opacity = false + xray = true + } +} diff --git a/config/hypr/hyprland.d/environment.conf b/config/hypr/hyprland.d/environment.conf new file mode 100644 index 0000000..60a5d6a --- /dev/null +++ b/config/hypr/hyprland.d/environment.conf @@ -0,0 +1,20 @@ +# Qt +env = QT_QPA_PLATFORM, wayland +env = QT_QPA_PLATFORMTHEME, qt6ct +env = QT_AUTO_SCREEN_SCALE_FACTOR, 1 +env = QT_WAYLAND_DISABLE_WINDOWDECORATION, 1 + +# Clutter +env = CLUTTER_BACKEND = wayland + +# SDL +env = SDL_VIDEODRIVER, wayland + +# ELM +env = ELM_DISPLAY, wl + +# Java +env = _JAVA_AWT_WM_NONREPARENTING, 1 + +# XDG +env = XDG_SESSION_DESKTOP, Hyprland diff --git a/config/hypr/hyprland.d/general.conf b/config/hypr/hyprland.d/general.conf new file mode 100644 index 0000000..1b865b7 --- /dev/null +++ b/config/hypr/hyprland.d/general.conf @@ -0,0 +1,25 @@ +# General +general { + # Borders + border_size = 2 + col.inactive_border = rgba(80808080) + col.nogroup_border = rgba(80808080) + col.active_border = rgb(9933ff) rgb(d966ff) 270deg + col.nogroup_border_active = rgb(00cc66) rgb(33ff99) 270deg + resize_on_border = false + + # Gaps + gaps_in = 5 + gaps_out = 10 + gaps_workspaces = 0 + + # Cursor + cursor_inactive_timeout = 0 + no_cursor_warps = false + + # Layout + layout = hy3 + + # Focus + no_focus_fallback = true +} diff --git a/config/hypr/hyprland.d/input.conf b/config/hypr/hyprland.d/input.conf new file mode 100644 index 0000000..3fefe33 --- /dev/null +++ b/config/hypr/hyprland.d/input.conf @@ -0,0 +1,12 @@ +# Input +input { + # Keyboard + kb_layout = fr + numlock_by_default = true + repeat_rate = 75 + repeat_delay = 300 + + # Mouse + sensitivity = 0.0 + accel_profile = flat +} diff --git a/config/hypr/hyprland.d/misc.conf b/config/hypr/hyprland.d/misc.conf new file mode 100644 index 0000000..132756f --- /dev/null +++ b/config/hypr/hyprland.d/misc.conf @@ -0,0 +1,30 @@ +# Misc +misc { + # Logos and mascotts + disable_hyprland_logo = true + disable_splash_rendering = true + force_hypr_chan = false + + # Focus + layers_hog_keyboard_focus = true + mouse_move_focuses_monitor = true + + # Animations + animate_manual_resizes = true + + # Swallowing + enable_swallow = true + swallow_regex = $terminal_class + + # Cursor + hide_cursor_on_touch = false + + # Screen locking + #allow_session_lock_restore = true + + # Workspaces + close_special_on_empty = true + + # Windows + new_window_takes_over_fullscreen = 2 +} diff --git a/config/hypr/hyprland.d/monitors.conf b/config/hypr/hyprland.d/monitors.conf new file mode 100644 index 0000000..2216e00 --- /dev/null +++ b/config/hypr/hyprland.d/monitors.conf @@ -0,0 +1,2 @@ +# Main monitor +monitor = , highrr, 1920x0, 1 diff --git a/config/hypr/hyprland.d/plugin.conf b/config/hypr/hyprland.d/plugin.conf new file mode 100644 index 0000000..6d5972c --- /dev/null +++ b/config/hypr/hyprland.d/plugin.conf @@ -0,0 +1,10 @@ +# Plugin configuration +plugin { + hy3 { + # Windows + no_gaps_when_only = false + + # Groups + node_collapse_policy = 0 + } +} diff --git a/config/hypr/hyprland.d/startup.conf b/config/hypr/hyprland.d/startup.conf new file mode 100644 index 0000000..60176ec --- /dev/null +++ b/config/hypr/hyprland.d/startup.conf @@ -0,0 +1,3 @@ +# Wallpaper +exec-once = hyprpaper +exec-once = hyprxdg diff --git a/config/hypr/hyprland.d/windowrules.conf b/config/hypr/hyprland.d/windowrules.conf new file mode 100644 index 0000000..6f9587f --- /dev/null +++ b/config/hypr/hyprland.d/windowrules.conf @@ -0,0 +1,5 @@ +# Workspace 4 +windowrulev2 = workspace 4 silent, class:($joplin_class) +windowrulev2 = workspace 4 silent, class:($bitwarden_class) +windowrulev2 = workspace 4 silent, class:($element_class) +windowrulev2 = workspace 4 silent, class:($discord_class) diff --git a/config/hypr/hyprland.d/xwayland.conf b/config/hypr/hyprland.d/xwayland.conf new file mode 100644 index 0000000..c2ab535 --- /dev/null +++ b/config/hypr/hyprland.d/xwayland.conf @@ -0,0 +1,4 @@ +# Xwayland +xwayland { + force_zero_scaling = true +} diff --git a/config/hypr/hyprpaper.conf b/config/hypr/hyprpaper.conf index 1e73982..4718937 100644 --- a/config/hypr/hyprpaper.conf +++ b/config/hypr/hyprpaper.conf @@ -1,6 +1,6 @@ -# Preload +# Wallpaper preload = ~/.local/share/backgrounds/virtual_riot_save_yourself_2-1920x1080.jpg - -# Definition wallpaper = , ~/.local/share/backgrounds/virtual_riot_save_yourself_2-1920x1080.jpg +# Save battery +#ipc = off