This commit is contained in:
Hadi
2024-06-26 14:44:08 +00:00
parent 57cab5fa52
commit 1ed7675095
23 changed files with 115 additions and 71 deletions

View File

@@ -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"

View File

@@ -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")

View File

@@ -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

View 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 |
# | -- | -- | -- |
# ...