mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-14 22:22:40 +00:00
feat: Adds previews to utils-launcher, sources catppuccin colors file in zshrc so that fzf options are setup.
This commit is contained in:
2
env/.config/utils-launcher/config.json
vendored
2
env/.config/utils-launcher/config.json
vendored
@@ -16,7 +16,7 @@
|
|||||||
"exec": "$SCRIPTS/hypr/waybarctl --restart"
|
"exec": "$SCRIPTS/hypr/waybarctl --restart"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Waybar -- toggle",
|
"name": "Waybar - toggle",
|
||||||
"exec": "$SCRIPTS/hypr/waybarctl --toggle"
|
"exec": "$SCRIPTS/hypr/waybarctl --toggle"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
1
env/.config/zsh/.zshrc
vendored
1
env/.config/zsh/.zshrc
vendored
@@ -219,6 +219,7 @@ source <(fzf --zsh)
|
|||||||
# I tried sourcing them in the the `.zshenv` files, but did not work.
|
# I tried sourcing them in the the `.zshenv` files, but did not work.
|
||||||
_source_if "$ZDOTDIR/.zshrc-local"
|
_source_if "$ZDOTDIR/.zshrc-local"
|
||||||
_source_if "$LOCAL_ENV"
|
_source_if "$LOCAL_ENV"
|
||||||
|
_source_if "$SCRIPTS/catppuccin-colors"
|
||||||
|
|
||||||
# pnpm
|
# pnpm
|
||||||
export PNPM_HOME="$XDG_DATA_HOME/pnpm"
|
export PNPM_HOME="$XDG_DATA_HOME/pnpm"
|
||||||
|
|||||||
21
env/.local/scripts/hypr/utils-launcher
vendored
21
env/.local/scripts/hypr/utils-launcher
vendored
@@ -25,6 +25,7 @@ window_padding_x="2"
|
|||||||
config_file=""
|
config_file=""
|
||||||
launch_flag="0"
|
launch_flag="0"
|
||||||
|
|
||||||
|
rows=()
|
||||||
XDG_CONFIG_HOME=${XDG_CONFIG_HOME}
|
XDG_CONFIG_HOME=${XDG_CONFIG_HOME}
|
||||||
SCRIPTS=${SCRIPTS}
|
SCRIPTS=${SCRIPTS}
|
||||||
|
|
||||||
@@ -61,6 +62,15 @@ footer() {
|
|||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
generate_rows() {
|
||||||
|
readarray -t names <<<"$(echo "$1" | jq -r '.[] | .name')"
|
||||||
|
readarray -t execs <<<"$(echo "$1" | jq -r '.[] | .exec')"
|
||||||
|
|
||||||
|
for i in "${!names[@]}"; do
|
||||||
|
rows+=("${execs[i]}|${names[i]}")
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# MAIN
|
# MAIN
|
||||||
################################################################################
|
################################################################################
|
||||||
@@ -89,7 +99,16 @@ file_data=$(cat $config_file)
|
|||||||
|
|
||||||
# Setup colors before calling fzf.
|
# Setup colors before calling fzf.
|
||||||
[[ -f $SCRIPTS/catppuccin-colors ]] && source $SCRIPTS/catppuccin-colors
|
[[ -f $SCRIPTS/catppuccin-colors ]] && source $SCRIPTS/catppuccin-colors
|
||||||
sel=$(echo "$file_data" | jq -r '.[] | .name' | fzf --style=full --footer="$(footer)")
|
|
||||||
|
generate_rows "$file_data"
|
||||||
|
# sel=$(echo "$file_data" | jq -r '.[] | .name' | fzf --style=full --footer="$(footer)")
|
||||||
|
echo "ROWS: ${rows[@]}"
|
||||||
|
sel=$(
|
||||||
|
printf "%s\n" "${rows[@]}" |
|
||||||
|
fzf --style=full --footer="$(footer)" --with-nth=2 --delimiter='|' \
|
||||||
|
--preview-label='[ Command ]' \
|
||||||
|
--preview='printf "\nName: {2}\nExec: {1}"'
|
||||||
|
)
|
||||||
|
|
||||||
echo "Selection: $sel"
|
echo "Selection: $sel"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user