-
-
Save vtmx/7688c762aaacd357e46f56ad6ad8adc8 to your computer and use it in GitHub Desktop.
orchis-install-yad
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| if ! command -v yad &>/dev/null; then | |
| echo "error: install yad" | |
| exit 1 | |
| fi | |
| # Options | |
| dest="$HOME/.themes" | |
| name="Orchis" | |
| theme=(default purple pink red orange yellow green teal grey all) | |
| color=(standard light dark) | |
| size=(standard compact all) | |
| icon=(default apple simple gnome ubuntu arch manjaro fedora debian void opensuse popos mxlinux zorin endeavouros tux nixos gentoo budgie solus kali) | |
| tweaks=(solid compact black primary macos submenu nord-dracula dock) | |
| round=(4px 8px 12px 16px) | |
| shell=("default" 38 40 42 44 46 47 48) | |
| # Form | |
| result=$(yad \ | |
| --form \ | |
| --title "Orchis Install - Yad" \ | |
| --item-separator=" " \ | |
| --field="Dest" "$dest" \ | |
| --field="Name" "$name" \ | |
| --field="Theme:CB" "$(echo ${theme[@]})" \ | |
| --field="Color:CB" "$(echo ${color[@]})" \ | |
| --field="Size:CB" "$(echo ${size[@]})" \ | |
| --field="Icon:CB" "$(echo ${icon[@]})" \ | |
| --field="Tweaks:CB" "$(echo ${tweaks[@]})" \ | |
| --field="Round:CB" "$(echo ${round[@]})" \ | |
| --field="Shell:CB" "$(echo ${shell[@]})") | |
| # Get args in array | |
| IFS="|" read -r -a args <<< "$result" | |
| # Check if dest exist | |
| if [[ ! -d "${args[0]}" ]]; then | |
| echo "error: dir ${args[0]} not exist" | |
| exit 1 | |
| fi | |
| # Change default shell to blank | |
| [[ "${args[8]}" == "default" ]] && args[8]="" | |
| # Show command | |
| echo "./install \ | |
| --dest \"${args[0]}\" \ | |
| --name ${args[1]} \ | |
| --theme ${args[2]} \ | |
| --color ${args[3]} \ | |
| --size ${args[4]} \ | |
| --icon ${args[5]} \ | |
| --tweaks ${args[6]} \ | |
| --round ${args[7]} \ | |
| --shell ${args[8]}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment