From 6b9d7ac78b32c287988c18f6642ea3b55d066594 Mon Sep 17 00:00:00 2001 From: Dylan Date: Mon, 18 Jan 2016 08:37:37 +1100 Subject: [PATCH] Added OS X wallpaper detection --- Readme.md | 11 ++++++----- fetch | 4 ++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Readme.md b/Readme.md index df4e73d6..418c055c 100644 --- a/Readme.md +++ b/Readme.md @@ -1,6 +1,6 @@ # fetch -[[Features](#features)] [[Dependencies](#dependencies)] [[Installation](#installation)] [[Usage](#usage)] [[TODO](#todo)] [[Thanks](#thanks)] +[[Features](#features)] [[Dependencies](#dependencies)] [[Installation](#installation)] [[Usage](#usage)] [[Issues and Workarounds](#issues-and-workarounds)] [[TODO](#todo)] [[Thanks](#thanks)] This is the home of my fetch script! This script gathers info
about your system and prints it to the terminal next to an image of your choice! @@ -20,7 +20,10 @@ about your system and prints it to the terminal next to an image of your choice! - **It's Fast** - The script makes heavy use of bash builtins and
string manipulation. - **Display an image next to the info. (or not)** - - The script can use your wallpaper, shuffle through a
directory or just display an image. + - The script can use your wallpaper, shuffle through a directory or just
display an image. + - The wallpaper function on linux uses feh, It's hard to add support
+ for other wallpaper setters as they don't provide a way of getting
+ current wallpaper from the cli. - **Highly Customizable** - You can customize almost everything. - See Usage below or lines 23-233 in script @@ -244,8 +247,6 @@ $gtk_shorthand on Here's what's on my todo list -- Add Mac OS X wallpaper detection - - Add Windows resolution detection - Look into iterm2 image rendering @@ -254,7 +255,7 @@ Here's what's on my todo list - Imagemagick optimizations -- More info outputs. Now that it's easy to customize what's printed and +- More info outputs. Now that it's easy to customize what's printed and
everything is a function we can add optional support for pretty much anything. - Resolution (Done!) diff --git a/fetch b/fetch index b157fd45..06043ae6 100755 --- a/fetch +++ b/fetch @@ -738,6 +738,10 @@ getwallpaper () { img="$(awk -F\' '/feh/ {printf $2}' $HOME/.fehbg)" ;; + "Mac OS X") + img="$(osascript -e 'tell app \"finder\" to get posix path of (get desktop picture as text)')" + ;; + "Windows") case "$distro" in "Windows XP")