diff --git a/docs/KEYBINDINGS.md b/docs/KEYBINDINGS.md new file mode 100644 index 0000000..c6e21e7 --- /dev/null +++ b/docs/KEYBINDINGS.md @@ -0,0 +1,36 @@ +# Keybindings + +The list of the keybindings working on Hyprland: + +| Description | Keybinding | Command | +| -- | -- | -- | +| Kitty | SUPER + RETURN | ${pkgs.kitty}/bin/kitty | +| Thunar | SUPER + E | ${pkgs.xfce.thunar}/bin/thunar | +| Qutebrowser | SUPER + B | ${pkgs.qutebrowser}/bin/qutebrowser | +| Bitwarden | SUPER + K | ${pkgs.bitwarden}/bin/bitwarden | +| Peaclock | SUPER + C | ${pkgs.kitty}/bin/kitty --class peaclock peaclock | +| Lock | SUPER + L | ${pkgs.hyprlock}/bin/hyprlock | +| Powermenu | SUPER + X | powermenu | +| Launcher | SUPER + SPACE | menu | +| Close window | SUPER + Q | | +| Toggle Floating | SUPER + T | | +| Toggle Fullscreen | SUPER + F | | +| Move focus left | SUPER + left | l | +| Move focus Right | SUPER + right | r | +| Move focus Up | SUPER + up | u | +| Move focus Down | SUPER + down | d | +| Screenshot window | SUPER + PRINT | screenshot window | +| Screenshot monitor | + PRINT | screenshot monitor | +| Screenshot region | SUPER SHIFT + PRINT | screenshot region | +| Screenshot region then edit | ALT + PRINT | screenshot region swappy | +| Turn off night shift | SUPER + F2 | night-shift-off | +| Turn on night shift | SUPER + F3 | night-shift-on | +| Choose sound output | SUPER + F5 | ${pkgs.kitty}/bin/kitty --class floating zsh -c sound-output | +| Move Window (mouse) | SUPER + mouse:272 | | +| Resize Window (mouse) | SUPER + R | | +| Toggle Mute | + XF86AudioMute | sound-toggle | +| Lock when closing Lid | + switch:Lid Switch | ${pkgs.hyprlock}/bin/hyprlock | +| Sound Up | + XF86AudioRaiseVolume | sound-up | +| Sound Down | + XF86AudioLowerVolume | sound-down | +| Brightness Up | + XF86MonBrightnessUp | brightness-up | +| Brightness Down | + XF86MonBrightnessDown | brightness-down | diff --git a/docs/scripts/keybindings_to_markdown.sh b/docs/scripts/keybindings_to_markdown.sh index c3e3100..c7fa90e 100644 --- a/docs/scripts/keybindings_to_markdown.sh +++ b/docs/scripts/keybindings_to_markdown.sh @@ -1,5 +1,12 @@ #!/usr/bin/env bash +[[ -f "./docs/scripts/install.sh" ]] || ( + printf "\n\e[0;91mx \e[0m\e[1;77mNot in the project root directory\e[0m" + exit 1 +) + +KEYBINDINGS_FILE="./docs/KEYBINDINGS.md" + function getList(){ content=$1 name=$2 @@ -17,38 +24,37 @@ config=$( cat "./home/system/hyprland/default.nix") # Bind bind=$(getList "$config" "bind") -echo "$bind" - # Bindm (mouse) bindm=$(getList "$config" "bindm") -echo "$bindm" - # Bindl (lock) bindl=$(getList "$config" "bindl") -echo "$bindl" - # Bindle (lock, repetition) bindle=$(getList "$config" "bindle") -echo "$bindle" # Join the lists: -# ... +keybindings=$(echo -e "$bind\n$bindm\n$bindl\n$bindle" | grep '"') -# Remove lines not containing a " -# ... +echo "# Keybindings" > "$KEYBINDINGS_FILE" +echo "" >> "$KEYBINDINGS_FILE" +echo "The list of the keybindings working on Hyprland:" >> "$KEYBINDINGS_FILE" +echo "" >> "$KEYBINDINGS_FILE" -# Parse the keybindings: -# Example: "mod, key, dispatcher, params" # Description -# 1. Get the description/remove it -# 2. Remove the quotes -# 3. Get mod /remove it (replace $mod and $shiftmod by SUPER and SUPER_SHIFT) -# 4. Get key /remove it -# 5. Get dispatcher /remove it -# 6. Get params +echo "| Description | Keybinding | Command |" >> "$KEYBINDINGS_FILE" +echo "| -- | -- | -- |" >> "$KEYBINDINGS_FILE" +echo "$keybindings" | while read line +do + comment=$(echo "$line" | cut -d\# -f2) + line=$(echo "$line" | cut -d\# -f1) + line=${line:1:${#line}-3} + mod=$(echo "$line" | cut -d, -f1) + key=$(echo "$line" | cut -d, -f2) + dispatcher=$(echo "$line" | cut -d, -f3) + params=$(echo "$line" | cut -d, -f4) + + [[ $mod == '$mod' ]] && mod="SUPER" + [[ $mod == '$shiftMod' ]] && mod="SUPER SHIFT" + + echo "| $comment | $mod + $key | $params |" >> "$KEYBINDINGS_FILE" +done # Manually add workspace shortcuts - -# Markdown table: -# | Description | keybinding | params | -# | -- | -- | -- | -# ...