mirror of
https://github.com/Ahwxorg/nixos-config.git
synced 2026-03-19 07:40:30 +01:00
feat: adds darwin-specific scripts
This commit is contained in:
parent
9934c9d02a
commit
25fbd43f5d
3 changed files with 39 additions and 0 deletions
18
modules/home/scripts/scripts/change-wallpaper.sh
Normal file
18
modules/home/scripts/scripts/change-wallpaper.sh
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# focus-kitty-picker $1
|
||||
|
||||
selected_wallpaper=$(
|
||||
eza -1 -X --no-quotes --absolute ~/Pictures/wallpapers/ | fzf --preview="wallpaper-preview {}" \
|
||||
--color=fg+:#b8bb26 \
|
||||
--color=hl:#fb4934,hl+:#fb4934,info:#83a598,marker:#fe8019 \
|
||||
--color=prompt:#fb4934,spinner:#fb4934,pointer:#fe8019,header:#b8bb26 \
|
||||
--color=border:#fe8019,scrollbar:#fabd2f,label:#fe8019 \
|
||||
--color=query:#b8bb26 \
|
||||
--color=preview-border:#fe8019 \
|
||||
--border="rounded" --border-label-pos="0" --preview-window="border-rounded"
|
||||
)
|
||||
|
||||
if [ ! -z "${selected_wallpaper}" ]; then
|
||||
osascript -e "tell application \"System Events\" to tell every desktop to set picture to POSIX file \"$selected_wallpaper\""
|
||||
fi
|
||||
11
modules/home/scripts/scripts/focus-kitty-picker.sh
Normal file
11
modules/home/scripts/scripts/focus-kitty-picker.sh
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
if [ "$1" = "kitty-picker" ]; then
|
||||
while :; do
|
||||
window_id=$(aerospace list-windows --all --format %{window-id}%{app-name} --json | jq ".[] | select(.\"app-name\" == \"kitty\") | .\"window-id\"")
|
||||
if [ ! -z "${window_id}" ]; then
|
||||
$(aerospace focus --window-id "${window_id}")
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
10
modules/home/scripts/scripts/image-preview.sh
Normal file
10
modules/home/scripts/scripts/image-preview.sh
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
dim=${FZF_PREVIEW_COLUMNS}x${FZF_PREVIEW_LINES}
|
||||
|
||||
if [[ $KITTY_WINDOW_ID ]] || [[ $GHOSTTY_RESOURCES_DIR ]] && command -v kitten >/dev/null; then
|
||||
kitten icat --clear --transfer-mode=memory --unicode-placeholder --stdin=no --place="$dim@0x0" "$1" | sed '$d' | sed $'$s/$/\e[m/'
|
||||
else
|
||||
chafa -s "$dim" "$1"
|
||||
echo
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue