mirror of
https://github.com/nikdoof/dotfiles.git
synced 2026-01-29 18:38:15 +00:00
[wallpaper] Add HEIC support
This commit is contained in:
@@ -74,7 +74,7 @@ function set_wallpaper() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
wallpaper_path=$(find "$wallpaper_dir" \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" \) | fzf --preview 'fzf-preview.sh {}' --height 40%)
|
wallpaper_path=$(find "$wallpaper_dir" \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" -o -iname "*.heic" \) | fzf --preview 'fzf-preview.sh {}' --height 40%)
|
||||||
|
|
||||||
if [ -z "$wallpaper_path" ]; then
|
if [ -z "$wallpaper_path" ]; then
|
||||||
echo "No wallpaper selected."
|
echo "No wallpaper selected."
|
||||||
@@ -97,14 +97,14 @@ function set_wallpaper() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if file is a valid image format (PNG or JPEG)
|
# Check if file is a valid image format (PNG, JPEG, or HEIC)
|
||||||
local file_type=$(file -b --mime-type "$wallpaper_path")
|
local file_type=$(file -b --mime-type "$wallpaper_path")
|
||||||
if [[ "$file_type" != "image/png" && "$file_type" != "image/jpeg" ]]; then
|
if [[ "$file_type" != "image/png" && "$file_type" != "image/jpeg" && "$file_type" != "image/heic" ]]; then
|
||||||
echo "Unsupported file type: $file_type. Only PNG and JPEG are supported."
|
echo "Unsupported file type: $file_type. Only PNG, JPEG, and HEIC are supported."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $(uname) == 'Darwin']; then
|
if [[ $(uname) == 'Darwin' ]]; then
|
||||||
# Set the wallpaper using AppleScript
|
# Set the wallpaper using AppleScript
|
||||||
osascript -e "tell application \"Finder\" to set desktop picture to POSIX file \"$wallpaper_path\""
|
osascript -e "tell application \"Finder\" to set desktop picture to POSIX file \"$wallpaper_path\""
|
||||||
|
|
||||||
|
|||||||
BIN
wallpaper/.config/wallpaper/silver_slate_bag.heic
Normal file
BIN
wallpaper/.config/wallpaper/silver_slate_bag.heic
Normal file
Binary file not shown.
Reference in New Issue
Block a user