diff --git a/README.md b/README.md index be9706a..1364560 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,8 @@ violet-dotfiles/ ├── README.md ← ce fichier │ │ ── le thème, prêt à installer (modèles avec chemins à substituer) ── -├── hypr/ ← Hyprland : hyprland.conf, hyprlock, hyprpaper +├── hypr/ ← Hyprland : hyprland.lua (format lu depuis 0.57), +│ hyprland.conf (même contenu, référence), hyprlock, hyprpaper ├── waybar/ ← barre du haut : config, style.css, icons/logo.png │ └── scripts/ ← modules média : media-cover, media-panel ├── mako/ ← notifications (popups violets assortis à la barre) @@ -380,7 +381,8 @@ Exemple pour remplacer le bouton d'alimentation de Waybar : | Fond d'écran noir | vérifie que `hyprpaper` est lancé (`pgrep hyprpaper`) et que le chemin dans `hypr/hyprpaper.conf` existe | | Thème GRUB inchangé après reboot | vérifie `GRUB_THEME` dans `/etc/default/grub`, relance `sudo grub-mkconfig -o /boot/grub/grub.cfg` | | Waybar ne démarre pas | lance `waybar --log level=debug` pour voir l'erreur | -| Config Hyprland invalide | `hyprctl --config ~/.config/hypr/hyprland.conf verify` | +| Config Hyprland invalide | `Hyprland --verify-config -c ~/.config/hypr/hyprland.lua` | +| Thème ignoré, style par défaut (0.57+) | seul `hyprland.lua` est lu : vérifie qu'il existe dans `~/.config/hypr/` (`./install.sh` le copie) | | L'ancienne config me manque | tout est dans `~/.violet-backup-/` | --- diff --git a/hypr/hyprland.lua b/hypr/hyprland.lua new file mode 100644 index 0000000..31b5515 --- /dev/null +++ b/hypr/hyprland.lua @@ -0,0 +1,187 @@ +-- 💜 FWS — configuration Hyprland (format Lua, Hyprland ≥ 0.56). +-- Depuis Hyprland 0.57, le format lu est hyprland.lua : si ce fichier existe, +-- hyprland.conf est ignoré. Même contenu, mêmes raccourcis, mêmes couleurs. +-- Raccourcis : transposition de la config i3/sway FWS (mêmes touches). +-- ⚠ Pas de virgule dans les descriptions (séparateur de champs Hyprland). + +local mod = "SUPER" + +--------------------- +---- MONITEURS ---- +--------------------- + +hl.monitor({ output = "", mode = "preferred", position = "auto", scale = 1 }) + +-------------------------- +---- RÉGLAGES GÉNÉRAUX ---- +-------------------------- + +hl.config({ + input = { + kb_layout = "ch", + kb_variant = "fr", + follow_mouse = 1, + numlock_by_default = true, + touchpad = { + natural_scroll = true, + tap_to_click = true, + }, + }, + + general = { + gaps_in = 4, + gaps_out = 8, + border_size = 2, + -- Palette de l'image : mauve #cba6f7 → lavande #c3b6f6 en dégradé. + col = { + active_border = { colors = { "rgba(cba6f7ff)", "rgba(c3b6f6ff)" }, angle = 45 }, + inactive_border = "rgba(313244ff)", + }, + layout = "dwindle", + }, + + decoration = { + rounding = 8, + -- Flou et ombres COUPÉS : rendu logiciel (llvmpipe) en VM. + -- Sur un vrai GPU : enabled = true. + blur = { enabled = false }, + shadow = { enabled = false }, + }, + + animations = { enabled = true }, + + misc = { + disable_hyprland_logo = true, + disable_splash_rendering = true, -- pas de « Thanks xxx! » en bas d'écran + force_default_wallpaper = 0, + background_color = "rgba(1f1a2eff)", -- violet profond + }, +}) + +-- Courbes et animations (équivalent de « bezier = fws, 0.22, 1.0, 0.36, 1.0 ») +hl.curve("fws", { type = "bezier", points = { { 0.22, 1.0 }, { 0.36, 1.0 } } }) +hl.animation({ leaf = "windows", enabled = true, speed = 3, bezier = "fws" }) +hl.animation({ leaf = "workspaces", enabled = true, speed = 3, bezier = "fws" }) +hl.animation({ leaf = "fade", enabled = true, speed = 2, bezier = "default" }) + +-------------------- +---- DÉMARRAGE ---- +-------------------- + +-- Barre d'état, notifications, réseau dans le tray, agent d'authentification +-- GUI (indispensable aux apps qui demandent les droits admin), fond d'écran. +hl.on("hyprland.start", function() + hl.exec_cmd("hyprpaper") + hl.exec_cmd("waybar") + hl.exec_cmd("mako") + -- playerctld suit le LECTEUR ACTIF (les modules média restent à jour). + hl.exec_cmd("playerctld daemon") + hl.exec_cmd("nm-applet") + -- Applet Bluetooth : seulement si un adaptateur existe (en VM il n'y en a + -- pas → blueman afficherait « Connection to BlueZ failed »). + hl.exec_cmd('sh -c \'[ -n "$(ls -A /sys/class/bluetooth 2>/dev/null)" ] && exec blueman-applet\'') + hl.exec_cmd("/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1") + -- Fenêtre de bienvenue (1er démarrage seulement — se retire ensuite). + hl.exec_cmd("fws-hello --autostart") +end) + +-------------------- +---- RACCOURCIS ---- +-------------------- + +-- Applications +hl.bind(mod .. " + Return", hl.dsp.exec_cmd("kitty"), { description = "Ouvrir un terminal (kitty)" }) +hl.bind(mod .. " + SHIFT + Return", hl.dsp.exec_cmd("kitty --class floating-term"), { description = "Terminal flottant" }) +hl.bind(mod .. " + R", hl.dsp.exec_cmd("wofi --show drun"), { description = "Menu des applications" }) +hl.bind(mod .. " + E", hl.dsp.exec_cmd("dolphin"), { description = "Gestionnaire de fichiers" }) +hl.bind(mod .. " + B", hl.dsp.exec_cmd("firefox"), { description = "Ouvrir Firefox" }) +hl.bind(mod .. " + K", hl.dsp.exec_cmd("fws-keys"), { description = "Afficher les raccourcis clavier" }) +hl.bind(mod .. " + X", hl.dsp.exec_cmd("fws-powermenu"), { description = "Menu d'alimentation (arrêt/redémarrage…)" }) +-- Panneau multimédia (même fenêtre que le clic sur la pochette de la barre). +hl.bind(mod .. " + M", hl.dsp.exec_cmd(os.getenv("HOME") .. "/.config/waybar/scripts/media-panel"), + { description = "Panneau multimédia (lecture en cours)" }) + +-- Fenêtres +hl.bind(mod .. " + Q", hl.dsp.window.close(), { description = "Fermer la fenêtre" }) +hl.bind(mod .. " + V", hl.dsp.window.float({ action = "toggle" }), { description = "Fenêtre flottante ou ancrée" }) +hl.bind(mod .. " + F", hl.dsp.window.fullscreen({ mode = "fullscreen", action = "toggle" }), { description = "Plein écran" }) +hl.bind(mod .. " + J", hl.dsp.layout("togglesplit"), { description = "Basculer la découpe horizontale/verticale" }) +hl.bind(mod .. " + L", hl.dsp.exec_cmd("hyprlock"), { description = "Verrouiller l'écran" }) +hl.bind(mod .. " + SHIFT + E", hl.dsp.exit(), { description = "Quitter la session (retour à SDDM)" }) +hl.bind(mod .. " + SHIFT + C", hl.dsp.reload_config(), { description = "Recharger la configuration Hyprland" }) + +-- Focus (flèches) +hl.bind(mod .. " + left", hl.dsp.focus({ direction = "left" }), { description = "Focus à gauche" }) +hl.bind(mod .. " + right", hl.dsp.focus({ direction = "right" }), { description = "Focus à droite" }) +hl.bind(mod .. " + up", hl.dsp.focus({ direction = "up" }), { description = "Focus en haut" }) +hl.bind(mod .. " + down", hl.dsp.focus({ direction = "down" }), { description = "Focus en bas" }) + +-- Déplacer la fenêtre (Maj + flèches) +hl.bind(mod .. " + SHIFT + left", hl.dsp.window.move({ direction = "left" }), { description = "Déplacer la fenêtre à gauche" }) +hl.bind(mod .. " + SHIFT + right", hl.dsp.window.move({ direction = "right" }), { description = "Déplacer la fenêtre à droite" }) +hl.bind(mod .. " + SHIFT + up", hl.dsp.window.move({ direction = "up" }), { description = "Déplacer la fenêtre en haut" }) +hl.bind(mod .. " + SHIFT + down", hl.dsp.window.move({ direction = "down" }), { description = "Déplacer la fenêtre en bas" }) + +-- Redimensionner (Ctrl + flèches, maintien possible) +hl.bind(mod .. " + CTRL + left", hl.dsp.window.resize({ x = -30, y = 0 }), { repeating = true }) +hl.bind(mod .. " + CTRL + right", hl.dsp.window.resize({ x = 30, y = 0 }), { repeating = true }) +hl.bind(mod .. " + CTRL + up", hl.dsp.window.resize({ x = 0, y = -30 }), { repeating = true }) +hl.bind(mod .. " + CTRL + down", hl.dsp.window.resize({ x = 0, y = 30 }), { repeating = true }) + +-- Espaces de travail 1-10 (0 = espace 10, comme i3) +for i = 1, 10 do + local key = i % 10 + hl.bind(mod .. " + " .. key, hl.dsp.focus({ workspace = i }), { description = "Aller à l'espace " .. i }) + hl.bind(mod .. " + SHIFT + " .. key, hl.dsp.window.move({ workspace = i }), { description = "Envoyer la fenêtre vers l'espace " .. i }) +end + +-- Multi-écrans (comme i3 : Super+Ctrl+1/2 = écran gauche/droit) +hl.bind(mod .. " + CTRL + 1", hl.dsp.window.move({ monitor = "l" }), { description = "Envoyer la fenêtre vers l'écran de gauche" }) +hl.bind(mod .. " + CTRL + 2", hl.dsp.window.move({ monitor = "r" }), { description = "Envoyer la fenêtre vers l'écran de droite" }) + +-- Molette = changer d'espace de travail +hl.bind(mod .. " + mouse_up", hl.dsp.focus({ workspace = "e-1" }), { description = "Espace de travail précédent" }) +hl.bind(mod .. " + mouse_down", hl.dsp.focus({ workspace = "e+1" }), { description = "Espace de travail suivant" }) + +-- Scratchpad (espace spécial) +hl.bind(mod .. " + S", hl.dsp.workspace.toggle_special("magic"), { description = "Afficher le scratchpad" }) +hl.bind(mod .. " + SHIFT + S", hl.dsp.window.move({ workspace = "special:magic" }), { description = "Envoyer la fenêtre au scratchpad" }) + +-- Captures d'écran (grim/slurp → presse-papier ou ~/Images) +hl.bind("Print", hl.dsp.exec_cmd("grim - | wl-copy"), + { description = "Capture plein écran vers le presse-papier" }) +hl.bind(mod .. " + Print", hl.dsp.exec_cmd('grim -g "$(slurp)" - | wl-copy'), + { description = "Capture d'une zone vers le presse-papier" }) +hl.bind(mod .. " + SHIFT + Print", + hl.dsp.exec_cmd('sh -c \'mkdir -p ~/Images && grim -g "$(slurp)" ~/Images/capture_$(date +%Y-%m-%d_%H-%M-%S).png\''), + { description = "Capture d'une zone vers ~/Images" }) + +-- Multimédia (touches XF86 : volume via PipeWire, lecture via playerctl) +hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd("wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+"), { locked = true, repeating = true }) +hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"), { locked = true, repeating = true }) +hl.bind("XF86AudioMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"), { locked = true }) +hl.bind("XF86AudioPlay", hl.dsp.exec_cmd("playerctl play-pause"), { locked = true }) +hl.bind("XF86AudioNext", hl.dsp.exec_cmd("playerctl next"), { locked = true }) +hl.bind("XF86AudioPrev", hl.dsp.exec_cmd("playerctl previous"), { locked = true }) + +-- Luminosité de l'écran (portables : touches Fn) +hl.bind("XF86MonBrightnessUp", hl.dsp.exec_cmd("fws-brightness up"), { locked = true, repeating = true }) +hl.bind("XF86MonBrightnessDown", hl.dsp.exec_cmd("fws-brightness down"), { locked = true, repeating = true }) + +-- Souris : déplacer / redimensionner les fenêtres +hl.bind(mod .. " + mouse:272", hl.dsp.window.drag(), { mouse = true }) +hl.bind(mod .. " + mouse:273", hl.dsp.window.resize(), { mouse = true }) + +-------------------------- +---- RÈGLES DE FENÊTRE --- +-------------------------- + +hl.window_rule({ name = "floating-term", match = { class = "^(floating-term)$" }, float = true, size = "900 550" }) +hl.window_rule({ name = "pavucontrol", match = { class = "^([Pp]avucontrol|org.pulseaudio.pavucontrol)$" }, float = true }) +hl.window_rule({ name = "blueman", match = { class = "^([Bb]lueman-manager.*)$" }, float = true }) +hl.window_rule({ name = "fws-hello", match = { class = "^([Ff]ws-hello)$" }, float = true }) +hl.window_rule({ name = "fws-about", match = { class = "^([Ff]ws-about)$" }, float = true }) +hl.window_rule({ name = "fws-bugreport", match = { class = "^([Ff]ws-bugreport)$" }, float = true }) +hl.window_rule({ name = "pip", match = { title = "^(Picture-in-Picture)$" }, float = true }) +-- Panneau multimédia (script media-panel) : flottant, à sa taille, au-dessus. +hl.window_rule({ name = "fws-media", match = { class = "^(fws[.]media)$" }, float = true, size = "460 214" }) diff --git a/install.sh b/install.sh index 9c8bd1f..75f841d 100755 --- a/install.sh +++ b/install.sh @@ -129,13 +129,17 @@ else fi # ═══════════════════════════════════════════════════════════════════ -# 2. Hyprland (hyprland.conf, hyprlock, hyprpaper) +# 2. Hyprland (hyprland.lua, hyprland.conf, hyprlock, hyprpaper) # ═══════════════════════════════════════════════════════════════════ +# Depuis Hyprland 0.57 la config est lue en Lua : un hyprland.lua présent +# prend le pas sur hyprland.conf. On installe les deux (le .conf reste la +# référence lisible, le .lua est celui qui s'applique). HYPR_DST="$HOME_DIR/.config/hypr" -for f in hyprland.conf hyprlock.conf hyprlock-violet.conf; do +for f in hyprland.lua hyprland.conf hyprlock.conf hyprlock-violet.conf; do backup "$HYPR_DST/$f" done mkdir -p "$HYPR_DST" +cp "$SRC_DIR/hypr/hyprland.lua" "$HYPR_DST/" cp "$SRC_DIR/hypr/hyprland.conf" "$HYPR_DST/" cp "$SRC_DIR/hypr/hyprlock.conf" "$HYPR_DST/" cp "$SRC_DIR/hypr/hyprlock-violet.conf" "$HYPR_DST/"