update
This commit is contained in:
@@ -26,5 +26,5 @@ variables=$(echo "$variables" | sed 's/tailscale = true/tailscale = false/')
|
||||
echo "$variables" >"$GUEST_CONFIG/variables.nix"
|
||||
|
||||
home=$(cat "$LAPTOP_CONFIG/home.nix")
|
||||
home=$(echo "$home" | sed 's/\.\/sops.nix/# .\/sops.nix/')
|
||||
home=$(echo "$home" | sed 's/\.\/secrets/# .\/secrets/')
|
||||
echo "$home" >"$GUEST_CONFIG/home.nix"
|
||||
@@ -7,7 +7,7 @@
|
||||
README_FILE="./README.md"
|
||||
|
||||
header=$(cat "./docs/src/header.md")
|
||||
table_of_content=$(~/go/bin/md-table-of-contents ./docs/src/README_template.md)
|
||||
table_of_content=$(md-table-of-contents ./docs/src/README_template.md)
|
||||
version=$(git describe --tags --abbrev=0)
|
||||
readme_content=$(cat "./docs/src/README_template.md")
|
||||
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
[[ -f "./home/system/hyprland/default.nix" ]] || (echo "File ./home/system/hyprland/default.nix not found" && exit 1)
|
||||
|
||||
config=$( cat "./home/system/hyprland/default.nix")
|
||||
|
||||
# get text between
|
||||
# bind = [
|
||||
# and next ]
|
||||
|
||||
# Example:
|
||||
# "$mod, E, exec, ${pkgs.xfce.thunar}/bin/thunar" # Description
|
||||
# Steps:
|
||||
# We should remove the ""
|
||||
# $mod replace by Super key
|
||||
# $shiftMod replace by "Super Shift"
|
||||
# Concat with key
|
||||
# Remove , exec,
|
||||
# Remove variables and /bin/ if present
|
||||
|
||||
# Create a markdown table with everything
|
||||
54
docs/scripts/keybindings_to_markdown.sh
Normal file
54
docs/scripts/keybindings_to_markdown.sh
Normal file
@@ -0,0 +1,54 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
function getList(){
|
||||
content=$1
|
||||
name=$2
|
||||
list_start=$(echo "$content" | sed "/$name = \[/!d;=;Q")
|
||||
list=$(echo "$content" | tail +$list_start)
|
||||
list_end=$(echo "$list" | sed '/\]/!d;=;Q')
|
||||
list=$(echo "$list" | head -n$list_end)
|
||||
|
||||
echo "$list"
|
||||
}
|
||||
|
||||
[[ -f "./home/system/hyprland/default.nix" ]] || (echo "File ./home/system/hyprland/default.nix not found" && exit 1)
|
||||
|
||||
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:
|
||||
# ...
|
||||
|
||||
# Remove lines not containing a "
|
||||
# ...
|
||||
|
||||
# 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
|
||||
|
||||
# Manually add workspace shortcuts
|
||||
|
||||
# Markdown table:
|
||||
# | Description | keybinding | params |
|
||||
# | -- | -- | -- |
|
||||
# ...
|
||||
Reference in New Issue
Block a user