diff --git a/CHANGELOG.md b/CHANGELOG.md index a4514adc0a..7dcb0c650c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,16 +8,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), ## Unreleased -### Added -- Docs: `MIGRATION-LUA.md`, a transition guide for upgrading from the hyprlang configuration — what moved where, the silent failures and their causes, and the files the upgrade leaves behind - ### Removed - Hyprland: dropped the legacy hyprlang dot, the files it deployed no longer exist ### Fixed -- Docs: the keybinding reference describes the Lua configuration instead of the removed `userprefs.conf`, documents binds that were missing from it, corrects four descriptions that no longer matched the code, and explains why an override needs the original bind's flags -- Docs: the shipped `hypr/hyprland.lua` stub shows a working bind instead of pointing at a wiki that does not exist -- Docs: the keybinding links in the German, Arabic, French, Dutch and Turkish readmes resolve again - Core: app launchers no longer show a false error when an unrelated `DEBUG` variable contains a non-boolean value such as `release` - Desktop: the generated battery notification startup command now launches `batterynotify.lua` instead of the removed shell implementation - Hyprland: Lua keybinds again match the documented shortcuts for window management, screenshots, wallpapers, Waybar, selectors, workspaces and the scratchpad diff --git a/Configs/.config/hypr/hyprland.lua b/Configs/.config/hypr/hyprland.lua index d110b85860..92cdd8066f 100644 --- a/Configs/.config/hypr/hyprland.lua +++ b/Configs/.config/hypr/hyprland.lua @@ -1,28 +1,5 @@ --- Your Hyprland configuration. HyDE never overwrites this file. --- --- It loads after HyDE's own binds, so settings here take precedence. Replacing --- a bind needs more than that: see below. HyDE's defaults live in --- ~/.local/share/hypr/lua/ and are overwritten on every update, so edits there --- do not survive. --- --- Adding a keybind: --- --- hl.bind("SUPER + SPACE", hl.dsp.exec_cmd(hyde.sh.gamelauncher()), { --- description = "[Utilities] game launcher", --- }) --- --- Replacing one of HyDE's: bind the same combination again and yours takes --- over, but copy its flags across as well. A bind counts as the same one only --- when its flags match, and `description` is not a flag — miss one and both --- binds stay live on that combination. Copy the whole options table from --- ~/.local/share/hypr/lua/key_binds.lua and change only what you need: --- --- hl.bind("F9", hl.dsp.exec_cmd(hyde.sh.volumecontrol("-o", "m")), { --- locked = true, --- description = "[Hardware Controls|Audio] un/mute output", --- }) --- --- Press SUPER + / to see what is actually loaded, your own binds included. --- The full reference is KEYBINDINGS.md in the HyDE repository. --- --- Other Lua files next to this one can be pulled in with require("name"). +-- User Configuration goeas here. +-- Adding keybinding are simple, refer to the wiki and add it here! +-- Duplicated keybinding will always respect the last last added, therefore please override keybindings as you wish. +--- use "require()" to load other lua files, for example: +-- require("keybindings") --- this will load "keybindings.lua" diff --git a/Hyprdots-to-HyDE.md b/Hyprdots-to-HyDE.md index acdae9a299..c053581d5f 100644 --- a/Hyprdots-to-HyDE.md +++ b/Hyprdots-to-HyDE.md @@ -67,14 +67,9 @@ Who are the $USER? --- -Here's how we keep HyDE's Hyprland settings separate from yours. HyDE's own -configuration lives in `~/.local/share/hypr/`, which it overwrites on every -update, and yours goes in `~/.config/hypr/hyprland.lua`, which loads after it -and is never touched. Anything else HyDE puts in `~/.config/hypr/` — the lock -screen, idle and sunset configs — is left alone once it exists. So an update -cannot overwrite your settings, and your settings cannot be lost with one. -Your own file is still yours to get wrong: a Lua error in it will stop the -session from starting, and a HyDE change may need a matching change there. +Here's how we can update HyDE-specific Hyprland settings without changing user preferences. We don't need the "userprefs" file. Instead, we can source HyDE's `hyprland.conf` and make $USER preferred changes directly in the config. With this approach, you won't potentially break hyde and hyde won't break your own dots. + +![Hyprland structure](https://github.com/user-attachments/assets/91b35c2e-0003-458f-ab58-18fc29541268) # Why name it HyDE? diff --git a/KEYBINDINGS.md b/KEYBINDINGS.md index a1f245aab0..dd09fec158 100644 --- a/KEYBINDINGS.md +++ b/KEYBINDINGS.md @@ -20,7 +20,6 @@ Multi-language KEYBINDINGS support [![中文](https://img.shields.io/badge/lang-中文-orange.svg)](Source/assets/keybinds/KEYBINDINGS.zh.md) [![fr](https://img.shields.io/badge/lang-fr-blue.svg)](Source/assets/keybinds/KEYBINDINGS.fr.md) [![ar](https://img.shields.io/badge/lang-AR-orange.svg)](Source/assets/keybinds/KEYBINDINGS.ar.md) -[![pt-br](https://img.shields.io/badge/lang-pt--br-brightgreen.svg)](Source/assets/keybinds/KEYBINDINGS.pt-br.md)
@@ -60,21 +59,19 @@ Here are all HyDE specific keybindings listed. ## -| Keys | Action | -| :--------------------------------------------------- | :--------------------------- | -| SUPER + Q | close focused window | -| ALT + F4 | close focused window | -| SUPER + ALT + F4 | kill focused window | -| SUPER + Delete | exit hyprland session | -| SUPER + W | toggle float | -| SUPER + G | toggle group | -| ALT + P | toggle pseudotile | -| Shift + F11 | cycle fullscreen states | -| SUPER + L | lock screen | -| SUPER + SHIFT + F | toggle pin on focused window | -| ALT + CTRL + Delete | logout menu | -| SUPER + CTRL + B | toggle waybar | -| SUPER + J | toggle split | +| Keys | Action | +| :--------------------------------------------------- | :------------------------------ | +| SUPER + Q | close focused window | +| ALT + F4 | close focused window | +| SUPER + Delete | kill hyprland session | +| SUPER + W | toggle float | +| SUPER + G | toggle group | +| Shift + F11 | toggle fullscreen | +| SUPER + L | lock screen | +| SUPER + SHIFT + F | toggle pin on focused window | +| ALT + CTRL + Delete | logout menu | +| SUPER + CTRL + B | toggle waybar and reload config | +| SUPER + J | toggle split | ### Group Navigation @@ -91,15 +88,7 @@ Here are all HyDE specific keybindings listed. | SUPER + Right | focus right | | SUPER + Up | focus up | | SUPER + Down | focus down | - -### Alt-tab switcher - -Holding ALT keeps the switcher open; releasing it applies the selection. - -| Keys | Action | -| :------------------------------------------------- | :-------------- | -| ALT + Tab | next window | -| ALT + SHIFT + Tab | previous window | +| ALT + Tab | cycle focus | ### Resize Active Window @@ -147,19 +136,17 @@ Holding ALT keeps the switcher open; releasing it applies the selecti ### Rofi menus -| Keys | Action | -| :----------------------------------------------------- | :------------------- | -| SUPER + A | application finder | -| SUPER + TAB | window switcher | -| SUPER + SHIFT + E | file finder | -| SUPER + slash | keybindings hint | -| SUPER + comma | emoji picker | -| SUPER + period | glyph picker | -| SUPER + V | clipboard | -| SUPER + SHIFT + V | clipboard manager | -| SUPER + SHIFT + A | select rofi launcher | -| SUPER + SHIFT + K | calculator | -| SUPER + SHIFT + slash | web search | +| Keys | Action | +| :------------------------------------------------- | :------------------- | +| SUPER + A | application finder | +| SUPER + TAB | window switcher | +| SUPER + SHIFT + E | file finder | +| SUPER + slash | keybindings hint | +| SUPER + comma | emoji picker | +| SUPER + period | glyph picker | +| SUPER + V | clipboard | +| SUPER + SHIFT + V | clipboard manager | +| SUPER + SHIFT + A | select rofi launcher | @@ -179,13 +166,12 @@ Holding ALT keeps the switcher open; releasing it applies the selecti ### Media -| Keys | Action | -| :------------------------------------------------ | :------------------------- | -| None + XF86AudioPlay | play media | -| None + XF86AudioPause | pause media | -| None + XF86AudioNext | next media | -| None + XF86AudioPrev | previous media | -| SUPER + CTRL + M | un/mute the focused window | +| Keys | Action | +| :------------------------------------------ | :------------- | +| None + XF86AudioPlay | play media | +| None + XF86AudioPause | pause media | +| None + XF86AudioNext | next media | +| None + XF86AudioPrev | previous media | ### Brightness @@ -198,11 +184,10 @@ Holding ALT keeps the switcher open; releasing it applies the selecti ## -| Keys | Action | -| :------------------------------------------------- | :--------------------- | -| SUPER + K | toggle keyboard layout | -| SUPER + ALT + G | game mode | -| SUPER + SHIFT + G | game launcher | +| Keys | Action | +| :----------------------------------------------- | :--------------------- | +| SUPER + K | toggle keyboard layout | +| SUPER + ALT + G | game mode | ### Screen Capture @@ -213,7 +198,6 @@ Holding ALT keeps the switcher open; releasing it applies the selecti | SUPER + CTRL + P | freeze and snip screen | | SUPER + ALT + P | print monitor | | None + Print | print all monitors | -| SUPER + CTRL + S | scan text on screen | @@ -249,14 +233,10 @@ Holding ALT keeps the switcher open; releasing it applies the selecti | SUPER + 8 | navigate to workspace 8 | | SUPER + 9 | navigate to workspace 9 | | SUPER + 0 | navigate to workspace 10 | -| SUPER + KP_1KP_0 | navigate to workspaces 11-20 | | SUPER + CTRL + Down | navigate to the nearest empty workspace | | SUPER + mouse_down | next workspace | | SUPER + mouse_up | previous workspace | -The numpad binds work with Num Lock on or off: each key is bound under both -keysyms it can emit. - #### Relative workspace | Keys | Action | @@ -289,19 +269,18 @@ keysyms it can emit. ### Move window to workspace -| Keys | Action | -| :---------------------------------------------------------------------- | :----------------------- | -| SUPER + SHIFT + 1 | move to workspace 1 | -| SUPER + SHIFT + 2 | move to workspace 2 | -| SUPER + SHIFT + 3 | move to workspace 3 | -| SUPER + SHIFT + 4 | move to workspace 4 | -| SUPER + SHIFT + 5 | move to workspace 5 | -| SUPER + SHIFT + 6 | move to workspace 6 | -| SUPER + SHIFT + 7 | move to workspace 7 | -| SUPER + SHIFT + 8 | move to workspace 8 | -| SUPER + SHIFT + 9 | move to workspace 9 | -| SUPER + SHIFT + 0 | move to workspace 10 | -| SUPER + SHIFT + KP_1KP_0 | move to workspaces 11-20 | +| Keys | Action | +| :------------------------------------------------- | :------------------- | +| SUPER + SHIFT + 1 | move to workspace 1 | +| SUPER + SHIFT + 2 | move to workspace 2 | +| SUPER + SHIFT + 3 | move to workspace 3 | +| SUPER + SHIFT + 4 | move to workspace 4 | +| SUPER + SHIFT + 5 | move to workspace 5 | +| SUPER + SHIFT + 6 | move to workspace 6 | +| SUPER + SHIFT + 7 | move to workspace 7 | +| SUPER + SHIFT + 8 | move to workspace 8 | +| SUPER + SHIFT + 9 | move to workspace 9 | +| SUPER + SHIFT + 0 | move to workspace 10 | | Keys | Action | | :--------------------------------------------------------------------- | :----------------------------------------- | @@ -310,78 +289,27 @@ keysyms it can emit. ## -Your own keybindings go in: +You can define your own keybindings by editing your preferences file at: ```bash -~/.config/hypr/hyprland.lua +~/.config/hypr/userprefs.conf ``` -That file is yours — updates never overwrite it. HyDE's own binds live in -`~/.local/share/hypr/lua/key_binds.lua`, which **is** overwritten on every -update, so edits there are lost. Your file loads after HyDE's binds, which is -why anything you write there wins. The one thing loaded after it is your -selected workflow, which can override compositor settings. - -For example, to bind the **HyDE Game Launcher** to SUPER + Space: +For example, to create a keybinding that launches the **HyDE Game Launcher**, add the following line: -```lua -hl.bind("SUPER + SPACE", hl.dsp.exec_cmd(hyde.sh.gamelauncher()), { - description = "[Utilities] game launcher", -}) +```ini +bind = $mainMod, SPACE, exec, $HOME/.local/lib/hyde/gamelauncher.sh ``` -Add a `description` in the `[Group|Subgroup] text` shape and your bind shows up -in the keybinding hint under that group. Without one it appears as a raw -dispatcher call under "Misc". - -`hyde.sh.()` builds a `hyde-shell` command — here `hyde-shell -gamelauncher`, the same thing you can run from a terminal. Some names are -shortcuts for something longer: `hyde.sh.screenshot.snip()` is `hyde-shell -screenshot s`, `hyde.sh.menu.binds()` is `hyde-shell keybinds_hint`. The full -list is `hyde.command_map` in `~/.local/share/hypr/lua/hyde/dispatcher.lua`. - -### Rebinding something HyDE already uses +This will bind the **Game Launcher** to SUPER + Space. +You can replace `SPACE` with any other key you prefer. -Bind the same combination again and yours replaces it — but **copy the flags -too**. A bind counts as the same one only when its flags match, and -`description` is not a flag. Thirty-three of HyDE's binds carry one: +The `gamelauncher.sh` script is included by default and lives at: -| Flags | Binds | -| :--------------------------------------------- | :--------------------------------------------------------------------------------------- | -| `locked` | media keys, mute, keyboard layout, game mode, and every screen-capture bind | -| `locked` and `repeating` | volume up and down, brightness up and down — on both the function row and the media keys | -| `repeating` | resize active window, move active window | -| `transparent`, and `release` on the apply step | the alt-tab switcher | - -Miss one and you end up with **both** binds firing on that combination. - -So to move the mute key from F10 to F9, carry `locked` -across: - -```lua -hl.unbind("F10") -hl.bind("F9", hl.dsp.exec_cmd(hyde.sh.volumecontrol("-o", "m")), { - locked = true, - description = "[Hardware Controls|Audio] un/mute output", -}) +```bash +~/.local/lib/hyde/gamelauncher.sh ``` -`hl.unbind` takes the combination exactly as the bind was registered, with -single spaces around each `+`. Copy the spelling from `key_binds.lua` rather -than guessing: several binds are written there with `CONTROL` where you might -expect `CTRL`. Rebinding is the safer route — HyDE replaces the old bind for -you, so you never have to match a string. - -### Seeing your live keybindings - -SUPER + / reads the binds from the compositor itself, so -it shows your own alongside HyDE's and reflects whatever replaced a default. -This table describes the shipped defaults only. - -The list is cached, and the cache is refreshed when you close it — so right -after adding a bind, the first press may still show the previous list. Press it -twice, or run `hyde-shell keybinds_hint --reload`. -