From 7179c7d98f728a73448a66447042e691f87eea95 Mon Sep 17 00:00:00 2001 From: Hippolyte Chauvin Date: Thu, 13 Apr 2023 00:14:04 +0200 Subject: [PATCH] Ajout de la configuration de Hyprland et d'une Waybar --- config/hypr/hyprland.conf | 93 ++++++++ config/hypr/hyprland.conf.d/bindings.conf | 103 +++++++++ config/hypr/hyprland.conf.d/environment.conf | 22 ++ config/hypr/hyprland.conf.d/startup.conf | 12 + config/hypr/hyprland.conf.d/windowrules.conf | 7 + config/hypr/hyprpaper.conf | 6 + config/waybar-1/config | 173 +++++++++++++++ config/waybar-1/style.css | 218 +++++++++++++++++++ 8 files changed, 634 insertions(+) create mode 100644 config/hypr/hyprland.conf create mode 100644 config/hypr/hyprland.conf.d/bindings.conf create mode 100644 config/hypr/hyprland.conf.d/environment.conf create mode 100644 config/hypr/hyprland.conf.d/startup.conf create mode 100644 config/hypr/hyprland.conf.d/windowrules.conf create mode 100644 config/hypr/hyprpaper.conf create mode 100644 config/waybar-1/config create mode 100644 config/waybar-1/style.css diff --git a/config/hypr/hyprland.conf b/config/hypr/hyprland.conf new file mode 100644 index 0000000..0668ac2 --- /dev/null +++ b/config/hypr/hyprland.conf @@ -0,0 +1,93 @@ +# Monitor +monitor = , highrr, auto, 1 + +# Input +input { + kb_layout = fr + kb_variant = + kb_model = + kb_options = + 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 +} + +# Decoration +decoration { + rounding = 5 + blur = yes + blur_size = 3 + blur_passes = 1 + blur_new_optimizations = on + + drop_shadow = yes + shadow_range = 4 + shadow_render_power = 3 + col.shadow = rgba(1a1a1aee) + + inactive_opacity = 0.9 +} + +# Animations +animations { + enabled = yes + + bezier = myBezier, 0.05, 0.9, 0.1, 1.05 + + animation = windows, 1, 7, myBezier + animation = windowsOut, 1, 7, default, popin 80% + animation = border, 1, 10, default + animation = fade, 1, 7, default + animation = workspaces, 1, 3, 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 +} + +# Modular sourcing +$confDir = ~/.config/hypr/hyprland.conf.d +source = $confDir/bindings.conf +source = $confDir/windowrules.conf +source = $confDir/startup.conf +source = $confDir/environment.conf + diff --git a/config/hypr/hyprland.conf.d/bindings.conf b/config/hypr/hyprland.conf.d/bindings.conf new file mode 100644 index 0000000..3260ec0 --- /dev/null +++ b/config/hypr/hyprland.conf.d/bindings.conf @@ -0,0 +1,103 @@ +# Bindings +# Main mod +$mainMod = SUPER + +# Hyprland control +bind = $mainMod SHIFT, A, killactive, +bind = $mainMod SHIFT, E, exit, + +# Windows controls +# Layout +bind = $mainMod, C, togglefloating, +bind = $mainMod, P, pseudo, +bind = $mainMod, E, togglesplit, +bind = $mainMod, S, togglegroup, + +# 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, kitty +bind = $mainMod, F1, exec, sensible-browser +bind = $mainMod, F2, exec, joplin-desktop +bind = $mainMod, F3, exec, webcord +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 + diff --git a/config/hypr/hyprland.conf.d/environment.conf b/config/hypr/hyprland.conf.d/environment.conf new file mode 100644 index 0000000..17f2825 --- /dev/null +++ b/config/hypr/hyprland.conf.d/environment.conf @@ -0,0 +1,22 @@ +# 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 + diff --git a/config/hypr/hyprland.conf.d/startup.conf b/config/hypr/hyprland.conf.d/startup.conf new file mode 100644 index 0000000..8011d40 --- /dev/null +++ b/config/hypr/hyprland.conf.d/startup.conf @@ -0,0 +1,12 @@ +# Startup +exec-once = swaync +exec-once = waybar +exec-once = hyprpaper +exec-once = artix-pipewire-loader +exec-once = /usr/lib/xdg-desktop-portal-hyprland +exec-once = mpd --no-daemon +exec-once = swayosd +exec-once = kitty & kitty sudo -i +exec-once = webcord +exec-once = joplin-desktop + diff --git a/config/hypr/hyprland.conf.d/windowrules.conf b/config/hypr/hyprland.conf.d/windowrules.conf new file mode 100644 index 0000000..0f6c68d --- /dev/null +++ b/config/hypr/hyprland.conf.d/windowrules.conf @@ -0,0 +1,7 @@ +# Window rules +windowrule = workspace 4 silent, ^(WebCord)$ +windowrule = workspace 4 silent, ^(Joplin)$ +windowrule = workspace 4 silent, ^(whatsapp-nativefier-.*)$ +windowrule = workspace 4 silent, ^(Deezer)$ +windowrule = float, ^(pavucontrol)$ + diff --git a/config/hypr/hyprpaper.conf b/config/hypr/hyprpaper.conf new file mode 100644 index 0000000..1e73982 --- /dev/null +++ b/config/hypr/hyprpaper.conf @@ -0,0 +1,6 @@ +# Preload +preload = ~/.local/share/backgrounds/virtual_riot_save_yourself_2-1920x1080.jpg + +# Definition +wallpaper = , ~/.local/share/backgrounds/virtual_riot_save_yourself_2-1920x1080.jpg + diff --git a/config/waybar-1/config b/config/waybar-1/config new file mode 100644 index 0000000..b011f0d --- /dev/null +++ b/config/waybar-1/config @@ -0,0 +1,173 @@ +{ + "layer": "top", + "position": "bottom", + "margin-bottom": 10, + "margin-left": 10, + "margin-right": 10, + "modules-left": ["wlr/workspaces", "hyprland/language", "keyboard-state", "hyprland/submap", "mpd", "hyprland/window"], + "modules-center": ["tray", "custom/notifications", "clock"], + "modules-right": ["network", "pulseaudio#output", "pulseaudio#input", "temperature", "cpu", "memory"], + "wlr/workspaces": { + "disable-scroll": true, + "all-outputs": true, + "format": "{icon} {name}", + "format-icons": { + "1": "", + "3": "", + "4": "", + "5": "󰖺", + "urgent": "", + "focused": "", + "default": "" + }, + "on-scroll-up": "hyprctl dispatch workspace e-1", + "on-scroll-down": "hyprctl dispatch workspace e+1", + "on-click": "activate", + "sort-by-number": true + }, + "mpd": { + "tooltip": false, + "format": "{stateIcon} {artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S})", + "format-disconnected": "ﳌ", + "format-stopped": "", + "state-icons": { + "playing": "", + "paused": "" + } + }, + "hyprland/submap": { + "format": " {}" + }, + "hyprland/window": { + "separate-out puts": true, + "format": " {}" + }, + "tray": { + "spacing": 8 + }, + "custom/notifications": { + "tooltip": false, + "format": "{icon} {}", + "format-icons": { + "notification": "", + "none": "", + "dnd-notification": "", + "dnd-none": "", + "inhibited-notification": "", + "inhibited-none": "", + "dnd-inhibited-notification": "", + "dnd-inhibited-none": "" + }, + "return-type": "json", + "exec-if": "which swaync-client", + "exec": "swaync-client -swb", + "on-click": "swaync-client -t -sw", + "on-click-right": "swaync-client -d -sw", + "escape": true + }, + "pulseaudio#output": { + "format": "{icon} {volume}%", + "format-bluetooth": " {volume}%", + "format-bluetooth-muted": "󰂲 {volume}%", + "format-muted": " {volume}%", + "format-icons": { + "headphone": " ", + "hands-free": " ", + "headset": " ", + "phone": " ", + "portable": " ", + "car": " ", + "default": ["", "", ""] + }, + "on-click": "pavucontrol -t 3", + "on-scroll-up": "swayosd --output-volume=raise", + "on-scroll-down": "swayosd --output-volume=lower" + }, + "pulseaudio#input": { + "format": "{format_source}", + "format-source": " {volume}%", + "format-source-muted": " {volume}%", + "format-icons": { + "headphone": " ", + "hands-free": " ", + "headset": " ", + "phone": " ", + "portable": " ", + "car": " ", + "default": ["", "", ""] + }, + "on-click": "pavucontrol -t 4", + "on-scroll-up": "swayosd --input-volume=raise", + "on-scroll-down": "swayosd --input-volume=lower" + }, + "temperature": { + "thermal-zone": 2, + "hwmon-path": "/sys/class/hwmon/hwmon0/temp1_input", + "critical-threshold": 80, + "format-critical": "{icon}  {temperatureC}°C", + "format": "{icon} {temperatureC}°C", + "format-icons": ["", "", ""] + }, + "network": { + "interface": "eth1", // (Optional) To force the use of this interface + "format-wifi": " {essid} ({signalStrength}%)", + "format-ethernet": "󰈀 {ipaddr}/{cidr}", + "tooltip-format": "󰱔 {ifname} via {gwaddr}", + "format-linked": " {ifname} (No IP)", + "format-disconnected": " Disconnected", + "format-alt": "󰱔 {ifname}: {ipaddr}/{cidr}" + }, + "cpu": { + "tooltip": false, + "format": " {}%" + }, + "memory": { + "tooltip": false, + "format": " {}%" + }, + "clock": { + "format": " {:%Y-%m-%d | %H:%M:%S}", + "interval": 1, + "tooltip-format": "{calendar}", + "calendar": { + "mode" : "year", + "mode-mon-col" : 3, + "weeks-pos" : "right", + "on-scroll" : 1, + "on-click-right": "mode", + "format": { + "months": "{}", + "days": "{}", + "weeks": "W{}", + "weekdays": "{}", + "today": "{}" + } + }, + "actions": { + "on-click-right": "mode", + "on-click-forward": "tz_up", + "on-click-backward": "tz_down", + "on-scroll-up": "shift_up", + "on-scroll-down": "shift_down" + } + }, + "keyboard-state": { + "numlock": true, + "capslock": true, + "format": { + "capslock": "C {icon} ", + "numlock": "N {icon} " + }, + "format-icons": { + "locked": "", + "unlocked": "" + } + }, + "hyprland/language": { + "format": "󰌌 {}", + "format-fr": "FR" + } +} + +// vim: set ft=json + diff --git a/config/waybar-1/style.css b/config/waybar-1/style.css new file mode 100644 index 0000000..8fae41b --- /dev/null +++ b/config/waybar-1/style.css @@ -0,0 +1,218 @@ +/* + ******************************************** + *░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░* + *░░█▀█░█░░░█░█░█▀▀░░░█░█░█░░░▀█▀░█▀▄░█▀█░░* + *░░█▀▀░█░░░█░█░▀▀█░░░█░█░█░░░░█░░█▀▄░█▀█░░* + *░░▀░░░▀▀▀░▀▀▀░▀▀▀░░░▀▀▀░▀▀▀░░▀░░▀░▀░▀░▀░░* + *░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░* + ******************************************** + */ + +* { + border: none; + border-radius: 0; + font-family: Hack Nerd Font; + font-weight: bold; + font-size: 14px; + min-height: 24px; +} + +window#waybar { + background: transparent; +} + +window#waybar.hidden { + opacity: 0.2; +} + +window#waybar.termite #window, +window#waybar.Firefox #window, +window#waybar.Navigator #window, +window#waybar.PCSX2 #window { + color: #4d4d4d; + background: #e6e6e6; +} + +#workspaces { + /* margin-top: 8px; */ + /* margin-left: 12px; */ + /* margin-bottom: 0; */ + padding-right: 3px; + border-radius: 26px; + background: #282a36; + transition: none; +} + +#workspaces button { + transition: none; + color: #f8f8f2; + background: transparent; + font-size: 16px; +} + +#workspaces button.active { + color: #9aedfe; +} + +#workspaces button:hover { + transition: none; + box-shadow: inherit; + text-shadow: inherit; + color: #ff79c6; +} + +#mpd { + /* margin-top: 8px; */ + margin-left: 8px; + padding-left: 16px; + padding-right: 16px; + margin-bottom: 0; + border-radius: 26px; + background: #282a36; + transition: none; + color: #4d4d4d; + background: #5af78e; +} + +#mpd.disconnected, +#mpd.stopped { + color: #f8f8f2; + background: #282a36; +} + +#submap { + margin-left: 8px; + padding-left: 16px; + padding-right: 16px; + background: #ffb3ff; + color: #282a36; + border-radius: 26px; +} + +#window, #custom-notifications { + /* margin-top: 8px; */ + margin-left: 8px; + padding-left: 16px; + padding-right: 16px; + /* border-radius: 26px; */ + /* transition: none; */ + /* + color: #f8f8f2; + background: #282a36; + */ + /* color: transparent; */ + /* background: transparent; */ + background: #282a36; + border-radius: 26px; +} + +#tray { + padding-right: 16px; + padding-left: 16px; + background: #282a36; + border-radius: 26px; +} + +#network { + /* margin-top: 8px; */ + margin-left: 8px; + padding-left: 16px; + padding-right: 16px; + margin-bottom: 0; + border-radius: 26px; + transition: none; + color: #4d4d4d; + background: #bd93f9; +} + +#pulseaudio { + /* margin-top: 8px; */ + padding-left: 16px; + padding-right: 16px; + margin-bottom: 0; + transition: none; + color: #4d4d4d; + background: #9aedfe; +} +#pulseaudio.output { + margin-left: 8px; + border-radius: 26px 4px 4px 26px; +} +#pulseaudio.input { + margin-left: 2px; + border-radius: 4px 26px 26px 4px; +} + + +#temperature { + /* margin-top: 8px; */ + margin-left: 8px; + padding-left: 16px; + padding-right: 16px; + margin-bottom: 0; + border-radius: 26px; + transition: none; + color: #4d4d4d; + background: #5af78e; +} + +#cpu { + /* margin-top: 8px; */ + margin-left: 8px; + padding-left: 16px; + padding-right: 16px; + margin-bottom: 0; + border-radius: 26px; + transition: none; + color: #4d4d4d; + background: #f1fa8c; +} + +#memory { + /* margin-top: 8px; */ + margin-left: 8px; + padding-left: 16px; + padding-right: 16px; + margin-bottom: 0; + border-radius: 26px; + transition: none; + color: #4d4d4d; + background: #ff6e67; +} + +#clock { + /* margin-top: 8px; */ + margin-left: 8px; + padding-left: 16px; + padding-right: 16px; + margin-bottom: 0; + border-radius: 26px; + transition: none; + color: #f8f8f2; + background: #282a36; +} + +#language { + /* margin-top: 8px; */ + margin-left: 8px; + padding-left: 16px; + padding-right: 16px; + margin-bottom: 0; + border-radius: 26px 4px 4px 26px; + transition: none; + color: #f8f8f2; + background: #282a36; +} + +#keyboard-state { + /* margin-top: 8px; */ + margin-left: 2px; + padding-left: 16px; + padding-right: 16px; + margin-bottom: 0; + border-radius: 4px 26px 26px 4px; + transition: none; + color: #f8f8f2; + background: #282a36; +} +