Niri-basierter Wayland-Desktop mit greetd/regreet, Catppuccin Mocha Theming, Rofi-Menus, Waybar und vollstaendiger Post-Install-Automatisierung. Archinstall-Config klont das Repo automatisch via custom-commands, danach genuegt ein einzelner Befehl fuer die komplette Einrichtung.
53 lines
1.0 KiB
Bash
Executable File
53 lines
1.0 KiB
Bash
Executable File
#!/bin/bash
|
|
# ABOUTME: Rofi helper that reads a JSON config file to build a dynamic menu.
|
|
# ABOUTME: Parses name/command/icon fields from JSON and launches selected entries.
|
|
|
|
#https://github.com/luiscrjunior/rofi-json
|
|
|
|
user_file="${1/#\~/$HOME}"
|
|
|
|
if [[ "$user_file" = /* ]]
|
|
then
|
|
config_file="$user_file"
|
|
else
|
|
cwd=$(dirname $0)
|
|
config_file="${cwd}/${user_file}"
|
|
fi
|
|
|
|
json=$(cat ${config_file})
|
|
|
|
if [ $# -eq 1 ]; then
|
|
echo $json | jq -cr '.[] | "\(.name)|\(.command)|\(.icon)"' |
|
|
while IFS="|" read -r name command icon
|
|
do
|
|
if [[ $name == "null" ]]; then
|
|
continue
|
|
fi
|
|
if [[ $icon == "null" ]]; then
|
|
icon="system-run"
|
|
fi
|
|
echo -en "${name}\0icon\x1f${icon}\n"
|
|
done
|
|
exit 1
|
|
fi
|
|
|
|
if [ $# -eq 2 ]; then
|
|
|
|
selected=$2
|
|
task=$(echo $json | jq ".[] | select(.name == \"$selected\")")
|
|
|
|
if [[ $task == "" ]]; then
|
|
exit 1
|
|
fi
|
|
|
|
command=$(echo $task | jq -j ".command")
|
|
|
|
if [[ $command == "null" ]]; then
|
|
command=$(echo $task | jq -j ".name")
|
|
fi
|
|
|
|
coproc bash -c "$command"
|
|
exit
|
|
|
|
fi
|